From ee23d6ecb286d5a4046b1a07b87949a45eb91512 Mon Sep 17 00:00:00 2001 From: Valentin Knabel Date: Thu, 3 Sep 2026 14:17:39 +0200 Subject: [PATCH 1/5] chore: update --- .github/workflows/npm-publish.yaml | 43 ++ Makefile | 1 + generate/Makefile | 17 +- generate/generate.go | 41 +- generate/go_client.tpl | 29 -- generate/go_mock_client.tpl | 93 ---- generate/python_client.tpl | 11 +- generate/ts_client.tpl | 106 +++++ go/client/client-interceptors.go | 4 +- go/client/client.go | 29 -- go/client/conn.go | 112 ++++- go/tests/mock_clients.go | 124 ----- go/tests/mocks/client/Apiv1.go | 359 -------------- go/tests/mocks/client/Client.go | 83 ---- .../v1/apiv1connect/HealthServiceClient.go | 107 ----- .../v1/apiv1connect/HealthServiceHandler.go | 107 ----- .../api/v1/apiv1connect/IPServiceClient.go | 379 --------------- .../api/v1/apiv1connect/IPServiceHandler.go | 379 --------------- .../v1/apiv1connect/MethodServiceClient.go | 175 ------- .../v1/apiv1connect/MethodServiceHandler.go | 175 ------- .../v1/apiv1connect/ProjectServiceClient.go | 379 --------------- .../v1/apiv1connect/ProjectServiceHandler.go | 379 --------------- .../v1/apiv1connect/TenantServiceClient.go | 379 --------------- .../v1/apiv1connect/TenantServiceHandler.go | 379 --------------- .../api/v1/apiv1connect/TokenServiceClient.go | 447 ------------------ .../v1/apiv1connect/TokenServiceHandler.go | 447 ------------------ .../v1/apiv1connect/VersionServiceClient.go | 107 ----- .../v1/apiv1connect/VersionServiceHandler.go | 107 ----- js/Makefile | 7 +- bun.lock => js/bun.lock | 0 js/client-test.d.ts | 1 + js/client-test.js | 45 ++ js/client-test.ts | 49 ++ js/client.d.ts | 27 ++ js/client.js | 101 ++++ js/client.ts | 184 +++++++ package.json => js/package.json | 4 +- js/test-interceptor.d.ts | 9 + js/test-interceptor.js | 33 ++ js/test-interceptor.ts | 49 ++ python/fits/client/client.py | 23 +- 41 files changed, 818 insertions(+), 4712 deletions(-) create mode 100644 .github/workflows/npm-publish.yaml delete mode 100644 generate/go_mock_client.tpl create mode 100644 generate/ts_client.tpl delete mode 100755 go/tests/mock_clients.go delete mode 100644 go/tests/mocks/client/Apiv1.go delete mode 100644 go/tests/mocks/client/Client.go delete mode 100644 go/tests/mocks/fits/api/v1/apiv1connect/HealthServiceClient.go delete mode 100644 go/tests/mocks/fits/api/v1/apiv1connect/HealthServiceHandler.go delete mode 100644 go/tests/mocks/fits/api/v1/apiv1connect/IPServiceClient.go delete mode 100644 go/tests/mocks/fits/api/v1/apiv1connect/IPServiceHandler.go delete mode 100644 go/tests/mocks/fits/api/v1/apiv1connect/MethodServiceClient.go delete mode 100644 go/tests/mocks/fits/api/v1/apiv1connect/MethodServiceHandler.go delete mode 100644 go/tests/mocks/fits/api/v1/apiv1connect/ProjectServiceClient.go delete mode 100644 go/tests/mocks/fits/api/v1/apiv1connect/ProjectServiceHandler.go delete mode 100644 go/tests/mocks/fits/api/v1/apiv1connect/TenantServiceClient.go delete mode 100644 go/tests/mocks/fits/api/v1/apiv1connect/TenantServiceHandler.go delete mode 100644 go/tests/mocks/fits/api/v1/apiv1connect/TokenServiceClient.go delete mode 100644 go/tests/mocks/fits/api/v1/apiv1connect/TokenServiceHandler.go delete mode 100644 go/tests/mocks/fits/api/v1/apiv1connect/VersionServiceClient.go delete mode 100644 go/tests/mocks/fits/api/v1/apiv1connect/VersionServiceHandler.go rename bun.lock => js/bun.lock (100%) create mode 100644 js/client-test.d.ts create mode 100644 js/client-test.js create mode 100644 js/client-test.ts create mode 100644 js/client.d.ts create mode 100644 js/client.js create mode 100755 js/client.ts rename package.json => js/package.json (90%) create mode 100644 js/test-interceptor.d.ts create mode 100644 js/test-interceptor.js create mode 100644 js/test-interceptor.ts diff --git a/.github/workflows/npm-publish.yaml b/.github/workflows/npm-publish.yaml new file mode 100644 index 0000000..360ff19 --- /dev/null +++ b/.github/workflows/npm-publish.yaml @@ -0,0 +1,43 @@ +name: publish-npm + +on: + release: + types: + - published + +permissions: + id-token: write # Required for OIDC + contents: read + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + js: + name: JavaScript + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v7 + + - name: setup Node.js + uses: actions/setup-node@v6 + with: + node-version: 24 + registry-url: https://registry.npmjs.org/ + + - name: setup bun + uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + working-directory: js + run: bun install --frozen-lockfile + + - name: build + run: make build + + - name: Publish to npm + working-directory: js + run: bunx npm@11.8.0 publish --provenance # workaround for bun not supporting trusted publishing of npm (https://github.com/oven-sh/bun/issues/15601) + if: github.event_name == 'release' diff --git a/Makefile b/Makefile index b89968a..6005dba 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,7 @@ generate: .PHONY: test test: $(MAKE) -C go test + $(MAKE) -C js test .PHONY: build build: diff --git a/generate/Makefile b/generate/Makefile index f29f3a8..7141846 100644 --- a/generate/Makefile +++ b/generate/Makefile @@ -1,20 +1,9 @@ .PHONY: generate -generate: go-mocks +generate: # we remove files explicitly to ensure files really get generated rm -f ../go/permissions/servicepermissions.go rm -f ../go/client/client.go - rm -f ../go/tests/mock_clients.go + rm -f ../python/fits/client.py + rm -f ../ts/client/client.* go run ./generate.go - -.PHONY: go-mocks -go-mocks: - # we remove files explicitly to ensure files really get generated - rm -rf ../go/tests/mocks - - docker run --rm \ - --user $$(id -u):$$(id -g) \ - --tmpfs /.cache:uid=$$(id -u),gid=$$(id -g) \ - -w /work \ - -v ${PWD}:/work \ - vektra/mockery:v3.7.4 diff --git a/generate/generate.go b/generate/generate.go index ec342e3..1137ced 100644 --- a/generate/generate.go +++ b/generate/generate.go @@ -4,12 +4,12 @@ import ( "bytes" "fmt" "go/format" - "html/template" "os" "path" "path/filepath" "slices" "strings" + "text/template" v1 "github.com/fi-ts/api/go/fits/api/v1" "github.com/fi-ts/api/go/permissions" @@ -29,10 +29,10 @@ const ( var ( //go:embed go_servicepermissions.tpl servicePermissionsTpl string - //go:embed go_mock_client.tpl - mockClientTpl string //go:embed go_client.tpl clientTpl string + //go:embed ts_client.tpl + tsClientTpl string //go:embed python_client.tpl pythonClientTpl string ) @@ -54,7 +54,7 @@ func main() { panic(err) } - err = writeTemplate("../go/permissions/servicepermissions.go", servicePermissionsTpl, perms) + err = writeTemplate("../go/permissions/servicepermissions.go", servicePermissionsTpl, perms, sprig.FuncMap()) if err != nil { panic(err) } @@ -66,12 +66,24 @@ func main() { panic(err) } - err = writeTemplate("../go/client/client.go", clientTpl, svcs) + funcs := sprig.FuncMap() + funcs["lowerFirst"] = func(s string) string { + if len(s) == 0 { + return s + } + // If the string is all uppercase (e.g. "IP", "VPN", "BMC"), lowercase the entire thing + if s == strings.ToUpper(s) { + return strings.ToLower(s) + } + return strings.ToLower(s[:1]) + s[1:] + } + + err = writeTemplate("../go/client/client.go", clientTpl, svcs, funcs) if err != nil { panic(err) } - err = writeTemplate("../go/tests/mock_clients.go", mockClientTpl, svcs) + err = writeTemplate("../js/client.ts", tsClientTpl, svcs, funcs) if err != nil { panic(err) } @@ -264,8 +276,8 @@ func svcs(root string) (map[string]api, error) { return result, nil } -func writeTemplate(dest, text string, data any) error { - t, err := template.New("").Funcs(sprig.FuncMap()).Parse(text) +func writeTemplate(dest, text string, data any, funcs template.FuncMap) error { + t, err := template.New("").Funcs(funcs).Parse(text) if err != nil { return err } @@ -275,15 +287,22 @@ func writeTemplate(dest, text string, data any) error { return err } - p, err := format.Source(buf.Bytes()) - if err != nil { - return err + var p []byte + if strings.HasSuffix(dest, ".go") { + var ferr error + p, ferr = format.Source(buf.Bytes()) + if ferr != nil { + return ferr + } + } else { + p = buf.Bytes() } fmt.Println("wrote " + dest) return os.WriteFile(dest, p, 0755) // nolint:gosec } + func writePythonTemplate(dest, text string, data any) error { t, err := template.New("").Funcs(sprig.FuncMap()).Parse(text) if err != nil { diff --git a/generate/go_client.tpl b/generate/go_client.tpl index 7da715a..1609533 100644 --- a/generate/go_client.tpl +++ b/generate/go_client.tpl @@ -37,35 +37,6 @@ type ( {{ end }} ) -func New(config *DialConfig) (Client, error) { - err := config.parse() - if err != nil { - return nil, err - } - - c := &client{ - config: config, - interceptors: []connect.Interceptor{}, - } - - if config.Token != "" { - authInterceptor := &authInterceptor{config: config} - c.interceptors = append(c.interceptors, authInterceptor) - - if config.TokenRenewal != nil { - tokenRenewingInterceptor := &tokenRenewingInterceptor{config: config, client: c} - c.interceptors = append(c.interceptors, tokenRenewingInterceptor) - } - } - if config.Log != nil { - loggingInterceptor := &loggingInterceptor{config: config} - c.interceptors = append(c.interceptors, loggingInterceptor) - } - c.interceptors = append(c.interceptors, config.Interceptors...) - - return c, nil -} - {{ range $name, $api := . -}} func (c *client) {{ $name | title }}() {{ $name | title }} { a := &{{ $name }}{ diff --git a/generate/go_mock_client.tpl b/generate/go_mock_client.tpl deleted file mode 100644 index 9cac62b..0000000 --- a/generate/go_mock_client.tpl +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated generate_clients.go. DO NOT EDIT. -package apitests - -import ( - "testing" - - apiclient "github.com/fi-ts/api/go/client" -{{ range $name, $api := . -}} - "github.com/fi-ts/api/go{{ $api.Path }}/{{ $api.Name }}connect" - {{ $name }}mocks "github.com/fi-ts/api/go/tests/mocks{{ $api.Path }}/{{ $api.Name }}connect" -{{ end }} - "github.com/stretchr/testify/mock" -) - -type ( - client struct { -{{ range $name, $api := . -}} - {{ $name }}service *{{ $name}} -{{ end }} - } - - ClientMockFns struct { -{{ range $name, $api := . -}} - {{ $name | title }}Mocks *{{ $name | title }}MockFns -{{ end }} - } - - wrapper struct { - t *testing.T - } -{{ range $name, $api := . -}} - {{ $name }} struct { -{{ range $svc := $api.Services -}} - {{ $svc.Name | lower }} *{{ $name }}mocks.{{ $svc.Name }}Client -{{ end }} - } - - {{ $name | title }}MockFns struct { -{{ range $svc := $api.Services -}} - {{ $svc.Name | trimSuffix "Service" }} func(m *mock.Mock) -{{ end }} - } -{{ end }} -) - -func New(t *testing.T) *wrapper { - return &wrapper{t: t} -} - -func (w wrapper) Client(fns *ClientMockFns) *client { - return &client{ -{{ range $name, $api := . -}} - {{ $name }}service: w.{{ $name |title }}(fns.{{ $name | title }}Mocks), -{{ end }} - } -} - -{{ range $name, $api := . -}} -func (c *client) {{ $name | title }}() apiclient.{{ $name | title }} { - return c.{{ $name }}service -} -{{ end }} - -{{ range $name, $api := . -}} -func (w wrapper) {{ $name | title }}(fns *{{ $name | title }}MockFns) *{{ $name }} { - return new{{ $name }}(w.t, fns) -} - -func new{{ $name }}(t *testing.T, fns *{{ $name | title }}MockFns) *{{ $name }} { - a := &{{ $name }}{ -{{ range $svc := $api.Services -}} - {{ $svc.Name | lower }}: {{ $name }}mocks.New{{ $svc.Name }}Client(t), -{{ end }} - } - - if fns != nil { -{{ range $svc := $api.Services -}} - if fns.{{ $svc.Name | trimSuffix "Service" }} != nil { - fns.{{ $svc.Name | trimSuffix "Service" }}(&a.{{ $svc.Name | lower }}.Mock) - } -{{ end }} - } - - return a -} - -{{ range $svc := $api.Services -}} -func (c *{{ $name }} ) {{ $svc.Name | trimSuffix "Service" }}() {{ $name }}connect.{{ $svc.Name }}Client { - return c.{{ $svc.Name | lower }} -} -{{ end }} - -{{ end }} diff --git a/generate/python_client.tpl b/generate/python_client.tpl index 7f88e9a..9783e0e 100644 --- a/generate/python_client.tpl +++ b/generate/python_client.tpl @@ -8,9 +8,11 @@ import fits.{{ $name | trimSuffix "v1" }}.v1.{{ $svc.FileName | trimSuffix ".pro {{ end }} {{ end }} + class Client: - def __init__(self, baseurl: str, timeout: float = 10): + def __init__(self, baseurl: str, timeout: float = 10, interceptors: list = []): self._baseurl = baseurl + self._interceptors = list(interceptors) transport = pyqwest.SyncHTTPTransport( http_version=pyqwest.HTTPVersion.HTTP2, @@ -21,17 +23,18 @@ class Client: {{ range $name, $api := . }} def {{ $name | lower }}(self): - return self._{{ $name | title }}(baseurl=self._baseurl, client=self._client) + return self._{{ $name | title }}(baseurl=self._baseurl, client=self._client, interceptors=self._interceptors) {{ end }} {{ range $name, $api := . }} class _{{ $name | title }}: - def __init__(self, baseurl: str, client: pyqwest.SyncClient = None): + def __init__(self, baseurl: str, client: pyqwest.SyncClient = None, interceptors: list = []): self._baseurl = baseurl self._client = client + self._interceptors = list(interceptors) {{ range $svc := $api.Services }} def {{ $svc.FileName | trimSuffix ".proto" | lower }}(self): - return {{ $name | trimSuffix "v1" }}_{{ $svc.FileName | trimSuffix ".proto" | lower }}_connect.{{ $svc.Name }}ClientSync(address=self._baseurl, http_client=self._client) + return {{ $name | trimSuffix "v1" }}_{{ $svc.FileName | trimSuffix ".proto" | lower }}_connect.{{ $svc.Name }}ClientSync(address=self._baseurl, http_client=self._client, interceptors=self._interceptors) {{ end }} {{ end }} diff --git a/generate/ts_client.tpl b/generate/ts_client.tpl new file mode 100644 index 0000000..47a81fa --- /dev/null +++ b/generate/ts_client.tpl @@ -0,0 +1,106 @@ +// Code generated by generate_clients.go. DO NOT EDIT. + +import { createClient, Interceptor, Transport } from "@connectrpc/connect"; +import type { Client as ConnectClient } from "@connectrpc/connect"; +import { createConnectTransport } from "@connectrpc/connect-web"; +{{ range $name, $api := . }} +{{ range $svc := $api.Services }} +import { {{ $svc.Name }} as {{ $name | title }}{{ $svc.Name }} } from ".{{ $api.Path }}/{{ $svc.FileName | trimSuffix ".proto" }}_pb"; +{{ end }} +{{ end }} + +export interface ClientConfig { + baseUrl: string; + token?: string; + interceptors?: Interceptor[]; +} + +export interface Client { +{{ range $name, $api := . }} + {{ $name }}(): {{ $name | title }}; +{{ end }} +} + +{{ range $name, $api := . }} +export interface {{ $name | title }} { +{{ range $svc := $api.Services }} + {{ $svc.Name | trimSuffix "Service" | title | lowerFirst }}(): ConnectClient; +{{ end }} +} + +{{ end }} + +function authInterceptor(token: string): Interceptor { + return (next) => async (req) => { + req.header.set("Authorization", `Bearer ${token}`); + return await next(req); + }; +} + +function buildTransport(config: ClientConfig): Transport { + const interceptors: Interceptor[] = []; + + if (config.token) { + interceptors.push(authInterceptor(config.token)); + } + + if (config.interceptors) { + interceptors.push(...config.interceptors); + } + + return createConnectTransport({ + baseUrl: config.baseUrl, + interceptors: interceptors.length > 0 ? interceptors : undefined, + defaultTimeoutMs: 30_000, + }); +} + +export function newClient(config: ClientConfig): Client { + const transport = buildTransport(config); + return new ClientImpl(transport); +} + +class ClientImpl implements Client { + private transport: Transport; + +{{ range $name, $api := . }} + private _{{ $name }}?: {{ $name | title }}Impl; +{{ end }} + + constructor(transport: Transport) { + this.transport = transport; + } + +{{ range $name, $api := . }} + {{ $name }}(): {{ $name | title }} { + if (!this._{{ $name }}) { + this._{{ $name }} = new {{ $name | title }}Impl(this.transport); + } + return this._{{ $name }}; + } +{{ end }} +} + +{{ range $name, $api := . }} +class {{ $name | title }}Impl implements {{ $name | title }} { + private transport: Transport; + +{{ range $svc := $api.Services }} + private _{{ $svc.Name | trimSuffix "Service" | title | lowerFirst }}?: ConnectClient; +{{ end }} + + constructor(transport: Transport) { + this.transport = transport; + } + +{{ range $svc := $api.Services }} + {{ $svc.Name | trimSuffix "Service" | title | lowerFirst }}(): ConnectClient { + if (!this._{{ $svc.Name | trimSuffix "Service" | title | lowerFirst }}) { + this._{{ $svc.Name | trimSuffix "Service" | title | lowerFirst }} = createClient({{ $name | title }}{{ $svc.Name }}, this.transport); + } + return this._{{ $svc.Name | trimSuffix "Service" | title | lowerFirst }}; + } +{{ end }} +} + +{{ end }} diff --git a/go/client/client-interceptors.go b/go/client/client-interceptors.go index be6c2be..10bf00b 100644 --- a/go/client/client-interceptors.go +++ b/go/client/client-interceptors.go @@ -9,7 +9,7 @@ import ( "time" "connectrpc.com/connect" - apiv2models "github.com/fi-ts/api/go/fits/api/v1" + apiv1models "github.com/fi-ts/api/go/fits/api/v1" ) // authinterceptor adds the required auth headers @@ -124,7 +124,7 @@ func (i *tokenRenewingInterceptor) renewTokenIfNeeded() error { i.Lock() defer i.Unlock() - resp, err := i.client.Apiv1().Token().Refresh(context.Background(), &apiv2models.TokenServiceRefreshRequest{}) + resp, err := i.client.Apiv1().Token().Refresh(context.Background(), &apiv1models.TokenServiceRefreshRequest{}) if err != nil { return fmt.Errorf("unable to refresh token %w", err) } diff --git a/go/client/client.go b/go/client/client.go index 6ba98ae..76e642c 100755 --- a/go/client/client.go +++ b/go/client/client.go @@ -38,35 +38,6 @@ type ( } ) -func New(config *DialConfig) (Client, error) { - err := config.parse() - if err != nil { - return nil, err - } - - c := &client{ - config: config, - interceptors: []connect.Interceptor{}, - } - - if config.Token != "" { - authInterceptor := &authInterceptor{config: config} - c.interceptors = append(c.interceptors, authInterceptor) - - if config.TokenRenewal != nil { - tokenRenewingInterceptor := &tokenRenewingInterceptor{config: config, client: c} - c.interceptors = append(c.interceptors, tokenRenewingInterceptor) - } - } - if config.Log != nil { - loggingInterceptor := &loggingInterceptor{config: config} - c.interceptors = append(c.interceptors, loggingInterceptor) - } - c.interceptors = append(c.interceptors, config.Interceptors...) - - return c, nil -} - func (c *client) Apiv1() Apiv1 { a := &apiv1{ healthservice: apiv1connect.NewHealthServiceClient( diff --git a/go/client/conn.go b/go/client/conn.go index 3c5aecb..5286c8f 100644 --- a/go/client/conn.go +++ b/go/client/conn.go @@ -5,19 +5,37 @@ import ( "fmt" "log/slog" "net/http" + "net/url" + "os" "time" "connectrpc.com/connect" "github.com/golang-jwt/jwt/v5" ) -const tokenRenewChecksDuringLifetime = 4 +const ( + tokenRenewChecksDuringLifetime = 4 + tokenFileRereadDuration = 5 * time.Minute + TokenEnvName = "FCO_APIV1_TOKEN" + TokenFileEnvName = "FCO_APIV1_TOKEN_FILE" + BaseURLEnvName = "FCO_APIV1_URL" +) type ( // DialConfig is the configuration to create a api-server connection DialConfig struct { + // BaseUrl points to the apiv2 url where the apiserver is reachable BaseURL string - Token string + // Token to be used to talk to the apiserver, the string representation of the token. + // If Token is specified, TokenFile cannot be specified. + // It is possible to renew this token automatically, see TokenRenewal. + Token string + // Tokenfile path to a file containing the string representation of the token. + // If Tokenfile is specified, Token cannot be specified. + // Token renewal must be done from outside + TokenFile string + // Duration between token file re-reads, optional, defaults to 5min if not specified. + TokenFileRereadDuration time.Duration // Optional client Interceptors Interceptors []connect.Interceptor @@ -26,12 +44,14 @@ type ( // TokenRenewal defines if and how the token should be renewed TokenRenewal *TokenRenewal + // Transport optional, can be used to configure how the http transport works. Transport http.RoundTripper Log *slog.Logger - expiresAt time.Time - issuedAt time.Time + expiresAt time.Time + issuedAt time.Time + tokenFileLastRead time.Time } TokenRenewal struct { @@ -43,6 +63,44 @@ type ( PersistTokenFn func(token string) error ) +func New(config *DialConfig) (Client, error) { + err := config.parse() + if err != nil { + return nil, err + } + + c := &client{ + config: config, + interceptors: []connect.Interceptor{}, + } + + if config.Token != "" { + authInterceptor := &authInterceptor{config: config} + c.interceptors = append(c.interceptors, authInterceptor) + + if config.TokenRenewal != nil { + tokenRenewingInterceptor := &tokenRenewingInterceptor{config: config, client: c} + c.interceptors = append(c.interceptors, tokenRenewingInterceptor) + } + } + + if config.TokenFile != "" { + authInterceptor := &authInterceptor{config: config} + c.interceptors = append(c.interceptors, authInterceptor) + + tokenRenewingInterceptor := &tokenRenewingInterceptor{config: config, client: c} + c.interceptors = append(c.interceptors, tokenRenewingInterceptor) + } + + if config.Log != nil { + loggingInterceptor := &loggingInterceptor{config: config} + c.interceptors = append(c.interceptors, loggingInterceptor) + } + c.interceptors = append(c.interceptors, config.Interceptors...) + + return c, nil +} + func (d *DialConfig) HttpClient() *http.Client { transport := http.DefaultTransport if d.Transport != nil { @@ -55,9 +113,54 @@ func (d *DialConfig) HttpClient() *http.Client { } func (dc *DialConfig) parse() error { + if dc.BaseURL == "" { + dc.BaseURL = os.Getenv(BaseURLEnvName) + if dc.BaseURL == "" { + return fmt.Errorf("neither BaseURL nor %s were given", BaseURLEnvName) + } + if _, err := url.Parse(dc.BaseURL); err != nil { + return err + } + } + if dc.Token == "" { + dc.Token = os.Getenv(TokenEnvName) + } + + if dc.TokenFile == "" { + dc.TokenFile = os.Getenv(TokenFileEnvName) + } + + if dc.Token != "" && dc.TokenFile != "" { + return fmt.Errorf("either token or tokenfile must be specified, not both") + } + + if dc.Token == "" && dc.TokenFile != "" { + if dc.TokenFileRereadDuration == 0 { + dc.TokenFileRereadDuration = tokenFileRereadDuration + } + if dc.TokenFileRereadDuration < time.Minute { + return fmt.Errorf("token file re-read duration must be greater than 1min") + } + content, err := os.ReadFile(dc.TokenFile) + if err != nil { + return err + } + dc.Token = string(content) + dc.tokenFileLastRead = time.Now() + } + + if dc.Token == "" && dc.TokenFile == "" { return nil } + + return dc.parseTokenClaims() +} + +// parseTokenClaims extracts expiresAt and issuedAt from the current Token. +// It is called both when initially parsing the config and when a tokenfile +// token is re-read, in which case only the claims need to be refreshed. +func (dc *DialConfig) parseTokenClaims() error { parsed, err := jwt.Parse(dc.Token, nil) if err != nil && !errors.Is(err, jwt.ErrTokenUnverifiable) { return fmt.Errorf("unable to parse token:%w", err) @@ -80,5 +183,6 @@ func (dc *DialConfig) parse() error { if dc.issuedAt.IsZero() { dc.issuedAt = time.Now() } + return nil } diff --git a/go/tests/mock_clients.go b/go/tests/mock_clients.go deleted file mode 100755 index 069bf71..0000000 --- a/go/tests/mock_clients.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated generate_clients.go. DO NOT EDIT. -package apitests - -import ( - "testing" - - apiclient "github.com/fi-ts/api/go/client" - "github.com/fi-ts/api/go/fits/api/v1/apiv1connect" - apiv1mocks "github.com/fi-ts/api/go/tests/mocks/fits/api/v1/apiv1connect" - - "github.com/stretchr/testify/mock" -) - -type ( - client struct { - apiv1service *apiv1 - } - - ClientMockFns struct { - Apiv1Mocks *Apiv1MockFns - } - - wrapper struct { - t *testing.T - } - apiv1 struct { - healthservice *apiv1mocks.HealthServiceClient - ipservice *apiv1mocks.IPServiceClient - methodservice *apiv1mocks.MethodServiceClient - projectservice *apiv1mocks.ProjectServiceClient - tenantservice *apiv1mocks.TenantServiceClient - tokenservice *apiv1mocks.TokenServiceClient - versionservice *apiv1mocks.VersionServiceClient - } - - Apiv1MockFns struct { - Health func(m *mock.Mock) - IP func(m *mock.Mock) - Method func(m *mock.Mock) - Project func(m *mock.Mock) - Tenant func(m *mock.Mock) - Token func(m *mock.Mock) - Version func(m *mock.Mock) - } -) - -func New(t *testing.T) *wrapper { - return &wrapper{t: t} -} - -func (w wrapper) Client(fns *ClientMockFns) *client { - return &client{ - apiv1service: w.Apiv1(fns.Apiv1Mocks), - } -} - -func (c *client) Apiv1() apiclient.Apiv1 { - return c.apiv1service -} - -func (w wrapper) Apiv1(fns *Apiv1MockFns) *apiv1 { - return newapiv1(w.t, fns) -} - -func newapiv1(t *testing.T, fns *Apiv1MockFns) *apiv1 { - a := &apiv1{ - healthservice: apiv1mocks.NewHealthServiceClient(t), - ipservice: apiv1mocks.NewIPServiceClient(t), - methodservice: apiv1mocks.NewMethodServiceClient(t), - projectservice: apiv1mocks.NewProjectServiceClient(t), - tenantservice: apiv1mocks.NewTenantServiceClient(t), - tokenservice: apiv1mocks.NewTokenServiceClient(t), - versionservice: apiv1mocks.NewVersionServiceClient(t), - } - - if fns != nil { - if fns.Health != nil { - fns.Health(&a.healthservice.Mock) - } - if fns.IP != nil { - fns.IP(&a.ipservice.Mock) - } - if fns.Method != nil { - fns.Method(&a.methodservice.Mock) - } - if fns.Project != nil { - fns.Project(&a.projectservice.Mock) - } - if fns.Tenant != nil { - fns.Tenant(&a.tenantservice.Mock) - } - if fns.Token != nil { - fns.Token(&a.tokenservice.Mock) - } - if fns.Version != nil { - fns.Version(&a.versionservice.Mock) - } - - } - - return a -} - -func (c *apiv1) Health() apiv1connect.HealthServiceClient { - return c.healthservice -} -func (c *apiv1) IP() apiv1connect.IPServiceClient { - return c.ipservice -} -func (c *apiv1) Method() apiv1connect.MethodServiceClient { - return c.methodservice -} -func (c *apiv1) Project() apiv1connect.ProjectServiceClient { - return c.projectservice -} -func (c *apiv1) Tenant() apiv1connect.TenantServiceClient { - return c.tenantservice -} -func (c *apiv1) Token() apiv1connect.TokenServiceClient { - return c.tokenservice -} -func (c *apiv1) Version() apiv1connect.VersionServiceClient { - return c.versionservice -} diff --git a/go/tests/mocks/client/Apiv1.go b/go/tests/mocks/client/Apiv1.go deleted file mode 100644 index 2f6223b..0000000 --- a/go/tests/mocks/client/Apiv1.go +++ /dev/null @@ -1,359 +0,0 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify - -package client - -import ( - "github.com/fi-ts/api/go/fits/api/v1/apiv1connect" - mock "github.com/stretchr/testify/mock" -) - -// NewApiv1 creates a new instance of Apiv1. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewApiv1(t interface { - mock.TestingT - Cleanup(func()) -}) *Apiv1 { - mock := &Apiv1{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - -// Apiv1 is an autogenerated mock type for the Apiv1 type -type Apiv1 struct { - mock.Mock -} - -type Apiv1_Expecter struct { - mock *mock.Mock -} - -func (_m *Apiv1) EXPECT() *Apiv1_Expecter { - return &Apiv1_Expecter{mock: &_m.Mock} -} - -// Health provides a mock function for the type Apiv1 -func (_mock *Apiv1) Health() apiv1connect.HealthServiceClient { - ret := _mock.Called() - - if len(ret) == 0 { - panic("no return value specified for Health") - } - - var r0 apiv1connect.HealthServiceClient - if returnFunc, ok := ret.Get(0).(func() apiv1connect.HealthServiceClient); ok { - r0 = returnFunc() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(apiv1connect.HealthServiceClient) - } - } - return r0 -} - -// Apiv1_Health_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Health' -type Apiv1_Health_Call struct { - *mock.Call -} - -// Health is a helper method to define mock.On call -func (_e *Apiv1_Expecter) Health() *Apiv1_Health_Call { - return &Apiv1_Health_Call{Call: _e.mock.On("Health")} -} - -func (_c *Apiv1_Health_Call) Run(run func()) *Apiv1_Health_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Apiv1_Health_Call) Return(healthServiceClient apiv1connect.HealthServiceClient) *Apiv1_Health_Call { - _c.Call.Return(healthServiceClient) - return _c -} - -func (_c *Apiv1_Health_Call) RunAndReturn(run func() apiv1connect.HealthServiceClient) *Apiv1_Health_Call { - _c.Call.Return(run) - return _c -} - -// IP provides a mock function for the type Apiv1 -func (_mock *Apiv1) IP() apiv1connect.IPServiceClient { - ret := _mock.Called() - - if len(ret) == 0 { - panic("no return value specified for IP") - } - - var r0 apiv1connect.IPServiceClient - if returnFunc, ok := ret.Get(0).(func() apiv1connect.IPServiceClient); ok { - r0 = returnFunc() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(apiv1connect.IPServiceClient) - } - } - return r0 -} - -// Apiv1_IP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IP' -type Apiv1_IP_Call struct { - *mock.Call -} - -// IP is a helper method to define mock.On call -func (_e *Apiv1_Expecter) IP() *Apiv1_IP_Call { - return &Apiv1_IP_Call{Call: _e.mock.On("IP")} -} - -func (_c *Apiv1_IP_Call) Run(run func()) *Apiv1_IP_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Apiv1_IP_Call) Return(iPServiceClient apiv1connect.IPServiceClient) *Apiv1_IP_Call { - _c.Call.Return(iPServiceClient) - return _c -} - -func (_c *Apiv1_IP_Call) RunAndReturn(run func() apiv1connect.IPServiceClient) *Apiv1_IP_Call { - _c.Call.Return(run) - return _c -} - -// Method provides a mock function for the type Apiv1 -func (_mock *Apiv1) Method() apiv1connect.MethodServiceClient { - ret := _mock.Called() - - if len(ret) == 0 { - panic("no return value specified for Method") - } - - var r0 apiv1connect.MethodServiceClient - if returnFunc, ok := ret.Get(0).(func() apiv1connect.MethodServiceClient); ok { - r0 = returnFunc() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(apiv1connect.MethodServiceClient) - } - } - return r0 -} - -// Apiv1_Method_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Method' -type Apiv1_Method_Call struct { - *mock.Call -} - -// Method is a helper method to define mock.On call -func (_e *Apiv1_Expecter) Method() *Apiv1_Method_Call { - return &Apiv1_Method_Call{Call: _e.mock.On("Method")} -} - -func (_c *Apiv1_Method_Call) Run(run func()) *Apiv1_Method_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Apiv1_Method_Call) Return(methodServiceClient apiv1connect.MethodServiceClient) *Apiv1_Method_Call { - _c.Call.Return(methodServiceClient) - return _c -} - -func (_c *Apiv1_Method_Call) RunAndReturn(run func() apiv1connect.MethodServiceClient) *Apiv1_Method_Call { - _c.Call.Return(run) - return _c -} - -// Project provides a mock function for the type Apiv1 -func (_mock *Apiv1) Project() apiv1connect.ProjectServiceClient { - ret := _mock.Called() - - if len(ret) == 0 { - panic("no return value specified for Project") - } - - var r0 apiv1connect.ProjectServiceClient - if returnFunc, ok := ret.Get(0).(func() apiv1connect.ProjectServiceClient); ok { - r0 = returnFunc() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(apiv1connect.ProjectServiceClient) - } - } - return r0 -} - -// Apiv1_Project_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Project' -type Apiv1_Project_Call struct { - *mock.Call -} - -// Project is a helper method to define mock.On call -func (_e *Apiv1_Expecter) Project() *Apiv1_Project_Call { - return &Apiv1_Project_Call{Call: _e.mock.On("Project")} -} - -func (_c *Apiv1_Project_Call) Run(run func()) *Apiv1_Project_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Apiv1_Project_Call) Return(projectServiceClient apiv1connect.ProjectServiceClient) *Apiv1_Project_Call { - _c.Call.Return(projectServiceClient) - return _c -} - -func (_c *Apiv1_Project_Call) RunAndReturn(run func() apiv1connect.ProjectServiceClient) *Apiv1_Project_Call { - _c.Call.Return(run) - return _c -} - -// Tenant provides a mock function for the type Apiv1 -func (_mock *Apiv1) Tenant() apiv1connect.TenantServiceClient { - ret := _mock.Called() - - if len(ret) == 0 { - panic("no return value specified for Tenant") - } - - var r0 apiv1connect.TenantServiceClient - if returnFunc, ok := ret.Get(0).(func() apiv1connect.TenantServiceClient); ok { - r0 = returnFunc() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(apiv1connect.TenantServiceClient) - } - } - return r0 -} - -// Apiv1_Tenant_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tenant' -type Apiv1_Tenant_Call struct { - *mock.Call -} - -// Tenant is a helper method to define mock.On call -func (_e *Apiv1_Expecter) Tenant() *Apiv1_Tenant_Call { - return &Apiv1_Tenant_Call{Call: _e.mock.On("Tenant")} -} - -func (_c *Apiv1_Tenant_Call) Run(run func()) *Apiv1_Tenant_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Apiv1_Tenant_Call) Return(tenantServiceClient apiv1connect.TenantServiceClient) *Apiv1_Tenant_Call { - _c.Call.Return(tenantServiceClient) - return _c -} - -func (_c *Apiv1_Tenant_Call) RunAndReturn(run func() apiv1connect.TenantServiceClient) *Apiv1_Tenant_Call { - _c.Call.Return(run) - return _c -} - -// Token provides a mock function for the type Apiv1 -func (_mock *Apiv1) Token() apiv1connect.TokenServiceClient { - ret := _mock.Called() - - if len(ret) == 0 { - panic("no return value specified for Token") - } - - var r0 apiv1connect.TokenServiceClient - if returnFunc, ok := ret.Get(0).(func() apiv1connect.TokenServiceClient); ok { - r0 = returnFunc() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(apiv1connect.TokenServiceClient) - } - } - return r0 -} - -// Apiv1_Token_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Token' -type Apiv1_Token_Call struct { - *mock.Call -} - -// Token is a helper method to define mock.On call -func (_e *Apiv1_Expecter) Token() *Apiv1_Token_Call { - return &Apiv1_Token_Call{Call: _e.mock.On("Token")} -} - -func (_c *Apiv1_Token_Call) Run(run func()) *Apiv1_Token_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Apiv1_Token_Call) Return(tokenServiceClient apiv1connect.TokenServiceClient) *Apiv1_Token_Call { - _c.Call.Return(tokenServiceClient) - return _c -} - -func (_c *Apiv1_Token_Call) RunAndReturn(run func() apiv1connect.TokenServiceClient) *Apiv1_Token_Call { - _c.Call.Return(run) - return _c -} - -// Version provides a mock function for the type Apiv1 -func (_mock *Apiv1) Version() apiv1connect.VersionServiceClient { - ret := _mock.Called() - - if len(ret) == 0 { - panic("no return value specified for Version") - } - - var r0 apiv1connect.VersionServiceClient - if returnFunc, ok := ret.Get(0).(func() apiv1connect.VersionServiceClient); ok { - r0 = returnFunc() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(apiv1connect.VersionServiceClient) - } - } - return r0 -} - -// Apiv1_Version_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Version' -type Apiv1_Version_Call struct { - *mock.Call -} - -// Version is a helper method to define mock.On call -func (_e *Apiv1_Expecter) Version() *Apiv1_Version_Call { - return &Apiv1_Version_Call{Call: _e.mock.On("Version")} -} - -func (_c *Apiv1_Version_Call) Run(run func()) *Apiv1_Version_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Apiv1_Version_Call) Return(versionServiceClient apiv1connect.VersionServiceClient) *Apiv1_Version_Call { - _c.Call.Return(versionServiceClient) - return _c -} - -func (_c *Apiv1_Version_Call) RunAndReturn(run func() apiv1connect.VersionServiceClient) *Apiv1_Version_Call { - _c.Call.Return(run) - return _c -} diff --git a/go/tests/mocks/client/Client.go b/go/tests/mocks/client/Client.go deleted file mode 100644 index 1335272..0000000 --- a/go/tests/mocks/client/Client.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify - -package client - -import ( - "github.com/fi-ts/api/go/client" - mock "github.com/stretchr/testify/mock" -) - -// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewClient(t interface { - mock.TestingT - Cleanup(func()) -}) *Client { - mock := &Client{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - -// Client is an autogenerated mock type for the Client type -type Client struct { - mock.Mock -} - -type Client_Expecter struct { - mock *mock.Mock -} - -func (_m *Client) EXPECT() *Client_Expecter { - return &Client_Expecter{mock: &_m.Mock} -} - -// Apiv1 provides a mock function for the type Client -func (_mock *Client) Apiv1() client.Apiv1 { - ret := _mock.Called() - - if len(ret) == 0 { - panic("no return value specified for Apiv1") - } - - var r0 client.Apiv1 - if returnFunc, ok := ret.Get(0).(func() client.Apiv1); ok { - r0 = returnFunc() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(client.Apiv1) - } - } - return r0 -} - -// Client_Apiv1_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Apiv1' -type Client_Apiv1_Call struct { - *mock.Call -} - -// Apiv1 is a helper method to define mock.On call -func (_e *Client_Expecter) Apiv1() *Client_Apiv1_Call { - return &Client_Apiv1_Call{Call: _e.mock.On("Apiv1")} -} - -func (_c *Client_Apiv1_Call) Run(run func()) *Client_Apiv1_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Client_Apiv1_Call) Return(apiv1 client.Apiv1) *Client_Apiv1_Call { - _c.Call.Return(apiv1) - return _c -} - -func (_c *Client_Apiv1_Call) RunAndReturn(run func() client.Apiv1) *Client_Apiv1_Call { - _c.Call.Return(run) - return _c -} diff --git a/go/tests/mocks/fits/api/v1/apiv1connect/HealthServiceClient.go b/go/tests/mocks/fits/api/v1/apiv1connect/HealthServiceClient.go deleted file mode 100644 index 4ddc21c..0000000 --- a/go/tests/mocks/fits/api/v1/apiv1connect/HealthServiceClient.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify - -package apiv1connect - -import ( - "context" - - "github.com/fi-ts/api/go/fits/api/v1" - mock "github.com/stretchr/testify/mock" -) - -// NewHealthServiceClient creates a new instance of HealthServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewHealthServiceClient(t interface { - mock.TestingT - Cleanup(func()) -}) *HealthServiceClient { - mock := &HealthServiceClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - -// HealthServiceClient is an autogenerated mock type for the HealthServiceClient type -type HealthServiceClient struct { - mock.Mock -} - -type HealthServiceClient_Expecter struct { - mock *mock.Mock -} - -func (_m *HealthServiceClient) EXPECT() *HealthServiceClient_Expecter { - return &HealthServiceClient_Expecter{mock: &_m.Mock} -} - -// Get provides a mock function for the type HealthServiceClient -func (_mock *HealthServiceClient) Get(context1 context.Context, healthServiceGetRequest *apiv1.HealthServiceGetRequest) (*apiv1.HealthServiceGetResponse, error) { - ret := _mock.Called(context1, healthServiceGetRequest) - - if len(ret) == 0 { - panic("no return value specified for Get") - } - - var r0 *apiv1.HealthServiceGetResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.HealthServiceGetRequest) (*apiv1.HealthServiceGetResponse, error)); ok { - return returnFunc(context1, healthServiceGetRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.HealthServiceGetRequest) *apiv1.HealthServiceGetResponse); ok { - r0 = returnFunc(context1, healthServiceGetRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.HealthServiceGetResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.HealthServiceGetRequest) error); ok { - r1 = returnFunc(context1, healthServiceGetRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// HealthServiceClient_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type HealthServiceClient_Get_Call struct { - *mock.Call -} - -// Get is a helper method to define mock.On call -// - context1 context.Context -// - healthServiceGetRequest *apiv1.HealthServiceGetRequest -func (_e *HealthServiceClient_Expecter) Get(context1 any, healthServiceGetRequest any) *HealthServiceClient_Get_Call { - return &HealthServiceClient_Get_Call{Call: _e.mock.On("Get", context1, healthServiceGetRequest)} -} - -func (_c *HealthServiceClient_Get_Call) Run(run func(context1 context.Context, healthServiceGetRequest *apiv1.HealthServiceGetRequest)) *HealthServiceClient_Get_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.HealthServiceGetRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.HealthServiceGetRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *HealthServiceClient_Get_Call) Return(healthServiceGetResponse *apiv1.HealthServiceGetResponse, err error) *HealthServiceClient_Get_Call { - _c.Call.Return(healthServiceGetResponse, err) - return _c -} - -func (_c *HealthServiceClient_Get_Call) RunAndReturn(run func(context1 context.Context, healthServiceGetRequest *apiv1.HealthServiceGetRequest) (*apiv1.HealthServiceGetResponse, error)) *HealthServiceClient_Get_Call { - _c.Call.Return(run) - return _c -} diff --git a/go/tests/mocks/fits/api/v1/apiv1connect/HealthServiceHandler.go b/go/tests/mocks/fits/api/v1/apiv1connect/HealthServiceHandler.go deleted file mode 100644 index ca62912..0000000 --- a/go/tests/mocks/fits/api/v1/apiv1connect/HealthServiceHandler.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify - -package apiv1connect - -import ( - "context" - - "github.com/fi-ts/api/go/fits/api/v1" - mock "github.com/stretchr/testify/mock" -) - -// NewHealthServiceHandler creates a new instance of HealthServiceHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewHealthServiceHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *HealthServiceHandler { - mock := &HealthServiceHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - -// HealthServiceHandler is an autogenerated mock type for the HealthServiceHandler type -type HealthServiceHandler struct { - mock.Mock -} - -type HealthServiceHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *HealthServiceHandler) EXPECT() *HealthServiceHandler_Expecter { - return &HealthServiceHandler_Expecter{mock: &_m.Mock} -} - -// Get provides a mock function for the type HealthServiceHandler -func (_mock *HealthServiceHandler) Get(context1 context.Context, healthServiceGetRequest *apiv1.HealthServiceGetRequest) (*apiv1.HealthServiceGetResponse, error) { - ret := _mock.Called(context1, healthServiceGetRequest) - - if len(ret) == 0 { - panic("no return value specified for Get") - } - - var r0 *apiv1.HealthServiceGetResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.HealthServiceGetRequest) (*apiv1.HealthServiceGetResponse, error)); ok { - return returnFunc(context1, healthServiceGetRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.HealthServiceGetRequest) *apiv1.HealthServiceGetResponse); ok { - r0 = returnFunc(context1, healthServiceGetRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.HealthServiceGetResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.HealthServiceGetRequest) error); ok { - r1 = returnFunc(context1, healthServiceGetRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// HealthServiceHandler_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type HealthServiceHandler_Get_Call struct { - *mock.Call -} - -// Get is a helper method to define mock.On call -// - context1 context.Context -// - healthServiceGetRequest *apiv1.HealthServiceGetRequest -func (_e *HealthServiceHandler_Expecter) Get(context1 any, healthServiceGetRequest any) *HealthServiceHandler_Get_Call { - return &HealthServiceHandler_Get_Call{Call: _e.mock.On("Get", context1, healthServiceGetRequest)} -} - -func (_c *HealthServiceHandler_Get_Call) Run(run func(context1 context.Context, healthServiceGetRequest *apiv1.HealthServiceGetRequest)) *HealthServiceHandler_Get_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.HealthServiceGetRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.HealthServiceGetRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *HealthServiceHandler_Get_Call) Return(healthServiceGetResponse *apiv1.HealthServiceGetResponse, err error) *HealthServiceHandler_Get_Call { - _c.Call.Return(healthServiceGetResponse, err) - return _c -} - -func (_c *HealthServiceHandler_Get_Call) RunAndReturn(run func(context1 context.Context, healthServiceGetRequest *apiv1.HealthServiceGetRequest) (*apiv1.HealthServiceGetResponse, error)) *HealthServiceHandler_Get_Call { - _c.Call.Return(run) - return _c -} diff --git a/go/tests/mocks/fits/api/v1/apiv1connect/IPServiceClient.go b/go/tests/mocks/fits/api/v1/apiv1connect/IPServiceClient.go deleted file mode 100644 index 947ff13..0000000 --- a/go/tests/mocks/fits/api/v1/apiv1connect/IPServiceClient.go +++ /dev/null @@ -1,379 +0,0 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify - -package apiv1connect - -import ( - "context" - - "github.com/fi-ts/api/go/fits/api/v1" - mock "github.com/stretchr/testify/mock" -) - -// NewIPServiceClient creates a new instance of IPServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewIPServiceClient(t interface { - mock.TestingT - Cleanup(func()) -}) *IPServiceClient { - mock := &IPServiceClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - -// IPServiceClient is an autogenerated mock type for the IPServiceClient type -type IPServiceClient struct { - mock.Mock -} - -type IPServiceClient_Expecter struct { - mock *mock.Mock -} - -func (_m *IPServiceClient) EXPECT() *IPServiceClient_Expecter { - return &IPServiceClient_Expecter{mock: &_m.Mock} -} - -// Create provides a mock function for the type IPServiceClient -func (_mock *IPServiceClient) Create(context1 context.Context, iPServiceCreateRequest *apiv1.IPServiceCreateRequest) (*apiv1.IPServiceCreateResponse, error) { - ret := _mock.Called(context1, iPServiceCreateRequest) - - if len(ret) == 0 { - panic("no return value specified for Create") - } - - var r0 *apiv1.IPServiceCreateResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceCreateRequest) (*apiv1.IPServiceCreateResponse, error)); ok { - return returnFunc(context1, iPServiceCreateRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceCreateRequest) *apiv1.IPServiceCreateResponse); ok { - r0 = returnFunc(context1, iPServiceCreateRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.IPServiceCreateResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.IPServiceCreateRequest) error); ok { - r1 = returnFunc(context1, iPServiceCreateRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// IPServiceClient_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' -type IPServiceClient_Create_Call struct { - *mock.Call -} - -// Create is a helper method to define mock.On call -// - context1 context.Context -// - iPServiceCreateRequest *apiv1.IPServiceCreateRequest -func (_e *IPServiceClient_Expecter) Create(context1 any, iPServiceCreateRequest any) *IPServiceClient_Create_Call { - return &IPServiceClient_Create_Call{Call: _e.mock.On("Create", context1, iPServiceCreateRequest)} -} - -func (_c *IPServiceClient_Create_Call) Run(run func(context1 context.Context, iPServiceCreateRequest *apiv1.IPServiceCreateRequest)) *IPServiceClient_Create_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.IPServiceCreateRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.IPServiceCreateRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *IPServiceClient_Create_Call) Return(iPServiceCreateResponse *apiv1.IPServiceCreateResponse, err error) *IPServiceClient_Create_Call { - _c.Call.Return(iPServiceCreateResponse, err) - return _c -} - -func (_c *IPServiceClient_Create_Call) RunAndReturn(run func(context1 context.Context, iPServiceCreateRequest *apiv1.IPServiceCreateRequest) (*apiv1.IPServiceCreateResponse, error)) *IPServiceClient_Create_Call { - _c.Call.Return(run) - return _c -} - -// Delete provides a mock function for the type IPServiceClient -func (_mock *IPServiceClient) Delete(context1 context.Context, iPServiceDeleteRequest *apiv1.IPServiceDeleteRequest) (*apiv1.IPServiceDeleteResponse, error) { - ret := _mock.Called(context1, iPServiceDeleteRequest) - - if len(ret) == 0 { - panic("no return value specified for Delete") - } - - var r0 *apiv1.IPServiceDeleteResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceDeleteRequest) (*apiv1.IPServiceDeleteResponse, error)); ok { - return returnFunc(context1, iPServiceDeleteRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceDeleteRequest) *apiv1.IPServiceDeleteResponse); ok { - r0 = returnFunc(context1, iPServiceDeleteRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.IPServiceDeleteResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.IPServiceDeleteRequest) error); ok { - r1 = returnFunc(context1, iPServiceDeleteRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// IPServiceClient_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' -type IPServiceClient_Delete_Call struct { - *mock.Call -} - -// Delete is a helper method to define mock.On call -// - context1 context.Context -// - iPServiceDeleteRequest *apiv1.IPServiceDeleteRequest -func (_e *IPServiceClient_Expecter) Delete(context1 any, iPServiceDeleteRequest any) *IPServiceClient_Delete_Call { - return &IPServiceClient_Delete_Call{Call: _e.mock.On("Delete", context1, iPServiceDeleteRequest)} -} - -func (_c *IPServiceClient_Delete_Call) Run(run func(context1 context.Context, iPServiceDeleteRequest *apiv1.IPServiceDeleteRequest)) *IPServiceClient_Delete_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.IPServiceDeleteRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.IPServiceDeleteRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *IPServiceClient_Delete_Call) Return(iPServiceDeleteResponse *apiv1.IPServiceDeleteResponse, err error) *IPServiceClient_Delete_Call { - _c.Call.Return(iPServiceDeleteResponse, err) - return _c -} - -func (_c *IPServiceClient_Delete_Call) RunAndReturn(run func(context1 context.Context, iPServiceDeleteRequest *apiv1.IPServiceDeleteRequest) (*apiv1.IPServiceDeleteResponse, error)) *IPServiceClient_Delete_Call { - _c.Call.Return(run) - return _c -} - -// Get provides a mock function for the type IPServiceClient -func (_mock *IPServiceClient) Get(context1 context.Context, iPServiceGetRequest *apiv1.IPServiceGetRequest) (*apiv1.IPServiceGetResponse, error) { - ret := _mock.Called(context1, iPServiceGetRequest) - - if len(ret) == 0 { - panic("no return value specified for Get") - } - - var r0 *apiv1.IPServiceGetResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceGetRequest) (*apiv1.IPServiceGetResponse, error)); ok { - return returnFunc(context1, iPServiceGetRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceGetRequest) *apiv1.IPServiceGetResponse); ok { - r0 = returnFunc(context1, iPServiceGetRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.IPServiceGetResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.IPServiceGetRequest) error); ok { - r1 = returnFunc(context1, iPServiceGetRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// IPServiceClient_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type IPServiceClient_Get_Call struct { - *mock.Call -} - -// Get is a helper method to define mock.On call -// - context1 context.Context -// - iPServiceGetRequest *apiv1.IPServiceGetRequest -func (_e *IPServiceClient_Expecter) Get(context1 any, iPServiceGetRequest any) *IPServiceClient_Get_Call { - return &IPServiceClient_Get_Call{Call: _e.mock.On("Get", context1, iPServiceGetRequest)} -} - -func (_c *IPServiceClient_Get_Call) Run(run func(context1 context.Context, iPServiceGetRequest *apiv1.IPServiceGetRequest)) *IPServiceClient_Get_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.IPServiceGetRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.IPServiceGetRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *IPServiceClient_Get_Call) Return(iPServiceGetResponse *apiv1.IPServiceGetResponse, err error) *IPServiceClient_Get_Call { - _c.Call.Return(iPServiceGetResponse, err) - return _c -} - -func (_c *IPServiceClient_Get_Call) RunAndReturn(run func(context1 context.Context, iPServiceGetRequest *apiv1.IPServiceGetRequest) (*apiv1.IPServiceGetResponse, error)) *IPServiceClient_Get_Call { - _c.Call.Return(run) - return _c -} - -// List provides a mock function for the type IPServiceClient -func (_mock *IPServiceClient) List(context1 context.Context, iPServiceListRequest *apiv1.IPServiceListRequest) (*apiv1.IPServiceListResponse, error) { - ret := _mock.Called(context1, iPServiceListRequest) - - if len(ret) == 0 { - panic("no return value specified for List") - } - - var r0 *apiv1.IPServiceListResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceListRequest) (*apiv1.IPServiceListResponse, error)); ok { - return returnFunc(context1, iPServiceListRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceListRequest) *apiv1.IPServiceListResponse); ok { - r0 = returnFunc(context1, iPServiceListRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.IPServiceListResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.IPServiceListRequest) error); ok { - r1 = returnFunc(context1, iPServiceListRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// IPServiceClient_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' -type IPServiceClient_List_Call struct { - *mock.Call -} - -// List is a helper method to define mock.On call -// - context1 context.Context -// - iPServiceListRequest *apiv1.IPServiceListRequest -func (_e *IPServiceClient_Expecter) List(context1 any, iPServiceListRequest any) *IPServiceClient_List_Call { - return &IPServiceClient_List_Call{Call: _e.mock.On("List", context1, iPServiceListRequest)} -} - -func (_c *IPServiceClient_List_Call) Run(run func(context1 context.Context, iPServiceListRequest *apiv1.IPServiceListRequest)) *IPServiceClient_List_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.IPServiceListRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.IPServiceListRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *IPServiceClient_List_Call) Return(iPServiceListResponse *apiv1.IPServiceListResponse, err error) *IPServiceClient_List_Call { - _c.Call.Return(iPServiceListResponse, err) - return _c -} - -func (_c *IPServiceClient_List_Call) RunAndReturn(run func(context1 context.Context, iPServiceListRequest *apiv1.IPServiceListRequest) (*apiv1.IPServiceListResponse, error)) *IPServiceClient_List_Call { - _c.Call.Return(run) - return _c -} - -// Update provides a mock function for the type IPServiceClient -func (_mock *IPServiceClient) Update(context1 context.Context, iPServiceUpdateRequest *apiv1.IPServiceUpdateRequest) (*apiv1.IPServiceUpdateResponse, error) { - ret := _mock.Called(context1, iPServiceUpdateRequest) - - if len(ret) == 0 { - panic("no return value specified for Update") - } - - var r0 *apiv1.IPServiceUpdateResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceUpdateRequest) (*apiv1.IPServiceUpdateResponse, error)); ok { - return returnFunc(context1, iPServiceUpdateRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceUpdateRequest) *apiv1.IPServiceUpdateResponse); ok { - r0 = returnFunc(context1, iPServiceUpdateRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.IPServiceUpdateResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.IPServiceUpdateRequest) error); ok { - r1 = returnFunc(context1, iPServiceUpdateRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// IPServiceClient_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' -type IPServiceClient_Update_Call struct { - *mock.Call -} - -// Update is a helper method to define mock.On call -// - context1 context.Context -// - iPServiceUpdateRequest *apiv1.IPServiceUpdateRequest -func (_e *IPServiceClient_Expecter) Update(context1 any, iPServiceUpdateRequest any) *IPServiceClient_Update_Call { - return &IPServiceClient_Update_Call{Call: _e.mock.On("Update", context1, iPServiceUpdateRequest)} -} - -func (_c *IPServiceClient_Update_Call) Run(run func(context1 context.Context, iPServiceUpdateRequest *apiv1.IPServiceUpdateRequest)) *IPServiceClient_Update_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.IPServiceUpdateRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.IPServiceUpdateRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *IPServiceClient_Update_Call) Return(iPServiceUpdateResponse *apiv1.IPServiceUpdateResponse, err error) *IPServiceClient_Update_Call { - _c.Call.Return(iPServiceUpdateResponse, err) - return _c -} - -func (_c *IPServiceClient_Update_Call) RunAndReturn(run func(context1 context.Context, iPServiceUpdateRequest *apiv1.IPServiceUpdateRequest) (*apiv1.IPServiceUpdateResponse, error)) *IPServiceClient_Update_Call { - _c.Call.Return(run) - return _c -} diff --git a/go/tests/mocks/fits/api/v1/apiv1connect/IPServiceHandler.go b/go/tests/mocks/fits/api/v1/apiv1connect/IPServiceHandler.go deleted file mode 100644 index 5056d0e..0000000 --- a/go/tests/mocks/fits/api/v1/apiv1connect/IPServiceHandler.go +++ /dev/null @@ -1,379 +0,0 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify - -package apiv1connect - -import ( - "context" - - "github.com/fi-ts/api/go/fits/api/v1" - mock "github.com/stretchr/testify/mock" -) - -// NewIPServiceHandler creates a new instance of IPServiceHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewIPServiceHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *IPServiceHandler { - mock := &IPServiceHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - -// IPServiceHandler is an autogenerated mock type for the IPServiceHandler type -type IPServiceHandler struct { - mock.Mock -} - -type IPServiceHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *IPServiceHandler) EXPECT() *IPServiceHandler_Expecter { - return &IPServiceHandler_Expecter{mock: &_m.Mock} -} - -// Create provides a mock function for the type IPServiceHandler -func (_mock *IPServiceHandler) Create(context1 context.Context, iPServiceCreateRequest *apiv1.IPServiceCreateRequest) (*apiv1.IPServiceCreateResponse, error) { - ret := _mock.Called(context1, iPServiceCreateRequest) - - if len(ret) == 0 { - panic("no return value specified for Create") - } - - var r0 *apiv1.IPServiceCreateResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceCreateRequest) (*apiv1.IPServiceCreateResponse, error)); ok { - return returnFunc(context1, iPServiceCreateRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceCreateRequest) *apiv1.IPServiceCreateResponse); ok { - r0 = returnFunc(context1, iPServiceCreateRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.IPServiceCreateResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.IPServiceCreateRequest) error); ok { - r1 = returnFunc(context1, iPServiceCreateRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// IPServiceHandler_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' -type IPServiceHandler_Create_Call struct { - *mock.Call -} - -// Create is a helper method to define mock.On call -// - context1 context.Context -// - iPServiceCreateRequest *apiv1.IPServiceCreateRequest -func (_e *IPServiceHandler_Expecter) Create(context1 any, iPServiceCreateRequest any) *IPServiceHandler_Create_Call { - return &IPServiceHandler_Create_Call{Call: _e.mock.On("Create", context1, iPServiceCreateRequest)} -} - -func (_c *IPServiceHandler_Create_Call) Run(run func(context1 context.Context, iPServiceCreateRequest *apiv1.IPServiceCreateRequest)) *IPServiceHandler_Create_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.IPServiceCreateRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.IPServiceCreateRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *IPServiceHandler_Create_Call) Return(iPServiceCreateResponse *apiv1.IPServiceCreateResponse, err error) *IPServiceHandler_Create_Call { - _c.Call.Return(iPServiceCreateResponse, err) - return _c -} - -func (_c *IPServiceHandler_Create_Call) RunAndReturn(run func(context1 context.Context, iPServiceCreateRequest *apiv1.IPServiceCreateRequest) (*apiv1.IPServiceCreateResponse, error)) *IPServiceHandler_Create_Call { - _c.Call.Return(run) - return _c -} - -// Delete provides a mock function for the type IPServiceHandler -func (_mock *IPServiceHandler) Delete(context1 context.Context, iPServiceDeleteRequest *apiv1.IPServiceDeleteRequest) (*apiv1.IPServiceDeleteResponse, error) { - ret := _mock.Called(context1, iPServiceDeleteRequest) - - if len(ret) == 0 { - panic("no return value specified for Delete") - } - - var r0 *apiv1.IPServiceDeleteResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceDeleteRequest) (*apiv1.IPServiceDeleteResponse, error)); ok { - return returnFunc(context1, iPServiceDeleteRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceDeleteRequest) *apiv1.IPServiceDeleteResponse); ok { - r0 = returnFunc(context1, iPServiceDeleteRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.IPServiceDeleteResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.IPServiceDeleteRequest) error); ok { - r1 = returnFunc(context1, iPServiceDeleteRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// IPServiceHandler_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' -type IPServiceHandler_Delete_Call struct { - *mock.Call -} - -// Delete is a helper method to define mock.On call -// - context1 context.Context -// - iPServiceDeleteRequest *apiv1.IPServiceDeleteRequest -func (_e *IPServiceHandler_Expecter) Delete(context1 any, iPServiceDeleteRequest any) *IPServiceHandler_Delete_Call { - return &IPServiceHandler_Delete_Call{Call: _e.mock.On("Delete", context1, iPServiceDeleteRequest)} -} - -func (_c *IPServiceHandler_Delete_Call) Run(run func(context1 context.Context, iPServiceDeleteRequest *apiv1.IPServiceDeleteRequest)) *IPServiceHandler_Delete_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.IPServiceDeleteRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.IPServiceDeleteRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *IPServiceHandler_Delete_Call) Return(iPServiceDeleteResponse *apiv1.IPServiceDeleteResponse, err error) *IPServiceHandler_Delete_Call { - _c.Call.Return(iPServiceDeleteResponse, err) - return _c -} - -func (_c *IPServiceHandler_Delete_Call) RunAndReturn(run func(context1 context.Context, iPServiceDeleteRequest *apiv1.IPServiceDeleteRequest) (*apiv1.IPServiceDeleteResponse, error)) *IPServiceHandler_Delete_Call { - _c.Call.Return(run) - return _c -} - -// Get provides a mock function for the type IPServiceHandler -func (_mock *IPServiceHandler) Get(context1 context.Context, iPServiceGetRequest *apiv1.IPServiceGetRequest) (*apiv1.IPServiceGetResponse, error) { - ret := _mock.Called(context1, iPServiceGetRequest) - - if len(ret) == 0 { - panic("no return value specified for Get") - } - - var r0 *apiv1.IPServiceGetResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceGetRequest) (*apiv1.IPServiceGetResponse, error)); ok { - return returnFunc(context1, iPServiceGetRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceGetRequest) *apiv1.IPServiceGetResponse); ok { - r0 = returnFunc(context1, iPServiceGetRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.IPServiceGetResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.IPServiceGetRequest) error); ok { - r1 = returnFunc(context1, iPServiceGetRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// IPServiceHandler_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type IPServiceHandler_Get_Call struct { - *mock.Call -} - -// Get is a helper method to define mock.On call -// - context1 context.Context -// - iPServiceGetRequest *apiv1.IPServiceGetRequest -func (_e *IPServiceHandler_Expecter) Get(context1 any, iPServiceGetRequest any) *IPServiceHandler_Get_Call { - return &IPServiceHandler_Get_Call{Call: _e.mock.On("Get", context1, iPServiceGetRequest)} -} - -func (_c *IPServiceHandler_Get_Call) Run(run func(context1 context.Context, iPServiceGetRequest *apiv1.IPServiceGetRequest)) *IPServiceHandler_Get_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.IPServiceGetRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.IPServiceGetRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *IPServiceHandler_Get_Call) Return(iPServiceGetResponse *apiv1.IPServiceGetResponse, err error) *IPServiceHandler_Get_Call { - _c.Call.Return(iPServiceGetResponse, err) - return _c -} - -func (_c *IPServiceHandler_Get_Call) RunAndReturn(run func(context1 context.Context, iPServiceGetRequest *apiv1.IPServiceGetRequest) (*apiv1.IPServiceGetResponse, error)) *IPServiceHandler_Get_Call { - _c.Call.Return(run) - return _c -} - -// List provides a mock function for the type IPServiceHandler -func (_mock *IPServiceHandler) List(context1 context.Context, iPServiceListRequest *apiv1.IPServiceListRequest) (*apiv1.IPServiceListResponse, error) { - ret := _mock.Called(context1, iPServiceListRequest) - - if len(ret) == 0 { - panic("no return value specified for List") - } - - var r0 *apiv1.IPServiceListResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceListRequest) (*apiv1.IPServiceListResponse, error)); ok { - return returnFunc(context1, iPServiceListRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceListRequest) *apiv1.IPServiceListResponse); ok { - r0 = returnFunc(context1, iPServiceListRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.IPServiceListResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.IPServiceListRequest) error); ok { - r1 = returnFunc(context1, iPServiceListRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// IPServiceHandler_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' -type IPServiceHandler_List_Call struct { - *mock.Call -} - -// List is a helper method to define mock.On call -// - context1 context.Context -// - iPServiceListRequest *apiv1.IPServiceListRequest -func (_e *IPServiceHandler_Expecter) List(context1 any, iPServiceListRequest any) *IPServiceHandler_List_Call { - return &IPServiceHandler_List_Call{Call: _e.mock.On("List", context1, iPServiceListRequest)} -} - -func (_c *IPServiceHandler_List_Call) Run(run func(context1 context.Context, iPServiceListRequest *apiv1.IPServiceListRequest)) *IPServiceHandler_List_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.IPServiceListRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.IPServiceListRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *IPServiceHandler_List_Call) Return(iPServiceListResponse *apiv1.IPServiceListResponse, err error) *IPServiceHandler_List_Call { - _c.Call.Return(iPServiceListResponse, err) - return _c -} - -func (_c *IPServiceHandler_List_Call) RunAndReturn(run func(context1 context.Context, iPServiceListRequest *apiv1.IPServiceListRequest) (*apiv1.IPServiceListResponse, error)) *IPServiceHandler_List_Call { - _c.Call.Return(run) - return _c -} - -// Update provides a mock function for the type IPServiceHandler -func (_mock *IPServiceHandler) Update(context1 context.Context, iPServiceUpdateRequest *apiv1.IPServiceUpdateRequest) (*apiv1.IPServiceUpdateResponse, error) { - ret := _mock.Called(context1, iPServiceUpdateRequest) - - if len(ret) == 0 { - panic("no return value specified for Update") - } - - var r0 *apiv1.IPServiceUpdateResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceUpdateRequest) (*apiv1.IPServiceUpdateResponse, error)); ok { - return returnFunc(context1, iPServiceUpdateRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.IPServiceUpdateRequest) *apiv1.IPServiceUpdateResponse); ok { - r0 = returnFunc(context1, iPServiceUpdateRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.IPServiceUpdateResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.IPServiceUpdateRequest) error); ok { - r1 = returnFunc(context1, iPServiceUpdateRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// IPServiceHandler_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' -type IPServiceHandler_Update_Call struct { - *mock.Call -} - -// Update is a helper method to define mock.On call -// - context1 context.Context -// - iPServiceUpdateRequest *apiv1.IPServiceUpdateRequest -func (_e *IPServiceHandler_Expecter) Update(context1 any, iPServiceUpdateRequest any) *IPServiceHandler_Update_Call { - return &IPServiceHandler_Update_Call{Call: _e.mock.On("Update", context1, iPServiceUpdateRequest)} -} - -func (_c *IPServiceHandler_Update_Call) Run(run func(context1 context.Context, iPServiceUpdateRequest *apiv1.IPServiceUpdateRequest)) *IPServiceHandler_Update_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.IPServiceUpdateRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.IPServiceUpdateRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *IPServiceHandler_Update_Call) Return(iPServiceUpdateResponse *apiv1.IPServiceUpdateResponse, err error) *IPServiceHandler_Update_Call { - _c.Call.Return(iPServiceUpdateResponse, err) - return _c -} - -func (_c *IPServiceHandler_Update_Call) RunAndReturn(run func(context1 context.Context, iPServiceUpdateRequest *apiv1.IPServiceUpdateRequest) (*apiv1.IPServiceUpdateResponse, error)) *IPServiceHandler_Update_Call { - _c.Call.Return(run) - return _c -} diff --git a/go/tests/mocks/fits/api/v1/apiv1connect/MethodServiceClient.go b/go/tests/mocks/fits/api/v1/apiv1connect/MethodServiceClient.go deleted file mode 100644 index 54d50c0..0000000 --- a/go/tests/mocks/fits/api/v1/apiv1connect/MethodServiceClient.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify - -package apiv1connect - -import ( - "context" - - "github.com/fi-ts/api/go/fits/api/v1" - mock "github.com/stretchr/testify/mock" -) - -// NewMethodServiceClient creates a new instance of MethodServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMethodServiceClient(t interface { - mock.TestingT - Cleanup(func()) -}) *MethodServiceClient { - mock := &MethodServiceClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - -// MethodServiceClient is an autogenerated mock type for the MethodServiceClient type -type MethodServiceClient struct { - mock.Mock -} - -type MethodServiceClient_Expecter struct { - mock *mock.Mock -} - -func (_m *MethodServiceClient) EXPECT() *MethodServiceClient_Expecter { - return &MethodServiceClient_Expecter{mock: &_m.Mock} -} - -// List provides a mock function for the type MethodServiceClient -func (_mock *MethodServiceClient) List(context1 context.Context, methodServiceListRequest *apiv1.MethodServiceListRequest) (*apiv1.MethodServiceListResponse, error) { - ret := _mock.Called(context1, methodServiceListRequest) - - if len(ret) == 0 { - panic("no return value specified for List") - } - - var r0 *apiv1.MethodServiceListResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.MethodServiceListRequest) (*apiv1.MethodServiceListResponse, error)); ok { - return returnFunc(context1, methodServiceListRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.MethodServiceListRequest) *apiv1.MethodServiceListResponse); ok { - r0 = returnFunc(context1, methodServiceListRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.MethodServiceListResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.MethodServiceListRequest) error); ok { - r1 = returnFunc(context1, methodServiceListRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// MethodServiceClient_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' -type MethodServiceClient_List_Call struct { - *mock.Call -} - -// List is a helper method to define mock.On call -// - context1 context.Context -// - methodServiceListRequest *apiv1.MethodServiceListRequest -func (_e *MethodServiceClient_Expecter) List(context1 any, methodServiceListRequest any) *MethodServiceClient_List_Call { - return &MethodServiceClient_List_Call{Call: _e.mock.On("List", context1, methodServiceListRequest)} -} - -func (_c *MethodServiceClient_List_Call) Run(run func(context1 context.Context, methodServiceListRequest *apiv1.MethodServiceListRequest)) *MethodServiceClient_List_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.MethodServiceListRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.MethodServiceListRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *MethodServiceClient_List_Call) Return(methodServiceListResponse *apiv1.MethodServiceListResponse, err error) *MethodServiceClient_List_Call { - _c.Call.Return(methodServiceListResponse, err) - return _c -} - -func (_c *MethodServiceClient_List_Call) RunAndReturn(run func(context1 context.Context, methodServiceListRequest *apiv1.MethodServiceListRequest) (*apiv1.MethodServiceListResponse, error)) *MethodServiceClient_List_Call { - _c.Call.Return(run) - return _c -} - -// TokenScopedList provides a mock function for the type MethodServiceClient -func (_mock *MethodServiceClient) TokenScopedList(context1 context.Context, methodServiceTokenScopedListRequest *apiv1.MethodServiceTokenScopedListRequest) (*apiv1.MethodServiceTokenScopedListResponse, error) { - ret := _mock.Called(context1, methodServiceTokenScopedListRequest) - - if len(ret) == 0 { - panic("no return value specified for TokenScopedList") - } - - var r0 *apiv1.MethodServiceTokenScopedListResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.MethodServiceTokenScopedListRequest) (*apiv1.MethodServiceTokenScopedListResponse, error)); ok { - return returnFunc(context1, methodServiceTokenScopedListRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.MethodServiceTokenScopedListRequest) *apiv1.MethodServiceTokenScopedListResponse); ok { - r0 = returnFunc(context1, methodServiceTokenScopedListRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.MethodServiceTokenScopedListResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.MethodServiceTokenScopedListRequest) error); ok { - r1 = returnFunc(context1, methodServiceTokenScopedListRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// MethodServiceClient_TokenScopedList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TokenScopedList' -type MethodServiceClient_TokenScopedList_Call struct { - *mock.Call -} - -// TokenScopedList is a helper method to define mock.On call -// - context1 context.Context -// - methodServiceTokenScopedListRequest *apiv1.MethodServiceTokenScopedListRequest -func (_e *MethodServiceClient_Expecter) TokenScopedList(context1 any, methodServiceTokenScopedListRequest any) *MethodServiceClient_TokenScopedList_Call { - return &MethodServiceClient_TokenScopedList_Call{Call: _e.mock.On("TokenScopedList", context1, methodServiceTokenScopedListRequest)} -} - -func (_c *MethodServiceClient_TokenScopedList_Call) Run(run func(context1 context.Context, methodServiceTokenScopedListRequest *apiv1.MethodServiceTokenScopedListRequest)) *MethodServiceClient_TokenScopedList_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.MethodServiceTokenScopedListRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.MethodServiceTokenScopedListRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *MethodServiceClient_TokenScopedList_Call) Return(methodServiceTokenScopedListResponse *apiv1.MethodServiceTokenScopedListResponse, err error) *MethodServiceClient_TokenScopedList_Call { - _c.Call.Return(methodServiceTokenScopedListResponse, err) - return _c -} - -func (_c *MethodServiceClient_TokenScopedList_Call) RunAndReturn(run func(context1 context.Context, methodServiceTokenScopedListRequest *apiv1.MethodServiceTokenScopedListRequest) (*apiv1.MethodServiceTokenScopedListResponse, error)) *MethodServiceClient_TokenScopedList_Call { - _c.Call.Return(run) - return _c -} diff --git a/go/tests/mocks/fits/api/v1/apiv1connect/MethodServiceHandler.go b/go/tests/mocks/fits/api/v1/apiv1connect/MethodServiceHandler.go deleted file mode 100644 index 777376f..0000000 --- a/go/tests/mocks/fits/api/v1/apiv1connect/MethodServiceHandler.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify - -package apiv1connect - -import ( - "context" - - "github.com/fi-ts/api/go/fits/api/v1" - mock "github.com/stretchr/testify/mock" -) - -// NewMethodServiceHandler creates a new instance of MethodServiceHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMethodServiceHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *MethodServiceHandler { - mock := &MethodServiceHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - -// MethodServiceHandler is an autogenerated mock type for the MethodServiceHandler type -type MethodServiceHandler struct { - mock.Mock -} - -type MethodServiceHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *MethodServiceHandler) EXPECT() *MethodServiceHandler_Expecter { - return &MethodServiceHandler_Expecter{mock: &_m.Mock} -} - -// List provides a mock function for the type MethodServiceHandler -func (_mock *MethodServiceHandler) List(context1 context.Context, methodServiceListRequest *apiv1.MethodServiceListRequest) (*apiv1.MethodServiceListResponse, error) { - ret := _mock.Called(context1, methodServiceListRequest) - - if len(ret) == 0 { - panic("no return value specified for List") - } - - var r0 *apiv1.MethodServiceListResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.MethodServiceListRequest) (*apiv1.MethodServiceListResponse, error)); ok { - return returnFunc(context1, methodServiceListRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.MethodServiceListRequest) *apiv1.MethodServiceListResponse); ok { - r0 = returnFunc(context1, methodServiceListRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.MethodServiceListResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.MethodServiceListRequest) error); ok { - r1 = returnFunc(context1, methodServiceListRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// MethodServiceHandler_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' -type MethodServiceHandler_List_Call struct { - *mock.Call -} - -// List is a helper method to define mock.On call -// - context1 context.Context -// - methodServiceListRequest *apiv1.MethodServiceListRequest -func (_e *MethodServiceHandler_Expecter) List(context1 any, methodServiceListRequest any) *MethodServiceHandler_List_Call { - return &MethodServiceHandler_List_Call{Call: _e.mock.On("List", context1, methodServiceListRequest)} -} - -func (_c *MethodServiceHandler_List_Call) Run(run func(context1 context.Context, methodServiceListRequest *apiv1.MethodServiceListRequest)) *MethodServiceHandler_List_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.MethodServiceListRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.MethodServiceListRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *MethodServiceHandler_List_Call) Return(methodServiceListResponse *apiv1.MethodServiceListResponse, err error) *MethodServiceHandler_List_Call { - _c.Call.Return(methodServiceListResponse, err) - return _c -} - -func (_c *MethodServiceHandler_List_Call) RunAndReturn(run func(context1 context.Context, methodServiceListRequest *apiv1.MethodServiceListRequest) (*apiv1.MethodServiceListResponse, error)) *MethodServiceHandler_List_Call { - _c.Call.Return(run) - return _c -} - -// TokenScopedList provides a mock function for the type MethodServiceHandler -func (_mock *MethodServiceHandler) TokenScopedList(context1 context.Context, methodServiceTokenScopedListRequest *apiv1.MethodServiceTokenScopedListRequest) (*apiv1.MethodServiceTokenScopedListResponse, error) { - ret := _mock.Called(context1, methodServiceTokenScopedListRequest) - - if len(ret) == 0 { - panic("no return value specified for TokenScopedList") - } - - var r0 *apiv1.MethodServiceTokenScopedListResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.MethodServiceTokenScopedListRequest) (*apiv1.MethodServiceTokenScopedListResponse, error)); ok { - return returnFunc(context1, methodServiceTokenScopedListRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.MethodServiceTokenScopedListRequest) *apiv1.MethodServiceTokenScopedListResponse); ok { - r0 = returnFunc(context1, methodServiceTokenScopedListRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.MethodServiceTokenScopedListResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.MethodServiceTokenScopedListRequest) error); ok { - r1 = returnFunc(context1, methodServiceTokenScopedListRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// MethodServiceHandler_TokenScopedList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TokenScopedList' -type MethodServiceHandler_TokenScopedList_Call struct { - *mock.Call -} - -// TokenScopedList is a helper method to define mock.On call -// - context1 context.Context -// - methodServiceTokenScopedListRequest *apiv1.MethodServiceTokenScopedListRequest -func (_e *MethodServiceHandler_Expecter) TokenScopedList(context1 any, methodServiceTokenScopedListRequest any) *MethodServiceHandler_TokenScopedList_Call { - return &MethodServiceHandler_TokenScopedList_Call{Call: _e.mock.On("TokenScopedList", context1, methodServiceTokenScopedListRequest)} -} - -func (_c *MethodServiceHandler_TokenScopedList_Call) Run(run func(context1 context.Context, methodServiceTokenScopedListRequest *apiv1.MethodServiceTokenScopedListRequest)) *MethodServiceHandler_TokenScopedList_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.MethodServiceTokenScopedListRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.MethodServiceTokenScopedListRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *MethodServiceHandler_TokenScopedList_Call) Return(methodServiceTokenScopedListResponse *apiv1.MethodServiceTokenScopedListResponse, err error) *MethodServiceHandler_TokenScopedList_Call { - _c.Call.Return(methodServiceTokenScopedListResponse, err) - return _c -} - -func (_c *MethodServiceHandler_TokenScopedList_Call) RunAndReturn(run func(context1 context.Context, methodServiceTokenScopedListRequest *apiv1.MethodServiceTokenScopedListRequest) (*apiv1.MethodServiceTokenScopedListResponse, error)) *MethodServiceHandler_TokenScopedList_Call { - _c.Call.Return(run) - return _c -} diff --git a/go/tests/mocks/fits/api/v1/apiv1connect/ProjectServiceClient.go b/go/tests/mocks/fits/api/v1/apiv1connect/ProjectServiceClient.go deleted file mode 100644 index e13ad89..0000000 --- a/go/tests/mocks/fits/api/v1/apiv1connect/ProjectServiceClient.go +++ /dev/null @@ -1,379 +0,0 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify - -package apiv1connect - -import ( - "context" - - "github.com/fi-ts/api/go/fits/api/v1" - mock "github.com/stretchr/testify/mock" -) - -// NewProjectServiceClient creates a new instance of ProjectServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewProjectServiceClient(t interface { - mock.TestingT - Cleanup(func()) -}) *ProjectServiceClient { - mock := &ProjectServiceClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - -// ProjectServiceClient is an autogenerated mock type for the ProjectServiceClient type -type ProjectServiceClient struct { - mock.Mock -} - -type ProjectServiceClient_Expecter struct { - mock *mock.Mock -} - -func (_m *ProjectServiceClient) EXPECT() *ProjectServiceClient_Expecter { - return &ProjectServiceClient_Expecter{mock: &_m.Mock} -} - -// Create provides a mock function for the type ProjectServiceClient -func (_mock *ProjectServiceClient) Create(context1 context.Context, projectServiceCreateRequest *apiv1.ProjectServiceCreateRequest) (*apiv1.ProjectServiceCreateResponse, error) { - ret := _mock.Called(context1, projectServiceCreateRequest) - - if len(ret) == 0 { - panic("no return value specified for Create") - } - - var r0 *apiv1.ProjectServiceCreateResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceCreateRequest) (*apiv1.ProjectServiceCreateResponse, error)); ok { - return returnFunc(context1, projectServiceCreateRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceCreateRequest) *apiv1.ProjectServiceCreateResponse); ok { - r0 = returnFunc(context1, projectServiceCreateRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.ProjectServiceCreateResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.ProjectServiceCreateRequest) error); ok { - r1 = returnFunc(context1, projectServiceCreateRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// ProjectServiceClient_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' -type ProjectServiceClient_Create_Call struct { - *mock.Call -} - -// Create is a helper method to define mock.On call -// - context1 context.Context -// - projectServiceCreateRequest *apiv1.ProjectServiceCreateRequest -func (_e *ProjectServiceClient_Expecter) Create(context1 any, projectServiceCreateRequest any) *ProjectServiceClient_Create_Call { - return &ProjectServiceClient_Create_Call{Call: _e.mock.On("Create", context1, projectServiceCreateRequest)} -} - -func (_c *ProjectServiceClient_Create_Call) Run(run func(context1 context.Context, projectServiceCreateRequest *apiv1.ProjectServiceCreateRequest)) *ProjectServiceClient_Create_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.ProjectServiceCreateRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.ProjectServiceCreateRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *ProjectServiceClient_Create_Call) Return(projectServiceCreateResponse *apiv1.ProjectServiceCreateResponse, err error) *ProjectServiceClient_Create_Call { - _c.Call.Return(projectServiceCreateResponse, err) - return _c -} - -func (_c *ProjectServiceClient_Create_Call) RunAndReturn(run func(context1 context.Context, projectServiceCreateRequest *apiv1.ProjectServiceCreateRequest) (*apiv1.ProjectServiceCreateResponse, error)) *ProjectServiceClient_Create_Call { - _c.Call.Return(run) - return _c -} - -// Delete provides a mock function for the type ProjectServiceClient -func (_mock *ProjectServiceClient) Delete(context1 context.Context, projectServiceDeleteRequest *apiv1.ProjectServiceDeleteRequest) (*apiv1.ProjectServiceDeleteResponse, error) { - ret := _mock.Called(context1, projectServiceDeleteRequest) - - if len(ret) == 0 { - panic("no return value specified for Delete") - } - - var r0 *apiv1.ProjectServiceDeleteResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceDeleteRequest) (*apiv1.ProjectServiceDeleteResponse, error)); ok { - return returnFunc(context1, projectServiceDeleteRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceDeleteRequest) *apiv1.ProjectServiceDeleteResponse); ok { - r0 = returnFunc(context1, projectServiceDeleteRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.ProjectServiceDeleteResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.ProjectServiceDeleteRequest) error); ok { - r1 = returnFunc(context1, projectServiceDeleteRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// ProjectServiceClient_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' -type ProjectServiceClient_Delete_Call struct { - *mock.Call -} - -// Delete is a helper method to define mock.On call -// - context1 context.Context -// - projectServiceDeleteRequest *apiv1.ProjectServiceDeleteRequest -func (_e *ProjectServiceClient_Expecter) Delete(context1 any, projectServiceDeleteRequest any) *ProjectServiceClient_Delete_Call { - return &ProjectServiceClient_Delete_Call{Call: _e.mock.On("Delete", context1, projectServiceDeleteRequest)} -} - -func (_c *ProjectServiceClient_Delete_Call) Run(run func(context1 context.Context, projectServiceDeleteRequest *apiv1.ProjectServiceDeleteRequest)) *ProjectServiceClient_Delete_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.ProjectServiceDeleteRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.ProjectServiceDeleteRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *ProjectServiceClient_Delete_Call) Return(projectServiceDeleteResponse *apiv1.ProjectServiceDeleteResponse, err error) *ProjectServiceClient_Delete_Call { - _c.Call.Return(projectServiceDeleteResponse, err) - return _c -} - -func (_c *ProjectServiceClient_Delete_Call) RunAndReturn(run func(context1 context.Context, projectServiceDeleteRequest *apiv1.ProjectServiceDeleteRequest) (*apiv1.ProjectServiceDeleteResponse, error)) *ProjectServiceClient_Delete_Call { - _c.Call.Return(run) - return _c -} - -// Get provides a mock function for the type ProjectServiceClient -func (_mock *ProjectServiceClient) Get(context1 context.Context, projectServiceGetRequest *apiv1.ProjectServiceGetRequest) (*apiv1.ProjectServiceGetResponse, error) { - ret := _mock.Called(context1, projectServiceGetRequest) - - if len(ret) == 0 { - panic("no return value specified for Get") - } - - var r0 *apiv1.ProjectServiceGetResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceGetRequest) (*apiv1.ProjectServiceGetResponse, error)); ok { - return returnFunc(context1, projectServiceGetRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceGetRequest) *apiv1.ProjectServiceGetResponse); ok { - r0 = returnFunc(context1, projectServiceGetRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.ProjectServiceGetResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.ProjectServiceGetRequest) error); ok { - r1 = returnFunc(context1, projectServiceGetRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// ProjectServiceClient_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type ProjectServiceClient_Get_Call struct { - *mock.Call -} - -// Get is a helper method to define mock.On call -// - context1 context.Context -// - projectServiceGetRequest *apiv1.ProjectServiceGetRequest -func (_e *ProjectServiceClient_Expecter) Get(context1 any, projectServiceGetRequest any) *ProjectServiceClient_Get_Call { - return &ProjectServiceClient_Get_Call{Call: _e.mock.On("Get", context1, projectServiceGetRequest)} -} - -func (_c *ProjectServiceClient_Get_Call) Run(run func(context1 context.Context, projectServiceGetRequest *apiv1.ProjectServiceGetRequest)) *ProjectServiceClient_Get_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.ProjectServiceGetRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.ProjectServiceGetRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *ProjectServiceClient_Get_Call) Return(projectServiceGetResponse *apiv1.ProjectServiceGetResponse, err error) *ProjectServiceClient_Get_Call { - _c.Call.Return(projectServiceGetResponse, err) - return _c -} - -func (_c *ProjectServiceClient_Get_Call) RunAndReturn(run func(context1 context.Context, projectServiceGetRequest *apiv1.ProjectServiceGetRequest) (*apiv1.ProjectServiceGetResponse, error)) *ProjectServiceClient_Get_Call { - _c.Call.Return(run) - return _c -} - -// List provides a mock function for the type ProjectServiceClient -func (_mock *ProjectServiceClient) List(context1 context.Context, projectServiceListRequest *apiv1.ProjectServiceListRequest) (*apiv1.ProjectServiceListResponse, error) { - ret := _mock.Called(context1, projectServiceListRequest) - - if len(ret) == 0 { - panic("no return value specified for List") - } - - var r0 *apiv1.ProjectServiceListResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceListRequest) (*apiv1.ProjectServiceListResponse, error)); ok { - return returnFunc(context1, projectServiceListRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceListRequest) *apiv1.ProjectServiceListResponse); ok { - r0 = returnFunc(context1, projectServiceListRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.ProjectServiceListResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.ProjectServiceListRequest) error); ok { - r1 = returnFunc(context1, projectServiceListRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// ProjectServiceClient_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' -type ProjectServiceClient_List_Call struct { - *mock.Call -} - -// List is a helper method to define mock.On call -// - context1 context.Context -// - projectServiceListRequest *apiv1.ProjectServiceListRequest -func (_e *ProjectServiceClient_Expecter) List(context1 any, projectServiceListRequest any) *ProjectServiceClient_List_Call { - return &ProjectServiceClient_List_Call{Call: _e.mock.On("List", context1, projectServiceListRequest)} -} - -func (_c *ProjectServiceClient_List_Call) Run(run func(context1 context.Context, projectServiceListRequest *apiv1.ProjectServiceListRequest)) *ProjectServiceClient_List_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.ProjectServiceListRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.ProjectServiceListRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *ProjectServiceClient_List_Call) Return(projectServiceListResponse *apiv1.ProjectServiceListResponse, err error) *ProjectServiceClient_List_Call { - _c.Call.Return(projectServiceListResponse, err) - return _c -} - -func (_c *ProjectServiceClient_List_Call) RunAndReturn(run func(context1 context.Context, projectServiceListRequest *apiv1.ProjectServiceListRequest) (*apiv1.ProjectServiceListResponse, error)) *ProjectServiceClient_List_Call { - _c.Call.Return(run) - return _c -} - -// Update provides a mock function for the type ProjectServiceClient -func (_mock *ProjectServiceClient) Update(context1 context.Context, projectServiceUpdateRequest *apiv1.ProjectServiceUpdateRequest) (*apiv1.ProjectServiceUpdateResponse, error) { - ret := _mock.Called(context1, projectServiceUpdateRequest) - - if len(ret) == 0 { - panic("no return value specified for Update") - } - - var r0 *apiv1.ProjectServiceUpdateResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceUpdateRequest) (*apiv1.ProjectServiceUpdateResponse, error)); ok { - return returnFunc(context1, projectServiceUpdateRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceUpdateRequest) *apiv1.ProjectServiceUpdateResponse); ok { - r0 = returnFunc(context1, projectServiceUpdateRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.ProjectServiceUpdateResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.ProjectServiceUpdateRequest) error); ok { - r1 = returnFunc(context1, projectServiceUpdateRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// ProjectServiceClient_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' -type ProjectServiceClient_Update_Call struct { - *mock.Call -} - -// Update is a helper method to define mock.On call -// - context1 context.Context -// - projectServiceUpdateRequest *apiv1.ProjectServiceUpdateRequest -func (_e *ProjectServiceClient_Expecter) Update(context1 any, projectServiceUpdateRequest any) *ProjectServiceClient_Update_Call { - return &ProjectServiceClient_Update_Call{Call: _e.mock.On("Update", context1, projectServiceUpdateRequest)} -} - -func (_c *ProjectServiceClient_Update_Call) Run(run func(context1 context.Context, projectServiceUpdateRequest *apiv1.ProjectServiceUpdateRequest)) *ProjectServiceClient_Update_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.ProjectServiceUpdateRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.ProjectServiceUpdateRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *ProjectServiceClient_Update_Call) Return(projectServiceUpdateResponse *apiv1.ProjectServiceUpdateResponse, err error) *ProjectServiceClient_Update_Call { - _c.Call.Return(projectServiceUpdateResponse, err) - return _c -} - -func (_c *ProjectServiceClient_Update_Call) RunAndReturn(run func(context1 context.Context, projectServiceUpdateRequest *apiv1.ProjectServiceUpdateRequest) (*apiv1.ProjectServiceUpdateResponse, error)) *ProjectServiceClient_Update_Call { - _c.Call.Return(run) - return _c -} diff --git a/go/tests/mocks/fits/api/v1/apiv1connect/ProjectServiceHandler.go b/go/tests/mocks/fits/api/v1/apiv1connect/ProjectServiceHandler.go deleted file mode 100644 index 33af9b7..0000000 --- a/go/tests/mocks/fits/api/v1/apiv1connect/ProjectServiceHandler.go +++ /dev/null @@ -1,379 +0,0 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify - -package apiv1connect - -import ( - "context" - - "github.com/fi-ts/api/go/fits/api/v1" - mock "github.com/stretchr/testify/mock" -) - -// NewProjectServiceHandler creates a new instance of ProjectServiceHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewProjectServiceHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *ProjectServiceHandler { - mock := &ProjectServiceHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - -// ProjectServiceHandler is an autogenerated mock type for the ProjectServiceHandler type -type ProjectServiceHandler struct { - mock.Mock -} - -type ProjectServiceHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *ProjectServiceHandler) EXPECT() *ProjectServiceHandler_Expecter { - return &ProjectServiceHandler_Expecter{mock: &_m.Mock} -} - -// Create provides a mock function for the type ProjectServiceHandler -func (_mock *ProjectServiceHandler) Create(context1 context.Context, projectServiceCreateRequest *apiv1.ProjectServiceCreateRequest) (*apiv1.ProjectServiceCreateResponse, error) { - ret := _mock.Called(context1, projectServiceCreateRequest) - - if len(ret) == 0 { - panic("no return value specified for Create") - } - - var r0 *apiv1.ProjectServiceCreateResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceCreateRequest) (*apiv1.ProjectServiceCreateResponse, error)); ok { - return returnFunc(context1, projectServiceCreateRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceCreateRequest) *apiv1.ProjectServiceCreateResponse); ok { - r0 = returnFunc(context1, projectServiceCreateRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.ProjectServiceCreateResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.ProjectServiceCreateRequest) error); ok { - r1 = returnFunc(context1, projectServiceCreateRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// ProjectServiceHandler_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' -type ProjectServiceHandler_Create_Call struct { - *mock.Call -} - -// Create is a helper method to define mock.On call -// - context1 context.Context -// - projectServiceCreateRequest *apiv1.ProjectServiceCreateRequest -func (_e *ProjectServiceHandler_Expecter) Create(context1 any, projectServiceCreateRequest any) *ProjectServiceHandler_Create_Call { - return &ProjectServiceHandler_Create_Call{Call: _e.mock.On("Create", context1, projectServiceCreateRequest)} -} - -func (_c *ProjectServiceHandler_Create_Call) Run(run func(context1 context.Context, projectServiceCreateRequest *apiv1.ProjectServiceCreateRequest)) *ProjectServiceHandler_Create_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.ProjectServiceCreateRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.ProjectServiceCreateRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *ProjectServiceHandler_Create_Call) Return(projectServiceCreateResponse *apiv1.ProjectServiceCreateResponse, err error) *ProjectServiceHandler_Create_Call { - _c.Call.Return(projectServiceCreateResponse, err) - return _c -} - -func (_c *ProjectServiceHandler_Create_Call) RunAndReturn(run func(context1 context.Context, projectServiceCreateRequest *apiv1.ProjectServiceCreateRequest) (*apiv1.ProjectServiceCreateResponse, error)) *ProjectServiceHandler_Create_Call { - _c.Call.Return(run) - return _c -} - -// Delete provides a mock function for the type ProjectServiceHandler -func (_mock *ProjectServiceHandler) Delete(context1 context.Context, projectServiceDeleteRequest *apiv1.ProjectServiceDeleteRequest) (*apiv1.ProjectServiceDeleteResponse, error) { - ret := _mock.Called(context1, projectServiceDeleteRequest) - - if len(ret) == 0 { - panic("no return value specified for Delete") - } - - var r0 *apiv1.ProjectServiceDeleteResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceDeleteRequest) (*apiv1.ProjectServiceDeleteResponse, error)); ok { - return returnFunc(context1, projectServiceDeleteRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceDeleteRequest) *apiv1.ProjectServiceDeleteResponse); ok { - r0 = returnFunc(context1, projectServiceDeleteRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.ProjectServiceDeleteResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.ProjectServiceDeleteRequest) error); ok { - r1 = returnFunc(context1, projectServiceDeleteRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// ProjectServiceHandler_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' -type ProjectServiceHandler_Delete_Call struct { - *mock.Call -} - -// Delete is a helper method to define mock.On call -// - context1 context.Context -// - projectServiceDeleteRequest *apiv1.ProjectServiceDeleteRequest -func (_e *ProjectServiceHandler_Expecter) Delete(context1 any, projectServiceDeleteRequest any) *ProjectServiceHandler_Delete_Call { - return &ProjectServiceHandler_Delete_Call{Call: _e.mock.On("Delete", context1, projectServiceDeleteRequest)} -} - -func (_c *ProjectServiceHandler_Delete_Call) Run(run func(context1 context.Context, projectServiceDeleteRequest *apiv1.ProjectServiceDeleteRequest)) *ProjectServiceHandler_Delete_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.ProjectServiceDeleteRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.ProjectServiceDeleteRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *ProjectServiceHandler_Delete_Call) Return(projectServiceDeleteResponse *apiv1.ProjectServiceDeleteResponse, err error) *ProjectServiceHandler_Delete_Call { - _c.Call.Return(projectServiceDeleteResponse, err) - return _c -} - -func (_c *ProjectServiceHandler_Delete_Call) RunAndReturn(run func(context1 context.Context, projectServiceDeleteRequest *apiv1.ProjectServiceDeleteRequest) (*apiv1.ProjectServiceDeleteResponse, error)) *ProjectServiceHandler_Delete_Call { - _c.Call.Return(run) - return _c -} - -// Get provides a mock function for the type ProjectServiceHandler -func (_mock *ProjectServiceHandler) Get(context1 context.Context, projectServiceGetRequest *apiv1.ProjectServiceGetRequest) (*apiv1.ProjectServiceGetResponse, error) { - ret := _mock.Called(context1, projectServiceGetRequest) - - if len(ret) == 0 { - panic("no return value specified for Get") - } - - var r0 *apiv1.ProjectServiceGetResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceGetRequest) (*apiv1.ProjectServiceGetResponse, error)); ok { - return returnFunc(context1, projectServiceGetRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceGetRequest) *apiv1.ProjectServiceGetResponse); ok { - r0 = returnFunc(context1, projectServiceGetRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.ProjectServiceGetResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.ProjectServiceGetRequest) error); ok { - r1 = returnFunc(context1, projectServiceGetRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// ProjectServiceHandler_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type ProjectServiceHandler_Get_Call struct { - *mock.Call -} - -// Get is a helper method to define mock.On call -// - context1 context.Context -// - projectServiceGetRequest *apiv1.ProjectServiceGetRequest -func (_e *ProjectServiceHandler_Expecter) Get(context1 any, projectServiceGetRequest any) *ProjectServiceHandler_Get_Call { - return &ProjectServiceHandler_Get_Call{Call: _e.mock.On("Get", context1, projectServiceGetRequest)} -} - -func (_c *ProjectServiceHandler_Get_Call) Run(run func(context1 context.Context, projectServiceGetRequest *apiv1.ProjectServiceGetRequest)) *ProjectServiceHandler_Get_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.ProjectServiceGetRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.ProjectServiceGetRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *ProjectServiceHandler_Get_Call) Return(projectServiceGetResponse *apiv1.ProjectServiceGetResponse, err error) *ProjectServiceHandler_Get_Call { - _c.Call.Return(projectServiceGetResponse, err) - return _c -} - -func (_c *ProjectServiceHandler_Get_Call) RunAndReturn(run func(context1 context.Context, projectServiceGetRequest *apiv1.ProjectServiceGetRequest) (*apiv1.ProjectServiceGetResponse, error)) *ProjectServiceHandler_Get_Call { - _c.Call.Return(run) - return _c -} - -// List provides a mock function for the type ProjectServiceHandler -func (_mock *ProjectServiceHandler) List(context1 context.Context, projectServiceListRequest *apiv1.ProjectServiceListRequest) (*apiv1.ProjectServiceListResponse, error) { - ret := _mock.Called(context1, projectServiceListRequest) - - if len(ret) == 0 { - panic("no return value specified for List") - } - - var r0 *apiv1.ProjectServiceListResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceListRequest) (*apiv1.ProjectServiceListResponse, error)); ok { - return returnFunc(context1, projectServiceListRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceListRequest) *apiv1.ProjectServiceListResponse); ok { - r0 = returnFunc(context1, projectServiceListRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.ProjectServiceListResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.ProjectServiceListRequest) error); ok { - r1 = returnFunc(context1, projectServiceListRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// ProjectServiceHandler_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' -type ProjectServiceHandler_List_Call struct { - *mock.Call -} - -// List is a helper method to define mock.On call -// - context1 context.Context -// - projectServiceListRequest *apiv1.ProjectServiceListRequest -func (_e *ProjectServiceHandler_Expecter) List(context1 any, projectServiceListRequest any) *ProjectServiceHandler_List_Call { - return &ProjectServiceHandler_List_Call{Call: _e.mock.On("List", context1, projectServiceListRequest)} -} - -func (_c *ProjectServiceHandler_List_Call) Run(run func(context1 context.Context, projectServiceListRequest *apiv1.ProjectServiceListRequest)) *ProjectServiceHandler_List_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.ProjectServiceListRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.ProjectServiceListRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *ProjectServiceHandler_List_Call) Return(projectServiceListResponse *apiv1.ProjectServiceListResponse, err error) *ProjectServiceHandler_List_Call { - _c.Call.Return(projectServiceListResponse, err) - return _c -} - -func (_c *ProjectServiceHandler_List_Call) RunAndReturn(run func(context1 context.Context, projectServiceListRequest *apiv1.ProjectServiceListRequest) (*apiv1.ProjectServiceListResponse, error)) *ProjectServiceHandler_List_Call { - _c.Call.Return(run) - return _c -} - -// Update provides a mock function for the type ProjectServiceHandler -func (_mock *ProjectServiceHandler) Update(context1 context.Context, projectServiceUpdateRequest *apiv1.ProjectServiceUpdateRequest) (*apiv1.ProjectServiceUpdateResponse, error) { - ret := _mock.Called(context1, projectServiceUpdateRequest) - - if len(ret) == 0 { - panic("no return value specified for Update") - } - - var r0 *apiv1.ProjectServiceUpdateResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceUpdateRequest) (*apiv1.ProjectServiceUpdateResponse, error)); ok { - return returnFunc(context1, projectServiceUpdateRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.ProjectServiceUpdateRequest) *apiv1.ProjectServiceUpdateResponse); ok { - r0 = returnFunc(context1, projectServiceUpdateRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.ProjectServiceUpdateResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.ProjectServiceUpdateRequest) error); ok { - r1 = returnFunc(context1, projectServiceUpdateRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// ProjectServiceHandler_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' -type ProjectServiceHandler_Update_Call struct { - *mock.Call -} - -// Update is a helper method to define mock.On call -// - context1 context.Context -// - projectServiceUpdateRequest *apiv1.ProjectServiceUpdateRequest -func (_e *ProjectServiceHandler_Expecter) Update(context1 any, projectServiceUpdateRequest any) *ProjectServiceHandler_Update_Call { - return &ProjectServiceHandler_Update_Call{Call: _e.mock.On("Update", context1, projectServiceUpdateRequest)} -} - -func (_c *ProjectServiceHandler_Update_Call) Run(run func(context1 context.Context, projectServiceUpdateRequest *apiv1.ProjectServiceUpdateRequest)) *ProjectServiceHandler_Update_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.ProjectServiceUpdateRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.ProjectServiceUpdateRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *ProjectServiceHandler_Update_Call) Return(projectServiceUpdateResponse *apiv1.ProjectServiceUpdateResponse, err error) *ProjectServiceHandler_Update_Call { - _c.Call.Return(projectServiceUpdateResponse, err) - return _c -} - -func (_c *ProjectServiceHandler_Update_Call) RunAndReturn(run func(context1 context.Context, projectServiceUpdateRequest *apiv1.ProjectServiceUpdateRequest) (*apiv1.ProjectServiceUpdateResponse, error)) *ProjectServiceHandler_Update_Call { - _c.Call.Return(run) - return _c -} diff --git a/go/tests/mocks/fits/api/v1/apiv1connect/TenantServiceClient.go b/go/tests/mocks/fits/api/v1/apiv1connect/TenantServiceClient.go deleted file mode 100644 index 387d39f..0000000 --- a/go/tests/mocks/fits/api/v1/apiv1connect/TenantServiceClient.go +++ /dev/null @@ -1,379 +0,0 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify - -package apiv1connect - -import ( - "context" - - "github.com/fi-ts/api/go/fits/api/v1" - mock "github.com/stretchr/testify/mock" -) - -// NewTenantServiceClient creates a new instance of TenantServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewTenantServiceClient(t interface { - mock.TestingT - Cleanup(func()) -}) *TenantServiceClient { - mock := &TenantServiceClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - -// TenantServiceClient is an autogenerated mock type for the TenantServiceClient type -type TenantServiceClient struct { - mock.Mock -} - -type TenantServiceClient_Expecter struct { - mock *mock.Mock -} - -func (_m *TenantServiceClient) EXPECT() *TenantServiceClient_Expecter { - return &TenantServiceClient_Expecter{mock: &_m.Mock} -} - -// Create provides a mock function for the type TenantServiceClient -func (_mock *TenantServiceClient) Create(context1 context.Context, tenantServiceCreateRequest *apiv1.TenantServiceCreateRequest) (*apiv1.TenantServiceCreateResponse, error) { - ret := _mock.Called(context1, tenantServiceCreateRequest) - - if len(ret) == 0 { - panic("no return value specified for Create") - } - - var r0 *apiv1.TenantServiceCreateResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceCreateRequest) (*apiv1.TenantServiceCreateResponse, error)); ok { - return returnFunc(context1, tenantServiceCreateRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceCreateRequest) *apiv1.TenantServiceCreateResponse); ok { - r0 = returnFunc(context1, tenantServiceCreateRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TenantServiceCreateResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TenantServiceCreateRequest) error); ok { - r1 = returnFunc(context1, tenantServiceCreateRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TenantServiceClient_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' -type TenantServiceClient_Create_Call struct { - *mock.Call -} - -// Create is a helper method to define mock.On call -// - context1 context.Context -// - tenantServiceCreateRequest *apiv1.TenantServiceCreateRequest -func (_e *TenantServiceClient_Expecter) Create(context1 any, tenantServiceCreateRequest any) *TenantServiceClient_Create_Call { - return &TenantServiceClient_Create_Call{Call: _e.mock.On("Create", context1, tenantServiceCreateRequest)} -} - -func (_c *TenantServiceClient_Create_Call) Run(run func(context1 context.Context, tenantServiceCreateRequest *apiv1.TenantServiceCreateRequest)) *TenantServiceClient_Create_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TenantServiceCreateRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TenantServiceCreateRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TenantServiceClient_Create_Call) Return(tenantServiceCreateResponse *apiv1.TenantServiceCreateResponse, err error) *TenantServiceClient_Create_Call { - _c.Call.Return(tenantServiceCreateResponse, err) - return _c -} - -func (_c *TenantServiceClient_Create_Call) RunAndReturn(run func(context1 context.Context, tenantServiceCreateRequest *apiv1.TenantServiceCreateRequest) (*apiv1.TenantServiceCreateResponse, error)) *TenantServiceClient_Create_Call { - _c.Call.Return(run) - return _c -} - -// Delete provides a mock function for the type TenantServiceClient -func (_mock *TenantServiceClient) Delete(context1 context.Context, tenantServiceDeleteRequest *apiv1.TenantServiceDeleteRequest) (*apiv1.TenantServiceDeleteResponse, error) { - ret := _mock.Called(context1, tenantServiceDeleteRequest) - - if len(ret) == 0 { - panic("no return value specified for Delete") - } - - var r0 *apiv1.TenantServiceDeleteResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceDeleteRequest) (*apiv1.TenantServiceDeleteResponse, error)); ok { - return returnFunc(context1, tenantServiceDeleteRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceDeleteRequest) *apiv1.TenantServiceDeleteResponse); ok { - r0 = returnFunc(context1, tenantServiceDeleteRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TenantServiceDeleteResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TenantServiceDeleteRequest) error); ok { - r1 = returnFunc(context1, tenantServiceDeleteRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TenantServiceClient_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' -type TenantServiceClient_Delete_Call struct { - *mock.Call -} - -// Delete is a helper method to define mock.On call -// - context1 context.Context -// - tenantServiceDeleteRequest *apiv1.TenantServiceDeleteRequest -func (_e *TenantServiceClient_Expecter) Delete(context1 any, tenantServiceDeleteRequest any) *TenantServiceClient_Delete_Call { - return &TenantServiceClient_Delete_Call{Call: _e.mock.On("Delete", context1, tenantServiceDeleteRequest)} -} - -func (_c *TenantServiceClient_Delete_Call) Run(run func(context1 context.Context, tenantServiceDeleteRequest *apiv1.TenantServiceDeleteRequest)) *TenantServiceClient_Delete_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TenantServiceDeleteRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TenantServiceDeleteRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TenantServiceClient_Delete_Call) Return(tenantServiceDeleteResponse *apiv1.TenantServiceDeleteResponse, err error) *TenantServiceClient_Delete_Call { - _c.Call.Return(tenantServiceDeleteResponse, err) - return _c -} - -func (_c *TenantServiceClient_Delete_Call) RunAndReturn(run func(context1 context.Context, tenantServiceDeleteRequest *apiv1.TenantServiceDeleteRequest) (*apiv1.TenantServiceDeleteResponse, error)) *TenantServiceClient_Delete_Call { - _c.Call.Return(run) - return _c -} - -// Get provides a mock function for the type TenantServiceClient -func (_mock *TenantServiceClient) Get(context1 context.Context, tenantServiceGetRequest *apiv1.TenantServiceGetRequest) (*apiv1.TenantServiceGetResponse, error) { - ret := _mock.Called(context1, tenantServiceGetRequest) - - if len(ret) == 0 { - panic("no return value specified for Get") - } - - var r0 *apiv1.TenantServiceGetResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceGetRequest) (*apiv1.TenantServiceGetResponse, error)); ok { - return returnFunc(context1, tenantServiceGetRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceGetRequest) *apiv1.TenantServiceGetResponse); ok { - r0 = returnFunc(context1, tenantServiceGetRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TenantServiceGetResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TenantServiceGetRequest) error); ok { - r1 = returnFunc(context1, tenantServiceGetRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TenantServiceClient_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type TenantServiceClient_Get_Call struct { - *mock.Call -} - -// Get is a helper method to define mock.On call -// - context1 context.Context -// - tenantServiceGetRequest *apiv1.TenantServiceGetRequest -func (_e *TenantServiceClient_Expecter) Get(context1 any, tenantServiceGetRequest any) *TenantServiceClient_Get_Call { - return &TenantServiceClient_Get_Call{Call: _e.mock.On("Get", context1, tenantServiceGetRequest)} -} - -func (_c *TenantServiceClient_Get_Call) Run(run func(context1 context.Context, tenantServiceGetRequest *apiv1.TenantServiceGetRequest)) *TenantServiceClient_Get_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TenantServiceGetRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TenantServiceGetRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TenantServiceClient_Get_Call) Return(tenantServiceGetResponse *apiv1.TenantServiceGetResponse, err error) *TenantServiceClient_Get_Call { - _c.Call.Return(tenantServiceGetResponse, err) - return _c -} - -func (_c *TenantServiceClient_Get_Call) RunAndReturn(run func(context1 context.Context, tenantServiceGetRequest *apiv1.TenantServiceGetRequest) (*apiv1.TenantServiceGetResponse, error)) *TenantServiceClient_Get_Call { - _c.Call.Return(run) - return _c -} - -// List provides a mock function for the type TenantServiceClient -func (_mock *TenantServiceClient) List(context1 context.Context, tenantServiceListRequest *apiv1.TenantServiceListRequest) (*apiv1.TenantServiceListResponse, error) { - ret := _mock.Called(context1, tenantServiceListRequest) - - if len(ret) == 0 { - panic("no return value specified for List") - } - - var r0 *apiv1.TenantServiceListResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceListRequest) (*apiv1.TenantServiceListResponse, error)); ok { - return returnFunc(context1, tenantServiceListRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceListRequest) *apiv1.TenantServiceListResponse); ok { - r0 = returnFunc(context1, tenantServiceListRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TenantServiceListResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TenantServiceListRequest) error); ok { - r1 = returnFunc(context1, tenantServiceListRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TenantServiceClient_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' -type TenantServiceClient_List_Call struct { - *mock.Call -} - -// List is a helper method to define mock.On call -// - context1 context.Context -// - tenantServiceListRequest *apiv1.TenantServiceListRequest -func (_e *TenantServiceClient_Expecter) List(context1 any, tenantServiceListRequest any) *TenantServiceClient_List_Call { - return &TenantServiceClient_List_Call{Call: _e.mock.On("List", context1, tenantServiceListRequest)} -} - -func (_c *TenantServiceClient_List_Call) Run(run func(context1 context.Context, tenantServiceListRequest *apiv1.TenantServiceListRequest)) *TenantServiceClient_List_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TenantServiceListRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TenantServiceListRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TenantServiceClient_List_Call) Return(tenantServiceListResponse *apiv1.TenantServiceListResponse, err error) *TenantServiceClient_List_Call { - _c.Call.Return(tenantServiceListResponse, err) - return _c -} - -func (_c *TenantServiceClient_List_Call) RunAndReturn(run func(context1 context.Context, tenantServiceListRequest *apiv1.TenantServiceListRequest) (*apiv1.TenantServiceListResponse, error)) *TenantServiceClient_List_Call { - _c.Call.Return(run) - return _c -} - -// Update provides a mock function for the type TenantServiceClient -func (_mock *TenantServiceClient) Update(context1 context.Context, tenantServiceUpdateRequest *apiv1.TenantServiceUpdateRequest) (*apiv1.TenantServiceUpdateResponse, error) { - ret := _mock.Called(context1, tenantServiceUpdateRequest) - - if len(ret) == 0 { - panic("no return value specified for Update") - } - - var r0 *apiv1.TenantServiceUpdateResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceUpdateRequest) (*apiv1.TenantServiceUpdateResponse, error)); ok { - return returnFunc(context1, tenantServiceUpdateRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceUpdateRequest) *apiv1.TenantServiceUpdateResponse); ok { - r0 = returnFunc(context1, tenantServiceUpdateRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TenantServiceUpdateResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TenantServiceUpdateRequest) error); ok { - r1 = returnFunc(context1, tenantServiceUpdateRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TenantServiceClient_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' -type TenantServiceClient_Update_Call struct { - *mock.Call -} - -// Update is a helper method to define mock.On call -// - context1 context.Context -// - tenantServiceUpdateRequest *apiv1.TenantServiceUpdateRequest -func (_e *TenantServiceClient_Expecter) Update(context1 any, tenantServiceUpdateRequest any) *TenantServiceClient_Update_Call { - return &TenantServiceClient_Update_Call{Call: _e.mock.On("Update", context1, tenantServiceUpdateRequest)} -} - -func (_c *TenantServiceClient_Update_Call) Run(run func(context1 context.Context, tenantServiceUpdateRequest *apiv1.TenantServiceUpdateRequest)) *TenantServiceClient_Update_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TenantServiceUpdateRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TenantServiceUpdateRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TenantServiceClient_Update_Call) Return(tenantServiceUpdateResponse *apiv1.TenantServiceUpdateResponse, err error) *TenantServiceClient_Update_Call { - _c.Call.Return(tenantServiceUpdateResponse, err) - return _c -} - -func (_c *TenantServiceClient_Update_Call) RunAndReturn(run func(context1 context.Context, tenantServiceUpdateRequest *apiv1.TenantServiceUpdateRequest) (*apiv1.TenantServiceUpdateResponse, error)) *TenantServiceClient_Update_Call { - _c.Call.Return(run) - return _c -} diff --git a/go/tests/mocks/fits/api/v1/apiv1connect/TenantServiceHandler.go b/go/tests/mocks/fits/api/v1/apiv1connect/TenantServiceHandler.go deleted file mode 100644 index 3995a98..0000000 --- a/go/tests/mocks/fits/api/v1/apiv1connect/TenantServiceHandler.go +++ /dev/null @@ -1,379 +0,0 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify - -package apiv1connect - -import ( - "context" - - "github.com/fi-ts/api/go/fits/api/v1" - mock "github.com/stretchr/testify/mock" -) - -// NewTenantServiceHandler creates a new instance of TenantServiceHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewTenantServiceHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *TenantServiceHandler { - mock := &TenantServiceHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - -// TenantServiceHandler is an autogenerated mock type for the TenantServiceHandler type -type TenantServiceHandler struct { - mock.Mock -} - -type TenantServiceHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *TenantServiceHandler) EXPECT() *TenantServiceHandler_Expecter { - return &TenantServiceHandler_Expecter{mock: &_m.Mock} -} - -// Create provides a mock function for the type TenantServiceHandler -func (_mock *TenantServiceHandler) Create(context1 context.Context, tenantServiceCreateRequest *apiv1.TenantServiceCreateRequest) (*apiv1.TenantServiceCreateResponse, error) { - ret := _mock.Called(context1, tenantServiceCreateRequest) - - if len(ret) == 0 { - panic("no return value specified for Create") - } - - var r0 *apiv1.TenantServiceCreateResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceCreateRequest) (*apiv1.TenantServiceCreateResponse, error)); ok { - return returnFunc(context1, tenantServiceCreateRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceCreateRequest) *apiv1.TenantServiceCreateResponse); ok { - r0 = returnFunc(context1, tenantServiceCreateRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TenantServiceCreateResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TenantServiceCreateRequest) error); ok { - r1 = returnFunc(context1, tenantServiceCreateRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TenantServiceHandler_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' -type TenantServiceHandler_Create_Call struct { - *mock.Call -} - -// Create is a helper method to define mock.On call -// - context1 context.Context -// - tenantServiceCreateRequest *apiv1.TenantServiceCreateRequest -func (_e *TenantServiceHandler_Expecter) Create(context1 any, tenantServiceCreateRequest any) *TenantServiceHandler_Create_Call { - return &TenantServiceHandler_Create_Call{Call: _e.mock.On("Create", context1, tenantServiceCreateRequest)} -} - -func (_c *TenantServiceHandler_Create_Call) Run(run func(context1 context.Context, tenantServiceCreateRequest *apiv1.TenantServiceCreateRequest)) *TenantServiceHandler_Create_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TenantServiceCreateRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TenantServiceCreateRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TenantServiceHandler_Create_Call) Return(tenantServiceCreateResponse *apiv1.TenantServiceCreateResponse, err error) *TenantServiceHandler_Create_Call { - _c.Call.Return(tenantServiceCreateResponse, err) - return _c -} - -func (_c *TenantServiceHandler_Create_Call) RunAndReturn(run func(context1 context.Context, tenantServiceCreateRequest *apiv1.TenantServiceCreateRequest) (*apiv1.TenantServiceCreateResponse, error)) *TenantServiceHandler_Create_Call { - _c.Call.Return(run) - return _c -} - -// Delete provides a mock function for the type TenantServiceHandler -func (_mock *TenantServiceHandler) Delete(context1 context.Context, tenantServiceDeleteRequest *apiv1.TenantServiceDeleteRequest) (*apiv1.TenantServiceDeleteResponse, error) { - ret := _mock.Called(context1, tenantServiceDeleteRequest) - - if len(ret) == 0 { - panic("no return value specified for Delete") - } - - var r0 *apiv1.TenantServiceDeleteResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceDeleteRequest) (*apiv1.TenantServiceDeleteResponse, error)); ok { - return returnFunc(context1, tenantServiceDeleteRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceDeleteRequest) *apiv1.TenantServiceDeleteResponse); ok { - r0 = returnFunc(context1, tenantServiceDeleteRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TenantServiceDeleteResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TenantServiceDeleteRequest) error); ok { - r1 = returnFunc(context1, tenantServiceDeleteRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TenantServiceHandler_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' -type TenantServiceHandler_Delete_Call struct { - *mock.Call -} - -// Delete is a helper method to define mock.On call -// - context1 context.Context -// - tenantServiceDeleteRequest *apiv1.TenantServiceDeleteRequest -func (_e *TenantServiceHandler_Expecter) Delete(context1 any, tenantServiceDeleteRequest any) *TenantServiceHandler_Delete_Call { - return &TenantServiceHandler_Delete_Call{Call: _e.mock.On("Delete", context1, tenantServiceDeleteRequest)} -} - -func (_c *TenantServiceHandler_Delete_Call) Run(run func(context1 context.Context, tenantServiceDeleteRequest *apiv1.TenantServiceDeleteRequest)) *TenantServiceHandler_Delete_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TenantServiceDeleteRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TenantServiceDeleteRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TenantServiceHandler_Delete_Call) Return(tenantServiceDeleteResponse *apiv1.TenantServiceDeleteResponse, err error) *TenantServiceHandler_Delete_Call { - _c.Call.Return(tenantServiceDeleteResponse, err) - return _c -} - -func (_c *TenantServiceHandler_Delete_Call) RunAndReturn(run func(context1 context.Context, tenantServiceDeleteRequest *apiv1.TenantServiceDeleteRequest) (*apiv1.TenantServiceDeleteResponse, error)) *TenantServiceHandler_Delete_Call { - _c.Call.Return(run) - return _c -} - -// Get provides a mock function for the type TenantServiceHandler -func (_mock *TenantServiceHandler) Get(context1 context.Context, tenantServiceGetRequest *apiv1.TenantServiceGetRequest) (*apiv1.TenantServiceGetResponse, error) { - ret := _mock.Called(context1, tenantServiceGetRequest) - - if len(ret) == 0 { - panic("no return value specified for Get") - } - - var r0 *apiv1.TenantServiceGetResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceGetRequest) (*apiv1.TenantServiceGetResponse, error)); ok { - return returnFunc(context1, tenantServiceGetRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceGetRequest) *apiv1.TenantServiceGetResponse); ok { - r0 = returnFunc(context1, tenantServiceGetRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TenantServiceGetResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TenantServiceGetRequest) error); ok { - r1 = returnFunc(context1, tenantServiceGetRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TenantServiceHandler_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type TenantServiceHandler_Get_Call struct { - *mock.Call -} - -// Get is a helper method to define mock.On call -// - context1 context.Context -// - tenantServiceGetRequest *apiv1.TenantServiceGetRequest -func (_e *TenantServiceHandler_Expecter) Get(context1 any, tenantServiceGetRequest any) *TenantServiceHandler_Get_Call { - return &TenantServiceHandler_Get_Call{Call: _e.mock.On("Get", context1, tenantServiceGetRequest)} -} - -func (_c *TenantServiceHandler_Get_Call) Run(run func(context1 context.Context, tenantServiceGetRequest *apiv1.TenantServiceGetRequest)) *TenantServiceHandler_Get_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TenantServiceGetRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TenantServiceGetRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TenantServiceHandler_Get_Call) Return(tenantServiceGetResponse *apiv1.TenantServiceGetResponse, err error) *TenantServiceHandler_Get_Call { - _c.Call.Return(tenantServiceGetResponse, err) - return _c -} - -func (_c *TenantServiceHandler_Get_Call) RunAndReturn(run func(context1 context.Context, tenantServiceGetRequest *apiv1.TenantServiceGetRequest) (*apiv1.TenantServiceGetResponse, error)) *TenantServiceHandler_Get_Call { - _c.Call.Return(run) - return _c -} - -// List provides a mock function for the type TenantServiceHandler -func (_mock *TenantServiceHandler) List(context1 context.Context, tenantServiceListRequest *apiv1.TenantServiceListRequest) (*apiv1.TenantServiceListResponse, error) { - ret := _mock.Called(context1, tenantServiceListRequest) - - if len(ret) == 0 { - panic("no return value specified for List") - } - - var r0 *apiv1.TenantServiceListResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceListRequest) (*apiv1.TenantServiceListResponse, error)); ok { - return returnFunc(context1, tenantServiceListRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceListRequest) *apiv1.TenantServiceListResponse); ok { - r0 = returnFunc(context1, tenantServiceListRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TenantServiceListResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TenantServiceListRequest) error); ok { - r1 = returnFunc(context1, tenantServiceListRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TenantServiceHandler_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' -type TenantServiceHandler_List_Call struct { - *mock.Call -} - -// List is a helper method to define mock.On call -// - context1 context.Context -// - tenantServiceListRequest *apiv1.TenantServiceListRequest -func (_e *TenantServiceHandler_Expecter) List(context1 any, tenantServiceListRequest any) *TenantServiceHandler_List_Call { - return &TenantServiceHandler_List_Call{Call: _e.mock.On("List", context1, tenantServiceListRequest)} -} - -func (_c *TenantServiceHandler_List_Call) Run(run func(context1 context.Context, tenantServiceListRequest *apiv1.TenantServiceListRequest)) *TenantServiceHandler_List_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TenantServiceListRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TenantServiceListRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TenantServiceHandler_List_Call) Return(tenantServiceListResponse *apiv1.TenantServiceListResponse, err error) *TenantServiceHandler_List_Call { - _c.Call.Return(tenantServiceListResponse, err) - return _c -} - -func (_c *TenantServiceHandler_List_Call) RunAndReturn(run func(context1 context.Context, tenantServiceListRequest *apiv1.TenantServiceListRequest) (*apiv1.TenantServiceListResponse, error)) *TenantServiceHandler_List_Call { - _c.Call.Return(run) - return _c -} - -// Update provides a mock function for the type TenantServiceHandler -func (_mock *TenantServiceHandler) Update(context1 context.Context, tenantServiceUpdateRequest *apiv1.TenantServiceUpdateRequest) (*apiv1.TenantServiceUpdateResponse, error) { - ret := _mock.Called(context1, tenantServiceUpdateRequest) - - if len(ret) == 0 { - panic("no return value specified for Update") - } - - var r0 *apiv1.TenantServiceUpdateResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceUpdateRequest) (*apiv1.TenantServiceUpdateResponse, error)); ok { - return returnFunc(context1, tenantServiceUpdateRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TenantServiceUpdateRequest) *apiv1.TenantServiceUpdateResponse); ok { - r0 = returnFunc(context1, tenantServiceUpdateRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TenantServiceUpdateResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TenantServiceUpdateRequest) error); ok { - r1 = returnFunc(context1, tenantServiceUpdateRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TenantServiceHandler_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' -type TenantServiceHandler_Update_Call struct { - *mock.Call -} - -// Update is a helper method to define mock.On call -// - context1 context.Context -// - tenantServiceUpdateRequest *apiv1.TenantServiceUpdateRequest -func (_e *TenantServiceHandler_Expecter) Update(context1 any, tenantServiceUpdateRequest any) *TenantServiceHandler_Update_Call { - return &TenantServiceHandler_Update_Call{Call: _e.mock.On("Update", context1, tenantServiceUpdateRequest)} -} - -func (_c *TenantServiceHandler_Update_Call) Run(run func(context1 context.Context, tenantServiceUpdateRequest *apiv1.TenantServiceUpdateRequest)) *TenantServiceHandler_Update_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TenantServiceUpdateRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TenantServiceUpdateRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TenantServiceHandler_Update_Call) Return(tenantServiceUpdateResponse *apiv1.TenantServiceUpdateResponse, err error) *TenantServiceHandler_Update_Call { - _c.Call.Return(tenantServiceUpdateResponse, err) - return _c -} - -func (_c *TenantServiceHandler_Update_Call) RunAndReturn(run func(context1 context.Context, tenantServiceUpdateRequest *apiv1.TenantServiceUpdateRequest) (*apiv1.TenantServiceUpdateResponse, error)) *TenantServiceHandler_Update_Call { - _c.Call.Return(run) - return _c -} diff --git a/go/tests/mocks/fits/api/v1/apiv1connect/TokenServiceClient.go b/go/tests/mocks/fits/api/v1/apiv1connect/TokenServiceClient.go deleted file mode 100644 index fa3d1d0..0000000 --- a/go/tests/mocks/fits/api/v1/apiv1connect/TokenServiceClient.go +++ /dev/null @@ -1,447 +0,0 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify - -package apiv1connect - -import ( - "context" - - "github.com/fi-ts/api/go/fits/api/v1" - mock "github.com/stretchr/testify/mock" -) - -// NewTokenServiceClient creates a new instance of TokenServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewTokenServiceClient(t interface { - mock.TestingT - Cleanup(func()) -}) *TokenServiceClient { - mock := &TokenServiceClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - -// TokenServiceClient is an autogenerated mock type for the TokenServiceClient type -type TokenServiceClient struct { - mock.Mock -} - -type TokenServiceClient_Expecter struct { - mock *mock.Mock -} - -func (_m *TokenServiceClient) EXPECT() *TokenServiceClient_Expecter { - return &TokenServiceClient_Expecter{mock: &_m.Mock} -} - -// Create provides a mock function for the type TokenServiceClient -func (_mock *TokenServiceClient) Create(context1 context.Context, tokenServiceCreateRequest *apiv1.TokenServiceCreateRequest) (*apiv1.TokenServiceCreateResponse, error) { - ret := _mock.Called(context1, tokenServiceCreateRequest) - - if len(ret) == 0 { - panic("no return value specified for Create") - } - - var r0 *apiv1.TokenServiceCreateResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceCreateRequest) (*apiv1.TokenServiceCreateResponse, error)); ok { - return returnFunc(context1, tokenServiceCreateRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceCreateRequest) *apiv1.TokenServiceCreateResponse); ok { - r0 = returnFunc(context1, tokenServiceCreateRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TokenServiceCreateResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TokenServiceCreateRequest) error); ok { - r1 = returnFunc(context1, tokenServiceCreateRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TokenServiceClient_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' -type TokenServiceClient_Create_Call struct { - *mock.Call -} - -// Create is a helper method to define mock.On call -// - context1 context.Context -// - tokenServiceCreateRequest *apiv1.TokenServiceCreateRequest -func (_e *TokenServiceClient_Expecter) Create(context1 any, tokenServiceCreateRequest any) *TokenServiceClient_Create_Call { - return &TokenServiceClient_Create_Call{Call: _e.mock.On("Create", context1, tokenServiceCreateRequest)} -} - -func (_c *TokenServiceClient_Create_Call) Run(run func(context1 context.Context, tokenServiceCreateRequest *apiv1.TokenServiceCreateRequest)) *TokenServiceClient_Create_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TokenServiceCreateRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TokenServiceCreateRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TokenServiceClient_Create_Call) Return(tokenServiceCreateResponse *apiv1.TokenServiceCreateResponse, err error) *TokenServiceClient_Create_Call { - _c.Call.Return(tokenServiceCreateResponse, err) - return _c -} - -func (_c *TokenServiceClient_Create_Call) RunAndReturn(run func(context1 context.Context, tokenServiceCreateRequest *apiv1.TokenServiceCreateRequest) (*apiv1.TokenServiceCreateResponse, error)) *TokenServiceClient_Create_Call { - _c.Call.Return(run) - return _c -} - -// Get provides a mock function for the type TokenServiceClient -func (_mock *TokenServiceClient) Get(context1 context.Context, tokenServiceGetRequest *apiv1.TokenServiceGetRequest) (*apiv1.TokenServiceGetResponse, error) { - ret := _mock.Called(context1, tokenServiceGetRequest) - - if len(ret) == 0 { - panic("no return value specified for Get") - } - - var r0 *apiv1.TokenServiceGetResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceGetRequest) (*apiv1.TokenServiceGetResponse, error)); ok { - return returnFunc(context1, tokenServiceGetRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceGetRequest) *apiv1.TokenServiceGetResponse); ok { - r0 = returnFunc(context1, tokenServiceGetRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TokenServiceGetResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TokenServiceGetRequest) error); ok { - r1 = returnFunc(context1, tokenServiceGetRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TokenServiceClient_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type TokenServiceClient_Get_Call struct { - *mock.Call -} - -// Get is a helper method to define mock.On call -// - context1 context.Context -// - tokenServiceGetRequest *apiv1.TokenServiceGetRequest -func (_e *TokenServiceClient_Expecter) Get(context1 any, tokenServiceGetRequest any) *TokenServiceClient_Get_Call { - return &TokenServiceClient_Get_Call{Call: _e.mock.On("Get", context1, tokenServiceGetRequest)} -} - -func (_c *TokenServiceClient_Get_Call) Run(run func(context1 context.Context, tokenServiceGetRequest *apiv1.TokenServiceGetRequest)) *TokenServiceClient_Get_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TokenServiceGetRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TokenServiceGetRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TokenServiceClient_Get_Call) Return(tokenServiceGetResponse *apiv1.TokenServiceGetResponse, err error) *TokenServiceClient_Get_Call { - _c.Call.Return(tokenServiceGetResponse, err) - return _c -} - -func (_c *TokenServiceClient_Get_Call) RunAndReturn(run func(context1 context.Context, tokenServiceGetRequest *apiv1.TokenServiceGetRequest) (*apiv1.TokenServiceGetResponse, error)) *TokenServiceClient_Get_Call { - _c.Call.Return(run) - return _c -} - -// List provides a mock function for the type TokenServiceClient -func (_mock *TokenServiceClient) List(context1 context.Context, tokenServiceListRequest *apiv1.TokenServiceListRequest) (*apiv1.TokenServiceListResponse, error) { - ret := _mock.Called(context1, tokenServiceListRequest) - - if len(ret) == 0 { - panic("no return value specified for List") - } - - var r0 *apiv1.TokenServiceListResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceListRequest) (*apiv1.TokenServiceListResponse, error)); ok { - return returnFunc(context1, tokenServiceListRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceListRequest) *apiv1.TokenServiceListResponse); ok { - r0 = returnFunc(context1, tokenServiceListRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TokenServiceListResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TokenServiceListRequest) error); ok { - r1 = returnFunc(context1, tokenServiceListRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TokenServiceClient_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' -type TokenServiceClient_List_Call struct { - *mock.Call -} - -// List is a helper method to define mock.On call -// - context1 context.Context -// - tokenServiceListRequest *apiv1.TokenServiceListRequest -func (_e *TokenServiceClient_Expecter) List(context1 any, tokenServiceListRequest any) *TokenServiceClient_List_Call { - return &TokenServiceClient_List_Call{Call: _e.mock.On("List", context1, tokenServiceListRequest)} -} - -func (_c *TokenServiceClient_List_Call) Run(run func(context1 context.Context, tokenServiceListRequest *apiv1.TokenServiceListRequest)) *TokenServiceClient_List_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TokenServiceListRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TokenServiceListRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TokenServiceClient_List_Call) Return(tokenServiceListResponse *apiv1.TokenServiceListResponse, err error) *TokenServiceClient_List_Call { - _c.Call.Return(tokenServiceListResponse, err) - return _c -} - -func (_c *TokenServiceClient_List_Call) RunAndReturn(run func(context1 context.Context, tokenServiceListRequest *apiv1.TokenServiceListRequest) (*apiv1.TokenServiceListResponse, error)) *TokenServiceClient_List_Call { - _c.Call.Return(run) - return _c -} - -// Refresh provides a mock function for the type TokenServiceClient -func (_mock *TokenServiceClient) Refresh(context1 context.Context, tokenServiceRefreshRequest *apiv1.TokenServiceRefreshRequest) (*apiv1.TokenServiceRefreshResponse, error) { - ret := _mock.Called(context1, tokenServiceRefreshRequest) - - if len(ret) == 0 { - panic("no return value specified for Refresh") - } - - var r0 *apiv1.TokenServiceRefreshResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceRefreshRequest) (*apiv1.TokenServiceRefreshResponse, error)); ok { - return returnFunc(context1, tokenServiceRefreshRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceRefreshRequest) *apiv1.TokenServiceRefreshResponse); ok { - r0 = returnFunc(context1, tokenServiceRefreshRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TokenServiceRefreshResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TokenServiceRefreshRequest) error); ok { - r1 = returnFunc(context1, tokenServiceRefreshRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TokenServiceClient_Refresh_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Refresh' -type TokenServiceClient_Refresh_Call struct { - *mock.Call -} - -// Refresh is a helper method to define mock.On call -// - context1 context.Context -// - tokenServiceRefreshRequest *apiv1.TokenServiceRefreshRequest -func (_e *TokenServiceClient_Expecter) Refresh(context1 any, tokenServiceRefreshRequest any) *TokenServiceClient_Refresh_Call { - return &TokenServiceClient_Refresh_Call{Call: _e.mock.On("Refresh", context1, tokenServiceRefreshRequest)} -} - -func (_c *TokenServiceClient_Refresh_Call) Run(run func(context1 context.Context, tokenServiceRefreshRequest *apiv1.TokenServiceRefreshRequest)) *TokenServiceClient_Refresh_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TokenServiceRefreshRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TokenServiceRefreshRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TokenServiceClient_Refresh_Call) Return(tokenServiceRefreshResponse *apiv1.TokenServiceRefreshResponse, err error) *TokenServiceClient_Refresh_Call { - _c.Call.Return(tokenServiceRefreshResponse, err) - return _c -} - -func (_c *TokenServiceClient_Refresh_Call) RunAndReturn(run func(context1 context.Context, tokenServiceRefreshRequest *apiv1.TokenServiceRefreshRequest) (*apiv1.TokenServiceRefreshResponse, error)) *TokenServiceClient_Refresh_Call { - _c.Call.Return(run) - return _c -} - -// Revoke provides a mock function for the type TokenServiceClient -func (_mock *TokenServiceClient) Revoke(context1 context.Context, tokenServiceRevokeRequest *apiv1.TokenServiceRevokeRequest) (*apiv1.TokenServiceRevokeResponse, error) { - ret := _mock.Called(context1, tokenServiceRevokeRequest) - - if len(ret) == 0 { - panic("no return value specified for Revoke") - } - - var r0 *apiv1.TokenServiceRevokeResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceRevokeRequest) (*apiv1.TokenServiceRevokeResponse, error)); ok { - return returnFunc(context1, tokenServiceRevokeRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceRevokeRequest) *apiv1.TokenServiceRevokeResponse); ok { - r0 = returnFunc(context1, tokenServiceRevokeRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TokenServiceRevokeResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TokenServiceRevokeRequest) error); ok { - r1 = returnFunc(context1, tokenServiceRevokeRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TokenServiceClient_Revoke_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Revoke' -type TokenServiceClient_Revoke_Call struct { - *mock.Call -} - -// Revoke is a helper method to define mock.On call -// - context1 context.Context -// - tokenServiceRevokeRequest *apiv1.TokenServiceRevokeRequest -func (_e *TokenServiceClient_Expecter) Revoke(context1 any, tokenServiceRevokeRequest any) *TokenServiceClient_Revoke_Call { - return &TokenServiceClient_Revoke_Call{Call: _e.mock.On("Revoke", context1, tokenServiceRevokeRequest)} -} - -func (_c *TokenServiceClient_Revoke_Call) Run(run func(context1 context.Context, tokenServiceRevokeRequest *apiv1.TokenServiceRevokeRequest)) *TokenServiceClient_Revoke_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TokenServiceRevokeRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TokenServiceRevokeRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TokenServiceClient_Revoke_Call) Return(tokenServiceRevokeResponse *apiv1.TokenServiceRevokeResponse, err error) *TokenServiceClient_Revoke_Call { - _c.Call.Return(tokenServiceRevokeResponse, err) - return _c -} - -func (_c *TokenServiceClient_Revoke_Call) RunAndReturn(run func(context1 context.Context, tokenServiceRevokeRequest *apiv1.TokenServiceRevokeRequest) (*apiv1.TokenServiceRevokeResponse, error)) *TokenServiceClient_Revoke_Call { - _c.Call.Return(run) - return _c -} - -// Update provides a mock function for the type TokenServiceClient -func (_mock *TokenServiceClient) Update(context1 context.Context, tokenServiceUpdateRequest *apiv1.TokenServiceUpdateRequest) (*apiv1.TokenServiceUpdateResponse, error) { - ret := _mock.Called(context1, tokenServiceUpdateRequest) - - if len(ret) == 0 { - panic("no return value specified for Update") - } - - var r0 *apiv1.TokenServiceUpdateResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceUpdateRequest) (*apiv1.TokenServiceUpdateResponse, error)); ok { - return returnFunc(context1, tokenServiceUpdateRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceUpdateRequest) *apiv1.TokenServiceUpdateResponse); ok { - r0 = returnFunc(context1, tokenServiceUpdateRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TokenServiceUpdateResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TokenServiceUpdateRequest) error); ok { - r1 = returnFunc(context1, tokenServiceUpdateRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TokenServiceClient_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' -type TokenServiceClient_Update_Call struct { - *mock.Call -} - -// Update is a helper method to define mock.On call -// - context1 context.Context -// - tokenServiceUpdateRequest *apiv1.TokenServiceUpdateRequest -func (_e *TokenServiceClient_Expecter) Update(context1 any, tokenServiceUpdateRequest any) *TokenServiceClient_Update_Call { - return &TokenServiceClient_Update_Call{Call: _e.mock.On("Update", context1, tokenServiceUpdateRequest)} -} - -func (_c *TokenServiceClient_Update_Call) Run(run func(context1 context.Context, tokenServiceUpdateRequest *apiv1.TokenServiceUpdateRequest)) *TokenServiceClient_Update_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TokenServiceUpdateRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TokenServiceUpdateRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TokenServiceClient_Update_Call) Return(tokenServiceUpdateResponse *apiv1.TokenServiceUpdateResponse, err error) *TokenServiceClient_Update_Call { - _c.Call.Return(tokenServiceUpdateResponse, err) - return _c -} - -func (_c *TokenServiceClient_Update_Call) RunAndReturn(run func(context1 context.Context, tokenServiceUpdateRequest *apiv1.TokenServiceUpdateRequest) (*apiv1.TokenServiceUpdateResponse, error)) *TokenServiceClient_Update_Call { - _c.Call.Return(run) - return _c -} diff --git a/go/tests/mocks/fits/api/v1/apiv1connect/TokenServiceHandler.go b/go/tests/mocks/fits/api/v1/apiv1connect/TokenServiceHandler.go deleted file mode 100644 index d0fb47e..0000000 --- a/go/tests/mocks/fits/api/v1/apiv1connect/TokenServiceHandler.go +++ /dev/null @@ -1,447 +0,0 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify - -package apiv1connect - -import ( - "context" - - "github.com/fi-ts/api/go/fits/api/v1" - mock "github.com/stretchr/testify/mock" -) - -// NewTokenServiceHandler creates a new instance of TokenServiceHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewTokenServiceHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *TokenServiceHandler { - mock := &TokenServiceHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - -// TokenServiceHandler is an autogenerated mock type for the TokenServiceHandler type -type TokenServiceHandler struct { - mock.Mock -} - -type TokenServiceHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *TokenServiceHandler) EXPECT() *TokenServiceHandler_Expecter { - return &TokenServiceHandler_Expecter{mock: &_m.Mock} -} - -// Create provides a mock function for the type TokenServiceHandler -func (_mock *TokenServiceHandler) Create(context1 context.Context, tokenServiceCreateRequest *apiv1.TokenServiceCreateRequest) (*apiv1.TokenServiceCreateResponse, error) { - ret := _mock.Called(context1, tokenServiceCreateRequest) - - if len(ret) == 0 { - panic("no return value specified for Create") - } - - var r0 *apiv1.TokenServiceCreateResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceCreateRequest) (*apiv1.TokenServiceCreateResponse, error)); ok { - return returnFunc(context1, tokenServiceCreateRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceCreateRequest) *apiv1.TokenServiceCreateResponse); ok { - r0 = returnFunc(context1, tokenServiceCreateRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TokenServiceCreateResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TokenServiceCreateRequest) error); ok { - r1 = returnFunc(context1, tokenServiceCreateRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TokenServiceHandler_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' -type TokenServiceHandler_Create_Call struct { - *mock.Call -} - -// Create is a helper method to define mock.On call -// - context1 context.Context -// - tokenServiceCreateRequest *apiv1.TokenServiceCreateRequest -func (_e *TokenServiceHandler_Expecter) Create(context1 any, tokenServiceCreateRequest any) *TokenServiceHandler_Create_Call { - return &TokenServiceHandler_Create_Call{Call: _e.mock.On("Create", context1, tokenServiceCreateRequest)} -} - -func (_c *TokenServiceHandler_Create_Call) Run(run func(context1 context.Context, tokenServiceCreateRequest *apiv1.TokenServiceCreateRequest)) *TokenServiceHandler_Create_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TokenServiceCreateRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TokenServiceCreateRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TokenServiceHandler_Create_Call) Return(tokenServiceCreateResponse *apiv1.TokenServiceCreateResponse, err error) *TokenServiceHandler_Create_Call { - _c.Call.Return(tokenServiceCreateResponse, err) - return _c -} - -func (_c *TokenServiceHandler_Create_Call) RunAndReturn(run func(context1 context.Context, tokenServiceCreateRequest *apiv1.TokenServiceCreateRequest) (*apiv1.TokenServiceCreateResponse, error)) *TokenServiceHandler_Create_Call { - _c.Call.Return(run) - return _c -} - -// Get provides a mock function for the type TokenServiceHandler -func (_mock *TokenServiceHandler) Get(context1 context.Context, tokenServiceGetRequest *apiv1.TokenServiceGetRequest) (*apiv1.TokenServiceGetResponse, error) { - ret := _mock.Called(context1, tokenServiceGetRequest) - - if len(ret) == 0 { - panic("no return value specified for Get") - } - - var r0 *apiv1.TokenServiceGetResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceGetRequest) (*apiv1.TokenServiceGetResponse, error)); ok { - return returnFunc(context1, tokenServiceGetRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceGetRequest) *apiv1.TokenServiceGetResponse); ok { - r0 = returnFunc(context1, tokenServiceGetRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TokenServiceGetResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TokenServiceGetRequest) error); ok { - r1 = returnFunc(context1, tokenServiceGetRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TokenServiceHandler_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type TokenServiceHandler_Get_Call struct { - *mock.Call -} - -// Get is a helper method to define mock.On call -// - context1 context.Context -// - tokenServiceGetRequest *apiv1.TokenServiceGetRequest -func (_e *TokenServiceHandler_Expecter) Get(context1 any, tokenServiceGetRequest any) *TokenServiceHandler_Get_Call { - return &TokenServiceHandler_Get_Call{Call: _e.mock.On("Get", context1, tokenServiceGetRequest)} -} - -func (_c *TokenServiceHandler_Get_Call) Run(run func(context1 context.Context, tokenServiceGetRequest *apiv1.TokenServiceGetRequest)) *TokenServiceHandler_Get_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TokenServiceGetRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TokenServiceGetRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TokenServiceHandler_Get_Call) Return(tokenServiceGetResponse *apiv1.TokenServiceGetResponse, err error) *TokenServiceHandler_Get_Call { - _c.Call.Return(tokenServiceGetResponse, err) - return _c -} - -func (_c *TokenServiceHandler_Get_Call) RunAndReturn(run func(context1 context.Context, tokenServiceGetRequest *apiv1.TokenServiceGetRequest) (*apiv1.TokenServiceGetResponse, error)) *TokenServiceHandler_Get_Call { - _c.Call.Return(run) - return _c -} - -// List provides a mock function for the type TokenServiceHandler -func (_mock *TokenServiceHandler) List(context1 context.Context, tokenServiceListRequest *apiv1.TokenServiceListRequest) (*apiv1.TokenServiceListResponse, error) { - ret := _mock.Called(context1, tokenServiceListRequest) - - if len(ret) == 0 { - panic("no return value specified for List") - } - - var r0 *apiv1.TokenServiceListResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceListRequest) (*apiv1.TokenServiceListResponse, error)); ok { - return returnFunc(context1, tokenServiceListRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceListRequest) *apiv1.TokenServiceListResponse); ok { - r0 = returnFunc(context1, tokenServiceListRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TokenServiceListResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TokenServiceListRequest) error); ok { - r1 = returnFunc(context1, tokenServiceListRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TokenServiceHandler_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' -type TokenServiceHandler_List_Call struct { - *mock.Call -} - -// List is a helper method to define mock.On call -// - context1 context.Context -// - tokenServiceListRequest *apiv1.TokenServiceListRequest -func (_e *TokenServiceHandler_Expecter) List(context1 any, tokenServiceListRequest any) *TokenServiceHandler_List_Call { - return &TokenServiceHandler_List_Call{Call: _e.mock.On("List", context1, tokenServiceListRequest)} -} - -func (_c *TokenServiceHandler_List_Call) Run(run func(context1 context.Context, tokenServiceListRequest *apiv1.TokenServiceListRequest)) *TokenServiceHandler_List_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TokenServiceListRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TokenServiceListRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TokenServiceHandler_List_Call) Return(tokenServiceListResponse *apiv1.TokenServiceListResponse, err error) *TokenServiceHandler_List_Call { - _c.Call.Return(tokenServiceListResponse, err) - return _c -} - -func (_c *TokenServiceHandler_List_Call) RunAndReturn(run func(context1 context.Context, tokenServiceListRequest *apiv1.TokenServiceListRequest) (*apiv1.TokenServiceListResponse, error)) *TokenServiceHandler_List_Call { - _c.Call.Return(run) - return _c -} - -// Refresh provides a mock function for the type TokenServiceHandler -func (_mock *TokenServiceHandler) Refresh(context1 context.Context, tokenServiceRefreshRequest *apiv1.TokenServiceRefreshRequest) (*apiv1.TokenServiceRefreshResponse, error) { - ret := _mock.Called(context1, tokenServiceRefreshRequest) - - if len(ret) == 0 { - panic("no return value specified for Refresh") - } - - var r0 *apiv1.TokenServiceRefreshResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceRefreshRequest) (*apiv1.TokenServiceRefreshResponse, error)); ok { - return returnFunc(context1, tokenServiceRefreshRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceRefreshRequest) *apiv1.TokenServiceRefreshResponse); ok { - r0 = returnFunc(context1, tokenServiceRefreshRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TokenServiceRefreshResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TokenServiceRefreshRequest) error); ok { - r1 = returnFunc(context1, tokenServiceRefreshRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TokenServiceHandler_Refresh_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Refresh' -type TokenServiceHandler_Refresh_Call struct { - *mock.Call -} - -// Refresh is a helper method to define mock.On call -// - context1 context.Context -// - tokenServiceRefreshRequest *apiv1.TokenServiceRefreshRequest -func (_e *TokenServiceHandler_Expecter) Refresh(context1 any, tokenServiceRefreshRequest any) *TokenServiceHandler_Refresh_Call { - return &TokenServiceHandler_Refresh_Call{Call: _e.mock.On("Refresh", context1, tokenServiceRefreshRequest)} -} - -func (_c *TokenServiceHandler_Refresh_Call) Run(run func(context1 context.Context, tokenServiceRefreshRequest *apiv1.TokenServiceRefreshRequest)) *TokenServiceHandler_Refresh_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TokenServiceRefreshRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TokenServiceRefreshRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TokenServiceHandler_Refresh_Call) Return(tokenServiceRefreshResponse *apiv1.TokenServiceRefreshResponse, err error) *TokenServiceHandler_Refresh_Call { - _c.Call.Return(tokenServiceRefreshResponse, err) - return _c -} - -func (_c *TokenServiceHandler_Refresh_Call) RunAndReturn(run func(context1 context.Context, tokenServiceRefreshRequest *apiv1.TokenServiceRefreshRequest) (*apiv1.TokenServiceRefreshResponse, error)) *TokenServiceHandler_Refresh_Call { - _c.Call.Return(run) - return _c -} - -// Revoke provides a mock function for the type TokenServiceHandler -func (_mock *TokenServiceHandler) Revoke(context1 context.Context, tokenServiceRevokeRequest *apiv1.TokenServiceRevokeRequest) (*apiv1.TokenServiceRevokeResponse, error) { - ret := _mock.Called(context1, tokenServiceRevokeRequest) - - if len(ret) == 0 { - panic("no return value specified for Revoke") - } - - var r0 *apiv1.TokenServiceRevokeResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceRevokeRequest) (*apiv1.TokenServiceRevokeResponse, error)); ok { - return returnFunc(context1, tokenServiceRevokeRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceRevokeRequest) *apiv1.TokenServiceRevokeResponse); ok { - r0 = returnFunc(context1, tokenServiceRevokeRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TokenServiceRevokeResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TokenServiceRevokeRequest) error); ok { - r1 = returnFunc(context1, tokenServiceRevokeRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TokenServiceHandler_Revoke_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Revoke' -type TokenServiceHandler_Revoke_Call struct { - *mock.Call -} - -// Revoke is a helper method to define mock.On call -// - context1 context.Context -// - tokenServiceRevokeRequest *apiv1.TokenServiceRevokeRequest -func (_e *TokenServiceHandler_Expecter) Revoke(context1 any, tokenServiceRevokeRequest any) *TokenServiceHandler_Revoke_Call { - return &TokenServiceHandler_Revoke_Call{Call: _e.mock.On("Revoke", context1, tokenServiceRevokeRequest)} -} - -func (_c *TokenServiceHandler_Revoke_Call) Run(run func(context1 context.Context, tokenServiceRevokeRequest *apiv1.TokenServiceRevokeRequest)) *TokenServiceHandler_Revoke_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TokenServiceRevokeRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TokenServiceRevokeRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TokenServiceHandler_Revoke_Call) Return(tokenServiceRevokeResponse *apiv1.TokenServiceRevokeResponse, err error) *TokenServiceHandler_Revoke_Call { - _c.Call.Return(tokenServiceRevokeResponse, err) - return _c -} - -func (_c *TokenServiceHandler_Revoke_Call) RunAndReturn(run func(context1 context.Context, tokenServiceRevokeRequest *apiv1.TokenServiceRevokeRequest) (*apiv1.TokenServiceRevokeResponse, error)) *TokenServiceHandler_Revoke_Call { - _c.Call.Return(run) - return _c -} - -// Update provides a mock function for the type TokenServiceHandler -func (_mock *TokenServiceHandler) Update(context1 context.Context, tokenServiceUpdateRequest *apiv1.TokenServiceUpdateRequest) (*apiv1.TokenServiceUpdateResponse, error) { - ret := _mock.Called(context1, tokenServiceUpdateRequest) - - if len(ret) == 0 { - panic("no return value specified for Update") - } - - var r0 *apiv1.TokenServiceUpdateResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceUpdateRequest) (*apiv1.TokenServiceUpdateResponse, error)); ok { - return returnFunc(context1, tokenServiceUpdateRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.TokenServiceUpdateRequest) *apiv1.TokenServiceUpdateResponse); ok { - r0 = returnFunc(context1, tokenServiceUpdateRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.TokenServiceUpdateResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.TokenServiceUpdateRequest) error); ok { - r1 = returnFunc(context1, tokenServiceUpdateRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// TokenServiceHandler_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' -type TokenServiceHandler_Update_Call struct { - *mock.Call -} - -// Update is a helper method to define mock.On call -// - context1 context.Context -// - tokenServiceUpdateRequest *apiv1.TokenServiceUpdateRequest -func (_e *TokenServiceHandler_Expecter) Update(context1 any, tokenServiceUpdateRequest any) *TokenServiceHandler_Update_Call { - return &TokenServiceHandler_Update_Call{Call: _e.mock.On("Update", context1, tokenServiceUpdateRequest)} -} - -func (_c *TokenServiceHandler_Update_Call) Run(run func(context1 context.Context, tokenServiceUpdateRequest *apiv1.TokenServiceUpdateRequest)) *TokenServiceHandler_Update_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.TokenServiceUpdateRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.TokenServiceUpdateRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *TokenServiceHandler_Update_Call) Return(tokenServiceUpdateResponse *apiv1.TokenServiceUpdateResponse, err error) *TokenServiceHandler_Update_Call { - _c.Call.Return(tokenServiceUpdateResponse, err) - return _c -} - -func (_c *TokenServiceHandler_Update_Call) RunAndReturn(run func(context1 context.Context, tokenServiceUpdateRequest *apiv1.TokenServiceUpdateRequest) (*apiv1.TokenServiceUpdateResponse, error)) *TokenServiceHandler_Update_Call { - _c.Call.Return(run) - return _c -} diff --git a/go/tests/mocks/fits/api/v1/apiv1connect/VersionServiceClient.go b/go/tests/mocks/fits/api/v1/apiv1connect/VersionServiceClient.go deleted file mode 100644 index fd1d12a..0000000 --- a/go/tests/mocks/fits/api/v1/apiv1connect/VersionServiceClient.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify - -package apiv1connect - -import ( - "context" - - "github.com/fi-ts/api/go/fits/api/v1" - mock "github.com/stretchr/testify/mock" -) - -// NewVersionServiceClient creates a new instance of VersionServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewVersionServiceClient(t interface { - mock.TestingT - Cleanup(func()) -}) *VersionServiceClient { - mock := &VersionServiceClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - -// VersionServiceClient is an autogenerated mock type for the VersionServiceClient type -type VersionServiceClient struct { - mock.Mock -} - -type VersionServiceClient_Expecter struct { - mock *mock.Mock -} - -func (_m *VersionServiceClient) EXPECT() *VersionServiceClient_Expecter { - return &VersionServiceClient_Expecter{mock: &_m.Mock} -} - -// Get provides a mock function for the type VersionServiceClient -func (_mock *VersionServiceClient) Get(context1 context.Context, versionServiceGetRequest *apiv1.VersionServiceGetRequest) (*apiv1.VersionServiceGetResponse, error) { - ret := _mock.Called(context1, versionServiceGetRequest) - - if len(ret) == 0 { - panic("no return value specified for Get") - } - - var r0 *apiv1.VersionServiceGetResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.VersionServiceGetRequest) (*apiv1.VersionServiceGetResponse, error)); ok { - return returnFunc(context1, versionServiceGetRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.VersionServiceGetRequest) *apiv1.VersionServiceGetResponse); ok { - r0 = returnFunc(context1, versionServiceGetRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.VersionServiceGetResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.VersionServiceGetRequest) error); ok { - r1 = returnFunc(context1, versionServiceGetRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// VersionServiceClient_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type VersionServiceClient_Get_Call struct { - *mock.Call -} - -// Get is a helper method to define mock.On call -// - context1 context.Context -// - versionServiceGetRequest *apiv1.VersionServiceGetRequest -func (_e *VersionServiceClient_Expecter) Get(context1 any, versionServiceGetRequest any) *VersionServiceClient_Get_Call { - return &VersionServiceClient_Get_Call{Call: _e.mock.On("Get", context1, versionServiceGetRequest)} -} - -func (_c *VersionServiceClient_Get_Call) Run(run func(context1 context.Context, versionServiceGetRequest *apiv1.VersionServiceGetRequest)) *VersionServiceClient_Get_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.VersionServiceGetRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.VersionServiceGetRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *VersionServiceClient_Get_Call) Return(versionServiceGetResponse *apiv1.VersionServiceGetResponse, err error) *VersionServiceClient_Get_Call { - _c.Call.Return(versionServiceGetResponse, err) - return _c -} - -func (_c *VersionServiceClient_Get_Call) RunAndReturn(run func(context1 context.Context, versionServiceGetRequest *apiv1.VersionServiceGetRequest) (*apiv1.VersionServiceGetResponse, error)) *VersionServiceClient_Get_Call { - _c.Call.Return(run) - return _c -} diff --git a/go/tests/mocks/fits/api/v1/apiv1connect/VersionServiceHandler.go b/go/tests/mocks/fits/api/v1/apiv1connect/VersionServiceHandler.go deleted file mode 100644 index 6c8cc89..0000000 --- a/go/tests/mocks/fits/api/v1/apiv1connect/VersionServiceHandler.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify - -package apiv1connect - -import ( - "context" - - "github.com/fi-ts/api/go/fits/api/v1" - mock "github.com/stretchr/testify/mock" -) - -// NewVersionServiceHandler creates a new instance of VersionServiceHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewVersionServiceHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *VersionServiceHandler { - mock := &VersionServiceHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - -// VersionServiceHandler is an autogenerated mock type for the VersionServiceHandler type -type VersionServiceHandler struct { - mock.Mock -} - -type VersionServiceHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *VersionServiceHandler) EXPECT() *VersionServiceHandler_Expecter { - return &VersionServiceHandler_Expecter{mock: &_m.Mock} -} - -// Get provides a mock function for the type VersionServiceHandler -func (_mock *VersionServiceHandler) Get(context1 context.Context, versionServiceGetRequest *apiv1.VersionServiceGetRequest) (*apiv1.VersionServiceGetResponse, error) { - ret := _mock.Called(context1, versionServiceGetRequest) - - if len(ret) == 0 { - panic("no return value specified for Get") - } - - var r0 *apiv1.VersionServiceGetResponse - var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.VersionServiceGetRequest) (*apiv1.VersionServiceGetResponse, error)); ok { - return returnFunc(context1, versionServiceGetRequest) - } - if returnFunc, ok := ret.Get(0).(func(context.Context, *apiv1.VersionServiceGetRequest) *apiv1.VersionServiceGetResponse); ok { - r0 = returnFunc(context1, versionServiceGetRequest) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.VersionServiceGetResponse) - } - } - if returnFunc, ok := ret.Get(1).(func(context.Context, *apiv1.VersionServiceGetRequest) error); ok { - r1 = returnFunc(context1, versionServiceGetRequest) - } else { - r1 = ret.Error(1) - } - return r0, r1 -} - -// VersionServiceHandler_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type VersionServiceHandler_Get_Call struct { - *mock.Call -} - -// Get is a helper method to define mock.On call -// - context1 context.Context -// - versionServiceGetRequest *apiv1.VersionServiceGetRequest -func (_e *VersionServiceHandler_Expecter) Get(context1 any, versionServiceGetRequest any) *VersionServiceHandler_Get_Call { - return &VersionServiceHandler_Get_Call{Call: _e.mock.On("Get", context1, versionServiceGetRequest)} -} - -func (_c *VersionServiceHandler_Get_Call) Run(run func(context1 context.Context, versionServiceGetRequest *apiv1.VersionServiceGetRequest)) *VersionServiceHandler_Get_Call { - _c.Call.Run(func(args mock.Arguments) { - var arg0 context.Context - if args[0] != nil { - arg0 = args[0].(context.Context) - } - var arg1 *apiv1.VersionServiceGetRequest - if args[1] != nil { - arg1 = args[1].(*apiv1.VersionServiceGetRequest) - } - run( - arg0, - arg1, - ) - }) - return _c -} - -func (_c *VersionServiceHandler_Get_Call) Return(versionServiceGetResponse *apiv1.VersionServiceGetResponse, err error) *VersionServiceHandler_Get_Call { - _c.Call.Return(versionServiceGetResponse, err) - return _c -} - -func (_c *VersionServiceHandler_Get_Call) RunAndReturn(run func(context1 context.Context, versionServiceGetRequest *apiv1.VersionServiceGetRequest) (*apiv1.VersionServiceGetResponse, error)) *VersionServiceHandler_Get_Call { - _c.Call.Return(run) - return _c -} diff --git a/js/Makefile b/js/Makefile index aced62f..c685cdf 100644 --- a/js/Makefile +++ b/js/Makefile @@ -12,8 +12,11 @@ clean: .PHONY: build build: install ifeq ($(CI),true) - cd .. &&\ yq e -i -o=json ".version=\"$(VERSION_STRIPPED)\"" package.json &&\ yq e -o=json ".version" package.json endif - cd .. && bun run build + bun run build + +.PHONY: test +test: + bun test ./client-test.ts diff --git a/bun.lock b/js/bun.lock similarity index 100% rename from bun.lock rename to js/bun.lock diff --git a/js/client-test.d.ts b/js/client-test.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/js/client-test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/js/client-test.js b/js/client-test.js new file mode 100644 index 0000000..0b3ee5f --- /dev/null +++ b/js/client-test.js @@ -0,0 +1,45 @@ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +import { describe, it, expect } from "bun:test"; +import { create } from "@bufbuild/protobuf"; +import { VersionSchema, VersionServiceGetRequestSchema, VersionServiceGetResponseSchema, } from "./fits/api/v1/version_pb"; +import { newClient } from "./client"; +import { newTestInterceptor } from "./test-interceptor"; +function unaryResponse(message) { + return { + stream: false, + message: message, + header: new Headers(), + trailer: new Headers(), + service: undefined, + method: undefined, + }; +} +describe("client", () => { + it("works with test interceptor", () => __awaiter(void 0, void 0, void 0, function* () { + var _a; + const c = newClient({ + baseUrl: "http://this-is-just-for-testing", + interceptors: [ + newTestInterceptor([ + { + wantRequest: create(VersionServiceGetRequestSchema, {}), + wantRequestSchema: VersionServiceGetRequestSchema, + wantResponse: () => unaryResponse(create(VersionServiceGetResponseSchema, { + version: create(VersionSchema, { version: "1.0" }), + })), + }, + ]), + ], + }); + const v = yield c.apiv1().version().get({}); + expect((_a = v.version) === null || _a === void 0 ? void 0 : _a.version).toBe("1.0"); + })); +}); diff --git a/js/client-test.ts b/js/client-test.ts new file mode 100644 index 0000000..963d9da --- /dev/null +++ b/js/client-test.ts @@ -0,0 +1,49 @@ +import { describe, it, expect } from "bun:test"; +import { create } from "@bufbuild/protobuf"; +import type { DescMessage, MessageShape } from "@bufbuild/protobuf"; +import { + VersionSchema, + VersionServiceGetRequestSchema, + VersionServiceGetResponseSchema, +} from "./fits/api/v1/version_pb"; +import type { UnaryResponse } from "@connectrpc/connect"; +import { newClient } from "./client"; +import { newTestInterceptor } from "./test-interceptor"; + +function unaryResponse( + message: MessageShape, +): UnaryResponse { + return { + stream: false as const, + message: message as any, + header: new Headers(), + trailer: new Headers(), + service: undefined as any, + method: undefined as any, + }; +} + +describe("client", () => { + it("works with test interceptor", async () => { + const c = newClient({ + baseUrl: "http://this-is-just-for-testing", + interceptors: [ + newTestInterceptor([ + { + wantRequest: create(VersionServiceGetRequestSchema, {}), + wantRequestSchema: VersionServiceGetRequestSchema, + wantResponse: () => + unaryResponse( + create(VersionServiceGetResponseSchema, { + version: create(VersionSchema, { version: "1.0" }), + }), + ), + }, + ]), + ], + }); + + const v = await c.apiv1().version().get({}); + expect(v.version?.version).toBe("1.0"); + }); +}); diff --git a/js/client.d.ts b/js/client.d.ts new file mode 100644 index 0000000..4806da2 --- /dev/null +++ b/js/client.d.ts @@ -0,0 +1,27 @@ +import { Interceptor } from "@connectrpc/connect"; +import type { Client as ConnectClient } from "@connectrpc/connect"; +import { HealthService as Apiv1HealthService } from "./fits/api/v1/health_pb"; +import { IPService as Apiv1IPService } from "./fits/api/v1/ip_pb"; +import { MethodService as Apiv1MethodService } from "./fits/api/v1/method_pb"; +import { ProjectService as Apiv1ProjectService } from "./fits/api/v1/project_pb"; +import { TenantService as Apiv1TenantService } from "./fits/api/v1/tenant_pb"; +import { TokenService as Apiv1TokenService } from "./fits/api/v1/token_pb"; +import { VersionService as Apiv1VersionService } from "./fits/api/v1/version_pb"; +export interface ClientConfig { + baseUrl: string; + token?: string; + interceptors?: Interceptor[]; +} +export interface Client { + apiv1(): Apiv1; +} +export interface Apiv1 { + health(): ConnectClient; + ip(): ConnectClient; + method(): ConnectClient; + project(): ConnectClient; + tenant(): ConnectClient; + token(): ConnectClient; + version(): ConnectClient; +} +export declare function newClient(config: ClientConfig): Client; diff --git a/js/client.js b/js/client.js new file mode 100644 index 0000000..ee27671 --- /dev/null +++ b/js/client.js @@ -0,0 +1,101 @@ +// Code generated by generate_clients.go. DO NOT EDIT. +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +import { createClient } from "@connectrpc/connect"; +import { createConnectTransport } from "@connectrpc/connect-web"; +import { HealthService as Apiv1HealthService } from "./fits/api/v1/health_pb"; +import { IPService as Apiv1IPService } from "./fits/api/v1/ip_pb"; +import { MethodService as Apiv1MethodService } from "./fits/api/v1/method_pb"; +import { ProjectService as Apiv1ProjectService } from "./fits/api/v1/project_pb"; +import { TenantService as Apiv1TenantService } from "./fits/api/v1/tenant_pb"; +import { TokenService as Apiv1TokenService } from "./fits/api/v1/token_pb"; +import { VersionService as Apiv1VersionService } from "./fits/api/v1/version_pb"; +function authInterceptor(token) { + return (next) => (req) => __awaiter(this, void 0, void 0, function* () { + req.header.set("Authorization", `Bearer ${token}`); + return yield next(req); + }); +} +function buildTransport(config) { + const interceptors = []; + if (config.token) { + interceptors.push(authInterceptor(config.token)); + } + if (config.interceptors) { + interceptors.push(...config.interceptors); + } + return createConnectTransport({ + baseUrl: config.baseUrl, + interceptors: interceptors.length > 0 ? interceptors : undefined, + defaultTimeoutMs: 30000, + }); +} +export function newClient(config) { + const transport = buildTransport(config); + return new ClientImpl(transport); +} +class ClientImpl { + constructor(transport) { + this.transport = transport; + } + apiv1() { + if (!this._apiv1) { + this._apiv1 = new Apiv1Impl(this.transport); + } + return this._apiv1; + } +} +class Apiv1Impl { + constructor(transport) { + this.transport = transport; + } + health() { + if (!this._health) { + this._health = createClient(Apiv1HealthService, this.transport); + } + return this._health; + } + ip() { + if (!this._ip) { + this._ip = createClient(Apiv1IPService, this.transport); + } + return this._ip; + } + method() { + if (!this._method) { + this._method = createClient(Apiv1MethodService, this.transport); + } + return this._method; + } + project() { + if (!this._project) { + this._project = createClient(Apiv1ProjectService, this.transport); + } + return this._project; + } + tenant() { + if (!this._tenant) { + this._tenant = createClient(Apiv1TenantService, this.transport); + } + return this._tenant; + } + token() { + if (!this._token) { + this._token = createClient(Apiv1TokenService, this.transport); + } + return this._token; + } + version() { + if (!this._version) { + this._version = createClient(Apiv1VersionService, this.transport); + } + return this._version; + } +} diff --git a/js/client.ts b/js/client.ts new file mode 100755 index 0000000..4113e7b --- /dev/null +++ b/js/client.ts @@ -0,0 +1,184 @@ +// Code generated by generate_clients.go. DO NOT EDIT. + +import { createClient, Interceptor, Transport } from "@connectrpc/connect"; +import type { Client as ConnectClient } from "@connectrpc/connect"; +import { createConnectTransport } from "@connectrpc/connect-web"; + + +import { HealthService as Apiv1HealthService } from "./fits/api/v1/health_pb"; + +import { IPService as Apiv1IPService } from "./fits/api/v1/ip_pb"; + +import { MethodService as Apiv1MethodService } from "./fits/api/v1/method_pb"; + +import { ProjectService as Apiv1ProjectService } from "./fits/api/v1/project_pb"; + +import { TenantService as Apiv1TenantService } from "./fits/api/v1/tenant_pb"; + +import { TokenService as Apiv1TokenService } from "./fits/api/v1/token_pb"; + +import { VersionService as Apiv1VersionService } from "./fits/api/v1/version_pb"; + + + +export interface ClientConfig { + baseUrl: string; + token?: string; + interceptors?: Interceptor[]; +} + +export interface Client { + + apiv1(): Apiv1; + +} + + +export interface Apiv1 { + + health(): ConnectClient; + + ip(): ConnectClient; + + method(): ConnectClient; + + project(): ConnectClient; + + tenant(): ConnectClient; + + token(): ConnectClient; + + version(): ConnectClient; + +} + + + +function authInterceptor(token: string): Interceptor { + return (next) => async (req) => { + req.header.set("Authorization", `Bearer ${token}`); + return await next(req); + }; +} + +function buildTransport(config: ClientConfig): Transport { + const interceptors: Interceptor[] = []; + + if (config.token) { + interceptors.push(authInterceptor(config.token)); + } + + if (config.interceptors) { + interceptors.push(...config.interceptors); + } + + return createConnectTransport({ + baseUrl: config.baseUrl, + interceptors: interceptors.length > 0 ? interceptors : undefined, + defaultTimeoutMs: 30_000, + }); +} + +export function newClient(config: ClientConfig): Client { + const transport = buildTransport(config); + return new ClientImpl(transport); +} + +class ClientImpl implements Client { + private transport: Transport; + + + private _apiv1?: Apiv1Impl; + + + constructor(transport: Transport) { + this.transport = transport; + } + + + apiv1(): Apiv1 { + if (!this._apiv1) { + this._apiv1 = new Apiv1Impl(this.transport); + } + return this._apiv1; + } + +} + + +class Apiv1Impl implements Apiv1 { + private transport: Transport; + + + private _health?: ConnectClient; + + private _ip?: ConnectClient; + + private _method?: ConnectClient; + + private _project?: ConnectClient; + + private _tenant?: ConnectClient; + + private _token?: ConnectClient; + + private _version?: ConnectClient; + + + constructor(transport: Transport) { + this.transport = transport; + } + + + health(): ConnectClient { + if (!this._health) { + this._health = createClient(Apiv1HealthService, this.transport); + } + return this._health; + } + + ip(): ConnectClient { + if (!this._ip) { + this._ip = createClient(Apiv1IPService, this.transport); + } + return this._ip; + } + + method(): ConnectClient { + if (!this._method) { + this._method = createClient(Apiv1MethodService, this.transport); + } + return this._method; + } + + project(): ConnectClient { + if (!this._project) { + this._project = createClient(Apiv1ProjectService, this.transport); + } + return this._project; + } + + tenant(): ConnectClient { + if (!this._tenant) { + this._tenant = createClient(Apiv1TenantService, this.transport); + } + return this._tenant; + } + + token(): ConnectClient { + if (!this._token) { + this._token = createClient(Apiv1TokenService, this.transport); + } + return this._token; + } + + version(): ConnectClient { + if (!this._version) { + this._version = createClient(Apiv1VersionService, this.transport); + } + return this._version; + } + +} + + diff --git a/package.json b/js/package.json similarity index 90% rename from package.json rename to js/package.json index 5f46bc9..f12575f 100644 --- a/package.json +++ b/js/package.json @@ -3,7 +3,7 @@ "description": "fi-ts api typescript client", "repository": "https://github.com/fi-ts/api.git", "scripts": { - "build": "tsc --project js/tsconfig.json", + "build": "tsc --project tsconfig.json", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "www.f-i-ts.de", @@ -20,4 +20,4 @@ "js/*" ], "version": "0.0.0" -} \ No newline at end of file +} diff --git a/js/test-interceptor.d.ts b/js/test-interceptor.d.ts new file mode 100644 index 0000000..bf9185e --- /dev/null +++ b/js/test-interceptor.d.ts @@ -0,0 +1,9 @@ +import type { Interceptor, UnaryResponse } from "@connectrpc/connect"; +import type { DescMessage, MessageShape } from "@bufbuild/protobuf"; +export type ClientCall = { + wantRequest: MessageShape; + wantRequestSchema: Req; + wantResponse?: () => UnaryResponse; + wantError?: Error; +}; +export declare function newTestInterceptor(calls: ClientCall[]): Interceptor; diff --git a/js/test-interceptor.js b/js/test-interceptor.js new file mode 100644 index 0000000..0dcfac4 --- /dev/null +++ b/js/test-interceptor.js @@ -0,0 +1,33 @@ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +import { equals } from "@bufbuild/protobuf"; +export function newTestInterceptor(calls) { + let count = 0; + return (next) => (req) => __awaiter(this, void 0, void 0, function* () { + var _a, _b; + var _c; + const reqAny = req; + const expected = calls[count]; + if (!expected) { + throw new Error(`received an unexpected client call of type ${(_c = (_b = (_a = reqAny.method) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.typeName) !== null && _c !== void 0 ? _c : "unknown"}`); + } + count++; + if (!equals(expected.wantRequestSchema, reqAny.message, expected.wantRequest)) { + throw new Error(`request mismatch for call #${count - 1}: got ${JSON.stringify(reqAny.message)}`); + } + if (expected.wantError) { + throw expected.wantError; + } + if (expected.wantResponse) { + return expected.wantResponse(); + } + throw new Error(`no wantResponse or wantError configured for call #${count - 1}`); + }); +} diff --git a/js/test-interceptor.ts b/js/test-interceptor.ts new file mode 100644 index 0000000..877ca0f --- /dev/null +++ b/js/test-interceptor.ts @@ -0,0 +1,49 @@ +import type { Interceptor, UnaryRequest, UnaryResponse } from "@connectrpc/connect"; +import { equals } from "@bufbuild/protobuf"; +import type { DescMessage, MessageShape } from "@bufbuild/protobuf"; + +export type ClientCall = { + wantRequest: MessageShape; + wantRequestSchema: Req; + wantResponse?: () => UnaryResponse; + wantError?: Error; +}; + +export function newTestInterceptor(calls: ClientCall[]): Interceptor { + let count = 0; + + return (next) => async (req) => { + const reqAny = req as UnaryRequest; + + const expected = calls[count]; + if (!expected) { + throw new Error( + `received an unexpected client call of type ${reqAny.method?.input?.typeName ?? "unknown"}`, + ); + } + + count++; + + if ( + !equals( + expected.wantRequestSchema, + reqAny.message, + expected.wantRequest as MessageShape, + ) + ) { + throw new Error( + `request mismatch for call #${count - 1}: got ${JSON.stringify(reqAny.message)}`, + ); + } + + if (expected.wantError) { + throw expected.wantError; + } + + if (expected.wantResponse) { + return expected.wantResponse(); + } + + throw new Error(`no wantResponse or wantError configured for call #${count - 1}`); + }; +} diff --git a/python/fits/client/client.py b/python/fits/client/client.py index ad466e6..2054258 100755 --- a/python/fits/client/client.py +++ b/python/fits/client/client.py @@ -12,9 +12,11 @@ + class Client: - def __init__(self, baseurl: str, timeout: float = 10): + def __init__(self, baseurl: str, timeout: float = 10, interceptors: list = []): self._baseurl = baseurl + self._interceptors = list(interceptors) transport = pyqwest.SyncHTTPTransport( http_version=pyqwest.HTTPVersion.HTTP2, @@ -25,35 +27,36 @@ def __init__(self, baseurl: str, timeout: float = 10): def apiv1(self): - return self._Apiv1(baseurl=self._baseurl, client=self._client) + return self._Apiv1(baseurl=self._baseurl, client=self._client, interceptors=self._interceptors) class _Apiv1: - def __init__(self, baseurl: str, client: pyqwest.SyncClient = None): + def __init__(self, baseurl: str, client: pyqwest.SyncClient = None, interceptors: list = []): self._baseurl = baseurl self._client = client + self._interceptors = list(interceptors) def health(self): - return api_health_connect.HealthServiceClientSync(address=self._baseurl, http_client=self._client) + return api_health_connect.HealthServiceClientSync(address=self._baseurl, http_client=self._client, interceptors=self._interceptors) def ip(self): - return api_ip_connect.IPServiceClientSync(address=self._baseurl, http_client=self._client) + return api_ip_connect.IPServiceClientSync(address=self._baseurl, http_client=self._client, interceptors=self._interceptors) def method(self): - return api_method_connect.MethodServiceClientSync(address=self._baseurl, http_client=self._client) + return api_method_connect.MethodServiceClientSync(address=self._baseurl, http_client=self._client, interceptors=self._interceptors) def project(self): - return api_project_connect.ProjectServiceClientSync(address=self._baseurl, http_client=self._client) + return api_project_connect.ProjectServiceClientSync(address=self._baseurl, http_client=self._client, interceptors=self._interceptors) def tenant(self): - return api_tenant_connect.TenantServiceClientSync(address=self._baseurl, http_client=self._client) + return api_tenant_connect.TenantServiceClientSync(address=self._baseurl, http_client=self._client, interceptors=self._interceptors) def token(self): - return api_token_connect.TokenServiceClientSync(address=self._baseurl, http_client=self._client) + return api_token_connect.TokenServiceClientSync(address=self._baseurl, http_client=self._client, interceptors=self._interceptors) def version(self): - return api_version_connect.VersionServiceClientSync(address=self._baseurl, http_client=self._client) + return api_version_connect.VersionServiceClientSync(address=self._baseurl, http_client=self._client, interceptors=self._interceptors) From 4aa9573d1f458315259c75f8cc54d206e5ce6cd4 Mon Sep 17 00:00:00 2001 From: Valentin Knabel Date: Thu, 3 Sep 2026 14:22:27 +0200 Subject: [PATCH 2/5] chore(ci): tests --- .github/workflows/main.yml | 121 +++-- .github/workflows/tests.yaml | 81 +++ go/fits/api/v1/common.pb.go | 2 +- go/fits/api/v1/health.pb.go | 2 +- go/fits/api/v1/ip.pb.go | 2 +- go/fits/api/v1/method.pb.go | 2 +- go/fits/api/v1/predefined_rules.pb.go | 2 +- go/fits/api/v1/project.pb.go | 2 +- go/fits/api/v1/tenant.pb.go | 2 +- go/fits/api/v1/token.pb.go | 2 +- go/fits/api/v1/version.pb.go | 2 +- js/buf/validate/validate_pb.ts | 2 +- js/bun.lock | 9 + js/fits/api/v1/common_pb.js | 2 +- js/fits/api/v1/common_pb.ts | 2 +- js/fits/api/v1/health_pb.js | 2 +- js/fits/api/v1/health_pb.ts | 2 +- js/fits/api/v1/ip_pb.js | 2 +- js/fits/api/v1/ip_pb.ts | 2 +- js/fits/api/v1/method_pb.js | 2 +- js/fits/api/v1/method_pb.ts | 2 +- js/fits/api/v1/predefined_rules_pb.js | 2 +- js/fits/api/v1/predefined_rules_pb.ts | 2 +- js/fits/api/v1/project_pb.js | 2 +- js/fits/api/v1/project_pb.ts | 2 +- js/fits/api/v1/tenant_pb.js | 2 +- js/fits/api/v1/tenant_pb.ts | 2 +- js/fits/api/v1/token_pb.js | 2 +- js/fits/api/v1/token_pb.ts | 2 +- js/fits/api/v1/version_pb.js | 2 +- js/fits/api/v1/version_pb.ts | 2 +- js/package.json | 1 + js/tsconfig.json | 78 +-- proto/buf.gen.yaml | 13 +- python/Makefile | 1 + python/buf/__init__.py | 0 python/buf/validate/__init__.py | 0 python/buf/validate/validate_pb2.py | 465 ++++++++++++++++++ python/fits/api/v1/common_pb2.py | 4 +- python/fits/api/v1/health_connect.py | 15 +- python/fits/api/v1/health_pb2.py | 4 +- python/fits/api/v1/ip_connect.py | 15 +- python/fits/api/v1/ip_pb2.py | 4 +- python/fits/api/v1/method_connect.py | 15 +- python/fits/api/v1/method_pb2.py | 4 +- python/fits/api/v1/predefined_rules_pb2.py | 4 +- python/fits/api/v1/project_connect.py | 15 +- python/fits/api/v1/project_pb2.py | 4 +- python/fits/api/v1/tenant_connect.py | 15 +- python/fits/api/v1/tenant_pb2.py | 4 +- python/fits/api/v1/token_connect.py | 15 +- python/fits/api/v1/token_pb2.py | 4 +- python/fits/api/v1/version_connect.py | 15 +- python/fits/api/v1/version_pb2.py | 4 +- python/fits/client/tests/__init__.py | 0 python/fits/client/tests/conftest.py | 172 +++++++ python/fits/client/tests/test_client.py | 122 +++++ python/fits/client/tests/test_interceptor.py | 173 +++++++ python/fits/client/tests/test_ping.py | 103 ++++ .../client/tests/test_token_persistent.py | 91 ++++ python/setup.py | 9 +- 61 files changed, 1471 insertions(+), 165 deletions(-) create mode 100644 .github/workflows/tests.yaml create mode 100644 python/buf/__init__.py create mode 100644 python/buf/validate/__init__.py create mode 100644 python/buf/validate/validate_pb2.py create mode 100644 python/fits/client/tests/__init__.py create mode 100644 python/fits/client/tests/conftest.py create mode 100644 python/fits/client/tests/test_client.py create mode 100644 python/fits/client/tests/test_interceptor.py create mode 100644 python/fits/client/tests/test_ping.py create mode 100644 python/fits/client/tests/test_token_persistent.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e48b3b9..ec45b0c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,39 +18,104 @@ jobs: name: Generate runs-on: ubuntu-latest steps: - - name: Check out code - uses: actions/checkout@v7 + - name: Check out code + uses: actions/checkout@v7 - - name: Set up Go - uses: actions/setup-go@v7 - with: - go-version-file: 'go.mod' - cache: false + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version-file: "go.mod" + cache: false - - name: Generate - run: make proto generate + - name: Generate + run: make proto generate - - name: Ensure Git is clean - run: | - git diff --exit-code --compact-summary + - name: Ensure Git is clean + run: | + git diff --exit-code --compact-summary + + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v7 + + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version: 24 + registry-url: https://registry.npmjs.org/ + + - name: Setup bun + uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + working-directory: js + run: bun install --frozen-lockfile + + - name: build + run: make build go: name: Go runs-on: ubuntu-latest steps: - - name: Check out code - uses: actions/checkout@v7 - - - name: Check spelling - uses: crate-ci/typos@master - - - name: Set up Go - uses: actions/setup-go@v7 - with: - go-version-file: 'go.mod' - cache: false - - - name: Lint - uses: golangci/golangci-lint-action@v9 - with: - args: -D protogetter --timeout=5m \ No newline at end of file + - name: Check out code + uses: actions/checkout@v7 + + - name: Check spelling + uses: crate-ci/typos@master + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version-file: "go.mod" + cache: false + + - name: Lint + uses: golangci/golangci-lint-action@v9 + with: + args: -D protogetter --timeout=5m + + python: + name: Python + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v7 + + - name: Set up Python 3.13 + uses: actions/setup-python@v6 + with: + python-version: "3.13" + + - name: Make tag + run: | + [ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "tag=v0.0.0.dev-${{ github.event.number }}" >> $GITHUB_ENV || true + [ "${GITHUB_EVENT_NAME}" == 'release' ] && echo "tag=${GITHUB_REF##*/}" >> $GITHUB_ENV || true + [ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "tag=v0.0.0-rc0" >> $GITHUB_ENV || true + + - name: Package + run: | + cd python + python -m pip install build + python -m build + env: + VERSION: ${{ env.tag }} + + - name: Publish to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.test_pypi_password }} + repository-url: https://test.pypi.org/legacy/ + skip-existing: true + packages-dir: python/dist + if: ${{ github.event_name != 'release' }} + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.pypi_password }} + packages-dir: python/dist + if: ${{ github.event_name == 'release' }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..b24d018 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,81 @@ +name: tests + +on: + pull_request: + branches: + - main + push: + branches: + - main + +permissions: + contents: read + +jobs: + go: + name: Go + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v7 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version-file: "go.mod" + cache: false + + - name: Run tests + run: make -C go test + + python: + name: Python (${{ matrix.python-version }}) + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + python-version: ["3.13", "3.14"] + + steps: + - name: Check out code + uses: actions/checkout@v7 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + + - name: Install with test dependencies + run: | + pip install -e python + pip install werkzeug pytest + env: + VERSION: v0.0.0 + + - name: Run Python client tests + run: | + python -m pytest python/fits/client/tests/ -v + + js: + name: JavaScript + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v7 + + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version: 24 + registry-url: https://registry.npmjs.org/ + + - name: Setup bun + uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + working-directory: js + run: bun install --frozen-lockfile + + - name: Run tests + run: make -C js test diff --git a/go/fits/api/v1/common.pb.go b/go/fits/api/v1/common.pb.go index ffc347b..f1bbfde 100644 --- a/go/fits/api/v1/common.pb.go +++ b/go/fits/api/v1/common.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: fits/api/v1/common.proto diff --git a/go/fits/api/v1/health.pb.go b/go/fits/api/v1/health.pb.go index 87a5ece..5aca16a 100644 --- a/go/fits/api/v1/health.pb.go +++ b/go/fits/api/v1/health.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: fits/api/v1/health.proto diff --git a/go/fits/api/v1/ip.pb.go b/go/fits/api/v1/ip.pb.go index 7d28619..0e4ff9e 100644 --- a/go/fits/api/v1/ip.pb.go +++ b/go/fits/api/v1/ip.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: fits/api/v1/ip.proto diff --git a/go/fits/api/v1/method.pb.go b/go/fits/api/v1/method.pb.go index fce8496..8738ef8 100644 --- a/go/fits/api/v1/method.pb.go +++ b/go/fits/api/v1/method.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: fits/api/v1/method.proto diff --git a/go/fits/api/v1/predefined_rules.pb.go b/go/fits/api/v1/predefined_rules.pb.go index 3c63cc1..534ebe2 100644 --- a/go/fits/api/v1/predefined_rules.pb.go +++ b/go/fits/api/v1/predefined_rules.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: fits/api/v1/predefined_rules.proto diff --git a/go/fits/api/v1/project.pb.go b/go/fits/api/v1/project.pb.go index 9cd1631..cf9d970 100644 --- a/go/fits/api/v1/project.pb.go +++ b/go/fits/api/v1/project.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: fits/api/v1/project.proto diff --git a/go/fits/api/v1/tenant.pb.go b/go/fits/api/v1/tenant.pb.go index ca6fc80..7280b07 100644 --- a/go/fits/api/v1/tenant.pb.go +++ b/go/fits/api/v1/tenant.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: fits/api/v1/tenant.proto diff --git a/go/fits/api/v1/token.pb.go b/go/fits/api/v1/token.pb.go index 7aa98f5..64e5f07 100644 --- a/go/fits/api/v1/token.pb.go +++ b/go/fits/api/v1/token.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: fits/api/v1/token.proto diff --git a/go/fits/api/v1/version.pb.go b/go/fits/api/v1/version.pb.go index c857651..673e159 100644 --- a/go/fits/api/v1/version.pb.go +++ b/go/fits/api/v1/version.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 +// protoc-gen-go v1.36.12 // protoc (unknown) // source: fits/api/v1/version.proto diff --git a/js/buf/validate/validate_pb.ts b/js/buf/validate/validate_pb.ts index 220e611..9b4fd51 100644 --- a/js/buf/validate/validate_pb.ts +++ b/js/buf/validate/validate_pb.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file buf/validate/validate.proto (package buf.validate, syntax proto2) /* eslint-disable */ diff --git a/js/bun.lock b/js/bun.lock index 00618e5..a12bfa4 100644 --- a/js/bun.lock +++ b/js/bun.lock @@ -9,6 +9,7 @@ "@connectrpc/connect-web": "^2.1.2", }, "devDependencies": { + "@types/bun": "^1.3.14", "typescript": "^7.0.2", }, }, @@ -20,6 +21,10 @@ "@connectrpc/connect-web": ["@connectrpc/connect-web@2.1.2", "", { "peerDependencies": { "@bufbuild/protobuf": "^2.7.0", "@connectrpc/connect": "2.1.2" } }, "sha512-1tfaK85MU+gJjwwmL31d2rzdf0XCYX99chZf63uG89SGBUd4XuZ4ZzhGo2u79TPXOE6nLIZQ2okrpyey42PYdg=="], + "@types/bun": ["@types/bun@1.4.0", "", { "dependencies": { "bun-types": "1.4.0" } }, "sha512-K+lZULY23vRgK/CfTjFIV+tyifaNdSMlPh9j+6mQ/cLfpOznLyAuzgV/JQysyECpkBQLVMSyvjlr2fBUSA9wFQ=="], + + "@types/node": ["@types/node@26.4.1", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-k97ENvZWtvA6yqz5/FS6a7duDgOPEeOQOc2iKS/nY6mX6qJUKtLnWzQS+Xj6tXweyj6ZcTAK2Qecetnvi9nCLA=="], + "@typescript/typescript-aix-ppc64": ["@typescript/typescript-aix-ppc64@7.0.2", "", { "os": "aix", "cpu": "ppc64" }, "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ=="], "@typescript/typescript-darwin-arm64": ["@typescript/typescript-darwin-arm64@7.0.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA=="], @@ -60,6 +65,10 @@ "@typescript/typescript-win32-x64": ["@typescript/typescript-win32-x64@7.0.2", "", { "os": "win32", "cpu": "x64" }, "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g=="], + "bun-types": ["bun-types@1.4.0", "", { "dependencies": { "@types/node": "*" } }, "sha512-iIKw23BspnQQYd3prITOBxeUsxBHnwzX6YJfGMuNOZzeNcMmVqzIIVGRm1l69ogaPQmb4wB6BN8mA5bE9YuC5Q=="], + "typescript": ["typescript@7.0.2", "", { "optionalDependencies": { "@typescript/typescript-aix-ppc64": "7.0.2", "@typescript/typescript-darwin-arm64": "7.0.2", "@typescript/typescript-darwin-x64": "7.0.2", "@typescript/typescript-freebsd-arm64": "7.0.2", "@typescript/typescript-freebsd-x64": "7.0.2", "@typescript/typescript-linux-arm": "7.0.2", "@typescript/typescript-linux-arm64": "7.0.2", "@typescript/typescript-linux-loong64": "7.0.2", "@typescript/typescript-linux-mips64el": "7.0.2", "@typescript/typescript-linux-ppc64": "7.0.2", "@typescript/typescript-linux-riscv64": "7.0.2", "@typescript/typescript-linux-s390x": "7.0.2", "@typescript/typescript-linux-x64": "7.0.2", "@typescript/typescript-netbsd-arm64": "7.0.2", "@typescript/typescript-netbsd-x64": "7.0.2", "@typescript/typescript-openbsd-arm64": "7.0.2", "@typescript/typescript-openbsd-x64": "7.0.2", "@typescript/typescript-sunos-x64": "7.0.2", "@typescript/typescript-win32-arm64": "7.0.2", "@typescript/typescript-win32-x64": "7.0.2" }, "bin": { "tsc": "bin/tsc" } }, "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA=="], + + "undici-types": ["undici-types@8.3.0", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="], } } diff --git a/js/fits/api/v1/common_pb.js b/js/fits/api/v1/common_pb.js index a7718cf..58e9345 100644 --- a/js/fits/api/v1/common_pb.js +++ b/js/fits/api/v1/common_pb.js @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/common.proto (package fits.api.v1, syntax proto3) /* eslint-disable */ import { enumDesc, extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; diff --git a/js/fits/api/v1/common_pb.ts b/js/fits/api/v1/common_pb.ts index 967f789..8b8ebbb 100644 --- a/js/fits/api/v1/common_pb.ts +++ b/js/fits/api/v1/common_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/common.proto (package fits.api.v1, syntax proto3) /* eslint-disable */ diff --git a/js/fits/api/v1/health_pb.js b/js/fits/api/v1/health_pb.js index 6798be4..3c0ce3a 100644 --- a/js/fits/api/v1/health_pb.js +++ b/js/fits/api/v1/health_pb.js @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/health.proto (package fits.api.v1, syntax proto3) /* eslint-disable */ import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; diff --git a/js/fits/api/v1/health_pb.ts b/js/fits/api/v1/health_pb.ts index a715c39..44b2765 100644 --- a/js/fits/api/v1/health_pb.ts +++ b/js/fits/api/v1/health_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/health.proto (package fits.api.v1, syntax proto3) /* eslint-disable */ diff --git a/js/fits/api/v1/ip_pb.js b/js/fits/api/v1/ip_pb.js index a15aa49..cb31c88 100644 --- a/js/fits/api/v1/ip_pb.js +++ b/js/fits/api/v1/ip_pb.js @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/ip.proto (package fits.api.v1, syntax proto3) /* eslint-disable */ import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; diff --git a/js/fits/api/v1/ip_pb.ts b/js/fits/api/v1/ip_pb.ts index 7ae562f..9d3537b 100644 --- a/js/fits/api/v1/ip_pb.ts +++ b/js/fits/api/v1/ip_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/ip.proto (package fits.api.v1, syntax proto3) /* eslint-disable */ diff --git a/js/fits/api/v1/method_pb.js b/js/fits/api/v1/method_pb.js index ac3db3f..1b6a16b 100644 --- a/js/fits/api/v1/method_pb.js +++ b/js/fits/api/v1/method_pb.js @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/method.proto (package fits.api.v1, syntax proto3) /* eslint-disable */ import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; diff --git a/js/fits/api/v1/method_pb.ts b/js/fits/api/v1/method_pb.ts index bc6bbd8..6d79ad6 100644 --- a/js/fits/api/v1/method_pb.ts +++ b/js/fits/api/v1/method_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/method.proto (package fits.api.v1, syntax proto3) /* eslint-disable */ diff --git a/js/fits/api/v1/predefined_rules_pb.js b/js/fits/api/v1/predefined_rules_pb.js index c8dc060..f2f2ee5 100644 --- a/js/fits/api/v1/predefined_rules_pb.js +++ b/js/fits/api/v1/predefined_rules_pb.js @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/predefined_rules.proto (package fits.api.v1, syntax proto2) /* eslint-disable */ import { extDesc, fileDesc } from "@bufbuild/protobuf/codegenv2"; diff --git a/js/fits/api/v1/predefined_rules_pb.ts b/js/fits/api/v1/predefined_rules_pb.ts index 559de67..695cce4 100644 --- a/js/fits/api/v1/predefined_rules_pb.ts +++ b/js/fits/api/v1/predefined_rules_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/predefined_rules.proto (package fits.api.v1, syntax proto2) /* eslint-disable */ diff --git a/js/fits/api/v1/project_pb.js b/js/fits/api/v1/project_pb.js index 0f0842b..d24ede8 100644 --- a/js/fits/api/v1/project_pb.js +++ b/js/fits/api/v1/project_pb.js @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/project.proto (package fits.api.v1, syntax proto3) /* eslint-disable */ import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; diff --git a/js/fits/api/v1/project_pb.ts b/js/fits/api/v1/project_pb.ts index c3e5a6f..9af8676 100644 --- a/js/fits/api/v1/project_pb.ts +++ b/js/fits/api/v1/project_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/project.proto (package fits.api.v1, syntax proto3) /* eslint-disable */ diff --git a/js/fits/api/v1/tenant_pb.js b/js/fits/api/v1/tenant_pb.js index dba3f3d..998821d 100644 --- a/js/fits/api/v1/tenant_pb.js +++ b/js/fits/api/v1/tenant_pb.js @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/tenant.proto (package fits.api.v1, syntax proto3) /* eslint-disable */ import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; diff --git a/js/fits/api/v1/tenant_pb.ts b/js/fits/api/v1/tenant_pb.ts index 0fcd574..74c95af 100644 --- a/js/fits/api/v1/tenant_pb.ts +++ b/js/fits/api/v1/tenant_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/tenant.proto (package fits.api.v1, syntax proto3) /* eslint-disable */ diff --git a/js/fits/api/v1/token_pb.js b/js/fits/api/v1/token_pb.js index c6744b4..a2bcf16 100644 --- a/js/fits/api/v1/token_pb.js +++ b/js/fits/api/v1/token_pb.js @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/token.proto (package fits.api.v1, syntax proto3) /* eslint-disable */ import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; diff --git a/js/fits/api/v1/token_pb.ts b/js/fits/api/v1/token_pb.ts index 7f7da1f..db1b664 100644 --- a/js/fits/api/v1/token_pb.ts +++ b/js/fits/api/v1/token_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/token.proto (package fits.api.v1, syntax proto3) /* eslint-disable */ diff --git a/js/fits/api/v1/version_pb.js b/js/fits/api/v1/version_pb.js index 970ea1c..7bf9cdf 100644 --- a/js/fits/api/v1/version_pb.js +++ b/js/fits/api/v1/version_pb.js @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/version.proto (package fits.api.v1, syntax proto3) /* eslint-disable */ import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; diff --git a/js/fits/api/v1/version_pb.ts b/js/fits/api/v1/version_pb.ts index b1c4a9f..eb459b8 100644 --- a/js/fits/api/v1/version_pb.ts +++ b/js/fits/api/v1/version_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v2.12.0 with parameter "target=ts" +// @generated by protoc-gen-es v2.14.1 with parameter "target=ts" // @generated from file fits/api/v1/version.proto (package fits.api.v1, syntax proto3) /* eslint-disable */ diff --git a/js/package.json b/js/package.json index f12575f..458e462 100644 --- a/js/package.json +++ b/js/package.json @@ -14,6 +14,7 @@ "@connectrpc/connect-web": "^2.1.2" }, "devDependencies": { + "@types/bun": "^1.3.14", "typescript": "^7.0.2" }, "files": [ diff --git a/js/tsconfig.json b/js/tsconfig.json index 4262062..2c51460 100644 --- a/js/tsconfig.json +++ b/js/tsconfig.json @@ -1,70 +1,14 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ - - /* Basic Options */ - // "incremental": true, /* Enable incremental compilation */ - "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ - "module": "esnext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ - // "lib": [], /* Specify library files to be included in the compilation. */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "./", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "composite": true, /* Enable project compilation */ - // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - - /* Strict Type-Checking Options */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ - - /* Module Resolution Options */ - "moduleResolution": "bundler", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - - /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - - /* Advanced Options */ - "skipLibCheck": true, /* Skip type checking of declaration files. */ - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ + "target": "es6", + "module": "esnext", + "declaration": true, + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "types": [ + "bun" + ] } -} \ No newline at end of file +} diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml index 6b863e2..cc8ca8f 100644 --- a/proto/buf.gen.yaml +++ b/proto/buf.gen.yaml @@ -13,21 +13,22 @@ managed: value: github.com/fi-ts/api/go plugins: # go - - remote: buf.build/protocolbuffers/go:v1.36.11 + - remote: buf.build/protocolbuffers/go:v1.36.12 out: ../go opt: paths=source_relative - - remote: buf.build/connectrpc/go:v1.19.2 + - remote: buf.build/connectrpc/go:v1.20.0 out: ../go opt: paths=source_relative,simple # python - - remote: buf.build/protocolbuffers/python:v34.1 + - remote: buf.build/protocolbuffers/python:v36.1 out: ../python - - remote: buf.build/protocolbuffers/pyi:v34.1 + include_imports: True + - remote: buf.build/protocolbuffers/pyi:v36.1 out: ../python - - remote: buf.build/connectrpc/python:v0.8.1 + - remote: buf.build/connectrpc/python:v0.10.1 out: ../python # js - - remote: buf.build/bufbuild/es:v2.12.0 + - remote: buf.build/bufbuild/es:v2.14.1 include_imports: true out: ../js opt: target=ts diff --git a/python/Makefile b/python/Makefile index 9e1817e..c706d1b 100644 --- a/python/Makefile +++ b/python/Makefile @@ -5,3 +5,4 @@ clean: .PHONY: generate generate: @find fits -type d -exec touch {}/__init__.py \; + @find buf -type d -exec touch {}/__init__.py \; diff --git a/python/buf/__init__.py b/python/buf/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/python/buf/validate/__init__.py b/python/buf/validate/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/python/buf/validate/validate_pb2.py b/python/buf/validate/validate_pb2.py new file mode 100644 index 0000000..57ca261 --- /dev/null +++ b/python/buf/validate/validate_pb2.py @@ -0,0 +1,465 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: buf/validate/validate.proto +# Protobuf Python Version: 7.36.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 7, + 36, + 1, + '', + 'buf/validate/validate.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 +from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x62uf/validate/validate.proto\x12\x0c\x62uf.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\x07message\x18\x02 \x01(\tR\x07message\x12\x1e\n\nexpression\x18\x03 \x01(\tR\nexpression\"\xa1\x01\n\x0cMessageRules\x12%\n\x0e\x63\x65l_expression\x18\x05 \x03(\tR\rcelExpression\x12$\n\x03\x63\x65l\x18\x03 \x03(\x0b\x32\x12.buf.validate.RuleR\x03\x63\x65l\x12\x34\n\x05oneof\x18\x04 \x03(\x0b\x32\x1e.buf.validate.MessageOneofRuleR\x05oneofJ\x04\x08\x01\x10\x02R\x08\x64isabled\"F\n\x10MessageOneofRule\x12\x16\n\x06\x66ields\x18\x01 \x03(\tR\x06\x66ields\x12\x1a\n\x08required\x18\x02 \x01(\x08R\x08required\"(\n\nOneofRules\x12\x1a\n\x08required\x18\x01 \x01(\x08R\x08required\"\xe3\n\n\nFieldRules\x12%\n\x0e\x63\x65l_expression\x18\x1d \x03(\tR\rcelExpression\x12$\n\x03\x63\x65l\x18\x17 \x03(\x0b\x32\x12.buf.validate.RuleR\x03\x63\x65l\x12\x1a\n\x08required\x18\x19 \x01(\x08R\x08required\x12,\n\x06ignore\x18\x1b \x01(\x0e\x32\x14.buf.validate.IgnoreR\x06ignore\x12\x30\n\x05\x66loat\x18\x01 \x01(\x0b\x32\x18.buf.validate.FloatRulesH\x00R\x05\x66loat\x12\x33\n\x06\x64ouble\x18\x02 \x01(\x0b\x32\x19.buf.validate.DoubleRulesH\x00R\x06\x64ouble\x12\x30\n\x05int32\x18\x03 \x01(\x0b\x32\x18.buf.validate.Int32RulesH\x00R\x05int32\x12\x30\n\x05int64\x18\x04 \x01(\x0b\x32\x18.buf.validate.Int64RulesH\x00R\x05int64\x12\x33\n\x06uint32\x18\x05 \x01(\x0b\x32\x19.buf.validate.UInt32RulesH\x00R\x06uint32\x12\x33\n\x06uint64\x18\x06 \x01(\x0b\x32\x19.buf.validate.UInt64RulesH\x00R\x06uint64\x12\x33\n\x06sint32\x18\x07 \x01(\x0b\x32\x19.buf.validate.SInt32RulesH\x00R\x06sint32\x12\x33\n\x06sint64\x18\x08 \x01(\x0b\x32\x19.buf.validate.SInt64RulesH\x00R\x06sint64\x12\x36\n\x07\x66ixed32\x18\t \x01(\x0b\x32\x1a.buf.validate.Fixed32RulesH\x00R\x07\x66ixed32\x12\x36\n\x07\x66ixed64\x18\n \x01(\x0b\x32\x1a.buf.validate.Fixed64RulesH\x00R\x07\x66ixed64\x12\x39\n\x08sfixed32\x18\x0b \x01(\x0b\x32\x1b.buf.validate.SFixed32RulesH\x00R\x08sfixed32\x12\x39\n\x08sfixed64\x18\x0c \x01(\x0b\x32\x1b.buf.validate.SFixed64RulesH\x00R\x08sfixed64\x12-\n\x04\x62ool\x18\r \x01(\x0b\x32\x17.buf.validate.BoolRulesH\x00R\x04\x62ool\x12\x33\n\x06string\x18\x0e \x01(\x0b\x32\x19.buf.validate.StringRulesH\x00R\x06string\x12\x30\n\x05\x62ytes\x18\x0f \x01(\x0b\x32\x18.buf.validate.BytesRulesH\x00R\x05\x62ytes\x12-\n\x04\x65num\x18\x10 \x01(\x0b\x32\x17.buf.validate.EnumRulesH\x00R\x04\x65num\x12\x39\n\x08repeated\x18\x12 \x01(\x0b\x32\x1b.buf.validate.RepeatedRulesH\x00R\x08repeated\x12*\n\x03map\x18\x13 \x01(\x0b\x32\x16.buf.validate.MapRulesH\x00R\x03map\x12*\n\x03\x61ny\x18\x14 \x01(\x0b\x32\x16.buf.validate.AnyRulesH\x00R\x03\x61ny\x12\x39\n\x08\x64uration\x18\x15 \x01(\x0b\x32\x1b.buf.validate.DurationRulesH\x00R\x08\x64uration\x12=\n\nfield_mask\x18\x1c \x01(\x0b\x32\x1c.buf.validate.FieldMaskRulesH\x00R\tfieldMask\x12<\n\ttimestamp\x18\x16 \x01(\x0b\x32\x1c.buf.validate.TimestampRulesH\x00R\ttimestampB\x06\n\x04typeJ\x04\x08\x18\x10\x19J\x04\x08\x1a\x10\x1bR\x07skippedR\x0cignore_empty\"Z\n\x0fPredefinedRules\x12$\n\x03\x63\x65l\x18\x01 \x03(\x0b\x32\x12.buf.validate.RuleR\x03\x63\x65lJ\x04\x08\x18\x10\x19J\x04\x08\x1a\x10\x1bR\x07skippedR\x0cignore_empty\"\x90\x18\n\nFloatRules\x12\x8a\x01\n\x05\x63onst\x18\x01 \x01(\x02\x42t\xc2Hq\no\n\x0b\x66loat.const\x1a`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\xa3\x01\n\x02lt\x18\x02 \x01(\x02\x42\x90\x01\xc2H\x8c\x01\n\x89\x01\n\x08\x66loat.lt\x1a}!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)? \'value must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xb4\x01\n\x03lte\x18\x03 \x01(\x02\x42\x9f\x01\xc2H\x9b\x01\n\x98\x01\n\tfloat.lte\x1a\x8a\x01!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\xf3\x07\n\x02gt\x18\x04 \x01(\x02\x42\xe0\x07\xc2H\xdc\x07\n\x8d\x01\n\x08\x66loat.gt\x1a\x80\x01!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\xc3\x01\n\x0b\x66loat.gt_lt\x1a\xb3\x01has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xcd\x01\n\x15\x66loat.gt_lt_exclusive\x1a\xb3\x01has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xd3\x01\n\x0c\x66loat.gt_lte\x1a\xc2\x01has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xdd\x01\n\x16\x66loat.gt_lte_exclusive\x1a\xc2\x01has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xbf\x08\n\x03gte\x18\x05 \x01(\x02\x42\xaa\x08\xc2H\xa6\x08\n\x9b\x01\n\tfloat.gte\x1a\x8d\x01!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xd2\x01\n\x0c\x66loat.gte_lt\x1a\xc1\x01has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xdc\x01\n\x16\x66loat.gte_lt_exclusive\x1a\xc1\x01has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xe2\x01\n\rfloat.gte_lte\x1a\xd0\x01has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xec\x01\n\x17\x66loat.gte_lte_exclusive\x1a\xd0\x01has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x83\x01\n\x02in\x18\x06 \x03(\x02\x42s\xc2Hp\nn\n\x08\x66loat.in\x1a\x62!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12}\n\x06not_in\x18\x07 \x03(\x02\x42\x66\xc2Hc\na\n\x0c\x66loat.not_in\x1aQthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12}\n\x06\x66inite\x18\x08 \x01(\x08\x42\x65\xc2Hb\n`\n\x0c\x66loat.finite\x1aPrules.finite ? (this.isNan() || this.isInf() ? \'value must be finite\' : \'\') : \'\'R\x06\x66inite\x12\x34\n\x07\x65xample\x18\t \x03(\x02\x42\x1a\xc2H\x17\n\x15\n\rfloat.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xa2\x18\n\x0b\x44oubleRules\x12\x8b\x01\n\x05\x63onst\x18\x01 \x01(\x01\x42u\xc2Hr\np\n\x0c\x64ouble.const\x1a`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\xa4\x01\n\x02lt\x18\x02 \x01(\x01\x42\x91\x01\xc2H\x8d\x01\n\x8a\x01\n\tdouble.lt\x1a}!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)? \'value must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xb5\x01\n\x03lte\x18\x03 \x01(\x01\x42\xa0\x01\xc2H\x9c\x01\n\x99\x01\n\ndouble.lte\x1a\x8a\x01!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\xf8\x07\n\x02gt\x18\x04 \x01(\x01\x42\xe5\x07\xc2H\xe1\x07\n\x8e\x01\n\tdouble.gt\x1a\x80\x01!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\xc4\x01\n\x0c\x64ouble.gt_lt\x1a\xb3\x01has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xce\x01\n\x16\x64ouble.gt_lt_exclusive\x1a\xb3\x01has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xd4\x01\n\rdouble.gt_lte\x1a\xc2\x01has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xde\x01\n\x17\x64ouble.gt_lte_exclusive\x1a\xc2\x01has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xc4\x08\n\x03gte\x18\x05 \x01(\x01\x42\xaf\x08\xc2H\xab\x08\n\x9c\x01\n\ndouble.gte\x1a\x8d\x01!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xd3\x01\n\rdouble.gte_lt\x1a\xc1\x01has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xdd\x01\n\x17\x64ouble.gte_lt_exclusive\x1a\xc1\x01has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xe3\x01\n\x0e\x64ouble.gte_lte\x1a\xd0\x01has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xed\x01\n\x18\x64ouble.gte_lte_exclusive\x1a\xd0\x01has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x84\x01\n\x02in\x18\x06 \x03(\x01\x42t\xc2Hq\no\n\tdouble.in\x1a\x62!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12~\n\x06not_in\x18\x07 \x03(\x01\x42g\xc2Hd\nb\n\rdouble.not_in\x1aQthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12~\n\x06\x66inite\x18\x08 \x01(\x08\x42\x66\xc2Hc\na\n\rdouble.finite\x1aPrules.finite ? (this.isNan() || this.isInf() ? \'value must be finite\' : \'\') : \'\'R\x06\x66inite\x12\x35\n\x07\x65xample\x18\t \x03(\x01\x42\x1b\xc2H\x18\n\x16\n\x0e\x64ouble.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xba\x15\n\nInt32Rules\x12\x8a\x01\n\x05\x63onst\x18\x01 \x01(\x05\x42t\xc2Hq\no\n\x0bint32.const\x1a`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x8e\x01\n\x02lt\x18\x02 \x01(\x05\x42|\xc2Hy\nw\n\x08int32.lt\x1ak!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xa1\x01\n\x03lte\x18\x03 \x01(\x05\x42\x8c\x01\xc2H\x88\x01\n\x85\x01\n\tint32.lte\x1ax!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\x9b\x07\n\x02gt\x18\x04 \x01(\x05\x42\x88\x07\xc2H\x84\x07\nz\n\x08int32.gt\x1an!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\xb3\x01\n\x0bint32.gt_lt\x1a\xa3\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbb\x01\n\x15int32.gt_lt_exclusive\x1a\xa1\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc3\x01\n\x0cint32.gt_lte\x1a\xb2\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xcb\x01\n\x16int32.gt_lte_exclusive\x1a\xb0\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xe8\x07\n\x03gte\x18\x05 \x01(\x05\x42\xd3\x07\xc2H\xcf\x07\n\x88\x01\n\tint32.gte\x1a{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xc2\x01\n\x0cint32.gte_lt\x1a\xb1\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xca\x01\n\x16int32.gte_lt_exclusive\x1a\xaf\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd2\x01\n\rint32.gte_lte\x1a\xc0\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xda\x01\n\x17int32.gte_lte_exclusive\x1a\xbe\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x83\x01\n\x02in\x18\x06 \x03(\x05\x42s\xc2Hp\nn\n\x08int32.in\x1a\x62!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12}\n\x06not_in\x18\x07 \x03(\x05\x42\x66\xc2Hc\na\n\x0cint32.not_in\x1aQthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x34\n\x07\x65xample\x18\x08 \x03(\x05\x42\x1a\xc2H\x17\n\x15\n\rint32.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xba\x15\n\nInt64Rules\x12\x8a\x01\n\x05\x63onst\x18\x01 \x01(\x03\x42t\xc2Hq\no\n\x0bint64.const\x1a`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x8e\x01\n\x02lt\x18\x02 \x01(\x03\x42|\xc2Hy\nw\n\x08int64.lt\x1ak!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xa1\x01\n\x03lte\x18\x03 \x01(\x03\x42\x8c\x01\xc2H\x88\x01\n\x85\x01\n\tint64.lte\x1ax!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\x9b\x07\n\x02gt\x18\x04 \x01(\x03\x42\x88\x07\xc2H\x84\x07\nz\n\x08int64.gt\x1an!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\xb3\x01\n\x0bint64.gt_lt\x1a\xa3\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbb\x01\n\x15int64.gt_lt_exclusive\x1a\xa1\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc3\x01\n\x0cint64.gt_lte\x1a\xb2\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xcb\x01\n\x16int64.gt_lte_exclusive\x1a\xb0\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xe8\x07\n\x03gte\x18\x05 \x01(\x03\x42\xd3\x07\xc2H\xcf\x07\n\x88\x01\n\tint64.gte\x1a{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xc2\x01\n\x0cint64.gte_lt\x1a\xb1\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xca\x01\n\x16int64.gte_lt_exclusive\x1a\xaf\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd2\x01\n\rint64.gte_lte\x1a\xc0\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xda\x01\n\x17int64.gte_lte_exclusive\x1a\xbe\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x83\x01\n\x02in\x18\x06 \x03(\x03\x42s\xc2Hp\nn\n\x08int64.in\x1a\x62!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12}\n\x06not_in\x18\x07 \x03(\x03\x42\x66\xc2Hc\na\n\x0cint64.not_in\x1aQthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x34\n\x07\x65xample\x18\t \x03(\x03\x42\x1a\xc2H\x17\n\x15\n\rint64.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xcb\x15\n\x0bUInt32Rules\x12\x8b\x01\n\x05\x63onst\x18\x01 \x01(\rBu\xc2Hr\np\n\x0cuint32.const\x1a`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x8f\x01\n\x02lt\x18\x02 \x01(\rB}\xc2Hz\nx\n\tuint32.lt\x1ak!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xa2\x01\n\x03lte\x18\x03 \x01(\rB\x8d\x01\xc2H\x89\x01\n\x86\x01\n\nuint32.lte\x1ax!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\xa0\x07\n\x02gt\x18\x04 \x01(\rB\x8d\x07\xc2H\x89\x07\n{\n\tuint32.gt\x1an!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\xb4\x01\n\x0cuint32.gt_lt\x1a\xa3\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbc\x01\n\x16uint32.gt_lt_exclusive\x1a\xa1\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc4\x01\n\ruint32.gt_lte\x1a\xb2\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xcc\x01\n\x17uint32.gt_lte_exclusive\x1a\xb0\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xed\x07\n\x03gte\x18\x05 \x01(\rB\xd8\x07\xc2H\xd4\x07\n\x89\x01\n\nuint32.gte\x1a{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xc3\x01\n\ruint32.gte_lt\x1a\xb1\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcb\x01\n\x17uint32.gte_lt_exclusive\x1a\xaf\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd3\x01\n\x0euint32.gte_lte\x1a\xc0\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xdb\x01\n\x18uint32.gte_lte_exclusive\x1a\xbe\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x84\x01\n\x02in\x18\x06 \x03(\rBt\xc2Hq\no\n\tuint32.in\x1a\x62!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12~\n\x06not_in\x18\x07 \x03(\rBg\xc2Hd\nb\n\ruint32.not_in\x1aQthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x35\n\x07\x65xample\x18\x08 \x03(\rB\x1b\xc2H\x18\n\x16\n\x0euint32.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xcb\x15\n\x0bUInt64Rules\x12\x8b\x01\n\x05\x63onst\x18\x01 \x01(\x04\x42u\xc2Hr\np\n\x0cuint64.const\x1a`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x8f\x01\n\x02lt\x18\x02 \x01(\x04\x42}\xc2Hz\nx\n\tuint64.lt\x1ak!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xa2\x01\n\x03lte\x18\x03 \x01(\x04\x42\x8d\x01\xc2H\x89\x01\n\x86\x01\n\nuint64.lte\x1ax!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\xa0\x07\n\x02gt\x18\x04 \x01(\x04\x42\x8d\x07\xc2H\x89\x07\n{\n\tuint64.gt\x1an!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\xb4\x01\n\x0cuint64.gt_lt\x1a\xa3\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbc\x01\n\x16uint64.gt_lt_exclusive\x1a\xa1\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc4\x01\n\ruint64.gt_lte\x1a\xb2\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xcc\x01\n\x17uint64.gt_lte_exclusive\x1a\xb0\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xed\x07\n\x03gte\x18\x05 \x01(\x04\x42\xd8\x07\xc2H\xd4\x07\n\x89\x01\n\nuint64.gte\x1a{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xc3\x01\n\ruint64.gte_lt\x1a\xb1\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcb\x01\n\x17uint64.gte_lt_exclusive\x1a\xaf\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd3\x01\n\x0euint64.gte_lte\x1a\xc0\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xdb\x01\n\x18uint64.gte_lte_exclusive\x1a\xbe\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x84\x01\n\x02in\x18\x06 \x03(\x04\x42t\xc2Hq\no\n\tuint64.in\x1a\x62!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12~\n\x06not_in\x18\x07 \x03(\x04\x42g\xc2Hd\nb\n\ruint64.not_in\x1aQthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x35\n\x07\x65xample\x18\x08 \x03(\x04\x42\x1b\xc2H\x18\n\x16\n\x0euint64.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xcb\x15\n\x0bSInt32Rules\x12\x8b\x01\n\x05\x63onst\x18\x01 \x01(\x11\x42u\xc2Hr\np\n\x0csint32.const\x1a`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x8f\x01\n\x02lt\x18\x02 \x01(\x11\x42}\xc2Hz\nx\n\tsint32.lt\x1ak!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xa2\x01\n\x03lte\x18\x03 \x01(\x11\x42\x8d\x01\xc2H\x89\x01\n\x86\x01\n\nsint32.lte\x1ax!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\xa0\x07\n\x02gt\x18\x04 \x01(\x11\x42\x8d\x07\xc2H\x89\x07\n{\n\tsint32.gt\x1an!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\xb4\x01\n\x0csint32.gt_lt\x1a\xa3\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbc\x01\n\x16sint32.gt_lt_exclusive\x1a\xa1\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc4\x01\n\rsint32.gt_lte\x1a\xb2\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xcc\x01\n\x17sint32.gt_lte_exclusive\x1a\xb0\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xed\x07\n\x03gte\x18\x05 \x01(\x11\x42\xd8\x07\xc2H\xd4\x07\n\x89\x01\n\nsint32.gte\x1a{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xc3\x01\n\rsint32.gte_lt\x1a\xb1\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcb\x01\n\x17sint32.gte_lt_exclusive\x1a\xaf\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd3\x01\n\x0esint32.gte_lte\x1a\xc0\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xdb\x01\n\x18sint32.gte_lte_exclusive\x1a\xbe\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x84\x01\n\x02in\x18\x06 \x03(\x11\x42t\xc2Hq\no\n\tsint32.in\x1a\x62!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12~\n\x06not_in\x18\x07 \x03(\x11\x42g\xc2Hd\nb\n\rsint32.not_in\x1aQthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x35\n\x07\x65xample\x18\x08 \x03(\x11\x42\x1b\xc2H\x18\n\x16\n\x0esint32.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xcb\x15\n\x0bSInt64Rules\x12\x8b\x01\n\x05\x63onst\x18\x01 \x01(\x12\x42u\xc2Hr\np\n\x0csint64.const\x1a`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x8f\x01\n\x02lt\x18\x02 \x01(\x12\x42}\xc2Hz\nx\n\tsint64.lt\x1ak!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xa2\x01\n\x03lte\x18\x03 \x01(\x12\x42\x8d\x01\xc2H\x89\x01\n\x86\x01\n\nsint64.lte\x1ax!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\xa0\x07\n\x02gt\x18\x04 \x01(\x12\x42\x8d\x07\xc2H\x89\x07\n{\n\tsint64.gt\x1an!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\xb4\x01\n\x0csint64.gt_lt\x1a\xa3\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbc\x01\n\x16sint64.gt_lt_exclusive\x1a\xa1\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc4\x01\n\rsint64.gt_lte\x1a\xb2\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xcc\x01\n\x17sint64.gt_lte_exclusive\x1a\xb0\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xed\x07\n\x03gte\x18\x05 \x01(\x12\x42\xd8\x07\xc2H\xd4\x07\n\x89\x01\n\nsint64.gte\x1a{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xc3\x01\n\rsint64.gte_lt\x1a\xb1\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcb\x01\n\x17sint64.gte_lt_exclusive\x1a\xaf\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd3\x01\n\x0esint64.gte_lte\x1a\xc0\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xdb\x01\n\x18sint64.gte_lte_exclusive\x1a\xbe\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x84\x01\n\x02in\x18\x06 \x03(\x12\x42t\xc2Hq\no\n\tsint64.in\x1a\x62!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12~\n\x06not_in\x18\x07 \x03(\x12\x42g\xc2Hd\nb\n\rsint64.not_in\x1aQthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x35\n\x07\x65xample\x18\x08 \x03(\x12\x42\x1b\xc2H\x18\n\x16\n\x0esint64.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xdc\x15\n\x0c\x46ixed32Rules\x12\x8c\x01\n\x05\x63onst\x18\x01 \x01(\x07\x42v\xc2Hs\nq\n\rfixed32.const\x1a`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x90\x01\n\x02lt\x18\x02 \x01(\x07\x42~\xc2H{\ny\n\nfixed32.lt\x1ak!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xa3\x01\n\x03lte\x18\x03 \x01(\x07\x42\x8e\x01\xc2H\x8a\x01\n\x87\x01\n\x0b\x66ixed32.lte\x1ax!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\xa5\x07\n\x02gt\x18\x04 \x01(\x07\x42\x92\x07\xc2H\x8e\x07\n|\n\nfixed32.gt\x1an!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\xb5\x01\n\rfixed32.gt_lt\x1a\xa3\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbd\x01\n\x17\x66ixed32.gt_lt_exclusive\x1a\xa1\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc5\x01\n\x0e\x66ixed32.gt_lte\x1a\xb2\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xcd\x01\n\x18\x66ixed32.gt_lte_exclusive\x1a\xb0\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xf2\x07\n\x03gte\x18\x05 \x01(\x07\x42\xdd\x07\xc2H\xd9\x07\n\x8a\x01\n\x0b\x66ixed32.gte\x1a{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xc4\x01\n\x0e\x66ixed32.gte_lt\x1a\xb1\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcc\x01\n\x18\x66ixed32.gte_lt_exclusive\x1a\xaf\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd4\x01\n\x0f\x66ixed32.gte_lte\x1a\xc0\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xdc\x01\n\x19\x66ixed32.gte_lte_exclusive\x1a\xbe\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x85\x01\n\x02in\x18\x06 \x03(\x07\x42u\xc2Hr\np\n\nfixed32.in\x1a\x62!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12\x7f\n\x06not_in\x18\x07 \x03(\x07\x42h\xc2He\nc\n\x0e\x66ixed32.not_in\x1aQthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x36\n\x07\x65xample\x18\x08 \x03(\x07\x42\x1c\xc2H\x19\n\x17\n\x0f\x66ixed32.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xdc\x15\n\x0c\x46ixed64Rules\x12\x8c\x01\n\x05\x63onst\x18\x01 \x01(\x06\x42v\xc2Hs\nq\n\rfixed64.const\x1a`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x90\x01\n\x02lt\x18\x02 \x01(\x06\x42~\xc2H{\ny\n\nfixed64.lt\x1ak!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xa3\x01\n\x03lte\x18\x03 \x01(\x06\x42\x8e\x01\xc2H\x8a\x01\n\x87\x01\n\x0b\x66ixed64.lte\x1ax!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\xa5\x07\n\x02gt\x18\x04 \x01(\x06\x42\x92\x07\xc2H\x8e\x07\n|\n\nfixed64.gt\x1an!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\xb5\x01\n\rfixed64.gt_lt\x1a\xa3\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbd\x01\n\x17\x66ixed64.gt_lt_exclusive\x1a\xa1\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc5\x01\n\x0e\x66ixed64.gt_lte\x1a\xb2\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xcd\x01\n\x18\x66ixed64.gt_lte_exclusive\x1a\xb0\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xf2\x07\n\x03gte\x18\x05 \x01(\x06\x42\xdd\x07\xc2H\xd9\x07\n\x8a\x01\n\x0b\x66ixed64.gte\x1a{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xc4\x01\n\x0e\x66ixed64.gte_lt\x1a\xb1\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcc\x01\n\x18\x66ixed64.gte_lt_exclusive\x1a\xaf\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd4\x01\n\x0f\x66ixed64.gte_lte\x1a\xc0\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xdc\x01\n\x19\x66ixed64.gte_lte_exclusive\x1a\xbe\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x85\x01\n\x02in\x18\x06 \x03(\x06\x42u\xc2Hr\np\n\nfixed64.in\x1a\x62!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12\x7f\n\x06not_in\x18\x07 \x03(\x06\x42h\xc2He\nc\n\x0e\x66ixed64.not_in\x1aQthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x36\n\x07\x65xample\x18\x08 \x03(\x06\x42\x1c\xc2H\x19\n\x17\n\x0f\x66ixed64.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xee\x15\n\rSFixed32Rules\x12\x8d\x01\n\x05\x63onst\x18\x01 \x01(\x0f\x42w\xc2Ht\nr\n\x0esfixed32.const\x1a`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x91\x01\n\x02lt\x18\x02 \x01(\x0f\x42\x7f\xc2H|\nz\n\x0bsfixed32.lt\x1ak!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xa4\x01\n\x03lte\x18\x03 \x01(\x0f\x42\x8f\x01\xc2H\x8b\x01\n\x88\x01\n\x0csfixed32.lte\x1ax!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\xaa\x07\n\x02gt\x18\x04 \x01(\x0f\x42\x97\x07\xc2H\x93\x07\n}\n\x0bsfixed32.gt\x1an!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\xb6\x01\n\x0esfixed32.gt_lt\x1a\xa3\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbe\x01\n\x18sfixed32.gt_lt_exclusive\x1a\xa1\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc6\x01\n\x0fsfixed32.gt_lte\x1a\xb2\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xce\x01\n\x19sfixed32.gt_lte_exclusive\x1a\xb0\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xf7\x07\n\x03gte\x18\x05 \x01(\x0f\x42\xe2\x07\xc2H\xde\x07\n\x8b\x01\n\x0csfixed32.gte\x1a{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xc5\x01\n\x0fsfixed32.gte_lt\x1a\xb1\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcd\x01\n\x19sfixed32.gte_lt_exclusive\x1a\xaf\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd5\x01\n\x10sfixed32.gte_lte\x1a\xc0\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xdd\x01\n\x1asfixed32.gte_lte_exclusive\x1a\xbe\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x86\x01\n\x02in\x18\x06 \x03(\x0f\x42v\xc2Hs\nq\n\x0bsfixed32.in\x1a\x62!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12\x80\x01\n\x06not_in\x18\x07 \x03(\x0f\x42i\xc2Hf\nd\n\x0fsfixed32.not_in\x1aQthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x37\n\x07\x65xample\x18\x08 \x03(\x0f\x42\x1d\xc2H\x1a\n\x18\n\x10sfixed32.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xee\x15\n\rSFixed64Rules\x12\x8d\x01\n\x05\x63onst\x18\x01 \x01(\x10\x42w\xc2Ht\nr\n\x0esfixed64.const\x1a`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x91\x01\n\x02lt\x18\x02 \x01(\x10\x42\x7f\xc2H|\nz\n\x0bsfixed64.lt\x1ak!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xa4\x01\n\x03lte\x18\x03 \x01(\x10\x42\x8f\x01\xc2H\x8b\x01\n\x88\x01\n\x0csfixed64.lte\x1ax!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\xaa\x07\n\x02gt\x18\x04 \x01(\x10\x42\x97\x07\xc2H\x93\x07\n}\n\x0bsfixed64.gt\x1an!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\xb6\x01\n\x0esfixed64.gt_lt\x1a\xa3\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbe\x01\n\x18sfixed64.gt_lt_exclusive\x1a\xa1\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc6\x01\n\x0fsfixed64.gt_lte\x1a\xb2\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xce\x01\n\x19sfixed64.gt_lte_exclusive\x1a\xb0\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xf7\x07\n\x03gte\x18\x05 \x01(\x10\x42\xe2\x07\xc2H\xde\x07\n\x8b\x01\n\x0csfixed64.gte\x1a{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xc5\x01\n\x0fsfixed64.gte_lt\x1a\xb1\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcd\x01\n\x19sfixed64.gte_lt_exclusive\x1a\xaf\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd5\x01\n\x10sfixed64.gte_lte\x1a\xc0\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xdd\x01\n\x1asfixed64.gte_lte_exclusive\x1a\xbe\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x86\x01\n\x02in\x18\x06 \x03(\x10\x42v\xc2Hs\nq\n\x0bsfixed64.in\x1a\x62!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12\x80\x01\n\x06not_in\x18\x07 \x03(\x10\x42i\xc2Hf\nd\n\x0fsfixed64.not_in\x1aQthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x37\n\x07\x65xample\x18\x08 \x03(\x10\x42\x1d\xc2H\x1a\n\x18\n\x10sfixed64.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xd7\x01\n\tBoolRules\x12\x89\x01\n\x05\x63onst\x18\x01 \x01(\x08\x42s\xc2Hp\nn\n\nbool.const\x1a`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x33\n\x07\x65xample\x18\x02 \x03(\x08\x42\x19\xc2H\x16\n\x14\n\x0c\x62ool.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xcf;\n\x0bStringRules\x12\x8d\x01\n\x05\x63onst\x18\x01 \x01(\tBw\xc2Ht\nr\n\x0cstring.const\x1a\x62this != getField(rules, \'const\') ? \'value must equal `%s`\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x83\x01\n\x03len\x18\x13 \x01(\x04\x42q\xc2Hn\nl\n\nstring.len\x1a^uint(this.size()) != rules.len ? \'value length must be %s characters\'.format([rules.len]) : \'\'R\x03len\x12\xa1\x01\n\x07min_len\x18\x02 \x01(\x04\x42\x87\x01\xc2H\x83\x01\n\x80\x01\n\x0estring.min_len\x1anuint(this.size()) < rules.min_len ? \'value length must be at least %s characters\'.format([rules.min_len]) : \'\'R\x06minLen\x12\x9f\x01\n\x07max_len\x18\x03 \x01(\x04\x42\x85\x01\xc2H\x81\x01\n\x7f\n\x0estring.max_len\x1amuint(this.size()) > rules.max_len ? \'value length must be at most %s characters\'.format([rules.max_len]) : \'\'R\x06maxLen\x12\xa5\x01\n\tlen_bytes\x18\x14 \x01(\x04\x42\x87\x01\xc2H\x83\x01\n\x80\x01\n\x10string.len_bytes\x1aluint(bytes(this).size()) != rules.len_bytes ? \'value length must be %s bytes\'.format([rules.len_bytes]) : \'\'R\x08lenBytes\x12\xad\x01\n\tmin_bytes\x18\x04 \x01(\x04\x42\x8f\x01\xc2H\x8b\x01\n\x88\x01\n\x10string.min_bytes\x1atuint(bytes(this).size()) < rules.min_bytes ? \'value length must be at least %s bytes\'.format([rules.min_bytes]) : \'\'R\x08minBytes\x12\xac\x01\n\tmax_bytes\x18\x05 \x01(\x04\x42\x8e\x01\xc2H\x8a\x01\n\x87\x01\n\x10string.max_bytes\x1asuint(bytes(this).size()) > rules.max_bytes ? \'value length must be at most %s bytes\'.format([rules.max_bytes]) : \'\'R\x08maxBytes\x12\x96\x01\n\x07pattern\x18\x06 \x01(\tB|\xc2Hy\nw\n\x0estring.pattern\x1a\x65!this.matches(rules.pattern) ? \'value does not match regex pattern `%s`\'.format([rules.pattern]) : \'\'R\x07pattern\x12\x8c\x01\n\x06prefix\x18\x07 \x01(\tBt\xc2Hq\no\n\rstring.prefix\x1a^!this.startsWith(rules.prefix) ? \'value does not have prefix `%s`\'.format([rules.prefix]) : \'\'R\x06prefix\x12\x8a\x01\n\x06suffix\x18\x08 \x01(\tBr\xc2Ho\nm\n\rstring.suffix\x1a\\!this.endsWith(rules.suffix) ? \'value does not have suffix `%s`\'.format([rules.suffix]) : \'\'R\x06suffix\x12\x9a\x01\n\x08\x63ontains\x18\t \x01(\tB~\xc2H{\ny\n\x0fstring.contains\x1a\x66!this.contains(rules.contains) ? \'value does not contain substring `%s`\'.format([rules.contains]) : \'\'R\x08\x63ontains\x12\xa5\x01\n\x0cnot_contains\x18\x17 \x01(\tB\x81\x01\xc2H~\n|\n\x13string.not_contains\x1a\x65this.contains(rules.not_contains) ? \'value contains substring `%s`\'.format([rules.not_contains]) : \'\'R\x0bnotContains\x12\x84\x01\n\x02in\x18\n \x03(\tBt\xc2Hq\no\n\tstring.in\x1a\x62!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12~\n\x06not_in\x18\x0b \x03(\tBg\xc2Hd\nb\n\rstring.not_in\x1aQthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\xe6\x01\n\x05\x65mail\x18\x0c \x01(\x08\x42\xcd\x01\xc2H\xc9\x01\na\n\x0cstring.email\x12#value must be a valid email address\x1a,!rules.email || this == \'\' || this.isEmail()\nd\n\x12string.email_empty\x12\x32value is empty, which is not a valid email address\x1a\x1a!rules.email || this != \'\'H\x00R\x05\x65mail\x12\xf1\x01\n\x08hostname\x18\r \x01(\x08\x42\xd2\x01\xc2H\xce\x01\ne\n\x0fstring.hostname\x12\x1evalue must be a valid hostname\x1a\x32!rules.hostname || this == \'\' || this.isHostname()\ne\n\x15string.hostname_empty\x12-value is empty, which is not a valid hostname\x1a\x1d!rules.hostname || this != \'\'H\x00R\x08hostname\x12\xcb\x01\n\x02ip\x18\x0e \x01(\x08\x42\xb8\x01\xc2H\xb4\x01\nU\n\tstring.ip\x12 value must 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\xdc\x01\n\x04ipv4\x18\x0f \x01(\x08\x42\xc5\x01\xc2H\xc1\x01\n\\\n\x0bstring.ipv4\x12\"value must be a valid IPv4 address\x1a)!rules.ipv4 || this == \'\' || this.isIp(4)\na\n\x11string.ipv4_empty\x12\x31value is empty, which is not a valid IPv4 address\x1a\x19!rules.ipv4 || this != \'\'H\x00R\x04ipv4\x12\xdc\x01\n\x04ipv6\x18\x10 \x01(\x08\x42\xc5\x01\xc2H\xc1\x01\n\\\n\x0bstring.ipv6\x12\"value must be a valid IPv6 address\x1a)!rules.ipv6 || this == \'\' || this.isIp(6)\na\n\x11string.ipv6_empty\x12\x31value is empty, which is not a valid IPv6 address\x1a\x19!rules.ipv6 || this != \'\'H\x00R\x04ipv6\x12\xc4\x01\n\x03uri\x18\x11 \x01(\x08\x42\xaf\x01\xc2H\xab\x01\nQ\n\nstring.uri\x12\x19value must be a valid URI\x1a(!rules.uri || this == \'\' || this.isUri()\nV\n\x10string.uri_empty\x12(value is empty, which is not a valid URI\x1a\x18!rules.uri || this != \'\'H\x00R\x03uri\x12x\n\x07uri_ref\x18\x12 \x01(\x08\x42]\xc2HZ\nX\n\x0estring.uri_ref\x12#value must be a valid URI Reference\x1a!!rules.uri_ref || this.isUriRef()H\x00R\x06uriRef\x12\x99\x02\n\x07\x61\x64\x64ress\x18\x15 \x01(\x08\x42\xfc\x01\xc2H\xf8\x01\n\x81\x01\n\x0estring.address\x12-value must be a valid hostname, or ip address\x1a@!rules.address || this == \'\' || this.isHostname() || this.isIp()\nr\n\x14string.address_empty\x12!rules.ipv4_with_prefixlen || this == \'\' || this.isIpPrefix(4)\n\x92\x01\n string.ipv4_with_prefixlen_empty\x12\x44value is empty, which is not a valid IPv4 address with prefix length\x1a(!rules.ipv4_with_prefixlen || this != \'\'H\x00R\x11ipv4WithPrefixlen\x12\xe2\x02\n\x13ipv6_with_prefixlen\x18\x1c \x01(\x08\x42\xaf\x02\xc2H\xab\x02\n\x93\x01\n\x1astring.ipv6_with_prefixlen\x12\x35value 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\x12\x44value is empty, which is not a valid IPv6 address with prefix length\x1a(!rules.ipv6_with_prefixlen || this != \'\'H\x00R\x11ipv6WithPrefixlen\x12\xfc\x01\n\tip_prefix\x18\x1d \x01(\x08\x42\xdc\x01\xc2H\xd8\x01\nl\n\x10string.ip_prefix\x12\x1fvalue must be a valid IP prefix\x1a\x37!rules.ip_prefix || this == \'\' || this.isIpPrefix(true)\nh\n\x16string.ip_prefix_empty\x12.value is empty, which is not a valid IP prefix\x1a\x1e!rules.ip_prefix || this != \'\'H\x00R\x08ipPrefix\x12\x8f\x02\n\x0bipv4_prefix\x18\x1e \x01(\x08\x42\xeb\x01\xc2H\xe7\x01\nu\n\x12string.ipv4_prefix\x12!value must be a valid IPv4 prefix\x1a!rules.host_and_port || this == \'\' || this.isHostAndPort(true)\ny\n\x1astring.host_and_port_empty\x12\x37value is empty, which is not a valid host and port pair\x1a\"!rules.host_and_port || this != \'\'H\x00R\x0bhostAndPort\x12\xfb\x01\n\x04ulid\x18# \x01(\x08\x42\xe4\x01\xc2H\xe0\x01\n\x82\x01\n\x0bstring.ulid\x12\x1avalue must be a valid ULID\x1aW!rules.ulid || this == \'\' || this.matches(\'^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$\')\nY\n\x11string.ulid_empty\x12)value is empty, which is not a valid ULID\x1a\x19!rules.ulid || this != \'\'H\x00R\x04ulid\x12\xb8\x05\n\x10well_known_regex\x18\x18 \x01(\x0e\x32\x18.buf.validate.KnownRegexB\xf1\x04\xc2H\xed\x04\n\xf0\x01\n#string.well_known_regex.header_name\x12&value 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\x12\x35value is empty, which is not a valid HTTP header name\x1a)rules.well_known_regex != 1 || this != \'\'\n\xe7\x01\n$string.well_known_regex.header_value\x12\'value 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(\x08R\x06strict\x12\x35\n\x07\x65xample\x18\" \x03(\tB\x1b\xc2H\x18\n\x16\n\x0estring.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0c\n\nwell_known\"\xac\x13\n\nBytesRules\x12\x87\x01\n\x05\x63onst\x18\x01 \x01(\x0c\x42q\xc2Hn\nl\n\x0b\x62ytes.const\x1a]this != getField(rules, \'const\') ? \'value must be %x\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12}\n\x03len\x18\r \x01(\x04\x42k\xc2Hh\nf\n\tbytes.len\x1aYuint(this.size()) != rules.len ? \'value length must be %s bytes\'.format([rules.len]) : \'\'R\x03len\x12\x98\x01\n\x07min_len\x18\x02 \x01(\x04\x42\x7f\xc2H|\nz\n\rbytes.min_len\x1aiuint(this.size()) < rules.min_len ? \'value length must be at least %s bytes\'.format([rules.min_len]) : \'\'R\x06minLen\x12\x90\x01\n\x07max_len\x18\x03 \x01(\x04\x42w\xc2Ht\nr\n\rbytes.max_len\x1a\x61uint(this.size()) > rules.max_len ? \'value must be at most %s bytes\'.format([rules.max_len]) : \'\'R\x06maxLen\x12\x99\x01\n\x07pattern\x18\x04 \x01(\tB\x7f\xc2H|\nz\n\rbytes.pattern\x1ai!string(this).matches(rules.pattern) ? \'value must match regex pattern `%s`\'.format([rules.pattern]) : \'\'R\x07pattern\x12\x89\x01\n\x06prefix\x18\x05 \x01(\x0c\x42q\xc2Hn\nl\n\x0c\x62ytes.prefix\x1a\\!this.startsWith(rules.prefix) ? \'value does not have prefix %x\'.format([rules.prefix]) : \'\'R\x06prefix\x12\x87\x01\n\x06suffix\x18\x06 \x01(\x0c\x42o\xc2Hl\nj\n\x0c\x62ytes.suffix\x1aZ!this.endsWith(rules.suffix) ? \'value does not have suffix %x\'.format([rules.suffix]) : \'\'R\x06suffix\x12\x8d\x01\n\x08\x63ontains\x18\x07 \x01(\x0c\x42q\xc2Hn\nl\n\x0e\x62ytes.contains\x1aZ!this.contains(rules.contains) ? \'value does not contain %x\'.format([rules.contains]) : \'\'R\x08\x63ontains\x12\xab\x01\n\x02in\x18\x08 \x03(\x0c\x42\x9a\x01\xc2H\x96\x01\n\x93\x01\n\x08\x62ytes.in\x1a\x86\x01getField(rules, \'in\').size() > 0 && !(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12}\n\x06not_in\x18\t \x03(\x0c\x42\x66\xc2Hc\na\n\x0c\x62ytes.not_in\x1aQthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\xef\x01\n\x02ip\x18\n \x01(\x08\x42\xdc\x01\xc2H\xd8\x01\nt\n\x08\x62ytes.ip\x12 value must be a valid IP address\x1a\x46!rules.ip || this.size() == 0 || this.size() == 4 || this.size() == 16\n`\n\x0e\x62ytes.ip_empty\x12/value is empty, which is not a valid IP address\x1a\x1d!rules.ip || this.size() != 0H\x00R\x02ip\x12\xea\x01\n\x04ipv4\x18\x0b \x01(\x08\x42\xd3\x01\xc2H\xcf\x01\ne\n\nbytes.ipv4\x12\"value must be a valid IPv4 address\x1a\x33!rules.ipv4 || this.size() == 0 || this.size() == 4\nf\n\x10\x62ytes.ipv4_empty\x12\x31value is empty, which is not a valid IPv4 address\x1a\x1f!rules.ipv4 || this.size() != 0H\x00R\x04ipv4\x12\xeb\x01\n\x04ipv6\x18\x0c \x01(\x08\x42\xd4\x01\xc2H\xd0\x01\nf\n\nbytes.ipv6\x12\"value must be a valid IPv6 address\x1a\x34!rules.ipv6 || this.size() == 0 || this.size() == 16\nf\n\x10\x62ytes.ipv6_empty\x12\x31value is empty, which is not a valid IPv6 address\x1a\x1f!rules.ipv6 || this.size() != 0H\x00R\x04ipv6\x12\xdb\x01\n\x04uuid\x18\x0f \x01(\x08\x42\xc4\x01\xc2H\xc0\x01\n^\n\nbytes.uuid\x12\x1avalue must be a valid UUID\x1a\x34!rules.uuid || this.size() == 0 || this.size() == 16\n^\n\x10\x62ytes.uuid_empty\x12)value is empty, which is not a valid UUID\x1a\x1f!rules.uuid || this.size() != 0H\x00R\x04uuid\x12\x34\n\x07\x65xample\x18\x0e \x03(\x0c\x42\x1a\xc2H\x17\n\x15\n\rbytes.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0c\n\nwell_known\"\xfd\x03\n\tEnumRules\x12\x89\x01\n\x05\x63onst\x18\x01 \x01(\x05\x42s\xc2Hp\nn\n\nenum.const\x1a`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12!\n\x0c\x64\x65\x66ined_only\x18\x02 \x01(\x08R\x0b\x64\x65\x66inedOnly\x12\x82\x01\n\x02in\x18\x03 \x03(\x05\x42r\xc2Ho\nm\n\x07\x65num.in\x1a\x62!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12|\n\x06not_in\x18\x04 \x03(\x05\x42\x65\xc2Hb\n`\n\x0b\x65num.not_in\x1aQthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x33\n\x07\x65xample\x18\x05 \x03(\x05\x42\x19\xc2H\x16\n\x14\n\x0c\x65num.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x9e\x04\n\rRepeatedRules\x12\xa8\x01\n\tmin_items\x18\x01 \x01(\x04\x42\x8a\x01\xc2H\x86\x01\n\x83\x01\n\x12repeated.min_items\x1amuint(this.size()) < rules.min_items ? \'value must contain at least %d item(s)\'.format([rules.min_items]) : \'\'R\x08minItems\x12\xac\x01\n\tmax_items\x18\x02 \x01(\x04\x42\x8e\x01\xc2H\x8a\x01\n\x87\x01\n\x12repeated.max_items\x1aquint(this.size()) > rules.max_items ? \'value must contain no more than %s item(s)\'.format([rules.max_items]) : \'\'R\x08maxItems\x12x\n\x06unique\x18\x03 \x01(\x08\x42`\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(\x0b\x32\x18.buf.validate.FieldRulesR\x05items*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xac\x03\n\x08MapRules\x12\x99\x01\n\tmin_pairs\x18\x01 \x01(\x04\x42|\xc2Hy\nw\n\rmap.min_pairs\x1a\x66uint(this.size()) < rules.min_pairs ? \'map must be at least %d entries\'.format([rules.min_pairs]) : \'\'R\x08minPairs\x12\x98\x01\n\tmax_pairs\x18\x02 \x01(\x04\x42{\xc2Hx\nv\n\rmap.max_pairs\x1a\x65uint(this.size()) > rules.max_pairs ? \'map must be at most %d entries\'.format([rules.max_pairs]) : \'\'R\x08maxPairs\x12,\n\x04keys\x18\x04 \x01(\x0b\x32\x18.buf.validate.FieldRulesR\x04keys\x12\x30\n\x06values\x18\x05 \x01(\x0b\x32\x18.buf.validate.FieldRulesR\x06values*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"1\n\x08\x41nyRules\x12\x0e\n\x02in\x18\x02 \x03(\tR\x02in\x12\x15\n\x06not_in\x18\x03 \x03(\tR\x05notIn\"\xc6\x17\n\rDurationRules\x12\xa8\x01\n\x05\x63onst\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationBw\xc2Ht\nr\n\x0e\x64uration.const\x1a`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\xac\x01\n\x02lt\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x7f\xc2H|\nz\n\x0b\x64uration.lt\x1ak!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xbf\x01\n\x03lte\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x8f\x01\xc2H\x8b\x01\n\x88\x01\n\x0c\x64uration.lte\x1ax!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\xc5\x07\n\x02gt\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\x97\x07\xc2H\x93\x07\n}\n\x0b\x64uration.gt\x1an!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\xb6\x01\n\x0e\x64uration.gt_lt\x1a\xa3\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbe\x01\n\x18\x64uration.gt_lt_exclusive\x1a\xa1\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc6\x01\n\x0f\x64uration.gt_lte\x1a\xb2\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xce\x01\n\x19\x64uration.gt_lte_exclusive\x1a\xb0\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\x92\x08\n\x03gte\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\xe2\x07\xc2H\xde\x07\n\x8b\x01\n\x0c\x64uration.gte\x1a{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xc5\x01\n\x0f\x64uration.gte_lt\x1a\xb1\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcd\x01\n\x19\x64uration.gte_lt_exclusive\x1a\xaf\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd5\x01\n\x10\x64uration.gte_lte\x1a\xc0\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xdd\x01\n\x1a\x64uration.gte_lte_exclusive\x1a\xbe\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\xa1\x01\n\x02in\x18\x07 \x03(\x0b\x32\x19.google.protobuf.DurationBv\xc2Hs\nq\n\x0b\x64uration.in\x1a\x62!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12\x9b\x01\n\x06not_in\x18\x08 \x03(\x0b\x32\x19.google.protobuf.DurationBi\xc2Hf\nd\n\x0f\x64uration.not_in\x1aQthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12R\n\x07\x65xample\x18\t \x03(\x0b\x32\x19.google.protobuf.DurationB\x1d\xc2H\x1a\n\x18\n\x10\x64uration.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\x98\x06\n\x0e\x46ieldMaskRules\x12\xc6\x01\n\x05\x63onst\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x93\x01\xc2H\x8f\x01\n\x8c\x01\n\x10\x66ield_mask.const\x1axthis.paths != getField(rules, \'const\').paths ? \'value must equal paths %s\'.format([getField(rules, \'const\').paths]) : \'\'R\x05\x63onst\x12\xdd\x01\n\x02in\x18\x02 \x03(\tB\xcc\x01\xc2H\xc8\x01\n\xc5\x01\n\rfield_mask.in\x1a\xb3\x01!this.paths.all(p, p in getField(rules, \'in\') || getField(rules, \'in\').exists(f, p.startsWith(f+\'.\'))) ? \'value must only contain paths in %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12\xfa\x01\n\x06not_in\x18\x03 \x03(\tB\xe2\x01\xc2H\xde\x01\n\xdb\x01\n\x11\x66ield_mask.not_in\x1a\xc5\x01!this.paths.all(p, !(p in getField(rules, \'not_in\') || getField(rules, \'not_in\').exists(f, p.startsWith(f+\'.\')))) ? \'value must not contain any paths in %s\'.format([getField(rules, \'not_in\')]) : \'\'R\x05notIn\x12U\n\x07\x65xample\x18\x04 \x03(\x0b\x32\x1a.google.protobuf.FieldMaskB\x1f\xc2H\x1c\n\x1a\n\x12\x66ield_mask.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xca\x18\n\x0eTimestampRules\x12\xaa\x01\n\x05\x63onst\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampBx\xc2Hu\ns\n\x0ftimestamp.const\x1a`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\xaf\x01\n\x02lt\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x80\x01\xc2H}\n{\n\x0ctimestamp.lt\x1ak!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xc1\x01\n\x03lte\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x90\x01\xc2H\x8c\x01\n\x89\x01\n\rtimestamp.lte\x1ax!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12s\n\x06lt_now\x18\x07 \x01(\x08\x42Z\xc2HW\nU\n\x10timestamp.lt_now\x1a\x41(rules.lt_now && this > now) ? \'value must be less than now\' : \'\'H\x00R\x05ltNow\x12\xcb\x07\n\x02gt\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x9c\x07\xc2H\x98\x07\n~\n\x0ctimestamp.gt\x1an!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\xb7\x01\n\x0ftimestamp.gt_lt\x1a\xa3\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbf\x01\n\x19timestamp.gt_lt_exclusive\x1a\xa1\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc7\x01\n\x10timestamp.gt_lte\x1a\xb2\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xcf\x01\n\x1atimestamp.gt_lte_exclusive\x1a\xb0\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\x98\x08\n\x03gte\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xe7\x07\xc2H\xe3\x07\n\x8c\x01\n\rtimestamp.gte\x1a{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xc6\x01\n\x10timestamp.gte_lt\x1a\xb1\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xce\x01\n\x1atimestamp.gte_lt_exclusive\x1a\xaf\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd6\x01\n\x11timestamp.gte_lte\x1a\xc0\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xde\x01\n\x1btimestamp.gte_lte_exclusive\x1a\xbe\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12v\n\x06gt_now\x18\x08 \x01(\x08\x42]\xc2HZ\nX\n\x10timestamp.gt_now\x1a\x44(rules.gt_now && this < now) ? \'value must be greater than now\' : \'\'H\x01R\x05gtNow\x12\xc0\x01\n\x06within\x18\t \x01(\x0b\x32\x19.google.protobuf.DurationB\x8c\x01\xc2H\x88\x01\n\x85\x01\n\x10timestamp.within\x1aqthis < now-rules.within || this > now+rules.within ? \'value must be within %s of now\'.format([rules.within]) : \'\'R\x06within\x12T\n\x07\x65xample\x18\n \x03(\x0b\x32\x1a.google.protobuf.TimestampB\x1e\xc2H\x1b\n\x19\n\x11timestamp.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"E\n\nViolations\x12\x37\n\nviolations\x18\x01 \x03(\x0b\x32\x17.buf.validate.ViolationR\nviolations\"\xc5\x01\n\tViolation\x12-\n\x05\x66ield\x18\x05 \x01(\x0b\x32\x17.buf.validate.FieldPathR\x05\x66ield\x12+\n\x04rule\x18\x06 \x01(\x0b\x32\x17.buf.validate.FieldPathR\x04rule\x12\x17\n\x07rule_id\x18\x02 \x01(\tR\x06ruleId\x12\x18\n\x07message\x18\x03 \x01(\tR\x07message\x12\x17\n\x07\x66or_key\x18\x04 \x01(\x08R\x06\x66orKeyJ\x04\x08\x01\x10\x02R\nfield_path\"G\n\tFieldPath\x12:\n\x08\x65lements\x18\x01 \x03(\x0b\x32\x1e.buf.validate.FieldPathElementR\x08\x65lements\"\xcc\x03\n\x10\x46ieldPathElement\x12!\n\x0c\x66ield_number\x18\x01 \x01(\x05R\x0b\x66ieldNumber\x12\x1d\n\nfield_name\x18\x02 \x01(\tR\tfieldName\x12I\n\nfield_type\x18\x03 \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.TypeR\tfieldType\x12\x45\n\x08key_type\x18\x04 \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.TypeR\x07keyType\x12I\n\nvalue_type\x18\x05 \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.TypeR\tvalueType\x12\x16\n\x05index\x18\x06 \x01(\x04H\x00R\x05index\x12\x1b\n\x08\x62ool_key\x18\x07 \x01(\x08H\x00R\x07\x62oolKey\x12\x19\n\x07int_key\x18\x08 \x01(\x03H\x00R\x06intKey\x12\x1b\n\x08uint_key\x18\t \x01(\x04H\x00R\x07uintKey\x12\x1f\n\nstring_key\x18\n \x01(\tH\x00R\tstringKeyB\x0b\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\x08\x02\x10\x02*\x0cIGNORE_EMPTY*\x0eIGNORE_DEFAULT*\x17IGNORE_IF_DEFAULT_VALUE*\x15IGNORE_IF_UNPOPULATED*n\n\nKnownRegex\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\x07message\x12\x1f.google.protobuf.MessageOptions\x18\x87\t \x01(\x0b\x32\x1a.buf.validate.MessageRulesR\x07message:N\n\x05oneof\x12\x1d.google.protobuf.OneofOptions\x18\x87\t \x01(\x0b\x32\x18.buf.validate.OneofRulesR\x05oneof:N\n\x05\x66ield\x12\x1d.google.protobuf.FieldOptions\x18\x87\t \x01(\x0b\x32\x18.buf.validate.FieldRulesR\x05\x66ield:]\n\npredefined\x12\x1d.google.protobuf.FieldOptions\x18\x88\t \x01(\x0b\x32\x1d.buf.validate.PredefinedRulesR\npredefinedB\xbb\x01\n\x10\x63om.buf.validateB\rValidateProtoP\x01ZGbuf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\xa2\x02\x03\x42VX\xaa\x02\x0c\x42uf.Validate\xca\x02\x0c\x42uf\\Validate\xe2\x02\x18\x42uf\\Validate\\GPBMetadata\xea\x02\rBuf::Validate') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'buf.validate.validate_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\020com.buf.validateB\rValidateProtoP\001ZGbuf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\242\002\003BVX\252\002\014Buf.Validate\312\002\014Buf\\Validate\342\002\030Buf\\Validate\\GPBMetadata\352\002\rBuf::Validate' + _globals['_FLOATRULES'].fields_by_name['const']._loaded_options = None + _globals['_FLOATRULES'].fields_by_name['const']._serialized_options = b'\302Hq\no\n\013float.const\032`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_FLOATRULES'].fields_by_name['lt']._loaded_options = None + _globals['_FLOATRULES'].fields_by_name['lt']._serialized_options = b'\302H\214\001\n\211\001\n\010float.lt\032}!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)? \'value must be less than %s\'.format([rules.lt]) : \'\'' + _globals['_FLOATRULES'].fields_by_name['lte']._loaded_options = None + _globals['_FLOATRULES'].fields_by_name['lte']._serialized_options = b'\302H\233\001\n\230\001\n\tfloat.lte\032\212\001!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'' + _globals['_FLOATRULES'].fields_by_name['gt']._loaded_options = None + _globals['_FLOATRULES'].fields_by_name['gt']._serialized_options = b'\302H\334\007\n\215\001\n\010float.gt\032\200\001!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\303\001\n\013float.gt_lt\032\263\001has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\315\001\n\025float.gt_lt_exclusive\032\263\001has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\323\001\n\014float.gt_lte\032\302\001has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\335\001\n\026float.gt_lte_exclusive\032\302\001has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' + _globals['_FLOATRULES'].fields_by_name['gte']._loaded_options = None + _globals['_FLOATRULES'].fields_by_name['gte']._serialized_options = b'\302H\246\010\n\233\001\n\tfloat.gte\032\215\001!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\322\001\n\014float.gte_lt\032\301\001has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\334\001\n\026float.gte_lt_exclusive\032\301\001has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\342\001\n\rfloat.gte_lte\032\320\001has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\354\001\n\027float.gte_lte_exclusive\032\320\001has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' + _globals['_FLOATRULES'].fields_by_name['in']._loaded_options = None + _globals['_FLOATRULES'].fields_by_name['in']._serialized_options = b'\302Hp\nn\n\010float.in\032b!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_FLOATRULES'].fields_by_name['not_in']._loaded_options = None + _globals['_FLOATRULES'].fields_by_name['not_in']._serialized_options = b'\302Hc\na\n\014float.not_in\032Qthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'' + _globals['_FLOATRULES'].fields_by_name['finite']._loaded_options = None + _globals['_FLOATRULES'].fields_by_name['finite']._serialized_options = b'\302Hb\n`\n\014float.finite\032Prules.finite ? (this.isNan() || this.isInf() ? \'value must be finite\' : \'\') : \'\'' + _globals['_FLOATRULES'].fields_by_name['example']._loaded_options = None + _globals['_FLOATRULES'].fields_by_name['example']._serialized_options = b'\302H\027\n\025\n\rfloat.example\032\004true' + _globals['_DOUBLERULES'].fields_by_name['const']._loaded_options = None + _globals['_DOUBLERULES'].fields_by_name['const']._serialized_options = b'\302Hr\np\n\014double.const\032`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_DOUBLERULES'].fields_by_name['lt']._loaded_options = None + _globals['_DOUBLERULES'].fields_by_name['lt']._serialized_options = b'\302H\215\001\n\212\001\n\tdouble.lt\032}!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)? \'value must be less than %s\'.format([rules.lt]) : \'\'' + _globals['_DOUBLERULES'].fields_by_name['lte']._loaded_options = None + _globals['_DOUBLERULES'].fields_by_name['lte']._serialized_options = b'\302H\234\001\n\231\001\n\ndouble.lte\032\212\001!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'' + _globals['_DOUBLERULES'].fields_by_name['gt']._loaded_options = None + _globals['_DOUBLERULES'].fields_by_name['gt']._serialized_options = b'\302H\341\007\n\216\001\n\tdouble.gt\032\200\001!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\304\001\n\014double.gt_lt\032\263\001has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\316\001\n\026double.gt_lt_exclusive\032\263\001has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\324\001\n\rdouble.gt_lte\032\302\001has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\336\001\n\027double.gt_lte_exclusive\032\302\001has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' + _globals['_DOUBLERULES'].fields_by_name['gte']._loaded_options = None + _globals['_DOUBLERULES'].fields_by_name['gte']._serialized_options = b'\302H\253\010\n\234\001\n\ndouble.gte\032\215\001!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\323\001\n\rdouble.gte_lt\032\301\001has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\335\001\n\027double.gte_lt_exclusive\032\301\001has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\343\001\n\016double.gte_lte\032\320\001has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\355\001\n\030double.gte_lte_exclusive\032\320\001has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' + _globals['_DOUBLERULES'].fields_by_name['in']._loaded_options = None + _globals['_DOUBLERULES'].fields_by_name['in']._serialized_options = b'\302Hq\no\n\tdouble.in\032b!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_DOUBLERULES'].fields_by_name['not_in']._loaded_options = None + _globals['_DOUBLERULES'].fields_by_name['not_in']._serialized_options = b'\302Hd\nb\n\rdouble.not_in\032Qthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'' + _globals['_DOUBLERULES'].fields_by_name['finite']._loaded_options = None + _globals['_DOUBLERULES'].fields_by_name['finite']._serialized_options = b'\302Hc\na\n\rdouble.finite\032Prules.finite ? (this.isNan() || this.isInf() ? \'value must be finite\' : \'\') : \'\'' + _globals['_DOUBLERULES'].fields_by_name['example']._loaded_options = None + _globals['_DOUBLERULES'].fields_by_name['example']._serialized_options = b'\302H\030\n\026\n\016double.example\032\004true' + _globals['_INT32RULES'].fields_by_name['const']._loaded_options = None + _globals['_INT32RULES'].fields_by_name['const']._serialized_options = b'\302Hq\no\n\013int32.const\032`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_INT32RULES'].fields_by_name['lt']._loaded_options = None + _globals['_INT32RULES'].fields_by_name['lt']._serialized_options = b'\302Hy\nw\n\010int32.lt\032k!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'' + _globals['_INT32RULES'].fields_by_name['lte']._loaded_options = None + _globals['_INT32RULES'].fields_by_name['lte']._serialized_options = b'\302H\210\001\n\205\001\n\tint32.lte\032x!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'' + _globals['_INT32RULES'].fields_by_name['gt']._loaded_options = None + _globals['_INT32RULES'].fields_by_name['gt']._serialized_options = b'\302H\204\007\nz\n\010int32.gt\032n!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\263\001\n\013int32.gt_lt\032\243\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\273\001\n\025int32.gt_lt_exclusive\032\241\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\303\001\n\014int32.gt_lte\032\262\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\313\001\n\026int32.gt_lte_exclusive\032\260\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' + _globals['_INT32RULES'].fields_by_name['gte']._loaded_options = None + _globals['_INT32RULES'].fields_by_name['gte']._serialized_options = b'\302H\317\007\n\210\001\n\tint32.gte\032{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\302\001\n\014int32.gte_lt\032\261\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\312\001\n\026int32.gte_lt_exclusive\032\257\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\322\001\n\rint32.gte_lte\032\300\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\332\001\n\027int32.gte_lte_exclusive\032\276\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' + _globals['_INT32RULES'].fields_by_name['in']._loaded_options = None + _globals['_INT32RULES'].fields_by_name['in']._serialized_options = b'\302Hp\nn\n\010int32.in\032b!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_INT32RULES'].fields_by_name['not_in']._loaded_options = None + _globals['_INT32RULES'].fields_by_name['not_in']._serialized_options = b'\302Hc\na\n\014int32.not_in\032Qthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'' + _globals['_INT32RULES'].fields_by_name['example']._loaded_options = None + _globals['_INT32RULES'].fields_by_name['example']._serialized_options = b'\302H\027\n\025\n\rint32.example\032\004true' + _globals['_INT64RULES'].fields_by_name['const']._loaded_options = None + _globals['_INT64RULES'].fields_by_name['const']._serialized_options = b'\302Hq\no\n\013int64.const\032`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_INT64RULES'].fields_by_name['lt']._loaded_options = None + _globals['_INT64RULES'].fields_by_name['lt']._serialized_options = b'\302Hy\nw\n\010int64.lt\032k!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'' + _globals['_INT64RULES'].fields_by_name['lte']._loaded_options = None + _globals['_INT64RULES'].fields_by_name['lte']._serialized_options = b'\302H\210\001\n\205\001\n\tint64.lte\032x!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'' + _globals['_INT64RULES'].fields_by_name['gt']._loaded_options = None + _globals['_INT64RULES'].fields_by_name['gt']._serialized_options = b'\302H\204\007\nz\n\010int64.gt\032n!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\263\001\n\013int64.gt_lt\032\243\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\273\001\n\025int64.gt_lt_exclusive\032\241\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\303\001\n\014int64.gt_lte\032\262\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\313\001\n\026int64.gt_lte_exclusive\032\260\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' + _globals['_INT64RULES'].fields_by_name['gte']._loaded_options = None + _globals['_INT64RULES'].fields_by_name['gte']._serialized_options = b'\302H\317\007\n\210\001\n\tint64.gte\032{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\302\001\n\014int64.gte_lt\032\261\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\312\001\n\026int64.gte_lt_exclusive\032\257\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\322\001\n\rint64.gte_lte\032\300\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\332\001\n\027int64.gte_lte_exclusive\032\276\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' + _globals['_INT64RULES'].fields_by_name['in']._loaded_options = None + _globals['_INT64RULES'].fields_by_name['in']._serialized_options = b'\302Hp\nn\n\010int64.in\032b!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_INT64RULES'].fields_by_name['not_in']._loaded_options = None + _globals['_INT64RULES'].fields_by_name['not_in']._serialized_options = b'\302Hc\na\n\014int64.not_in\032Qthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'' + _globals['_INT64RULES'].fields_by_name['example']._loaded_options = None + _globals['_INT64RULES'].fields_by_name['example']._serialized_options = b'\302H\027\n\025\n\rint64.example\032\004true' + _globals['_UINT32RULES'].fields_by_name['const']._loaded_options = None + _globals['_UINT32RULES'].fields_by_name['const']._serialized_options = b'\302Hr\np\n\014uint32.const\032`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_UINT32RULES'].fields_by_name['lt']._loaded_options = None + _globals['_UINT32RULES'].fields_by_name['lt']._serialized_options = b'\302Hz\nx\n\tuint32.lt\032k!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'' + _globals['_UINT32RULES'].fields_by_name['lte']._loaded_options = None + _globals['_UINT32RULES'].fields_by_name['lte']._serialized_options = b'\302H\211\001\n\206\001\n\nuint32.lte\032x!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'' + _globals['_UINT32RULES'].fields_by_name['gt']._loaded_options = None + _globals['_UINT32RULES'].fields_by_name['gt']._serialized_options = b'\302H\211\007\n{\n\tuint32.gt\032n!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\264\001\n\014uint32.gt_lt\032\243\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\274\001\n\026uint32.gt_lt_exclusive\032\241\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\304\001\n\ruint32.gt_lte\032\262\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\314\001\n\027uint32.gt_lte_exclusive\032\260\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' + _globals['_UINT32RULES'].fields_by_name['gte']._loaded_options = None + _globals['_UINT32RULES'].fields_by_name['gte']._serialized_options = b'\302H\324\007\n\211\001\n\nuint32.gte\032{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\303\001\n\ruint32.gte_lt\032\261\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\313\001\n\027uint32.gte_lt_exclusive\032\257\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\323\001\n\016uint32.gte_lte\032\300\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\333\001\n\030uint32.gte_lte_exclusive\032\276\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' + _globals['_UINT32RULES'].fields_by_name['in']._loaded_options = None + _globals['_UINT32RULES'].fields_by_name['in']._serialized_options = b'\302Hq\no\n\tuint32.in\032b!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_UINT32RULES'].fields_by_name['not_in']._loaded_options = None + _globals['_UINT32RULES'].fields_by_name['not_in']._serialized_options = b'\302Hd\nb\n\ruint32.not_in\032Qthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'' + _globals['_UINT32RULES'].fields_by_name['example']._loaded_options = None + _globals['_UINT32RULES'].fields_by_name['example']._serialized_options = b'\302H\030\n\026\n\016uint32.example\032\004true' + _globals['_UINT64RULES'].fields_by_name['const']._loaded_options = None + _globals['_UINT64RULES'].fields_by_name['const']._serialized_options = b'\302Hr\np\n\014uint64.const\032`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_UINT64RULES'].fields_by_name['lt']._loaded_options = None + _globals['_UINT64RULES'].fields_by_name['lt']._serialized_options = b'\302Hz\nx\n\tuint64.lt\032k!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'' + _globals['_UINT64RULES'].fields_by_name['lte']._loaded_options = None + _globals['_UINT64RULES'].fields_by_name['lte']._serialized_options = b'\302H\211\001\n\206\001\n\nuint64.lte\032x!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'' + _globals['_UINT64RULES'].fields_by_name['gt']._loaded_options = None + _globals['_UINT64RULES'].fields_by_name['gt']._serialized_options = b'\302H\211\007\n{\n\tuint64.gt\032n!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\264\001\n\014uint64.gt_lt\032\243\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\274\001\n\026uint64.gt_lt_exclusive\032\241\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\304\001\n\ruint64.gt_lte\032\262\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\314\001\n\027uint64.gt_lte_exclusive\032\260\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' + _globals['_UINT64RULES'].fields_by_name['gte']._loaded_options = None + _globals['_UINT64RULES'].fields_by_name['gte']._serialized_options = b'\302H\324\007\n\211\001\n\nuint64.gte\032{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\303\001\n\ruint64.gte_lt\032\261\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\313\001\n\027uint64.gte_lt_exclusive\032\257\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\323\001\n\016uint64.gte_lte\032\300\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\333\001\n\030uint64.gte_lte_exclusive\032\276\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' + _globals['_UINT64RULES'].fields_by_name['in']._loaded_options = None + _globals['_UINT64RULES'].fields_by_name['in']._serialized_options = b'\302Hq\no\n\tuint64.in\032b!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_UINT64RULES'].fields_by_name['not_in']._loaded_options = None + _globals['_UINT64RULES'].fields_by_name['not_in']._serialized_options = b'\302Hd\nb\n\ruint64.not_in\032Qthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'' + _globals['_UINT64RULES'].fields_by_name['example']._loaded_options = None + _globals['_UINT64RULES'].fields_by_name['example']._serialized_options = b'\302H\030\n\026\n\016uint64.example\032\004true' + _globals['_SINT32RULES'].fields_by_name['const']._loaded_options = None + _globals['_SINT32RULES'].fields_by_name['const']._serialized_options = b'\302Hr\np\n\014sint32.const\032`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_SINT32RULES'].fields_by_name['lt']._loaded_options = None + _globals['_SINT32RULES'].fields_by_name['lt']._serialized_options = b'\302Hz\nx\n\tsint32.lt\032k!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'' + _globals['_SINT32RULES'].fields_by_name['lte']._loaded_options = None + _globals['_SINT32RULES'].fields_by_name['lte']._serialized_options = b'\302H\211\001\n\206\001\n\nsint32.lte\032x!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'' + _globals['_SINT32RULES'].fields_by_name['gt']._loaded_options = None + _globals['_SINT32RULES'].fields_by_name['gt']._serialized_options = b'\302H\211\007\n{\n\tsint32.gt\032n!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\264\001\n\014sint32.gt_lt\032\243\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\274\001\n\026sint32.gt_lt_exclusive\032\241\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\304\001\n\rsint32.gt_lte\032\262\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\314\001\n\027sint32.gt_lte_exclusive\032\260\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' + _globals['_SINT32RULES'].fields_by_name['gte']._loaded_options = None + _globals['_SINT32RULES'].fields_by_name['gte']._serialized_options = b'\302H\324\007\n\211\001\n\nsint32.gte\032{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\303\001\n\rsint32.gte_lt\032\261\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\313\001\n\027sint32.gte_lt_exclusive\032\257\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\323\001\n\016sint32.gte_lte\032\300\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\333\001\n\030sint32.gte_lte_exclusive\032\276\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' + _globals['_SINT32RULES'].fields_by_name['in']._loaded_options = None + _globals['_SINT32RULES'].fields_by_name['in']._serialized_options = b'\302Hq\no\n\tsint32.in\032b!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_SINT32RULES'].fields_by_name['not_in']._loaded_options = None + _globals['_SINT32RULES'].fields_by_name['not_in']._serialized_options = b'\302Hd\nb\n\rsint32.not_in\032Qthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'' + _globals['_SINT32RULES'].fields_by_name['example']._loaded_options = None + _globals['_SINT32RULES'].fields_by_name['example']._serialized_options = b'\302H\030\n\026\n\016sint32.example\032\004true' + _globals['_SINT64RULES'].fields_by_name['const']._loaded_options = None + _globals['_SINT64RULES'].fields_by_name['const']._serialized_options = b'\302Hr\np\n\014sint64.const\032`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_SINT64RULES'].fields_by_name['lt']._loaded_options = None + _globals['_SINT64RULES'].fields_by_name['lt']._serialized_options = b'\302Hz\nx\n\tsint64.lt\032k!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'' + _globals['_SINT64RULES'].fields_by_name['lte']._loaded_options = None + _globals['_SINT64RULES'].fields_by_name['lte']._serialized_options = b'\302H\211\001\n\206\001\n\nsint64.lte\032x!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'' + _globals['_SINT64RULES'].fields_by_name['gt']._loaded_options = None + _globals['_SINT64RULES'].fields_by_name['gt']._serialized_options = b'\302H\211\007\n{\n\tsint64.gt\032n!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\264\001\n\014sint64.gt_lt\032\243\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\274\001\n\026sint64.gt_lt_exclusive\032\241\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\304\001\n\rsint64.gt_lte\032\262\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\314\001\n\027sint64.gt_lte_exclusive\032\260\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' + _globals['_SINT64RULES'].fields_by_name['gte']._loaded_options = None + _globals['_SINT64RULES'].fields_by_name['gte']._serialized_options = b'\302H\324\007\n\211\001\n\nsint64.gte\032{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\303\001\n\rsint64.gte_lt\032\261\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\313\001\n\027sint64.gte_lt_exclusive\032\257\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\323\001\n\016sint64.gte_lte\032\300\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\333\001\n\030sint64.gte_lte_exclusive\032\276\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' + _globals['_SINT64RULES'].fields_by_name['in']._loaded_options = None + _globals['_SINT64RULES'].fields_by_name['in']._serialized_options = b'\302Hq\no\n\tsint64.in\032b!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_SINT64RULES'].fields_by_name['not_in']._loaded_options = None + _globals['_SINT64RULES'].fields_by_name['not_in']._serialized_options = b'\302Hd\nb\n\rsint64.not_in\032Qthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'' + _globals['_SINT64RULES'].fields_by_name['example']._loaded_options = None + _globals['_SINT64RULES'].fields_by_name['example']._serialized_options = b'\302H\030\n\026\n\016sint64.example\032\004true' + _globals['_FIXED32RULES'].fields_by_name['const']._loaded_options = None + _globals['_FIXED32RULES'].fields_by_name['const']._serialized_options = b'\302Hs\nq\n\rfixed32.const\032`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_FIXED32RULES'].fields_by_name['lt']._loaded_options = None + _globals['_FIXED32RULES'].fields_by_name['lt']._serialized_options = b'\302H{\ny\n\nfixed32.lt\032k!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'' + _globals['_FIXED32RULES'].fields_by_name['lte']._loaded_options = None + _globals['_FIXED32RULES'].fields_by_name['lte']._serialized_options = b'\302H\212\001\n\207\001\n\013fixed32.lte\032x!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'' + _globals['_FIXED32RULES'].fields_by_name['gt']._loaded_options = None + _globals['_FIXED32RULES'].fields_by_name['gt']._serialized_options = b'\302H\216\007\n|\n\nfixed32.gt\032n!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\265\001\n\rfixed32.gt_lt\032\243\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\275\001\n\027fixed32.gt_lt_exclusive\032\241\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\305\001\n\016fixed32.gt_lte\032\262\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\315\001\n\030fixed32.gt_lte_exclusive\032\260\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' + _globals['_FIXED32RULES'].fields_by_name['gte']._loaded_options = None + _globals['_FIXED32RULES'].fields_by_name['gte']._serialized_options = b'\302H\331\007\n\212\001\n\013fixed32.gte\032{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\304\001\n\016fixed32.gte_lt\032\261\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\314\001\n\030fixed32.gte_lt_exclusive\032\257\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\324\001\n\017fixed32.gte_lte\032\300\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\334\001\n\031fixed32.gte_lte_exclusive\032\276\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' + _globals['_FIXED32RULES'].fields_by_name['in']._loaded_options = None + _globals['_FIXED32RULES'].fields_by_name['in']._serialized_options = b'\302Hr\np\n\nfixed32.in\032b!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_FIXED32RULES'].fields_by_name['not_in']._loaded_options = None + _globals['_FIXED32RULES'].fields_by_name['not_in']._serialized_options = b'\302He\nc\n\016fixed32.not_in\032Qthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'' + _globals['_FIXED32RULES'].fields_by_name['example']._loaded_options = None + _globals['_FIXED32RULES'].fields_by_name['example']._serialized_options = b'\302H\031\n\027\n\017fixed32.example\032\004true' + _globals['_FIXED64RULES'].fields_by_name['const']._loaded_options = None + _globals['_FIXED64RULES'].fields_by_name['const']._serialized_options = b'\302Hs\nq\n\rfixed64.const\032`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_FIXED64RULES'].fields_by_name['lt']._loaded_options = None + _globals['_FIXED64RULES'].fields_by_name['lt']._serialized_options = b'\302H{\ny\n\nfixed64.lt\032k!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'' + _globals['_FIXED64RULES'].fields_by_name['lte']._loaded_options = None + _globals['_FIXED64RULES'].fields_by_name['lte']._serialized_options = b'\302H\212\001\n\207\001\n\013fixed64.lte\032x!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'' + _globals['_FIXED64RULES'].fields_by_name['gt']._loaded_options = None + _globals['_FIXED64RULES'].fields_by_name['gt']._serialized_options = b'\302H\216\007\n|\n\nfixed64.gt\032n!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\265\001\n\rfixed64.gt_lt\032\243\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\275\001\n\027fixed64.gt_lt_exclusive\032\241\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\305\001\n\016fixed64.gt_lte\032\262\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\315\001\n\030fixed64.gt_lte_exclusive\032\260\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' + _globals['_FIXED64RULES'].fields_by_name['gte']._loaded_options = None + _globals['_FIXED64RULES'].fields_by_name['gte']._serialized_options = b'\302H\331\007\n\212\001\n\013fixed64.gte\032{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\304\001\n\016fixed64.gte_lt\032\261\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\314\001\n\030fixed64.gte_lt_exclusive\032\257\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\324\001\n\017fixed64.gte_lte\032\300\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\334\001\n\031fixed64.gte_lte_exclusive\032\276\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' + _globals['_FIXED64RULES'].fields_by_name['in']._loaded_options = None + _globals['_FIXED64RULES'].fields_by_name['in']._serialized_options = b'\302Hr\np\n\nfixed64.in\032b!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_FIXED64RULES'].fields_by_name['not_in']._loaded_options = None + _globals['_FIXED64RULES'].fields_by_name['not_in']._serialized_options = b'\302He\nc\n\016fixed64.not_in\032Qthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'' + _globals['_FIXED64RULES'].fields_by_name['example']._loaded_options = None + _globals['_FIXED64RULES'].fields_by_name['example']._serialized_options = b'\302H\031\n\027\n\017fixed64.example\032\004true' + _globals['_SFIXED32RULES'].fields_by_name['const']._loaded_options = None + _globals['_SFIXED32RULES'].fields_by_name['const']._serialized_options = b'\302Ht\nr\n\016sfixed32.const\032`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_SFIXED32RULES'].fields_by_name['lt']._loaded_options = None + _globals['_SFIXED32RULES'].fields_by_name['lt']._serialized_options = b'\302H|\nz\n\013sfixed32.lt\032k!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'' + _globals['_SFIXED32RULES'].fields_by_name['lte']._loaded_options = None + _globals['_SFIXED32RULES'].fields_by_name['lte']._serialized_options = b'\302H\213\001\n\210\001\n\014sfixed32.lte\032x!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'' + _globals['_SFIXED32RULES'].fields_by_name['gt']._loaded_options = None + _globals['_SFIXED32RULES'].fields_by_name['gt']._serialized_options = b'\302H\223\007\n}\n\013sfixed32.gt\032n!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\266\001\n\016sfixed32.gt_lt\032\243\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\276\001\n\030sfixed32.gt_lt_exclusive\032\241\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\306\001\n\017sfixed32.gt_lte\032\262\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\316\001\n\031sfixed32.gt_lte_exclusive\032\260\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' + _globals['_SFIXED32RULES'].fields_by_name['gte']._loaded_options = None + _globals['_SFIXED32RULES'].fields_by_name['gte']._serialized_options = b'\302H\336\007\n\213\001\n\014sfixed32.gte\032{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\305\001\n\017sfixed32.gte_lt\032\261\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\315\001\n\031sfixed32.gte_lt_exclusive\032\257\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\325\001\n\020sfixed32.gte_lte\032\300\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\335\001\n\032sfixed32.gte_lte_exclusive\032\276\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' + _globals['_SFIXED32RULES'].fields_by_name['in']._loaded_options = None + _globals['_SFIXED32RULES'].fields_by_name['in']._serialized_options = b'\302Hs\nq\n\013sfixed32.in\032b!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_SFIXED32RULES'].fields_by_name['not_in']._loaded_options = None + _globals['_SFIXED32RULES'].fields_by_name['not_in']._serialized_options = b'\302Hf\nd\n\017sfixed32.not_in\032Qthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'' + _globals['_SFIXED32RULES'].fields_by_name['example']._loaded_options = None + _globals['_SFIXED32RULES'].fields_by_name['example']._serialized_options = b'\302H\032\n\030\n\020sfixed32.example\032\004true' + _globals['_SFIXED64RULES'].fields_by_name['const']._loaded_options = None + _globals['_SFIXED64RULES'].fields_by_name['const']._serialized_options = b'\302Ht\nr\n\016sfixed64.const\032`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_SFIXED64RULES'].fields_by_name['lt']._loaded_options = None + _globals['_SFIXED64RULES'].fields_by_name['lt']._serialized_options = b'\302H|\nz\n\013sfixed64.lt\032k!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'' + _globals['_SFIXED64RULES'].fields_by_name['lte']._loaded_options = None + _globals['_SFIXED64RULES'].fields_by_name['lte']._serialized_options = b'\302H\213\001\n\210\001\n\014sfixed64.lte\032x!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'' + _globals['_SFIXED64RULES'].fields_by_name['gt']._loaded_options = None + _globals['_SFIXED64RULES'].fields_by_name['gt']._serialized_options = b'\302H\223\007\n}\n\013sfixed64.gt\032n!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\266\001\n\016sfixed64.gt_lt\032\243\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\276\001\n\030sfixed64.gt_lt_exclusive\032\241\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\306\001\n\017sfixed64.gt_lte\032\262\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\316\001\n\031sfixed64.gt_lte_exclusive\032\260\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' + _globals['_SFIXED64RULES'].fields_by_name['gte']._loaded_options = None + _globals['_SFIXED64RULES'].fields_by_name['gte']._serialized_options = b'\302H\336\007\n\213\001\n\014sfixed64.gte\032{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\305\001\n\017sfixed64.gte_lt\032\261\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\315\001\n\031sfixed64.gte_lt_exclusive\032\257\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\325\001\n\020sfixed64.gte_lte\032\300\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\335\001\n\032sfixed64.gte_lte_exclusive\032\276\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' + _globals['_SFIXED64RULES'].fields_by_name['in']._loaded_options = None + _globals['_SFIXED64RULES'].fields_by_name['in']._serialized_options = b'\302Hs\nq\n\013sfixed64.in\032b!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_SFIXED64RULES'].fields_by_name['not_in']._loaded_options = None + _globals['_SFIXED64RULES'].fields_by_name['not_in']._serialized_options = b'\302Hf\nd\n\017sfixed64.not_in\032Qthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'' + _globals['_SFIXED64RULES'].fields_by_name['example']._loaded_options = None + _globals['_SFIXED64RULES'].fields_by_name['example']._serialized_options = b'\302H\032\n\030\n\020sfixed64.example\032\004true' + _globals['_BOOLRULES'].fields_by_name['const']._loaded_options = None + _globals['_BOOLRULES'].fields_by_name['const']._serialized_options = b'\302Hp\nn\n\nbool.const\032`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_BOOLRULES'].fields_by_name['example']._loaded_options = None + _globals['_BOOLRULES'].fields_by_name['example']._serialized_options = b'\302H\026\n\024\n\014bool.example\032\004true' + _globals['_STRINGRULES'].fields_by_name['const']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['const']._serialized_options = b'\302Ht\nr\n\014string.const\032bthis != getField(rules, \'const\') ? \'value must equal `%s`\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_STRINGRULES'].fields_by_name['len']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['len']._serialized_options = b'\302Hn\nl\n\nstring.len\032^uint(this.size()) != rules.len ? \'value length must be %s characters\'.format([rules.len]) : \'\'' + _globals['_STRINGRULES'].fields_by_name['min_len']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['min_len']._serialized_options = b'\302H\203\001\n\200\001\n\016string.min_len\032nuint(this.size()) < rules.min_len ? \'value length must be at least %s characters\'.format([rules.min_len]) : \'\'' + _globals['_STRINGRULES'].fields_by_name['max_len']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['max_len']._serialized_options = b'\302H\201\001\n\177\n\016string.max_len\032muint(this.size()) > rules.max_len ? \'value length must be at most %s characters\'.format([rules.max_len]) : \'\'' + _globals['_STRINGRULES'].fields_by_name['len_bytes']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['len_bytes']._serialized_options = b'\302H\203\001\n\200\001\n\020string.len_bytes\032luint(bytes(this).size()) != rules.len_bytes ? \'value length must be %s bytes\'.format([rules.len_bytes]) : \'\'' + _globals['_STRINGRULES'].fields_by_name['min_bytes']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['min_bytes']._serialized_options = b'\302H\213\001\n\210\001\n\020string.min_bytes\032tuint(bytes(this).size()) < rules.min_bytes ? \'value length must be at least %s bytes\'.format([rules.min_bytes]) : \'\'' + _globals['_STRINGRULES'].fields_by_name['max_bytes']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['max_bytes']._serialized_options = b'\302H\212\001\n\207\001\n\020string.max_bytes\032suint(bytes(this).size()) > rules.max_bytes ? \'value length must be at most %s bytes\'.format([rules.max_bytes]) : \'\'' + _globals['_STRINGRULES'].fields_by_name['pattern']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['pattern']._serialized_options = b'\302Hy\nw\n\016string.pattern\032e!this.matches(rules.pattern) ? \'value does not match regex pattern `%s`\'.format([rules.pattern]) : \'\'' + _globals['_STRINGRULES'].fields_by_name['prefix']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['prefix']._serialized_options = b'\302Hq\no\n\rstring.prefix\032^!this.startsWith(rules.prefix) ? \'value does not have prefix `%s`\'.format([rules.prefix]) : \'\'' + _globals['_STRINGRULES'].fields_by_name['suffix']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['suffix']._serialized_options = b'\302Ho\nm\n\rstring.suffix\032\\!this.endsWith(rules.suffix) ? \'value does not have suffix `%s`\'.format([rules.suffix]) : \'\'' + _globals['_STRINGRULES'].fields_by_name['contains']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['contains']._serialized_options = b'\302H{\ny\n\017string.contains\032f!this.contains(rules.contains) ? \'value does not contain substring `%s`\'.format([rules.contains]) : \'\'' + _globals['_STRINGRULES'].fields_by_name['not_contains']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['not_contains']._serialized_options = b'\302H~\n|\n\023string.not_contains\032ethis.contains(rules.not_contains) ? \'value contains substring `%s`\'.format([rules.not_contains]) : \'\'' + _globals['_STRINGRULES'].fields_by_name['in']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['in']._serialized_options = b'\302Hq\no\n\tstring.in\032b!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_STRINGRULES'].fields_by_name['not_in']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['not_in']._serialized_options = b'\302Hd\nb\n\rstring.not_in\032Qthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'' + _globals['_STRINGRULES'].fields_by_name['email']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['email']._serialized_options = b'\302H\311\001\na\n\014string.email\022#value must be a valid email address\032,!rules.email || this == \'\' || this.isEmail()\nd\n\022string.email_empty\0222value is empty, which is not a valid email address\032\032!rules.email || this != \'\'' + _globals['_STRINGRULES'].fields_by_name['hostname']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['hostname']._serialized_options = b'\302H\316\001\ne\n\017string.hostname\022\036value must be a valid hostname\0322!rules.hostname || this == \'\' || this.isHostname()\ne\n\025string.hostname_empty\022-value is empty, which is not a valid hostname\032\035!rules.hostname || this != \'\'' + _globals['_STRINGRULES'].fields_by_name['ip']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['ip']._serialized_options = b'\302H\264\001\nU\n\tstring.ip\022 value must be a valid IP address\032&!rules.ip || this == \'\' || this.isIp()\n[\n\017string.ip_empty\022/value is empty, which is not a valid IP address\032\027!rules.ip || this != \'\'' + _globals['_STRINGRULES'].fields_by_name['ipv4']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['ipv4']._serialized_options = b'\302H\301\001\n\\\n\013string.ipv4\022\"value must be a valid IPv4 address\032)!rules.ipv4 || this == \'\' || this.isIp(4)\na\n\021string.ipv4_empty\0221value is empty, which is not a valid IPv4 address\032\031!rules.ipv4 || this != \'\'' + _globals['_STRINGRULES'].fields_by_name['ipv6']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['ipv6']._serialized_options = b'\302H\301\001\n\\\n\013string.ipv6\022\"value must be a valid IPv6 address\032)!rules.ipv6 || this == \'\' || this.isIp(6)\na\n\021string.ipv6_empty\0221value is empty, which is not a valid IPv6 address\032\031!rules.ipv6 || this != \'\'' + _globals['_STRINGRULES'].fields_by_name['uri']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['uri']._serialized_options = b'\302H\253\001\nQ\n\nstring.uri\022\031value must be a valid URI\032(!rules.uri || this == \'\' || this.isUri()\nV\n\020string.uri_empty\022(value is empty, which is not a valid URI\032\030!rules.uri || this != \'\'' + _globals['_STRINGRULES'].fields_by_name['uri_ref']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['uri_ref']._serialized_options = b'\302HZ\nX\n\016string.uri_ref\022#value must be a valid URI Reference\032!!rules.uri_ref || this.isUriRef()' + _globals['_STRINGRULES'].fields_by_name['address']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['address']._serialized_options = b'\302H\370\001\n\201\001\n\016string.address\022-value must be a valid hostname, or ip address\032@!rules.address || this == \'\' || this.isHostname() || this.isIp()\nr\n\024string.address_empty\022!rules.ipv4_with_prefixlen || this == \'\' || this.isIpPrefix(4)\n\222\001\n string.ipv4_with_prefixlen_empty\022Dvalue is empty, which is not a valid IPv4 address with prefix length\032(!rules.ipv4_with_prefixlen || this != \'\'' + _globals['_STRINGRULES'].fields_by_name['ipv6_with_prefixlen']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['ipv6_with_prefixlen']._serialized_options = b'\302H\253\002\n\223\001\n\032string.ipv6_with_prefixlen\0225value must be a valid IPv6 address with prefix length\032>!rules.ipv6_with_prefixlen || this == \'\' || this.isIpPrefix(6)\n\222\001\n string.ipv6_with_prefixlen_empty\022Dvalue is empty, which is not a valid IPv6 address with prefix length\032(!rules.ipv6_with_prefixlen || this != \'\'' + _globals['_STRINGRULES'].fields_by_name['ip_prefix']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['ip_prefix']._serialized_options = b'\302H\330\001\nl\n\020string.ip_prefix\022\037value must be a valid IP prefix\0327!rules.ip_prefix || this == \'\' || this.isIpPrefix(true)\nh\n\026string.ip_prefix_empty\022.value is empty, which is not a valid IP prefix\032\036!rules.ip_prefix || this != \'\'' + _globals['_STRINGRULES'].fields_by_name['ipv4_prefix']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['ipv4_prefix']._serialized_options = b'\302H\347\001\nu\n\022string.ipv4_prefix\022!value must be a valid IPv4 prefix\032!rules.host_and_port || this == \'\' || this.isHostAndPort(true)\ny\n\032string.host_and_port_empty\0227value is empty, which is not a valid host and port pair\032\"!rules.host_and_port || this != \'\'' + _globals['_STRINGRULES'].fields_by_name['ulid']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['ulid']._serialized_options = b'\302H\340\001\n\202\001\n\013string.ulid\022\032value must be a valid ULID\032W!rules.ulid || this == \'\' || this.matches(\'^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$\')\nY\n\021string.ulid_empty\022)value is empty, which is not a valid ULID\032\031!rules.ulid || this != \'\'' + _globals['_STRINGRULES'].fields_by_name['well_known_regex']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['well_known_regex']._serialized_options = b'\302H\355\004\n\360\001\n#string.well_known_regex.header_name\022&value must be a valid HTTP header name\032\240\001rules.well_known_regex != 1 || this == \'\' || this.matches(!has(rules.strict) || rules.strict ?\'^:?[0-9a-zA-Z!#$%&\\\'*+-.^_|~\\x60]+$\' :\'^[^\\u0000\\u000A\\u000D]+$\')\n\215\001\n)string.well_known_regex.header_name_empty\0225value is empty, which is not a valid HTTP header name\032)rules.well_known_regex != 1 || this != \'\'\n\347\001\n$string.well_known_regex.header_value\022\'value must be a valid HTTP header value\032\225\001rules.well_known_regex != 2 || this.matches(!has(rules.strict) || rules.strict ?\'^[^\\u0000-\\u0008\\u000A-\\u001F\\u007F]*$\' :\'^[^\\u0000\\u000A\\u000D]*$\')' + _globals['_STRINGRULES'].fields_by_name['example']._loaded_options = None + _globals['_STRINGRULES'].fields_by_name['example']._serialized_options = b'\302H\030\n\026\n\016string.example\032\004true' + _globals['_BYTESRULES'].fields_by_name['const']._loaded_options = None + _globals['_BYTESRULES'].fields_by_name['const']._serialized_options = b'\302Hn\nl\n\013bytes.const\032]this != getField(rules, \'const\') ? \'value must be %x\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_BYTESRULES'].fields_by_name['len']._loaded_options = None + _globals['_BYTESRULES'].fields_by_name['len']._serialized_options = b'\302Hh\nf\n\tbytes.len\032Yuint(this.size()) != rules.len ? \'value length must be %s bytes\'.format([rules.len]) : \'\'' + _globals['_BYTESRULES'].fields_by_name['min_len']._loaded_options = None + _globals['_BYTESRULES'].fields_by_name['min_len']._serialized_options = b'\302H|\nz\n\rbytes.min_len\032iuint(this.size()) < rules.min_len ? \'value length must be at least %s bytes\'.format([rules.min_len]) : \'\'' + _globals['_BYTESRULES'].fields_by_name['max_len']._loaded_options = None + _globals['_BYTESRULES'].fields_by_name['max_len']._serialized_options = b'\302Ht\nr\n\rbytes.max_len\032auint(this.size()) > rules.max_len ? \'value must be at most %s bytes\'.format([rules.max_len]) : \'\'' + _globals['_BYTESRULES'].fields_by_name['pattern']._loaded_options = None + _globals['_BYTESRULES'].fields_by_name['pattern']._serialized_options = b'\302H|\nz\n\rbytes.pattern\032i!string(this).matches(rules.pattern) ? \'value must match regex pattern `%s`\'.format([rules.pattern]) : \'\'' + _globals['_BYTESRULES'].fields_by_name['prefix']._loaded_options = None + _globals['_BYTESRULES'].fields_by_name['prefix']._serialized_options = b'\302Hn\nl\n\014bytes.prefix\032\\!this.startsWith(rules.prefix) ? \'value does not have prefix %x\'.format([rules.prefix]) : \'\'' + _globals['_BYTESRULES'].fields_by_name['suffix']._loaded_options = None + _globals['_BYTESRULES'].fields_by_name['suffix']._serialized_options = b'\302Hl\nj\n\014bytes.suffix\032Z!this.endsWith(rules.suffix) ? \'value does not have suffix %x\'.format([rules.suffix]) : \'\'' + _globals['_BYTESRULES'].fields_by_name['contains']._loaded_options = None + _globals['_BYTESRULES'].fields_by_name['contains']._serialized_options = b'\302Hn\nl\n\016bytes.contains\032Z!this.contains(rules.contains) ? \'value does not contain %x\'.format([rules.contains]) : \'\'' + _globals['_BYTESRULES'].fields_by_name['in']._loaded_options = None + _globals['_BYTESRULES'].fields_by_name['in']._serialized_options = b'\302H\226\001\n\223\001\n\010bytes.in\032\206\001getField(rules, \'in\').size() > 0 && !(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_BYTESRULES'].fields_by_name['not_in']._loaded_options = None + _globals['_BYTESRULES'].fields_by_name['not_in']._serialized_options = b'\302Hc\na\n\014bytes.not_in\032Qthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'' + _globals['_BYTESRULES'].fields_by_name['ip']._loaded_options = None + _globals['_BYTESRULES'].fields_by_name['ip']._serialized_options = b'\302H\330\001\nt\n\010bytes.ip\022 value must be a valid IP address\032F!rules.ip || this.size() == 0 || this.size() == 4 || this.size() == 16\n`\n\016bytes.ip_empty\022/value is empty, which is not a valid IP address\032\035!rules.ip || this.size() != 0' + _globals['_BYTESRULES'].fields_by_name['ipv4']._loaded_options = None + _globals['_BYTESRULES'].fields_by_name['ipv4']._serialized_options = b'\302H\317\001\ne\n\nbytes.ipv4\022\"value must be a valid IPv4 address\0323!rules.ipv4 || this.size() == 0 || this.size() == 4\nf\n\020bytes.ipv4_empty\0221value is empty, which is not a valid IPv4 address\032\037!rules.ipv4 || this.size() != 0' + _globals['_BYTESRULES'].fields_by_name['ipv6']._loaded_options = None + _globals['_BYTESRULES'].fields_by_name['ipv6']._serialized_options = b'\302H\320\001\nf\n\nbytes.ipv6\022\"value must be a valid IPv6 address\0324!rules.ipv6 || this.size() == 0 || this.size() == 16\nf\n\020bytes.ipv6_empty\0221value is empty, which is not a valid IPv6 address\032\037!rules.ipv6 || this.size() != 0' + _globals['_BYTESRULES'].fields_by_name['uuid']._loaded_options = None + _globals['_BYTESRULES'].fields_by_name['uuid']._serialized_options = b'\302H\300\001\n^\n\nbytes.uuid\022\032value must be a valid UUID\0324!rules.uuid || this.size() == 0 || this.size() == 16\n^\n\020bytes.uuid_empty\022)value is empty, which is not a valid UUID\032\037!rules.uuid || this.size() != 0' + _globals['_BYTESRULES'].fields_by_name['example']._loaded_options = None + _globals['_BYTESRULES'].fields_by_name['example']._serialized_options = b'\302H\027\n\025\n\rbytes.example\032\004true' + _globals['_ENUMRULES'].fields_by_name['const']._loaded_options = None + _globals['_ENUMRULES'].fields_by_name['const']._serialized_options = b'\302Hp\nn\n\nenum.const\032`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_ENUMRULES'].fields_by_name['in']._loaded_options = None + _globals['_ENUMRULES'].fields_by_name['in']._serialized_options = b'\302Ho\nm\n\007enum.in\032b!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_ENUMRULES'].fields_by_name['not_in']._loaded_options = None + _globals['_ENUMRULES'].fields_by_name['not_in']._serialized_options = b'\302Hb\n`\n\013enum.not_in\032Qthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'' + _globals['_ENUMRULES'].fields_by_name['example']._loaded_options = None + _globals['_ENUMRULES'].fields_by_name['example']._serialized_options = b'\302H\026\n\024\n\014enum.example\032\004true' + _globals['_REPEATEDRULES'].fields_by_name['min_items']._loaded_options = None + _globals['_REPEATEDRULES'].fields_by_name['min_items']._serialized_options = b'\302H\206\001\n\203\001\n\022repeated.min_items\032muint(this.size()) < rules.min_items ? \'value must contain at least %d item(s)\'.format([rules.min_items]) : \'\'' + _globals['_REPEATEDRULES'].fields_by_name['max_items']._loaded_options = None + _globals['_REPEATEDRULES'].fields_by_name['max_items']._serialized_options = b'\302H\212\001\n\207\001\n\022repeated.max_items\032quint(this.size()) > rules.max_items ? \'value must contain no more than %s item(s)\'.format([rules.max_items]) : \'\'' + _globals['_REPEATEDRULES'].fields_by_name['unique']._loaded_options = None + _globals['_REPEATEDRULES'].fields_by_name['unique']._serialized_options = b'\302H]\n[\n\017repeated.unique\022(repeated value must contain unique items\032\036!rules.unique || this.unique()' + _globals['_MAPRULES'].fields_by_name['min_pairs']._loaded_options = None + _globals['_MAPRULES'].fields_by_name['min_pairs']._serialized_options = b'\302Hy\nw\n\rmap.min_pairs\032fuint(this.size()) < rules.min_pairs ? \'map must be at least %d entries\'.format([rules.min_pairs]) : \'\'' + _globals['_MAPRULES'].fields_by_name['max_pairs']._loaded_options = None + _globals['_MAPRULES'].fields_by_name['max_pairs']._serialized_options = b'\302Hx\nv\n\rmap.max_pairs\032euint(this.size()) > rules.max_pairs ? \'map must be at most %d entries\'.format([rules.max_pairs]) : \'\'' + _globals['_DURATIONRULES'].fields_by_name['const']._loaded_options = None + _globals['_DURATIONRULES'].fields_by_name['const']._serialized_options = b'\302Ht\nr\n\016duration.const\032`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_DURATIONRULES'].fields_by_name['lt']._loaded_options = None + _globals['_DURATIONRULES'].fields_by_name['lt']._serialized_options = b'\302H|\nz\n\013duration.lt\032k!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'' + _globals['_DURATIONRULES'].fields_by_name['lte']._loaded_options = None + _globals['_DURATIONRULES'].fields_by_name['lte']._serialized_options = b'\302H\213\001\n\210\001\n\014duration.lte\032x!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'' + _globals['_DURATIONRULES'].fields_by_name['gt']._loaded_options = None + _globals['_DURATIONRULES'].fields_by_name['gt']._serialized_options = b'\302H\223\007\n}\n\013duration.gt\032n!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\266\001\n\016duration.gt_lt\032\243\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\276\001\n\030duration.gt_lt_exclusive\032\241\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\306\001\n\017duration.gt_lte\032\262\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\316\001\n\031duration.gt_lte_exclusive\032\260\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' + _globals['_DURATIONRULES'].fields_by_name['gte']._loaded_options = None + _globals['_DURATIONRULES'].fields_by_name['gte']._serialized_options = b'\302H\336\007\n\213\001\n\014duration.gte\032{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\305\001\n\017duration.gte_lt\032\261\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\315\001\n\031duration.gte_lt_exclusive\032\257\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\325\001\n\020duration.gte_lte\032\300\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\335\001\n\032duration.gte_lte_exclusive\032\276\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' + _globals['_DURATIONRULES'].fields_by_name['in']._loaded_options = None + _globals['_DURATIONRULES'].fields_by_name['in']._serialized_options = b'\302Hs\nq\n\013duration.in\032b!(this in getField(rules, \'in\')) ? \'value must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_DURATIONRULES'].fields_by_name['not_in']._loaded_options = None + _globals['_DURATIONRULES'].fields_by_name['not_in']._serialized_options = b'\302Hf\nd\n\017duration.not_in\032Qthis in rules.not_in ? \'value must not be in list %s\'.format([rules.not_in]) : \'\'' + _globals['_DURATIONRULES'].fields_by_name['example']._loaded_options = None + _globals['_DURATIONRULES'].fields_by_name['example']._serialized_options = b'\302H\032\n\030\n\020duration.example\032\004true' + _globals['_FIELDMASKRULES'].fields_by_name['const']._loaded_options = None + _globals['_FIELDMASKRULES'].fields_by_name['const']._serialized_options = b'\302H\217\001\n\214\001\n\020field_mask.const\032xthis.paths != getField(rules, \'const\').paths ? \'value must equal paths %s\'.format([getField(rules, \'const\').paths]) : \'\'' + _globals['_FIELDMASKRULES'].fields_by_name['in']._loaded_options = None + _globals['_FIELDMASKRULES'].fields_by_name['in']._serialized_options = b'\302H\310\001\n\305\001\n\rfield_mask.in\032\263\001!this.paths.all(p, p in getField(rules, \'in\') || getField(rules, \'in\').exists(f, p.startsWith(f+\'.\'))) ? \'value must only contain paths in %s\'.format([getField(rules, \'in\')]) : \'\'' + _globals['_FIELDMASKRULES'].fields_by_name['not_in']._loaded_options = None + _globals['_FIELDMASKRULES'].fields_by_name['not_in']._serialized_options = b'\302H\336\001\n\333\001\n\021field_mask.not_in\032\305\001!this.paths.all(p, !(p in getField(rules, \'not_in\') || getField(rules, \'not_in\').exists(f, p.startsWith(f+\'.\')))) ? \'value must not contain any paths in %s\'.format([getField(rules, \'not_in\')]) : \'\'' + _globals['_FIELDMASKRULES'].fields_by_name['example']._loaded_options = None + _globals['_FIELDMASKRULES'].fields_by_name['example']._serialized_options = b'\302H\034\n\032\n\022field_mask.example\032\004true' + _globals['_TIMESTAMPRULES'].fields_by_name['const']._loaded_options = None + _globals['_TIMESTAMPRULES'].fields_by_name['const']._serialized_options = b'\302Hu\ns\n\017timestamp.const\032`this != getField(rules, \'const\') ? \'value must equal %s\'.format([getField(rules, \'const\')]) : \'\'' + _globals['_TIMESTAMPRULES'].fields_by_name['lt']._loaded_options = None + _globals['_TIMESTAMPRULES'].fields_by_name['lt']._serialized_options = b'\302H}\n{\n\014timestamp.lt\032k!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'value must be less than %s\'.format([rules.lt]) : \'\'' + _globals['_TIMESTAMPRULES'].fields_by_name['lte']._loaded_options = None + _globals['_TIMESTAMPRULES'].fields_by_name['lte']._serialized_options = b'\302H\214\001\n\211\001\n\rtimestamp.lte\032x!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'value must be less than or equal to %s\'.format([rules.lte]) : \'\'' + _globals['_TIMESTAMPRULES'].fields_by_name['lt_now']._loaded_options = None + _globals['_TIMESTAMPRULES'].fields_by_name['lt_now']._serialized_options = b'\302HW\nU\n\020timestamp.lt_now\032A(rules.lt_now && this > now) ? \'value must be less than now\' : \'\'' + _globals['_TIMESTAMPRULES'].fields_by_name['gt']._loaded_options = None + _globals['_TIMESTAMPRULES'].fields_by_name['gt']._serialized_options = b'\302H\230\007\n~\n\014timestamp.gt\032n!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'value must be greater than %s\'.format([rules.gt]) : \'\'\n\267\001\n\017timestamp.gt_lt\032\243\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'value must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\277\001\n\031timestamp.gt_lt_exclusive\032\241\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'value must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\307\001\n\020timestamp.gt_lte\032\262\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'value must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\317\001\n\032timestamp.gt_lte_exclusive\032\260\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'value must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' + _globals['_TIMESTAMPRULES'].fields_by_name['gte']._loaded_options = None + _globals['_TIMESTAMPRULES'].fields_by_name['gte']._serialized_options = b'\302H\343\007\n\214\001\n\rtimestamp.gte\032{!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'value must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\306\001\n\020timestamp.gte_lt\032\261\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'value must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\316\001\n\032timestamp.gte_lt_exclusive\032\257\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'value must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\326\001\n\021timestamp.gte_lte\032\300\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'value must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\336\001\n\033timestamp.gte_lte_exclusive\032\276\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'value must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' + _globals['_TIMESTAMPRULES'].fields_by_name['gt_now']._loaded_options = None + _globals['_TIMESTAMPRULES'].fields_by_name['gt_now']._serialized_options = b'\302HZ\nX\n\020timestamp.gt_now\032D(rules.gt_now && this < now) ? \'value must be greater than now\' : \'\'' + _globals['_TIMESTAMPRULES'].fields_by_name['within']._loaded_options = None + _globals['_TIMESTAMPRULES'].fields_by_name['within']._serialized_options = b'\302H\210\001\n\205\001\n\020timestamp.within\032qthis < now-rules.within || this > now+rules.within ? \'value must be within %s of now\'.format([rules.within]) : \'\'' + _globals['_TIMESTAMPRULES'].fields_by_name['example']._loaded_options = None + _globals['_TIMESTAMPRULES'].fields_by_name['example']._serialized_options = b'\302H\033\n\031\n\021timestamp.example\032\004true' + _globals['_IGNORE']._serialized_start=55581 + _globals['_IGNORE']._serialized_end=55742 + _globals['_KNOWNREGEX']._serialized_start=55744 + _globals['_KNOWNREGEX']._serialized_end=55854 + _globals['_RULE']._serialized_start=178 + _globals['_RULE']._serialized_end=258 + _globals['_MESSAGERULES']._serialized_start=261 + _globals['_MESSAGERULES']._serialized_end=422 + _globals['_MESSAGEONEOFRULE']._serialized_start=424 + _globals['_MESSAGEONEOFRULE']._serialized_end=494 + _globals['_ONEOFRULES']._serialized_start=496 + _globals['_ONEOFRULES']._serialized_end=536 + _globals['_FIELDRULES']._serialized_start=539 + _globals['_FIELDRULES']._serialized_end=1918 + _globals['_PREDEFINEDRULES']._serialized_start=1920 + _globals['_PREDEFINEDRULES']._serialized_end=2010 + _globals['_FLOATRULES']._serialized_start=2013 + _globals['_FLOATRULES']._serialized_end=5101 + _globals['_DOUBLERULES']._serialized_start=5104 + _globals['_DOUBLERULES']._serialized_end=8210 + _globals['_INT32RULES']._serialized_start=8213 + _globals['_INT32RULES']._serialized_end=10959 + _globals['_INT64RULES']._serialized_start=10962 + _globals['_INT64RULES']._serialized_end=13708 + _globals['_UINT32RULES']._serialized_start=13711 + _globals['_UINT32RULES']._serialized_end=16474 + _globals['_UINT64RULES']._serialized_start=16477 + _globals['_UINT64RULES']._serialized_end=19240 + _globals['_SINT32RULES']._serialized_start=19243 + _globals['_SINT32RULES']._serialized_end=22006 + _globals['_SINT64RULES']._serialized_start=22009 + _globals['_SINT64RULES']._serialized_end=24772 + _globals['_FIXED32RULES']._serialized_start=24775 + _globals['_FIXED32RULES']._serialized_end=27555 + _globals['_FIXED64RULES']._serialized_start=27558 + _globals['_FIXED64RULES']._serialized_end=30338 + _globals['_SFIXED32RULES']._serialized_start=30341 + _globals['_SFIXED32RULES']._serialized_end=33139 + _globals['_SFIXED64RULES']._serialized_start=33142 + _globals['_SFIXED64RULES']._serialized_end=35940 + _globals['_BOOLRULES']._serialized_start=35943 + _globals['_BOOLRULES']._serialized_end=36158 + _globals['_STRINGRULES']._serialized_start=36161 + _globals['_STRINGRULES']._serialized_end=43792 + _globals['_BYTESRULES']._serialized_start=43795 + _globals['_BYTESRULES']._serialized_end=46271 + _globals['_ENUMRULES']._serialized_start=46274 + _globals['_ENUMRULES']._serialized_end=46783 + _globals['_REPEATEDRULES']._serialized_start=46786 + _globals['_REPEATEDRULES']._serialized_end=47328 + _globals['_MAPRULES']._serialized_start=47331 + _globals['_MAPRULES']._serialized_end=47759 + _globals['_ANYRULES']._serialized_start=47761 + _globals['_ANYRULES']._serialized_end=47810 + _globals['_DURATIONRULES']._serialized_start=47813 + _globals['_DURATIONRULES']._serialized_end=50827 + _globals['_FIELDMASKRULES']._serialized_start=50830 + _globals['_FIELDMASKRULES']._serialized_end=51622 + _globals['_TIMESTAMPRULES']._serialized_start=51625 + _globals['_TIMESTAMPRULES']._serialized_end=54771 + _globals['_VIOLATIONS']._serialized_start=54773 + _globals['_VIOLATIONS']._serialized_end=54842 + _globals['_VIOLATION']._serialized_start=54845 + _globals['_VIOLATION']._serialized_end=55042 + _globals['_FIELDPATH']._serialized_start=55044 + _globals['_FIELDPATH']._serialized_end=55115 + _globals['_FIELDPATHELEMENT']._serialized_start=55118 + _globals['_FIELDPATHELEMENT']._serialized_end=55578 +# @@protoc_insertion_point(module_scope) diff --git a/python/fits/api/v1/common_pb2.py b/python/fits/api/v1/common_pb2.py index 12c69b1..9aa1b6e 100644 --- a/python/fits/api/v1/common_pb2.py +++ b/python/fits/api/v1/common_pb2.py @@ -2,7 +2,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: fits/api/v1/common.proto -# Protobuf Python Version: 7.34.1 +# Protobuf Python Version: 7.36.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -12,7 +12,7 @@ _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, 7, - 34, + 36, 1, '', 'fits/api/v1/common.proto' diff --git a/python/fits/api/v1/health_connect.py b/python/fits/api/v1/health_connect.py index bfbb0e0..d4eaf61 100644 --- a/python/fits/api/v1/health_connect.py +++ b/python/fits/api/v1/health_connect.py @@ -7,6 +7,8 @@ from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code +from connectrpc.codec import Codec +from connectrpc.compression import Compression from connectrpc.errors import ConnectError from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo @@ -21,7 +23,7 @@ async def get(self, request: fits_dot_api_dot_v1_dot_health__pb2.HealthServiceGe class HealthServiceASGIApplication(ConnectASGIApplication[HealthService]): - def __init__(self, service: HealthService | AsyncGenerator[HealthService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None) -> None: + def __init__(self, service: HealthService | AsyncGenerator[HealthService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -38,6 +40,8 @@ def __init__(self, service: HealthService | AsyncGenerator[HealthService], *, in }, interceptors=interceptors, read_max_bytes=read_max_bytes, + compressions=compressions, + codecs=codecs, ) @property @@ -68,13 +72,16 @@ async def get( ) + + + class HealthServiceSync(Protocol): def get(self, request: fits_dot_api_dot_v1_dot_health__pb2.HealthServiceGetRequest, ctx: RequestContext) -> fits_dot_api_dot_v1_dot_health__pb2.HealthServiceGetResponse: raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") class HealthServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: HealthServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None) -> None: + def __init__(self, service: HealthServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: super().__init__( endpoints={ "/fits.api.v1.HealthService/Get": EndpointSync.unary( @@ -90,6 +97,8 @@ def __init__(self, service: HealthServiceSync, interceptors: Iterable[Intercepto }, interceptors=interceptors, read_max_bytes=read_max_bytes, + compressions=compressions, + codecs=codecs, ) @property @@ -118,3 +127,5 @@ def get( headers=headers, timeout_ms=timeout_ms, ) + + diff --git a/python/fits/api/v1/health_pb2.py b/python/fits/api/v1/health_pb2.py index a4c98f4..e0e3ddd 100644 --- a/python/fits/api/v1/health_pb2.py +++ b/python/fits/api/v1/health_pb2.py @@ -2,7 +2,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: fits/api/v1/health.proto -# Protobuf Python Version: 7.34.1 +# Protobuf Python Version: 7.36.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -12,7 +12,7 @@ _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, 7, - 34, + 36, 1, '', 'fits/api/v1/health.proto' diff --git a/python/fits/api/v1/ip_connect.py b/python/fits/api/v1/ip_connect.py index bafe90e..ac905ab 100644 --- a/python/fits/api/v1/ip_connect.py +++ b/python/fits/api/v1/ip_connect.py @@ -7,6 +7,8 @@ from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code +from connectrpc.codec import Codec +from connectrpc.compression import Compression from connectrpc.errors import ConnectError from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo @@ -33,7 +35,7 @@ async def delete(self, request: fits_dot_api_dot_v1_dot_ip__pb2.IPServiceDeleteR class IPServiceASGIApplication(ConnectASGIApplication[IPService]): - def __init__(self, service: IPService | AsyncGenerator[IPService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None) -> None: + def __init__(self, service: IPService | AsyncGenerator[IPService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -90,6 +92,8 @@ def __init__(self, service: IPService | AsyncGenerator[IPService], *, intercepto }, interceptors=interceptors, read_max_bytes=read_max_bytes, + compressions=compressions, + codecs=codecs, ) @property @@ -200,6 +204,9 @@ async def delete( ) + + + class IPServiceSync(Protocol): def get(self, request: fits_dot_api_dot_v1_dot_ip__pb2.IPServiceGetRequest, ctx: RequestContext) -> fits_dot_api_dot_v1_dot_ip__pb2.IPServiceGetResponse: raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") @@ -214,7 +221,7 @@ def delete(self, request: fits_dot_api_dot_v1_dot_ip__pb2.IPServiceDeleteRequest class IPServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: IPServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None) -> None: + def __init__(self, service: IPServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: super().__init__( endpoints={ "/fits.api.v1.IPService/Get": EndpointSync.unary( @@ -270,6 +277,8 @@ def __init__(self, service: IPServiceSync, interceptors: Iterable[InterceptorSyn }, interceptors=interceptors, read_max_bytes=read_max_bytes, + compressions=compressions, + codecs=codecs, ) @property @@ -378,3 +387,5 @@ def delete( headers=headers, timeout_ms=timeout_ms, ) + + diff --git a/python/fits/api/v1/ip_pb2.py b/python/fits/api/v1/ip_pb2.py index 3a3132d..bc71c16 100644 --- a/python/fits/api/v1/ip_pb2.py +++ b/python/fits/api/v1/ip_pb2.py @@ -2,7 +2,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: fits/api/v1/ip.proto -# Protobuf Python Version: 7.34.1 +# Protobuf Python Version: 7.36.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -12,7 +12,7 @@ _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, 7, - 34, + 36, 1, '', 'fits/api/v1/ip.proto' diff --git a/python/fits/api/v1/method_connect.py b/python/fits/api/v1/method_connect.py index 15782cf..488fdc7 100644 --- a/python/fits/api/v1/method_connect.py +++ b/python/fits/api/v1/method_connect.py @@ -7,6 +7,8 @@ from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code +from connectrpc.codec import Codec +from connectrpc.compression import Compression from connectrpc.errors import ConnectError from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo @@ -24,7 +26,7 @@ async def token_scoped_list(self, request: fits_dot_api_dot_v1_dot_method__pb2.M class MethodServiceASGIApplication(ConnectASGIApplication[MethodService]): - def __init__(self, service: MethodService | AsyncGenerator[MethodService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None) -> None: + def __init__(self, service: MethodService | AsyncGenerator[MethodService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -51,6 +53,8 @@ def __init__(self, service: MethodService | AsyncGenerator[MethodService], *, in }, interceptors=interceptors, read_max_bytes=read_max_bytes, + compressions=compressions, + codecs=codecs, ) @property @@ -101,6 +105,9 @@ async def token_scoped_list( ) + + + class MethodServiceSync(Protocol): def list(self, request: fits_dot_api_dot_v1_dot_method__pb2.MethodServiceListRequest, ctx: RequestContext) -> fits_dot_api_dot_v1_dot_method__pb2.MethodServiceListResponse: raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") @@ -109,7 +116,7 @@ def token_scoped_list(self, request: fits_dot_api_dot_v1_dot_method__pb2.MethodS class MethodServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: MethodServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None) -> None: + def __init__(self, service: MethodServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: super().__init__( endpoints={ "/fits.api.v1.MethodService/List": EndpointSync.unary( @@ -135,6 +142,8 @@ def __init__(self, service: MethodServiceSync, interceptors: Iterable[Intercepto }, interceptors=interceptors, read_max_bytes=read_max_bytes, + compressions=compressions, + codecs=codecs, ) @property @@ -183,3 +192,5 @@ def token_scoped_list( headers=headers, timeout_ms=timeout_ms, ) + + diff --git a/python/fits/api/v1/method_pb2.py b/python/fits/api/v1/method_pb2.py index dc86337..a58e59c 100644 --- a/python/fits/api/v1/method_pb2.py +++ b/python/fits/api/v1/method_pb2.py @@ -2,7 +2,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: fits/api/v1/method.proto -# Protobuf Python Version: 7.34.1 +# Protobuf Python Version: 7.36.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -12,7 +12,7 @@ _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, 7, - 34, + 36, 1, '', 'fits/api/v1/method.proto' diff --git a/python/fits/api/v1/predefined_rules_pb2.py b/python/fits/api/v1/predefined_rules_pb2.py index 85e4c3b..dcbcd24 100644 --- a/python/fits/api/v1/predefined_rules_pb2.py +++ b/python/fits/api/v1/predefined_rules_pb2.py @@ -2,7 +2,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: fits/api/v1/predefined_rules.proto -# Protobuf Python Version: 7.34.1 +# Protobuf Python Version: 7.36.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -12,7 +12,7 @@ _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, 7, - 34, + 36, 1, '', 'fits/api/v1/predefined_rules.proto' diff --git a/python/fits/api/v1/project_connect.py b/python/fits/api/v1/project_connect.py index 84fbab6..73d708d 100644 --- a/python/fits/api/v1/project_connect.py +++ b/python/fits/api/v1/project_connect.py @@ -7,6 +7,8 @@ from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code +from connectrpc.codec import Codec +from connectrpc.compression import Compression from connectrpc.errors import ConnectError from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo @@ -33,7 +35,7 @@ async def update(self, request: fits_dot_api_dot_v1_dot_project__pb2.ProjectServ class ProjectServiceASGIApplication(ConnectASGIApplication[ProjectService]): - def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None) -> None: + def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -90,6 +92,8 @@ def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, }, interceptors=interceptors, read_max_bytes=read_max_bytes, + compressions=compressions, + codecs=codecs, ) @property @@ -200,6 +204,9 @@ async def update( ) + + + class ProjectServiceSync(Protocol): def list(self, request: fits_dot_api_dot_v1_dot_project__pb2.ProjectServiceListRequest, ctx: RequestContext) -> fits_dot_api_dot_v1_dot_project__pb2.ProjectServiceListResponse: raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") @@ -214,7 +221,7 @@ def update(self, request: fits_dot_api_dot_v1_dot_project__pb2.ProjectServiceUpd class ProjectServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: ProjectServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None) -> None: + def __init__(self, service: ProjectServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: super().__init__( endpoints={ "/fits.api.v1.ProjectService/List": EndpointSync.unary( @@ -270,6 +277,8 @@ def __init__(self, service: ProjectServiceSync, interceptors: Iterable[Intercept }, interceptors=interceptors, read_max_bytes=read_max_bytes, + compressions=compressions, + codecs=codecs, ) @property @@ -378,3 +387,5 @@ def update( headers=headers, timeout_ms=timeout_ms, ) + + diff --git a/python/fits/api/v1/project_pb2.py b/python/fits/api/v1/project_pb2.py index e55aa0a..73dad2b 100644 --- a/python/fits/api/v1/project_pb2.py +++ b/python/fits/api/v1/project_pb2.py @@ -2,7 +2,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: fits/api/v1/project.proto -# Protobuf Python Version: 7.34.1 +# Protobuf Python Version: 7.36.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -12,7 +12,7 @@ _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, 7, - 34, + 36, 1, '', 'fits/api/v1/project.proto' diff --git a/python/fits/api/v1/tenant_connect.py b/python/fits/api/v1/tenant_connect.py index 2e69081..33430b7 100644 --- a/python/fits/api/v1/tenant_connect.py +++ b/python/fits/api/v1/tenant_connect.py @@ -7,6 +7,8 @@ from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code +from connectrpc.codec import Codec +from connectrpc.compression import Compression from connectrpc.errors import ConnectError from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo @@ -33,7 +35,7 @@ async def delete(self, request: fits_dot_api_dot_v1_dot_tenant__pb2.TenantServic class TenantServiceASGIApplication(ConnectASGIApplication[TenantService]): - def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None) -> None: + def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -90,6 +92,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in }, interceptors=interceptors, read_max_bytes=read_max_bytes, + compressions=compressions, + codecs=codecs, ) @property @@ -200,6 +204,9 @@ async def delete( ) + + + class TenantServiceSync(Protocol): def create(self, request: fits_dot_api_dot_v1_dot_tenant__pb2.TenantServiceCreateRequest, ctx: RequestContext) -> fits_dot_api_dot_v1_dot_tenant__pb2.TenantServiceCreateResponse: raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") @@ -214,7 +221,7 @@ def delete(self, request: fits_dot_api_dot_v1_dot_tenant__pb2.TenantServiceDelet class TenantServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: TenantServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None) -> None: + def __init__(self, service: TenantServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: super().__init__( endpoints={ "/fits.api.v1.TenantService/Create": EndpointSync.unary( @@ -270,6 +277,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto }, interceptors=interceptors, read_max_bytes=read_max_bytes, + compressions=compressions, + codecs=codecs, ) @property @@ -378,3 +387,5 @@ def delete( headers=headers, timeout_ms=timeout_ms, ) + + diff --git a/python/fits/api/v1/tenant_pb2.py b/python/fits/api/v1/tenant_pb2.py index 7905c76..2cf7533 100644 --- a/python/fits/api/v1/tenant_pb2.py +++ b/python/fits/api/v1/tenant_pb2.py @@ -2,7 +2,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: fits/api/v1/tenant.proto -# Protobuf Python Version: 7.34.1 +# Protobuf Python Version: 7.36.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -12,7 +12,7 @@ _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, 7, - 34, + 36, 1, '', 'fits/api/v1/tenant.proto' diff --git a/python/fits/api/v1/token_connect.py b/python/fits/api/v1/token_connect.py index feac28b..f52ad82 100644 --- a/python/fits/api/v1/token_connect.py +++ b/python/fits/api/v1/token_connect.py @@ -7,6 +7,8 @@ from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code +from connectrpc.codec import Codec +from connectrpc.compression import Compression from connectrpc.errors import ConnectError from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo @@ -36,7 +38,7 @@ async def refresh(self, request: fits_dot_api_dot_v1_dot_token__pb2.TokenService class TokenServiceASGIApplication(ConnectASGIApplication[TokenService]): - def __init__(self, service: TokenService | AsyncGenerator[TokenService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None) -> None: + def __init__(self, service: TokenService | AsyncGenerator[TokenService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -103,6 +105,8 @@ def __init__(self, service: TokenService | AsyncGenerator[TokenService], *, inte }, interceptors=interceptors, read_max_bytes=read_max_bytes, + compressions=compressions, + codecs=codecs, ) @property @@ -233,6 +237,9 @@ async def refresh( ) + + + class TokenServiceSync(Protocol): def get(self, request: fits_dot_api_dot_v1_dot_token__pb2.TokenServiceGetRequest, ctx: RequestContext) -> fits_dot_api_dot_v1_dot_token__pb2.TokenServiceGetResponse: raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") @@ -249,7 +256,7 @@ def refresh(self, request: fits_dot_api_dot_v1_dot_token__pb2.TokenServiceRefres class TokenServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: TokenServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None) -> None: + def __init__(self, service: TokenServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: super().__init__( endpoints={ "/fits.api.v1.TokenService/Get": EndpointSync.unary( @@ -315,6 +322,8 @@ def __init__(self, service: TokenServiceSync, interceptors: Iterable[Interceptor }, interceptors=interceptors, read_max_bytes=read_max_bytes, + compressions=compressions, + codecs=codecs, ) @property @@ -443,3 +452,5 @@ def refresh( headers=headers, timeout_ms=timeout_ms, ) + + diff --git a/python/fits/api/v1/token_pb2.py b/python/fits/api/v1/token_pb2.py index 46482f5..d404835 100644 --- a/python/fits/api/v1/token_pb2.py +++ b/python/fits/api/v1/token_pb2.py @@ -2,7 +2,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: fits/api/v1/token.proto -# Protobuf Python Version: 7.34.1 +# Protobuf Python Version: 7.36.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -12,7 +12,7 @@ _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, 7, - 34, + 36, 1, '', 'fits/api/v1/token.proto' diff --git a/python/fits/api/v1/version_connect.py b/python/fits/api/v1/version_connect.py index 2390894..ff0a0e8 100644 --- a/python/fits/api/v1/version_connect.py +++ b/python/fits/api/v1/version_connect.py @@ -7,6 +7,8 @@ from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code +from connectrpc.codec import Codec +from connectrpc.compression import Compression from connectrpc.errors import ConnectError from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo @@ -21,7 +23,7 @@ async def get(self, request: fits_dot_api_dot_v1_dot_version__pb2.VersionService class VersionServiceASGIApplication(ConnectASGIApplication[VersionService]): - def __init__(self, service: VersionService | AsyncGenerator[VersionService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None) -> None: + def __init__(self, service: VersionService | AsyncGenerator[VersionService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -38,6 +40,8 @@ def __init__(self, service: VersionService | AsyncGenerator[VersionService], *, }, interceptors=interceptors, read_max_bytes=read_max_bytes, + compressions=compressions, + codecs=codecs, ) @property @@ -68,13 +72,16 @@ async def get( ) + + + class VersionServiceSync(Protocol): def get(self, request: fits_dot_api_dot_v1_dot_version__pb2.VersionServiceGetRequest, ctx: RequestContext) -> fits_dot_api_dot_v1_dot_version__pb2.VersionServiceGetResponse: raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") class VersionServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: VersionServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None) -> None: + def __init__(self, service: VersionServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: super().__init__( endpoints={ "/fits.api.v1.VersionService/Get": EndpointSync.unary( @@ -90,6 +97,8 @@ def __init__(self, service: VersionServiceSync, interceptors: Iterable[Intercept }, interceptors=interceptors, read_max_bytes=read_max_bytes, + compressions=compressions, + codecs=codecs, ) @property @@ -118,3 +127,5 @@ def get( headers=headers, timeout_ms=timeout_ms, ) + + diff --git a/python/fits/api/v1/version_pb2.py b/python/fits/api/v1/version_pb2.py index 44012b3..7192c2e 100644 --- a/python/fits/api/v1/version_pb2.py +++ b/python/fits/api/v1/version_pb2.py @@ -2,7 +2,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: fits/api/v1/version.proto -# Protobuf Python Version: 7.34.1 +# Protobuf Python Version: 7.36.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -12,7 +12,7 @@ _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, 7, - 34, + 36, 1, '', 'fits/api/v1/version.proto' diff --git a/python/fits/client/tests/__init__.py b/python/fits/client/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/python/fits/client/tests/conftest.py b/python/fits/client/tests/conftest.py new file mode 100644 index 0000000..bdda0be --- /dev/null +++ b/python/fits/client/tests/conftest.py @@ -0,0 +1,172 @@ +from collections.abc import Iterator +from typing import Any + +import pyqwest +import pytest +from connectrpc.request import RequestContext +from pyqwest.testing import WSGITransport + +from fits.api.v1 import ip_pb2 +from fits.api.v1 import version_pb2 +from fits.api.v1.ip_connect import ( + IPServiceWSGIApplication, +) +from fits.api.v1.version_connect import ( + VersionServiceWSGIApplication, +) +from fits.client.client import Client +from fits.infra.v1 import bmc_pb2 +from fits.infra.v1 import component_pb2 as infra_component_pb2 +from fits.infra.v1.bmc_connect import ( + BMCServiceWSGIApplication, +) +from fits.infra.v1.component_connect import ( + ComponentServiceWSGIApplication, +) + + +class MockVersionService: + def __init__(self, version: str = "1.0"): + self._version = version + + def get( + self, request: version_pb2.VersionServiceGetRequest, ctx: RequestContext + ) -> version_pb2.VersionServiceGetResponse: + return version_pb2.VersionServiceGetResponse( + version=version_pb2.Version(version=self._version) + ) + + +class MockIPService: + def __init__(self): + self.received_auth: str | None = None + + def get( + self, request: ip_pb2.IPServiceGetRequest, ctx: RequestContext + ) -> ip_pb2.IPServiceGetResponse: + self.received_auth = ctx.request_headers().get("authorization") + return ip_pb2.IPServiceGetResponse( + ip=ip_pb2.IP(ip=request.ip, project=request.project) + ) + + def create( + self, request: ip_pb2.IPServiceCreateRequest, ctx: RequestContext + ) -> ip_pb2.IPServiceCreateResponse: + return ip_pb2.IPServiceCreateResponse() + + def update( + self, request: ip_pb2.IPServiceUpdateRequest, ctx: RequestContext + ) -> ip_pb2.IPServiceUpdateResponse: + return ip_pb2.IPServiceUpdateResponse() + + def list( + self, request: ip_pb2.IPServiceListRequest, ctx: RequestContext + ) -> ip_pb2.IPServiceListResponse: + return ip_pb2.IPServiceListResponse() + + def delete( + self, request: ip_pb2.IPServiceDeleteRequest, ctx: RequestContext + ) -> ip_pb2.IPServiceDeleteResponse: + return ip_pb2.IPServiceDeleteResponse() + + +class MockBMCService: + def __init__(self): + self.received_auth: str | None = None + + def update_b_m_c_info( + self, request: bmc_pb2.UpdateBMCInfoRequest, ctx: RequestContext + ) -> bmc_pb2.UpdateBMCInfoResponse: + self.received_auth = ctx.request_headers().get("authorization") + return bmc_pb2.UpdateBMCInfoResponse() + + def wait_for_b_m_c_command( + self, request: bmc_pb2.WaitForBMCCommandRequest, ctx: RequestContext + ) -> Iterator[bmc_pb2.WaitForBMCCommandResponse]: + self.received_auth = ctx.request_headers().get("authorization") + yield bmc_pb2.WaitForBMCCommandResponse(uuid="test-uuid", command_id="cmd-1") + + def b_m_c_command_done( + self, request: bmc_pb2.BMCCommandDoneRequest, ctx: RequestContext + ) -> bmc_pb2.BMCCommandDoneResponse: + return bmc_pb2.BMCCommandDoneResponse() + + +class MockComponentService: + def __init__(self): + self.pings: list[infra_component_pb2.ComponentServicePingRequest] = [] + + def ping( + self, + request: infra_component_pb2.ComponentServicePingRequest, + ctx: RequestContext, + ) -> infra_component_pb2.ComponentServicePingResponse: + self.pings.append( + infra_component_pb2.ComponentServicePingRequest( + type=request.type, + identifier=request.identifier, + started_at=request.started_at, + interval=request.interval, + version=request.version, + ) + ) + return infra_component_pb2.ComponentServicePingResponse() + + +def _build_combined_wsgi_app(services: dict[str, Any]): + """Build a combined WSGI app that dispatches by path prefix.""" + + def application(environ, start_response): + path = environ.get("PATH_INFO", "/") + for prefix, app in services.items(): + if path.startswith(prefix): + return app(environ, start_response) + from werkzeug.exceptions import NotFound + + return NotFound()(environ, start_response) + + return application + + +@pytest.fixture +def mock_version_service(): + return MockVersionService() + + +@pytest.fixture +def mock_ip_service(): + return MockIPService() + + +@pytest.fixture +def mock_bmc_service(): + return MockBMCService() + + +@pytest.fixture +def mock_component_service(): + return MockComponentService() + + +@pytest.fixture +def test_client( + mock_version_service, + mock_ip_service, + mock_bmc_service, + mock_component_service, +): + """Create a Client with WSGI-backed transport for testing.""" + services = { + "/fits.api.v1.VersionService": VersionServiceWSGIApplication( + mock_version_service + ), + "/fits.api.v1.IPService": IPServiceWSGIApplication(mock_ip_service), + "/fits.infra.v1.BMCService": BMCServiceWSGIApplication(mock_bmc_service), + "/fits.infra.v1.ComponentService": ComponentServiceWSGIApplication( + mock_component_service + ), + } + transport = WSGITransport(_build_combined_wsgi_app(services)) + c = Client(baseurl="http://test", timeout=10) + c._client = pyqwest.SyncClient(transport=transport) + return c diff --git a/python/fits/client/tests/test_client.py b/python/fits/client/tests/test_client.py new file mode 100644 index 0000000..ebee1bc --- /dev/null +++ b/python/fits/client/tests/test_client.py @@ -0,0 +1,122 @@ +"""Tests mirroring go/client/client_test.go. + +Test_Client -> test_client_apiv2_version_get +Test_ClientInterceptors -> test_client_auth_header_unary, test_client_auth_header_streaming +""" + +import pyqwest +import pytest +from pyqwest.testing import WSGITransport + +from fits.api.v1 import ip_pb2 +from fits.api.v1 import version_pb2 +from fits.api.v1.ip_connect import ( + IPServiceClientSync, + IPServiceWSGIApplication, +) +from fits.api.v1.version_connect import ( + VersionServiceClientSync, + VersionServiceWSGIApplication, +) +from fits.client.client import Client +from fits.infra.v1 import bmc_pb2 +from fits.infra.v1.bmc_connect import ( + BMCServiceClientSync, + BMCServiceWSGIApplication, +) +from fits.infra.v1 import component_pb2 as infra_component_pb2 +from fits.infra.v1.component_connect import ( + ComponentServiceClientSync, + ComponentServiceWSGIApplication, +) + +from .conftest import ( + MockBMCService, + MockComponentService, + MockIPService, + MockVersionService, + _build_combined_wsgi_app, +) + + +class TestClient: + """Mirrors Test_Client from client_test.go. + + Tests client instantiation and basic RPC calls through the generated Client wrapper. + """ + + def test_client_creates_service_groups(self, test_client): + """Client exposes adminv2, apiv2, infrav2 service groups.""" + assert test_client.apiv2() is not None + assert test_client.infrav2() is not None + + def test_client_apiv2_version_get(self, test_client, mock_version_service): + """Version.Get returns the expected version through the Client wrapper.""" + resp = test_client.apiv2().version().get( + request=version_pb2.VersionServiceGetRequest() + ) + assert resp is not None + assert resp.version.version == "1.0" + + def test_client_apiv2_version_get_custom_version(self, mock_version_service): + """Client can be configured with a custom version response.""" + mock_version_service._version = "2.5.3" + vs = MockVersionService(version="2.5.3") + ips = MockIPService() + bmc = MockBMCService() + cs = MockComponentService() + + services = { + "/fits.api.v1.VersionService": VersionServiceWSGIApplication(vs), + "/fits.api.v1.IPService": IPServiceWSGIApplication(ips), + "/fits.infra.v1.BMCService": BMCServiceWSGIApplication(bmc), + "/fits.infra.v1.ComponentService": ComponentServiceWSGIApplication(cs), + } + transport = WSGITransport(_build_combined_wsgi_app(services)) + c = Client(baseurl="http://test", timeout=10) + c._client = pyqwest.SyncClient(transport=transport) + + resp = c.apiv2().version().get( + request=version_pb2.VersionServiceGetRequest() + ) + assert resp.version.version == "2.5.3" + + +class TestClientInterceptors: + """Mirrors Test_ClientInterceptors from client_test.go. + + Tests that auth headers are correctly passed for both unary and streaming calls. + """ + + def test_client_auth_header_unary(self, test_client, mock_bmc_service): + """Unary call has Authorization header set.""" + token = "test-bearer-token" + resp = test_client.infrav2().bmc().update_b_m_c_info( + request=bmc_pb2.UpdateBMCInfoRequest(), + headers={"authorization": f"Bearer {token}"}, + ) + assert resp is not None + assert mock_bmc_service.received_auth == f"Bearer {token}" + + def test_client_auth_header_streaming(self, test_client, mock_bmc_service): + """Streaming call has Authorization header set.""" + token = "test-stream-token" + stream = test_client.infrav2().bmc().wait_for_b_m_c_command( + request=bmc_pb2.WaitForBMCCommandRequest(), + headers={"authorization": f"Bearer {token}"}, + ) + assert stream is not None + for cmd in stream: + assert cmd.uuid == "test-uuid" + assert mock_bmc_service.received_auth == f"Bearer {token}" + + def test_client_auth_header_ip_get(self, test_client, mock_ip_service): + """IP Get call has Authorization header set.""" + token = "ip-service-token" + resp = test_client.apiv2().ip().get( + request=ip_pb2.IPServiceGetRequest(ip="10.0.0.1"), + headers={"authorization": f"Bearer {token}"}, + ) + assert resp is not None + assert resp.ip.ip == "10.0.0.1" + assert mock_ip_service.received_auth == f"Bearer {token}" diff --git a/python/fits/client/tests/test_interceptor.py b/python/fits/client/tests/test_interceptor.py new file mode 100644 index 0000000..056ddb2 --- /dev/null +++ b/python/fits/client/tests/test_interceptor.py @@ -0,0 +1,173 @@ +"""Tests mirroring go/client/test_interceptor_test.go. + +Tests the interceptor pattern using connectrpc's MetadataInterceptorSync, +which is the Python equivalent of Go's TestClientInterceptor. +""" + +import pyqwest +import pytest +from connectrpc.interceptor import MetadataInterceptorSync +from connectrpc.request import RequestContext +from pyqwest.testing import WSGITransport + +from fits.api.v1 import ip_pb2 +from fits.api.v1.ip_connect import ( + IPServiceClientSync, + IPServiceWSGIApplication, +) +from fits.client.client import Client + +from .conftest import MockIPService, _build_combined_wsgi_app + + +class AuthInterceptor: + """Client-side interceptor that injects an Authorization header. + + Mirrors the authInterceptor from go/client/client-interceptors.go. + """ + + def __init__(self, token: str): + self.token = token + + def on_start_sync(self, ctx: RequestContext) -> None: + ctx.request_headers().add("authorization", f"Bearer {self.token}") + + def on_end_sync(self, token, ctx: RequestContext, error) -> None: + pass + + +class RequestRecordingInterceptor: + """Interceptor that records the received request for assertion. + + Mirrors the TestClientInterceptor from go/client/test_interceptor.go. + """ + + def __init__(self): + self.calls: list[tuple[str, str]] = [] + + def on_start_sync(self, ctx: RequestContext) -> None: + method = ctx.method() + self.calls.append( + (method.service_name, method.name) + ) + + def on_end_sync(self, token, ctx: RequestContext, error) -> None: + pass + + +class TestInterceptor: + """Mirrors TestInterceptor from test_interceptor_test.go. + + Tests that an interceptor can intercept a call and verify request/response flow. + """ + + def test_interceptor_receives_request(self, mock_ip_service): + """Interceptor can observe the service and method being called.""" + ips = MockIPService() + from fits.infra.v1.bmc_connect import BMCServiceWSGIApplication + from fits.infra.v1.component_connect import ComponentServiceWSGIApplication + from fits.api.v1.version_connect import VersionServiceWSGIApplication + from fits.infra.v1 import bmc_pb2 + from fits.infra.v1 import component_pb2 as infra_component_pb2 + + class NoopBMC: + def update_b_m_c_info(self, request, ctx): + from fits.infra.v1.bmc_pb2 import UpdateBMCInfoResponse + return UpdateBMCInfoResponse() + def wait_for_b_m_c_command(self, request, ctx): + from fits.infra.v1.bmc_pb2 import WaitForBMCCommandResponse + yield WaitForBMCCommandResponse() + def b_m_c_command_done(self, request, ctx): + from fits.infra.v1.bmc_pb2 import BMCCommandDoneResponse + return BMCCommandDoneResponse() + + class NoopComponent: + def ping(self, request, ctx): + from fits.infra.v1.component_pb2 import ComponentServicePingResponse + return ComponentServicePingResponse() + + class NoopVersion: + def get(self, request, ctx): + from fits.api.v1.version_pb2 import VersionServiceGetResponse, Version + return VersionServiceGetResponse(version=Version(version="0.0")) + + services = { + "/fits.api.v1.VersionService": VersionServiceWSGIApplication(NoopVersion()), + "/fits.api.v1.IPService": IPServiceWSGIApplication(ips), + "/fits.infra.v1.BMCService": BMCServiceWSGIApplication(NoopBMC()), + "/fits.infra.v1.ComponentService": ComponentServiceWSGIApplication(NoopComponent()), + } + transport = WSGITransport(_build_combined_wsgi_app(services)) + + interceptor = RequestRecordingInterceptor() + + svc = IPServiceClientSync( + "http://test", + http_client=pyqwest.SyncClient(transport=transport), + interceptors=[interceptor], + ) + + resp = svc.get( + request=ip_pb2.IPServiceGetRequest(ip="1.2.3.4"), + ) + + assert resp.ip.ip == "1.2.3.4" + assert len(interceptor.calls) == 1 + assert interceptor.calls[0] == ("fits.api.v1.IPService", "Get") + + def test_auth_interceptor_injects_token(self): + """Auth interceptor injects Authorization header that the server receives.""" + ips = MockIPService() + from fits.infra.v1.bmc_connect import BMCServiceWSGIApplication + from fits.infra.v1.component_connect import ComponentServiceWSGIApplication + from fits.api.v1.version_connect import VersionServiceWSGIApplication + + class NoopBMC: + def update_b_m_c_info(self, request, ctx): + from fits.infra.v1.bmc_pb2 import UpdateBMCInfoResponse + return UpdateBMCInfoResponse() + def wait_for_b_m_c_command(self, request, ctx): + from fits.infra.v1.bmc_pb2 import WaitForBMCCommandResponse + yield WaitForBMCCommandResponse() + def b_m_c_command_done(self, request, ctx): + from fits.infra.v1.bmc_pb2 import BMCCommandDoneResponse + return BMCCommandDoneResponse() + + class NoopComponent: + def ping(self, request, ctx): + from fits.infra.v1.component_pb2 import ComponentServicePingResponse + return ComponentServicePingResponse() + + class NoopVersion: + def get(self, request, ctx): + from fits.api.v1.version_pb2 import VersionServiceGetResponse, Version + return VersionServiceGetResponse(version=Version(version="0.0")) + + services = { + "/fits.api.v1.VersionService": VersionServiceWSGIApplication(NoopVersion()), + "/fits.api.v1.IPService": IPServiceWSGIApplication(ips), + "/fits.infra.v1.BMCService": BMCServiceWSGIApplication(NoopBMC()), + "/fits.infra.v1.ComponentService": ComponentServiceWSGIApplication(NoopComponent()), + } + transport = WSGITransport(_build_combined_wsgi_app(services)) + + svc = IPServiceClientSync( + "http://test", + http_client=pyqwest.SyncClient(transport=transport), + interceptors=[AuthInterceptor("my-secret-token")], + ) + + resp = svc.get(request=ip_pb2.IPServiceGetRequest(ip="1.2.3.4")) + + assert resp.ip.ip == "1.2.3.4" + assert ips.received_auth == "Bearer my-secret-token" + + def test_interceptor_on_client_wrapper(self, test_client, mock_ip_service): + """Client wrapper passes headers through to the underlying service.""" + token = "wrapper-test-token" + resp = test_client.apiv2().ip().get( + request=ip_pb2.IPServiceGetRequest(ip="5.6.7.8"), + headers={"authorization": f"Bearer {token}"}, + ) + assert resp.ip.ip == "5.6.7.8" + assert mock_ip_service.received_auth == f"Bearer {token}" diff --git a/python/fits/client/tests/test_ping.py b/python/fits/client/tests/test_ping.py new file mode 100644 index 0000000..e95fec6 --- /dev/null +++ b/python/fits/client/tests/test_ping.py @@ -0,0 +1,103 @@ +"""Tests mirroring go/client/ping_test.go. + +Tests the ComponentService.Ping RPC which is used by the Go client's Ping() method. +The Python client doesn't have a built-in Ping() method, but we test the underlying +ComponentService call that would be used to implement one. +""" + +import threading +import time +from datetime import timedelta + +import pytest +from google.protobuf import duration_pb2, timestamp_pb2 + +from fits.api.v1 import component_pb2 as api_component_pb2 +from fits.api.v1 import version_pb2 +from fits.infra.v1 import component_pb2 as infra_component_pb2 + + +class TestPing: + """Mirrors Test_Ping from ping_test.go. + + Verifies that ComponentServicePingRequest is correctly constructed and sent, + and that the mock service receives the expected fields. + """ + + def test_ping_request_fields(self, test_client, mock_component_service): + """Ping request contains correct component type, identifier, started_at, interval, version.""" + started_at = timestamp_pb2.Timestamp(seconds=1000) + interval = duration_pb2.Duration(seconds=5) + version = version_pb2.Version(version="1.0.0", git_sha1="abc123") + + resp = test_client.infrav2().component().ping( + request=infra_component_pb2.ComponentServicePingRequest( + type=api_component_pb2.COMPONENT_TYPE_METAL_CORE, + identifier="server01", + started_at=started_at, + interval=interval, + version=version, + ), + headers={"authorization": "Bearer test-token"}, + ) + + assert resp is not None + assert len(mock_component_service.pings) == 1 + + ping = mock_component_service.pings[0] + assert ping.type == api_component_pb2.COMPONENT_TYPE_METAL_CORE + assert ping.identifier == "server01" + assert ping.started_at.seconds == 1000 + assert ping.interval.seconds == 5 + assert ping.version.version == "1.0.0" + assert ping.version.git_sha1 == "abc123" + + def test_ping_multiple_requests(self, test_client, mock_component_service): + """Multiple ping calls are recorded correctly.""" + started_at = timestamp_pb2.Timestamp(seconds=2000) + interval = duration_pb2.Duration(seconds=10) + + for _ in range(3): + test_client.infrav2().component().ping( + request=infra_component_pb2.ComponentServicePingRequest( + type=api_component_pb2.COMPONENT_TYPE_METAL_CORE, + identifier="server02", + started_at=started_at, + interval=interval, + ), + headers={"authorization": "Bearer test-token"}, + ) + + assert len(mock_component_service.pings) == 3 + for ping in mock_component_service.pings: + assert ping.identifier == "server02" + assert ping.type == api_component_pb2.COMPONENT_TYPE_METAL_CORE + assert ping.started_at.seconds == 2000 + assert ping.interval.seconds == 10 + + def test_ping_background_simulation(self, test_client, mock_component_service): + """Simulate background pinging from a thread, similar to Go's ticker goroutine.""" + started_at = timestamp_pb2.Timestamp(seconds=3000) + interval = duration_pb2.Duration(seconds=1) + ping_count = 5 + + def do_pings(): + for _ in range(ping_count): + test_client.infrav2().component().ping( + request=infra_component_pb2.ComponentServicePingRequest( + type=api_component_pb2.COMPONENT_TYPE_METAL_CORE, + identifier="background-worker", + started_at=started_at, + interval=interval, + ), + headers={"authorization": "Bearer test-token"}, + ) + time.sleep(0.05) + + thread = threading.Thread(target=do_pings) + thread.start() + thread.join() + + assert len(mock_component_service.pings) == ping_count + for ping in mock_component_service.pings: + assert ping.identifier == "background-worker" diff --git a/python/fits/client/tests/test_token_persistent.py b/python/fits/client/tests/test_token_persistent.py new file mode 100644 index 0000000..2b84d86 --- /dev/null +++ b/python/fits/client/tests/test_token_persistent.py @@ -0,0 +1,91 @@ +"""Tests mirroring go/client/token-persistent-funcs_test.go. + +Tests filesystem-based token persistence, which is the Python equivalent of +Go's NewFilesystemTokenPersister. +""" + +import os +import tempfile +from pathlib import Path + +import pytest + + +class FilesystemTokenPersister: + """Persists a token to a file on disk. + + Mirrors the filesystem struct and persist method from + go/client/token-persistent-funcs.go. + """ + + def __init__(self, token_path: str): + self._token_path = token_path + + def persist(self, token: str) -> None: + Path(self._token_path).write_text(token) + + +def new_filesystem_token_persister(token_file: str) -> FilesystemTokenPersister: + """Create a new filesystem token persister. + + Mirrors NewFilesystemTokenPersister from go/client/token-persistent-funcs.go. + """ + path = Path(token_file) + if not path.exists(): + raise FileNotFoundError(f"token file {token_file} does not exist") + if os.access(token_file, os.W_OK) is False: + raise ValueError(f"tokenfile {token_file} is not writable") + return FilesystemTokenPersister(token_file) + + +class TestFilesystemTokenPersister: + """Mirrors TestNewFilesystemTokenPersiter from token-persistent-funcs_test.go.""" + + def test_persist_and_read_back(self, tmp_path): + """Write a token to a file and read it back.""" + token_path = str(tmp_path / "token") + Path(token_path).touch(mode=0o600) + + persister = new_filesystem_token_persister(token_path) + token = "a-token" + + persister.persist(token) + + content = Path(token_path).read_text() + assert content == token + + def test_persister_requires_existing_file(self, tmp_path): + """Persister raises FileNotFoundError for non-existent file.""" + token_path = str(tmp_path / "nonexistent") + with pytest.raises(FileNotFoundError): + new_filesystem_token_persister(token_path) + + def test_persister_requires_writable_file(self, tmp_path): + """Persister raises ValueError for read-only file.""" + token_path = str(tmp_path / "readonly") + Path(token_path).touch(mode=0o444) + + with pytest.raises(ValueError, match="not writable"): + new_filesystem_token_persister(token_path) + + def test_overwrite_existing_token(self, tmp_path): + """Persisting a new token overwrites the previous one.""" + token_path = str(tmp_path / "token") + Path(token_path).write_text("old-token") + + persister = new_filesystem_token_persister(token_path) + persister.persist("new-token") + + content = Path(token_path).read_text() + assert content == "new-token" + + def test_persist_empty_token(self, tmp_path): + """Persisting an empty token writes an empty file.""" + token_path = str(tmp_path / "token") + Path(token_path).touch(mode=0o600) + + persister = new_filesystem_token_persister(token_path) + persister.persist("") + + content = Path(token_path).read_text() + assert content == "" diff --git a/python/setup.py b/python/setup.py index ada4270..2e66fbc 100644 --- a/python/setup.py +++ b/python/setup.py @@ -4,9 +4,11 @@ NAME = "fi-ts-api" REQUIRES = [ - "connect-python>=0.8.0", + # this version needs to match the version specified in buf.gen.yaml + "connectrpc==0.10.1", + "protobuf>=7.0", "protovalidate>=1.2.0", -] + "pyqwest<0.7.0",] setup( name=NAME, @@ -24,9 +26,8 @@ 'Natural Language :: English', 'Operating System :: POSIX', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3.13', + 'Programming Language :: Python :: 3.14', ], include_package_data=True, ) From 764785a9c2a0730047db18ac83e26889f4144a48 Mon Sep 17 00:00:00 2001 From: Valentin Knabel Date: Mon, 7 Sep 2026 10:02:17 +0200 Subject: [PATCH 3/5] Apply batched suggestions from code review Co-authored-by: Simon Mayer <49491825+simcod@users.noreply.github.com> --- .github/workflows/npm-publish.yaml | 2 +- .github/workflows/tests.yaml | 6 +++--- js/package.json | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/npm-publish.yaml b/.github/workflows/npm-publish.yaml index 360ff19..7e153ab 100644 --- a/.github/workflows/npm-publish.yaml +++ b/.github/workflows/npm-publish.yaml @@ -22,7 +22,7 @@ jobs: uses: actions/checkout@v7 - name: setup Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@v7 with: node-version: 24 registry-url: https://registry.npmjs.org/ diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b24d018..05d335a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v7 - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@v7 with: go-version-file: "go.mod" cache: false @@ -42,7 +42,7 @@ jobs: uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} @@ -65,7 +65,7 @@ jobs: uses: actions/checkout@v7 - name: Setup Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@v7 with: node-version: 24 registry-url: https://registry.npmjs.org/ diff --git a/js/package.json b/js/package.json index 458e462..716c6e7 100644 --- a/js/package.json +++ b/js/package.json @@ -18,7 +18,8 @@ "typescript": "^7.0.2" }, "files": [ - "js/*" + "fits", + "buf" ], "version": "0.0.0" } From 9fe7f5961df7fb3a8016c9d593b7a5e6911eedb4 Mon Sep 17 00:00:00 2001 From: Valentin Knabel Date: Mon, 7 Sep 2026 10:48:46 +0200 Subject: [PATCH 4/5] cleanup --- doc/index.html | 66 ------- go/client/conn.go | 2 +- go/fits/api/v1/common.pb.go | 194 ++++--------------- go/tests/api_scopes_test.go | 4 +- js/fits/api/v1/common_pb.d.ts | 58 ------ js/fits/api/v1/common_pb.js | 68 +------ js/fits/api/v1/common_pb.ts | 76 +------- proto/fits/api/v1/common.proto | 20 -- python/fits/api/v1/common_pb2.py | 18 +- python/fits/api/v1/common_pb2.pyi | 18 -- python/fits/client/tests/conftest.py | 68 ------- python/fits/client/tests/test_client.py | 59 +----- python/fits/client/tests/test_interceptor.py | 44 +---- python/fits/client/tests/test_ping.py | 103 ---------- 14 files changed, 68 insertions(+), 730 deletions(-) delete mode 100644 python/fits/client/tests/test_ping.py diff --git a/doc/index.html b/doc/index.html index 870898c..1d54944 100644 --- a/doc/index.html +++ b/doc/index.html @@ -278,14 +278,6 @@

Table of Contents

EAuditing -
  • - EInfraRole -
  • - -
  • - EMachineRole -
  • -
  • EOptimisticLockingStrategy
  • @@ -1136,64 +1128,6 @@

    Auditing

    -

    InfraRole

    -

    InfraRole specifies what role a microservice needs to call this infra service

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameNumberDescription
    INFRA_ROLE_UNSPECIFIED0

    INFRA_ROLE_UNSPECIFIED is not specified

    INFRA_ROLE_EDITOR1

    INFRA_ROLE_EDITOR a microservice needs at least editor role to call this method

    INFRA_ROLE_VIEWER2

    INFRA_ROLE_VIEWER a microservice needs at least viewer role to call this method

    - -

    MachineRole

    -

    MachineRole specifies what role a microservice needs to call this machine service

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameNumberDescription
    MACHINE_ROLE_UNSPECIFIED0

    MACHINE_ROLE_UNSPECIFIED is not specified

    MACHINE_ROLE_EDITOR1

    MACHINE_ROLE_EDITOR a microservice needs at least editor role to call this method

    MACHINE_ROLE_VIEWER2

    MACHINE_ROLE_VIEWER a microservice needs at least viewer role to call this method

    -

    OptimisticLockingStrategy

    OptimisticLockingStrategy defines how optimistic locking should be handled.

    It defaults to client side, which requires the UpdatedAt timestamp to be provided

    diff --git a/go/client/conn.go b/go/client/conn.go index 5286c8f..a2b9d09 100644 --- a/go/client/conn.go +++ b/go/client/conn.go @@ -24,7 +24,7 @@ const ( type ( // DialConfig is the configuration to create a api-server connection DialConfig struct { - // BaseUrl points to the apiv2 url where the apiserver is reachable + // BaseUrl points to the apiv1 url where the apiserver is reachable BaseURL string // Token to be used to talk to the apiserver, the string representation of the token. // If Token is specified, TokenFile cannot be specified. diff --git a/go/fits/api/v1/common.pb.go b/go/fits/api/v1/common.pb.go index f1bbfde..d369aa9 100644 --- a/go/fits/api/v1/common.pb.go +++ b/go/fits/api/v1/common.pb.go @@ -197,112 +197,6 @@ func (AdminRole) EnumDescriptor() ([]byte, []int) { return file_fits_api_v1_common_proto_rawDescGZIP(), []int{2} } -// InfraRole specifies what role a microservice needs to call this infra service -type InfraRole int32 - -const ( - // INFRA_ROLE_UNSPECIFIED is not specified - InfraRole_INFRA_ROLE_UNSPECIFIED InfraRole = 0 - // INFRA_ROLE_EDITOR a microservice needs at least editor role to call this method - InfraRole_INFRA_ROLE_EDITOR InfraRole = 1 - // INFRA_ROLE_VIEWER a microservice needs at least viewer role to call this method - InfraRole_INFRA_ROLE_VIEWER InfraRole = 2 -) - -// Enum value maps for InfraRole. -var ( - InfraRole_name = map[int32]string{ - 0: "INFRA_ROLE_UNSPECIFIED", - 1: "INFRA_ROLE_EDITOR", - 2: "INFRA_ROLE_VIEWER", - } - InfraRole_value = map[string]int32{ - "INFRA_ROLE_UNSPECIFIED": 0, - "INFRA_ROLE_EDITOR": 1, - "INFRA_ROLE_VIEWER": 2, - } -) - -func (x InfraRole) Enum() *InfraRole { - p := new(InfraRole) - *p = x - return p -} - -func (x InfraRole) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (InfraRole) Descriptor() protoreflect.EnumDescriptor { - return file_fits_api_v1_common_proto_enumTypes[3].Descriptor() -} - -func (InfraRole) Type() protoreflect.EnumType { - return &file_fits_api_v1_common_proto_enumTypes[3] -} - -func (x InfraRole) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use InfraRole.Descriptor instead. -func (InfraRole) EnumDescriptor() ([]byte, []int) { - return file_fits_api_v1_common_proto_rawDescGZIP(), []int{3} -} - -// MachineRole specifies what role a microservice needs to call this machine service -type MachineRole int32 - -const ( - // MACHINE_ROLE_UNSPECIFIED is not specified - MachineRole_MACHINE_ROLE_UNSPECIFIED MachineRole = 0 - // MACHINE_ROLE_EDITOR a microservice needs at least editor role to call this method - MachineRole_MACHINE_ROLE_EDITOR MachineRole = 1 - // MACHINE_ROLE_VIEWER a microservice needs at least viewer role to call this method - MachineRole_MACHINE_ROLE_VIEWER MachineRole = 2 -) - -// Enum value maps for MachineRole. -var ( - MachineRole_name = map[int32]string{ - 0: "MACHINE_ROLE_UNSPECIFIED", - 1: "MACHINE_ROLE_EDITOR", - 2: "MACHINE_ROLE_VIEWER", - } - MachineRole_value = map[string]int32{ - "MACHINE_ROLE_UNSPECIFIED": 0, - "MACHINE_ROLE_EDITOR": 1, - "MACHINE_ROLE_VIEWER": 2, - } -) - -func (x MachineRole) Enum() *MachineRole { - p := new(MachineRole) - *p = x - return p -} - -func (x MachineRole) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (MachineRole) Descriptor() protoreflect.EnumDescriptor { - return file_fits_api_v1_common_proto_enumTypes[4].Descriptor() -} - -func (MachineRole) Type() protoreflect.EnumType { - return &file_fits_api_v1_common_proto_enumTypes[4] -} - -func (x MachineRole) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use MachineRole.Descriptor instead. -func (MachineRole) EnumDescriptor() ([]byte, []int) { - return file_fits_api_v1_common_proto_rawDescGZIP(), []int{4} -} - // Visibility of a method type Visibility int32 @@ -340,11 +234,11 @@ func (x Visibility) String() string { } func (Visibility) Descriptor() protoreflect.EnumDescriptor { - return file_fits_api_v1_common_proto_enumTypes[5].Descriptor() + return file_fits_api_v1_common_proto_enumTypes[3].Descriptor() } func (Visibility) Type() protoreflect.EnumType { - return &file_fits_api_v1_common_proto_enumTypes[5] + return &file_fits_api_v1_common_proto_enumTypes[3] } func (x Visibility) Number() protoreflect.EnumNumber { @@ -353,7 +247,7 @@ func (x Visibility) Number() protoreflect.EnumNumber { // Deprecated: Use Visibility.Descriptor instead. func (Visibility) EnumDescriptor() ([]byte, []int) { - return file_fits_api_v1_common_proto_rawDescGZIP(), []int{5} + return file_fits_api_v1_common_proto_rawDescGZIP(), []int{3} } // Auditing option specified per service method @@ -395,11 +289,11 @@ func (x Auditing) String() string { } func (Auditing) Descriptor() protoreflect.EnumDescriptor { - return file_fits_api_v1_common_proto_enumTypes[6].Descriptor() + return file_fits_api_v1_common_proto_enumTypes[4].Descriptor() } func (Auditing) Type() protoreflect.EnumType { - return &file_fits_api_v1_common_proto_enumTypes[6] + return &file_fits_api_v1_common_proto_enumTypes[4] } func (x Auditing) Number() protoreflect.EnumNumber { @@ -408,7 +302,7 @@ func (x Auditing) Number() protoreflect.EnumNumber { // Deprecated: Use Auditing.Descriptor instead. func (Auditing) EnumDescriptor() ([]byte, []int) { - return file_fits_api_v1_common_proto_rawDescGZIP(), []int{6} + return file_fits_api_v1_common_proto_rawDescGZIP(), []int{4} } // OptimisticLockingStrategy defines how optimistic locking should be handled. @@ -450,11 +344,11 @@ func (x OptimisticLockingStrategy) String() string { } func (OptimisticLockingStrategy) Descriptor() protoreflect.EnumDescriptor { - return file_fits_api_v1_common_proto_enumTypes[7].Descriptor() + return file_fits_api_v1_common_proto_enumTypes[5].Descriptor() } func (OptimisticLockingStrategy) Type() protoreflect.EnumType { - return &file_fits_api_v1_common_proto_enumTypes[7] + return &file_fits_api_v1_common_proto_enumTypes[5] } func (x OptimisticLockingStrategy) Number() protoreflect.EnumNumber { @@ -463,7 +357,7 @@ func (x OptimisticLockingStrategy) Number() protoreflect.EnumNumber { // Deprecated: Use OptimisticLockingStrategy.Descriptor instead. func (OptimisticLockingStrategy) EnumDescriptor() ([]byte, []int) { - return file_fits_api_v1_common_proto_rawDescGZIP(), []int{7} + return file_fits_api_v1_common_proto_rawDescGZIP(), []int{5} } // Paging defines paging for methods with a lot of results @@ -884,15 +778,7 @@ const file_fits_api_v1_common_proto_rawDesc = "" + "\tAdminRole\x12\x1a\n" + "\x16ADMIN_ROLE_UNSPECIFIED\x10\x00\x12\x15\n" + "\x11ADMIN_ROLE_EDITOR\x10\x01\x12\x15\n" + - "\x11ADMIN_ROLE_VIEWER\x10\x02*U\n" + - "\tInfraRole\x12\x1a\n" + - "\x16INFRA_ROLE_UNSPECIFIED\x10\x00\x12\x15\n" + - "\x11INFRA_ROLE_EDITOR\x10\x01\x12\x15\n" + - "\x11INFRA_ROLE_VIEWER\x10\x02*]\n" + - "\vMachineRole\x12\x1c\n" + - "\x18MACHINE_ROLE_UNSPECIFIED\x10\x00\x12\x17\n" + - "\x13MACHINE_ROLE_EDITOR\x10\x01\x12\x17\n" + - "\x13MACHINE_ROLE_VIEWER\x10\x02*T\n" + + "\x11ADMIN_ROLE_VIEWER\x10\x02*T\n" + "\n" + "Visibility\x12\x1a\n" + "\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x15\n" + @@ -929,46 +815,44 @@ func file_fits_api_v1_common_proto_rawDescGZIP() []byte { return file_fits_api_v1_common_proto_rawDescData } -var file_fits_api_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 8) +var file_fits_api_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 6) var file_fits_api_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_fits_api_v1_common_proto_goTypes = []any{ (TenantRole)(0), // 0: fits.api.v1.TenantRole (ProjectRole)(0), // 1: fits.api.v1.ProjectRole (AdminRole)(0), // 2: fits.api.v1.AdminRole - (InfraRole)(0), // 3: fits.api.v1.InfraRole - (MachineRole)(0), // 4: fits.api.v1.MachineRole - (Visibility)(0), // 5: fits.api.v1.Visibility - (Auditing)(0), // 6: fits.api.v1.Auditing - (OptimisticLockingStrategy)(0), // 7: fits.api.v1.OptimisticLockingStrategy - (*Paging)(nil), // 8: fits.api.v1.Paging - (*Labels)(nil), // 9: fits.api.v1.Labels - (*Meta)(nil), // 10: fits.api.v1.Meta - (*UpdateLabels)(nil), // 11: fits.api.v1.UpdateLabels - (*UpdateMeta)(nil), // 12: fits.api.v1.UpdateMeta - nil, // 13: fits.api.v1.Labels.LabelsEntry - (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp - (*descriptorpb.MethodOptions)(nil), // 15: google.protobuf.MethodOptions - (*descriptorpb.EnumValueOptions)(nil), // 16: google.protobuf.EnumValueOptions + (Visibility)(0), // 3: fits.api.v1.Visibility + (Auditing)(0), // 4: fits.api.v1.Auditing + (OptimisticLockingStrategy)(0), // 5: fits.api.v1.OptimisticLockingStrategy + (*Paging)(nil), // 6: fits.api.v1.Paging + (*Labels)(nil), // 7: fits.api.v1.Labels + (*Meta)(nil), // 8: fits.api.v1.Meta + (*UpdateLabels)(nil), // 9: fits.api.v1.UpdateLabels + (*UpdateMeta)(nil), // 10: fits.api.v1.UpdateMeta + nil, // 11: fits.api.v1.Labels.LabelsEntry + (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp + (*descriptorpb.MethodOptions)(nil), // 13: google.protobuf.MethodOptions + (*descriptorpb.EnumValueOptions)(nil), // 14: google.protobuf.EnumValueOptions } var file_fits_api_v1_common_proto_depIdxs = []int32{ - 13, // 0: fits.api.v1.Labels.labels:type_name -> fits.api.v1.Labels.LabelsEntry - 9, // 1: fits.api.v1.Meta.labels:type_name -> fits.api.v1.Labels - 14, // 2: fits.api.v1.Meta.created_at:type_name -> google.protobuf.Timestamp - 14, // 3: fits.api.v1.Meta.updated_at:type_name -> google.protobuf.Timestamp - 9, // 4: fits.api.v1.UpdateLabels.update:type_name -> fits.api.v1.Labels - 14, // 5: fits.api.v1.UpdateMeta.updated_at:type_name -> google.protobuf.Timestamp - 7, // 6: fits.api.v1.UpdateMeta.locking_strategy:type_name -> fits.api.v1.OptimisticLockingStrategy - 15, // 7: fits.api.v1.tenant_roles:extendee -> google.protobuf.MethodOptions - 15, // 8: fits.api.v1.project_roles:extendee -> google.protobuf.MethodOptions - 15, // 9: fits.api.v1.admin_roles:extendee -> google.protobuf.MethodOptions - 15, // 10: fits.api.v1.visibility:extendee -> google.protobuf.MethodOptions - 15, // 11: fits.api.v1.auditing:extendee -> google.protobuf.MethodOptions - 16, // 12: fits.api.v1.enum_string_value:extendee -> google.protobuf.EnumValueOptions + 11, // 0: fits.api.v1.Labels.labels:type_name -> fits.api.v1.Labels.LabelsEntry + 7, // 1: fits.api.v1.Meta.labels:type_name -> fits.api.v1.Labels + 12, // 2: fits.api.v1.Meta.created_at:type_name -> google.protobuf.Timestamp + 12, // 3: fits.api.v1.Meta.updated_at:type_name -> google.protobuf.Timestamp + 7, // 4: fits.api.v1.UpdateLabels.update:type_name -> fits.api.v1.Labels + 12, // 5: fits.api.v1.UpdateMeta.updated_at:type_name -> google.protobuf.Timestamp + 5, // 6: fits.api.v1.UpdateMeta.locking_strategy:type_name -> fits.api.v1.OptimisticLockingStrategy + 13, // 7: fits.api.v1.tenant_roles:extendee -> google.protobuf.MethodOptions + 13, // 8: fits.api.v1.project_roles:extendee -> google.protobuf.MethodOptions + 13, // 9: fits.api.v1.admin_roles:extendee -> google.protobuf.MethodOptions + 13, // 10: fits.api.v1.visibility:extendee -> google.protobuf.MethodOptions + 13, // 11: fits.api.v1.auditing:extendee -> google.protobuf.MethodOptions + 14, // 12: fits.api.v1.enum_string_value:extendee -> google.protobuf.EnumValueOptions 0, // 13: fits.api.v1.tenant_roles:type_name -> fits.api.v1.TenantRole 1, // 14: fits.api.v1.project_roles:type_name -> fits.api.v1.ProjectRole 2, // 15: fits.api.v1.admin_roles:type_name -> fits.api.v1.AdminRole - 5, // 16: fits.api.v1.visibility:type_name -> fits.api.v1.Visibility - 6, // 17: fits.api.v1.auditing:type_name -> fits.api.v1.Auditing + 3, // 16: fits.api.v1.visibility:type_name -> fits.api.v1.Visibility + 4, // 17: fits.api.v1.auditing:type_name -> fits.api.v1.Auditing 18, // [18:18] is the sub-list for method output_type 18, // [18:18] is the sub-list for method input_type 13, // [13:18] is the sub-list for extension type_name @@ -989,7 +873,7 @@ func file_fits_api_v1_common_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_fits_api_v1_common_proto_rawDesc), len(file_fits_api_v1_common_proto_rawDesc)), - NumEnums: 8, + NumEnums: 6, NumMessages: 6, NumExtensions: 6, NumServices: 0, diff --git a/go/tests/api_scopes_test.go b/go/tests/api_scopes_test.go index 239a857..24ad953 100644 --- a/go/tests/api_scopes_test.go +++ b/go/tests/api_scopes_test.go @@ -102,11 +102,11 @@ func Test_APIScopes(t *testing.T) { // errs := errors.Join( // errors.New("api service method: \"/fits.api.v1.WrongProjectService/Add\" has apiv1.TenantRole but request payload \"WrongProjectServiceAddRequest\" does not have a login field"), // errors.New("api service method: \"/fits.api.v1.WrongProjectService/Get\" has apiv1.ProjectRole but request payload \"WrongProjectServiceGetRequest\" does not have a project field"), - // errors.New("api service method: \"/fits.api.v1.WrongProjectService/List\" has no scope defined. one scope needs to be defined though. use one of the following scopes: [apiv1.AdminRole apiv1.InfraRole apiv1.MachineRole apiv1.ProjectRole apiv1.TenantRole apiv1.Visibility]"), + // errors.New("api service method: \"/fits.api.v1.WrongProjectService/List\" has no scope defined. one scope needs to be defined though. use one of the following scopes: [apiv1.AdminRole apiv1.ProjectRole apiv1.TenantRole apiv1.Visibility]"), // errors.New("api service method: \"/fits.api.v1.WrongProjectService/Update\" does not have a update_meta field in WrongProjectServiceUpdateRequest"), // errors.New("api service method: \"/fits.api.v1.WrongProjectService/Update\" can not have apiv1.AdminRole ([ADMIN_ROLE_VIEWER]) and apiv1.ProjectRole ([PROJECT_ROLE_OWNER]) at the same time. only one scope is allowed."), // errors.New("api service method: \"/fits.api.v1.WrongProjectService/Delete\" can not have apiv1.AdminRole ([ADMIN_ROLE_VIEWER]) and apiv1.Visibility ([VISIBILITY_PUBLIC]) at the same time. only one scope is allowed."), - // errors.New("api service method: \"/fits.api.v1.WrongProjectService/Charge\" has no scope defined. one scope needs to be defined though. use one of the following scopes: [apiv1.AdminRole apiv1.InfraRole apiv1.MachineRole apiv1.ProjectRole apiv1.TenantRole apiv1.Visibility]"), + // errors.New("api service method: \"/fits.api.v1.WrongProjectService/Charge\" has no scope defined. one scope needs to be defined though. use one of the following scopes: [apiv1.AdminRole apiv1.ProjectRole apiv1.TenantRole apiv1.Visibility]"), // ) // require.Equal(t, err, errs) diff --git a/js/fits/api/v1/common_pb.d.ts b/js/fits/api/v1/common_pb.d.ts index b72975e..25fa484 100644 --- a/js/fits/api/v1/common_pb.d.ts +++ b/js/fits/api/v1/common_pb.d.ts @@ -243,64 +243,6 @@ export declare enum AdminRole { * Describes the enum fits.api.v1.AdminRole. */ export declare const AdminRoleSchema: GenEnum; -/** - * InfraRole specifies what role a microservice needs to call this infra service - * - * @generated from enum fits.api.v1.InfraRole - */ -export declare enum InfraRole { - /** - * INFRA_ROLE_UNSPECIFIED is not specified - * - * @generated from enum value: INFRA_ROLE_UNSPECIFIED = 0; - */ - UNSPECIFIED = 0, - /** - * INFRA_ROLE_EDITOR a microservice needs at least editor role to call this method - * - * @generated from enum value: INFRA_ROLE_EDITOR = 1; - */ - EDITOR = 1, - /** - * INFRA_ROLE_VIEWER a microservice needs at least viewer role to call this method - * - * @generated from enum value: INFRA_ROLE_VIEWER = 2; - */ - VIEWER = 2 -} -/** - * Describes the enum fits.api.v1.InfraRole. - */ -export declare const InfraRoleSchema: GenEnum; -/** - * MachineRole specifies what role a microservice needs to call this machine service - * - * @generated from enum fits.api.v1.MachineRole - */ -export declare enum MachineRole { - /** - * MACHINE_ROLE_UNSPECIFIED is not specified - * - * @generated from enum value: MACHINE_ROLE_UNSPECIFIED = 0; - */ - UNSPECIFIED = 0, - /** - * MACHINE_ROLE_EDITOR a microservice needs at least editor role to call this method - * - * @generated from enum value: MACHINE_ROLE_EDITOR = 1; - */ - EDITOR = 1, - /** - * MACHINE_ROLE_VIEWER a microservice needs at least viewer role to call this method - * - * @generated from enum value: MACHINE_ROLE_VIEWER = 2; - */ - VIEWER = 2 -} -/** - * Describes the enum fits.api.v1.MachineRole. - */ -export declare const MachineRoleSchema: GenEnum; /** * Visibility of a method * diff --git a/js/fits/api/v1/common_pb.js b/js/fits/api/v1/common_pb.js index 58e9345..7b23b71 100644 --- a/js/fits/api/v1/common_pb.js +++ b/js/fits/api/v1/common_pb.js @@ -8,7 +8,7 @@ import { file_google_protobuf_descriptor, file_google_protobuf_timestamp } from /** * Describes the file fits/api/v1/common.proto. */ -export const file_fits_api_v1_common = /*@__PURE__*/ fileDesc("ChhmaXRzL2FwaS92MS9jb21tb24ucHJvdG8SC2ZpdHMuYXBpLnYxIkIKBlBhZ2luZxIRCgRwYWdlGAEgASgESACIAQESEgoFY291bnQYAiABKARIAYgBAUIHCgVfcGFnZUIICgZfY291bnQiiAEKBkxhYmVscxJPCgZsYWJlbHMYASADKAsyHy5maXRzLmFwaS52MS5MYWJlbHMuTGFiZWxzRW50cnlCHrpIG5oBGLiVuLECASIHcgUQARiAAioHcgUQABiAAhotCgtMYWJlbHNFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIq8BCgRNZXRhEigKBmxhYmVscxgBIAEoCzITLmZpdHMuYXBpLnYxLkxhYmVsc0gAiAEBEi4KCmNyZWF0ZWRfYXQYAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEi4KCnVwZGF0ZWRfYXQYAyABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEhIKCmdlbmVyYXRpb24YBCABKARCCQoHX2xhYmVscyJDCgxVcGRhdGVMYWJlbHMSIwoGdXBkYXRlGAEgASgLMhMuZml0cy5hcGkudjEuTGFiZWxzEg4KBnJlbW92ZRgCIAMoCSKIAQoKVXBkYXRlTWV0YRIuCgp1cGRhdGVkX2F0GAEgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBJKChBsb2NraW5nX3N0cmF0ZWd5GAIgASgOMiYuZml0cy5hcGkudjEuT3B0aW1pc3RpY0xvY2tpbmdTdHJhdGVneUIIukgFggECEAEqhwEKClRlbmFudFJvbGUSGwoXVEVOQU5UX1JPTEVfVU5TUEVDSUZJRUQQABIVChFURU5BTlRfUk9MRV9PV05FUhABEhYKElRFTkFOVF9ST0xFX0VESVRPUhACEhYKElRFTkFOVF9ST0xFX1ZJRVdFUhADEhUKEVRFTkFOVF9ST0xFX0dVRVNUEAQqdQoLUHJvamVjdFJvbGUSHAoYUFJPSkVDVF9ST0xFX1VOU1BFQ0lGSUVEEAASFgoSUFJPSkVDVF9ST0xFX09XTkVSEAESFwoTUFJPSkVDVF9ST0xFX0VESVRPUhACEhcKE1BST0pFQ1RfUk9MRV9WSUVXRVIQAypVCglBZG1pblJvbGUSGgoWQURNSU5fUk9MRV9VTlNQRUNJRklFRBAAEhUKEUFETUlOX1JPTEVfRURJVE9SEAESFQoRQURNSU5fUk9MRV9WSUVXRVIQAipVCglJbmZyYVJvbGUSGgoWSU5GUkFfUk9MRV9VTlNQRUNJRklFRBAAEhUKEUlORlJBX1JPTEVfRURJVE9SEAESFQoRSU5GUkFfUk9MRV9WSUVXRVIQAipdCgtNYWNoaW5lUm9sZRIcChhNQUNISU5FX1JPTEVfVU5TUEVDSUZJRUQQABIXChNNQUNISU5FX1JPTEVfRURJVE9SEAESFwoTTUFDSElORV9ST0xFX1ZJRVdFUhACKlQKClZpc2liaWxpdHkSGgoWVklTSUJJTElUWV9VTlNQRUNJRklFRBAAEhUKEVZJU0lCSUxJVFlfUFVCTElDEAESEwoPVklTSUJJTElUWV9TRUxGEAIqUgoIQXVkaXRpbmcSGAoUQVVESVRJTkdfVU5TUEVDSUZJRUQQABIVChFBVURJVElOR19JTkNMVURFRBABEhUKEUFVRElUSU5HX0VYQ0xVREVEEAIqmAEKGU9wdGltaXN0aWNMb2NraW5nU3RyYXRlZ3kSKwonT1BUSU1JU1RJQ19MT0NLSU5HX1NUUkFURUdZX1VOU1BFQ0lGSUVEEAASJgoiT1BUSU1JU1RJQ19MT0NLSU5HX1NUUkFURUdZX0NMSUVOVBABEiYKIk9QVElNSVNUSUNfTE9DS0lOR19TVFJBVEVHWV9TRVJWRVIQAjpcCgx0ZW5hbnRfcm9sZXMSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxi4jgMgAygOMhcuZml0cy5hcGkudjEuVGVuYW50Um9sZVILdGVuYW50Um9sZXM6XwoNcHJvamVjdF9yb2xlcxIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLmOAyADKA4yGC5maXRzLmFwaS52MS5Qcm9qZWN0Um9sZVIMcHJvamVjdFJvbGVzOlkKC2FkbWluX3JvbGVzEh4uZ29vZ2xlLnByb3RvYnVmLk1ldGhvZE9wdGlvbnMYuo4DIAMoDjIWLmZpdHMuYXBpLnYxLkFkbWluUm9sZVIKYWRtaW5Sb2xlczpZCgp2aXNpYmlsaXR5Eh4uZ29vZ2xlLnByb3RvYnVmLk1ldGhvZE9wdGlvbnMYu44DIAEoDjIXLmZpdHMuYXBpLnYxLlZpc2liaWxpdHlSCnZpc2liaWxpdHk6UwoIYXVkaXRpbmcSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxi8jgMgASgOMhUuZml0cy5hcGkudjEuQXVkaXRpbmdSCGF1ZGl0aW5nOk8KEWVudW1fc3RyaW5nX3ZhbHVlEiEuZ29vZ2xlLnByb3RvYnVmLkVudW1WYWx1ZU9wdGlvbnMYoJYDIAEoCVIPZW51bVN0cmluZ1ZhbHVlQpcBCg9jb20uZml0cy5hcGkudjFCC0NvbW1vblByb3RvUAFaKWdpdGh1Yi5jb20vZmktdHMvYXBpL2dvL2ZpdHMvYXBpL3YxO2FwaXYxogIDRkFYqgILRml0cy5BcGkuVjHKAgtGaXRzXEFwaVxWMeICF0ZpdHNcQXBpXFYxXEdQQk1ldGFkYXRh6gINRml0czo6QXBpOjpWMWIGcHJvdG8z", [file_buf_validate_validate, file_fits_api_v1_predefined_rules, file_google_protobuf_descriptor, file_google_protobuf_timestamp]); +export const file_fits_api_v1_common = /*@__PURE__*/ fileDesc("ChhmaXRzL2FwaS92MS9jb21tb24ucHJvdG8SC2ZpdHMuYXBpLnYxIkIKBlBhZ2luZxIRCgRwYWdlGAEgASgESACIAQESEgoFY291bnQYAiABKARIAYgBAUIHCgVfcGFnZUIICgZfY291bnQiiAEKBkxhYmVscxJPCgZsYWJlbHMYASADKAsyHy5maXRzLmFwaS52MS5MYWJlbHMuTGFiZWxzRW50cnlCHrpIG5oBGLiVuLECASIHcgUQARiAAioHcgUQABiAAhotCgtMYWJlbHNFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIq8BCgRNZXRhEigKBmxhYmVscxgBIAEoCzITLmZpdHMuYXBpLnYxLkxhYmVsc0gAiAEBEi4KCmNyZWF0ZWRfYXQYAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEi4KCnVwZGF0ZWRfYXQYAyABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEhIKCmdlbmVyYXRpb24YBCABKARCCQoHX2xhYmVscyJDCgxVcGRhdGVMYWJlbHMSIwoGdXBkYXRlGAEgASgLMhMuZml0cy5hcGkudjEuTGFiZWxzEg4KBnJlbW92ZRgCIAMoCSKIAQoKVXBkYXRlTWV0YRIuCgp1cGRhdGVkX2F0GAEgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBJKChBsb2NraW5nX3N0cmF0ZWd5GAIgASgOMiYuZml0cy5hcGkudjEuT3B0aW1pc3RpY0xvY2tpbmdTdHJhdGVneUIIukgFggECEAEqhwEKClRlbmFudFJvbGUSGwoXVEVOQU5UX1JPTEVfVU5TUEVDSUZJRUQQABIVChFURU5BTlRfUk9MRV9PV05FUhABEhYKElRFTkFOVF9ST0xFX0VESVRPUhACEhYKElRFTkFOVF9ST0xFX1ZJRVdFUhADEhUKEVRFTkFOVF9ST0xFX0dVRVNUEAQqdQoLUHJvamVjdFJvbGUSHAoYUFJPSkVDVF9ST0xFX1VOU1BFQ0lGSUVEEAASFgoSUFJPSkVDVF9ST0xFX09XTkVSEAESFwoTUFJPSkVDVF9ST0xFX0VESVRPUhACEhcKE1BST0pFQ1RfUk9MRV9WSUVXRVIQAypVCglBZG1pblJvbGUSGgoWQURNSU5fUk9MRV9VTlNQRUNJRklFRBAAEhUKEUFETUlOX1JPTEVfRURJVE9SEAESFQoRQURNSU5fUk9MRV9WSUVXRVIQAipUCgpWaXNpYmlsaXR5EhoKFlZJU0lCSUxJVFlfVU5TUEVDSUZJRUQQABIVChFWSVNJQklMSVRZX1BVQkxJQxABEhMKD1ZJU0lCSUxJVFlfU0VMRhACKlIKCEF1ZGl0aW5nEhgKFEFVRElUSU5HX1VOU1BFQ0lGSUVEEAASFQoRQVVESVRJTkdfSU5DTFVERUQQARIVChFBVURJVElOR19FWENMVURFRBACKpgBChlPcHRpbWlzdGljTG9ja2luZ1N0cmF0ZWd5EisKJ09QVElNSVNUSUNfTE9DS0lOR19TVFJBVEVHWV9VTlNQRUNJRklFRBAAEiYKIk9QVElNSVNUSUNfTE9DS0lOR19TVFJBVEVHWV9DTElFTlQQARImCiJPUFRJTUlTVElDX0xPQ0tJTkdfU1RSQVRFR1lfU0VSVkVSEAI6XAoMdGVuYW50X3JvbGVzEh4uZ29vZ2xlLnByb3RvYnVmLk1ldGhvZE9wdGlvbnMYuI4DIAMoDjIXLmZpdHMuYXBpLnYxLlRlbmFudFJvbGVSC3RlbmFudFJvbGVzOl8KDXByb2plY3Rfcm9sZXMSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxi5jgMgAygOMhguZml0cy5hcGkudjEuUHJvamVjdFJvbGVSDHByb2plY3RSb2xlczpZCgthZG1pbl9yb2xlcxIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLqOAyADKA4yFi5maXRzLmFwaS52MS5BZG1pblJvbGVSCmFkbWluUm9sZXM6WQoKdmlzaWJpbGl0eRIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLuOAyABKA4yFy5maXRzLmFwaS52MS5WaXNpYmlsaXR5Ugp2aXNpYmlsaXR5OlMKCGF1ZGl0aW5nEh4uZ29vZ2xlLnByb3RvYnVmLk1ldGhvZE9wdGlvbnMYvI4DIAEoDjIVLmZpdHMuYXBpLnYxLkF1ZGl0aW5nUghhdWRpdGluZzpPChFlbnVtX3N0cmluZ192YWx1ZRIhLmdvb2dsZS5wcm90b2J1Zi5FbnVtVmFsdWVPcHRpb25zGKCWAyABKAlSD2VudW1TdHJpbmdWYWx1ZUKXAQoPY29tLmZpdHMuYXBpLnYxQgtDb21tb25Qcm90b1ABWilnaXRodWIuY29tL2ZpLXRzL2FwaS9nby9maXRzL2FwaS92MTthcGl2MaICA0ZBWKoCC0ZpdHMuQXBpLlYxygILRml0c1xBcGlcVjHiAhdGaXRzXEFwaVxWMVxHUEJNZXRhZGF0YeoCDUZpdHM6OkFwaTo6VjFiBnByb3RvMw", [file_buf_validate_validate, file_fits_api_v1_predefined_rules, file_google_protobuf_descriptor, file_google_protobuf_timestamp]); /** * Describes the message fits.api.v1.Paging. * Use `create(PagingSchema)` to create a new message. @@ -144,66 +144,6 @@ export var AdminRole; * Describes the enum fits.api.v1.AdminRole. */ export const AdminRoleSchema = /*@__PURE__*/ enumDesc(file_fits_api_v1_common, 2); -/** - * InfraRole specifies what role a microservice needs to call this infra service - * - * @generated from enum fits.api.v1.InfraRole - */ -export var InfraRole; -(function (InfraRole) { - /** - * INFRA_ROLE_UNSPECIFIED is not specified - * - * @generated from enum value: INFRA_ROLE_UNSPECIFIED = 0; - */ - InfraRole[InfraRole["UNSPECIFIED"] = 0] = "UNSPECIFIED"; - /** - * INFRA_ROLE_EDITOR a microservice needs at least editor role to call this method - * - * @generated from enum value: INFRA_ROLE_EDITOR = 1; - */ - InfraRole[InfraRole["EDITOR"] = 1] = "EDITOR"; - /** - * INFRA_ROLE_VIEWER a microservice needs at least viewer role to call this method - * - * @generated from enum value: INFRA_ROLE_VIEWER = 2; - */ - InfraRole[InfraRole["VIEWER"] = 2] = "VIEWER"; -})(InfraRole || (InfraRole = {})); -/** - * Describes the enum fits.api.v1.InfraRole. - */ -export const InfraRoleSchema = /*@__PURE__*/ enumDesc(file_fits_api_v1_common, 3); -/** - * MachineRole specifies what role a microservice needs to call this machine service - * - * @generated from enum fits.api.v1.MachineRole - */ -export var MachineRole; -(function (MachineRole) { - /** - * MACHINE_ROLE_UNSPECIFIED is not specified - * - * @generated from enum value: MACHINE_ROLE_UNSPECIFIED = 0; - */ - MachineRole[MachineRole["UNSPECIFIED"] = 0] = "UNSPECIFIED"; - /** - * MACHINE_ROLE_EDITOR a microservice needs at least editor role to call this method - * - * @generated from enum value: MACHINE_ROLE_EDITOR = 1; - */ - MachineRole[MachineRole["EDITOR"] = 1] = "EDITOR"; - /** - * MACHINE_ROLE_VIEWER a microservice needs at least viewer role to call this method - * - * @generated from enum value: MACHINE_ROLE_VIEWER = 2; - */ - MachineRole[MachineRole["VIEWER"] = 2] = "VIEWER"; -})(MachineRole || (MachineRole = {})); -/** - * Describes the enum fits.api.v1.MachineRole. - */ -export const MachineRoleSchema = /*@__PURE__*/ enumDesc(file_fits_api_v1_common, 4); /** * Visibility of a method * @@ -233,7 +173,7 @@ export var Visibility; /** * Describes the enum fits.api.v1.Visibility. */ -export const VisibilitySchema = /*@__PURE__*/ enumDesc(file_fits_api_v1_common, 5); +export const VisibilitySchema = /*@__PURE__*/ enumDesc(file_fits_api_v1_common, 3); /** * Auditing option specified per service method * by default all service methods are included @@ -265,7 +205,7 @@ export var Auditing; /** * Describes the enum fits.api.v1.Auditing. */ -export const AuditingSchema = /*@__PURE__*/ enumDesc(file_fits_api_v1_common, 6); +export const AuditingSchema = /*@__PURE__*/ enumDesc(file_fits_api_v1_common, 4); /** * OptimisticLockingStrategy defines how optimistic locking should be handled. * It defaults to client side, which requires the UpdatedAt timestamp to be provided @@ -297,7 +237,7 @@ export var OptimisticLockingStrategy; /** * Describes the enum fits.api.v1.OptimisticLockingStrategy. */ -export const OptimisticLockingStrategySchema = /*@__PURE__*/ enumDesc(file_fits_api_v1_common, 7); +export const OptimisticLockingStrategySchema = /*@__PURE__*/ enumDesc(file_fits_api_v1_common, 5); /** * TenantRoles are used to define which tenant role a logged in user must provide to call this method * diff --git a/js/fits/api/v1/common_pb.ts b/js/fits/api/v1/common_pb.ts index 8b8ebbb..5c6f21c 100644 --- a/js/fits/api/v1/common_pb.ts +++ b/js/fits/api/v1/common_pb.ts @@ -14,7 +14,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file fits/api/v1/common.proto. */ export const file_fits_api_v1_common: GenFile = /*@__PURE__*/ - fileDesc("ChhmaXRzL2FwaS92MS9jb21tb24ucHJvdG8SC2ZpdHMuYXBpLnYxIkIKBlBhZ2luZxIRCgRwYWdlGAEgASgESACIAQESEgoFY291bnQYAiABKARIAYgBAUIHCgVfcGFnZUIICgZfY291bnQiiAEKBkxhYmVscxJPCgZsYWJlbHMYASADKAsyHy5maXRzLmFwaS52MS5MYWJlbHMuTGFiZWxzRW50cnlCHrpIG5oBGLiVuLECASIHcgUQARiAAioHcgUQABiAAhotCgtMYWJlbHNFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIq8BCgRNZXRhEigKBmxhYmVscxgBIAEoCzITLmZpdHMuYXBpLnYxLkxhYmVsc0gAiAEBEi4KCmNyZWF0ZWRfYXQYAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEi4KCnVwZGF0ZWRfYXQYAyABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEhIKCmdlbmVyYXRpb24YBCABKARCCQoHX2xhYmVscyJDCgxVcGRhdGVMYWJlbHMSIwoGdXBkYXRlGAEgASgLMhMuZml0cy5hcGkudjEuTGFiZWxzEg4KBnJlbW92ZRgCIAMoCSKIAQoKVXBkYXRlTWV0YRIuCgp1cGRhdGVkX2F0GAEgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBJKChBsb2NraW5nX3N0cmF0ZWd5GAIgASgOMiYuZml0cy5hcGkudjEuT3B0aW1pc3RpY0xvY2tpbmdTdHJhdGVneUIIukgFggECEAEqhwEKClRlbmFudFJvbGUSGwoXVEVOQU5UX1JPTEVfVU5TUEVDSUZJRUQQABIVChFURU5BTlRfUk9MRV9PV05FUhABEhYKElRFTkFOVF9ST0xFX0VESVRPUhACEhYKElRFTkFOVF9ST0xFX1ZJRVdFUhADEhUKEVRFTkFOVF9ST0xFX0dVRVNUEAQqdQoLUHJvamVjdFJvbGUSHAoYUFJPSkVDVF9ST0xFX1VOU1BFQ0lGSUVEEAASFgoSUFJPSkVDVF9ST0xFX09XTkVSEAESFwoTUFJPSkVDVF9ST0xFX0VESVRPUhACEhcKE1BST0pFQ1RfUk9MRV9WSUVXRVIQAypVCglBZG1pblJvbGUSGgoWQURNSU5fUk9MRV9VTlNQRUNJRklFRBAAEhUKEUFETUlOX1JPTEVfRURJVE9SEAESFQoRQURNSU5fUk9MRV9WSUVXRVIQAipVCglJbmZyYVJvbGUSGgoWSU5GUkFfUk9MRV9VTlNQRUNJRklFRBAAEhUKEUlORlJBX1JPTEVfRURJVE9SEAESFQoRSU5GUkFfUk9MRV9WSUVXRVIQAipdCgtNYWNoaW5lUm9sZRIcChhNQUNISU5FX1JPTEVfVU5TUEVDSUZJRUQQABIXChNNQUNISU5FX1JPTEVfRURJVE9SEAESFwoTTUFDSElORV9ST0xFX1ZJRVdFUhACKlQKClZpc2liaWxpdHkSGgoWVklTSUJJTElUWV9VTlNQRUNJRklFRBAAEhUKEVZJU0lCSUxJVFlfUFVCTElDEAESEwoPVklTSUJJTElUWV9TRUxGEAIqUgoIQXVkaXRpbmcSGAoUQVVESVRJTkdfVU5TUEVDSUZJRUQQABIVChFBVURJVElOR19JTkNMVURFRBABEhUKEUFVRElUSU5HX0VYQ0xVREVEEAIqmAEKGU9wdGltaXN0aWNMb2NraW5nU3RyYXRlZ3kSKwonT1BUSU1JU1RJQ19MT0NLSU5HX1NUUkFURUdZX1VOU1BFQ0lGSUVEEAASJgoiT1BUSU1JU1RJQ19MT0NLSU5HX1NUUkFURUdZX0NMSUVOVBABEiYKIk9QVElNSVNUSUNfTE9DS0lOR19TVFJBVEVHWV9TRVJWRVIQAjpcCgx0ZW5hbnRfcm9sZXMSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxi4jgMgAygOMhcuZml0cy5hcGkudjEuVGVuYW50Um9sZVILdGVuYW50Um9sZXM6XwoNcHJvamVjdF9yb2xlcxIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLmOAyADKA4yGC5maXRzLmFwaS52MS5Qcm9qZWN0Um9sZVIMcHJvamVjdFJvbGVzOlkKC2FkbWluX3JvbGVzEh4uZ29vZ2xlLnByb3RvYnVmLk1ldGhvZE9wdGlvbnMYuo4DIAMoDjIWLmZpdHMuYXBpLnYxLkFkbWluUm9sZVIKYWRtaW5Sb2xlczpZCgp2aXNpYmlsaXR5Eh4uZ29vZ2xlLnByb3RvYnVmLk1ldGhvZE9wdGlvbnMYu44DIAEoDjIXLmZpdHMuYXBpLnYxLlZpc2liaWxpdHlSCnZpc2liaWxpdHk6UwoIYXVkaXRpbmcSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxi8jgMgASgOMhUuZml0cy5hcGkudjEuQXVkaXRpbmdSCGF1ZGl0aW5nOk8KEWVudW1fc3RyaW5nX3ZhbHVlEiEuZ29vZ2xlLnByb3RvYnVmLkVudW1WYWx1ZU9wdGlvbnMYoJYDIAEoCVIPZW51bVN0cmluZ1ZhbHVlQpcBCg9jb20uZml0cy5hcGkudjFCC0NvbW1vblByb3RvUAFaKWdpdGh1Yi5jb20vZmktdHMvYXBpL2dvL2ZpdHMvYXBpL3YxO2FwaXYxogIDRkFYqgILRml0cy5BcGkuVjHKAgtGaXRzXEFwaVxWMeICF0ZpdHNcQXBpXFYxXEdQQk1ldGFkYXRh6gINRml0czo6QXBpOjpWMWIGcHJvdG8z", [file_buf_validate_validate, file_fits_api_v1_predefined_rules, file_google_protobuf_descriptor, file_google_protobuf_timestamp]); + fileDesc("ChhmaXRzL2FwaS92MS9jb21tb24ucHJvdG8SC2ZpdHMuYXBpLnYxIkIKBlBhZ2luZxIRCgRwYWdlGAEgASgESACIAQESEgoFY291bnQYAiABKARIAYgBAUIHCgVfcGFnZUIICgZfY291bnQiiAEKBkxhYmVscxJPCgZsYWJlbHMYASADKAsyHy5maXRzLmFwaS52MS5MYWJlbHMuTGFiZWxzRW50cnlCHrpIG5oBGLiVuLECASIHcgUQARiAAioHcgUQABiAAhotCgtMYWJlbHNFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIq8BCgRNZXRhEigKBmxhYmVscxgBIAEoCzITLmZpdHMuYXBpLnYxLkxhYmVsc0gAiAEBEi4KCmNyZWF0ZWRfYXQYAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEi4KCnVwZGF0ZWRfYXQYAyABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEhIKCmdlbmVyYXRpb24YBCABKARCCQoHX2xhYmVscyJDCgxVcGRhdGVMYWJlbHMSIwoGdXBkYXRlGAEgASgLMhMuZml0cy5hcGkudjEuTGFiZWxzEg4KBnJlbW92ZRgCIAMoCSKIAQoKVXBkYXRlTWV0YRIuCgp1cGRhdGVkX2F0GAEgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBJKChBsb2NraW5nX3N0cmF0ZWd5GAIgASgOMiYuZml0cy5hcGkudjEuT3B0aW1pc3RpY0xvY2tpbmdTdHJhdGVneUIIukgFggECEAEqhwEKClRlbmFudFJvbGUSGwoXVEVOQU5UX1JPTEVfVU5TUEVDSUZJRUQQABIVChFURU5BTlRfUk9MRV9PV05FUhABEhYKElRFTkFOVF9ST0xFX0VESVRPUhACEhYKElRFTkFOVF9ST0xFX1ZJRVdFUhADEhUKEVRFTkFOVF9ST0xFX0dVRVNUEAQqdQoLUHJvamVjdFJvbGUSHAoYUFJPSkVDVF9ST0xFX1VOU1BFQ0lGSUVEEAASFgoSUFJPSkVDVF9ST0xFX09XTkVSEAESFwoTUFJPSkVDVF9ST0xFX0VESVRPUhACEhcKE1BST0pFQ1RfUk9MRV9WSUVXRVIQAypVCglBZG1pblJvbGUSGgoWQURNSU5fUk9MRV9VTlNQRUNJRklFRBAAEhUKEUFETUlOX1JPTEVfRURJVE9SEAESFQoRQURNSU5fUk9MRV9WSUVXRVIQAipUCgpWaXNpYmlsaXR5EhoKFlZJU0lCSUxJVFlfVU5TUEVDSUZJRUQQABIVChFWSVNJQklMSVRZX1BVQkxJQxABEhMKD1ZJU0lCSUxJVFlfU0VMRhACKlIKCEF1ZGl0aW5nEhgKFEFVRElUSU5HX1VOU1BFQ0lGSUVEEAASFQoRQVVESVRJTkdfSU5DTFVERUQQARIVChFBVURJVElOR19FWENMVURFRBACKpgBChlPcHRpbWlzdGljTG9ja2luZ1N0cmF0ZWd5EisKJ09QVElNSVNUSUNfTE9DS0lOR19TVFJBVEVHWV9VTlNQRUNJRklFRBAAEiYKIk9QVElNSVNUSUNfTE9DS0lOR19TVFJBVEVHWV9DTElFTlQQARImCiJPUFRJTUlTVElDX0xPQ0tJTkdfU1RSQVRFR1lfU0VSVkVSEAI6XAoMdGVuYW50X3JvbGVzEh4uZ29vZ2xlLnByb3RvYnVmLk1ldGhvZE9wdGlvbnMYuI4DIAMoDjIXLmZpdHMuYXBpLnYxLlRlbmFudFJvbGVSC3RlbmFudFJvbGVzOl8KDXByb2plY3Rfcm9sZXMSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxi5jgMgAygOMhguZml0cy5hcGkudjEuUHJvamVjdFJvbGVSDHByb2plY3RSb2xlczpZCgthZG1pbl9yb2xlcxIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLqOAyADKA4yFi5maXRzLmFwaS52MS5BZG1pblJvbGVSCmFkbWluUm9sZXM6WQoKdmlzaWJpbGl0eRIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLuOAyABKA4yFy5maXRzLmFwaS52MS5WaXNpYmlsaXR5Ugp2aXNpYmlsaXR5OlMKCGF1ZGl0aW5nEh4uZ29vZ2xlLnByb3RvYnVmLk1ldGhvZE9wdGlvbnMYvI4DIAEoDjIVLmZpdHMuYXBpLnYxLkF1ZGl0aW5nUghhdWRpdGluZzpPChFlbnVtX3N0cmluZ192YWx1ZRIhLmdvb2dsZS5wcm90b2J1Zi5FbnVtVmFsdWVPcHRpb25zGKCWAyABKAlSD2VudW1TdHJpbmdWYWx1ZUKXAQoPY29tLmZpdHMuYXBpLnYxQgtDb21tb25Qcm90b1ABWilnaXRodWIuY29tL2ZpLXRzL2FwaS9nby9maXRzL2FwaS92MTthcGl2MaICA0ZBWKoCC0ZpdHMuQXBpLlYxygILRml0c1xBcGlcVjHiAhdGaXRzXEFwaVxWMVxHUEJNZXRhZGF0YeoCDUZpdHM6OkFwaTo6VjFiBnByb3RvMw", [file_buf_validate_validate, file_fits_api_v1_predefined_rules, file_google_protobuf_descriptor, file_google_protobuf_timestamp]); /** * Paging defines paging for methods with a lot of results @@ -291,74 +291,6 @@ export enum AdminRole { export const AdminRoleSchema: GenEnum = /*@__PURE__*/ enumDesc(file_fits_api_v1_common, 2); -/** - * InfraRole specifies what role a microservice needs to call this infra service - * - * @generated from enum fits.api.v1.InfraRole - */ -export enum InfraRole { - /** - * INFRA_ROLE_UNSPECIFIED is not specified - * - * @generated from enum value: INFRA_ROLE_UNSPECIFIED = 0; - */ - UNSPECIFIED = 0, - - /** - * INFRA_ROLE_EDITOR a microservice needs at least editor role to call this method - * - * @generated from enum value: INFRA_ROLE_EDITOR = 1; - */ - EDITOR = 1, - - /** - * INFRA_ROLE_VIEWER a microservice needs at least viewer role to call this method - * - * @generated from enum value: INFRA_ROLE_VIEWER = 2; - */ - VIEWER = 2, -} - -/** - * Describes the enum fits.api.v1.InfraRole. - */ -export const InfraRoleSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_fits_api_v1_common, 3); - -/** - * MachineRole specifies what role a microservice needs to call this machine service - * - * @generated from enum fits.api.v1.MachineRole - */ -export enum MachineRole { - /** - * MACHINE_ROLE_UNSPECIFIED is not specified - * - * @generated from enum value: MACHINE_ROLE_UNSPECIFIED = 0; - */ - UNSPECIFIED = 0, - - /** - * MACHINE_ROLE_EDITOR a microservice needs at least editor role to call this method - * - * @generated from enum value: MACHINE_ROLE_EDITOR = 1; - */ - EDITOR = 1, - - /** - * MACHINE_ROLE_VIEWER a microservice needs at least viewer role to call this method - * - * @generated from enum value: MACHINE_ROLE_VIEWER = 2; - */ - VIEWER = 2, -} - -/** - * Describes the enum fits.api.v1.MachineRole. - */ -export const MachineRoleSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_fits_api_v1_common, 4); - /** * Visibility of a method * @@ -391,7 +323,7 @@ export enum Visibility { * Describes the enum fits.api.v1.Visibility. */ export const VisibilitySchema: GenEnum = /*@__PURE__*/ - enumDesc(file_fits_api_v1_common, 5); + enumDesc(file_fits_api_v1_common, 3); /** * Auditing option specified per service method @@ -427,7 +359,7 @@ export enum Auditing { * Describes the enum fits.api.v1.Auditing. */ export const AuditingSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_fits_api_v1_common, 6); + enumDesc(file_fits_api_v1_common, 4); /** * OptimisticLockingStrategy defines how optimistic locking should be handled. @@ -463,7 +395,7 @@ export enum OptimisticLockingStrategy { * Describes the enum fits.api.v1.OptimisticLockingStrategy. */ export const OptimisticLockingStrategySchema: GenEnum = /*@__PURE__*/ - enumDesc(file_fits_api_v1_common, 7); + enumDesc(file_fits_api_v1_common, 5); /** * TenantRoles are used to define which tenant role a logged in user must provide to call this method diff --git a/proto/fits/api/v1/common.proto b/proto/fits/api/v1/common.proto index dad0bfd..8daf65c 100644 --- a/proto/fits/api/v1/common.proto +++ b/proto/fits/api/v1/common.proto @@ -45,26 +45,6 @@ enum AdminRole { ADMIN_ROLE_VIEWER = 2; } -// InfraRole specifies what role a microservice needs to call this infra service -enum InfraRole { - // INFRA_ROLE_UNSPECIFIED is not specified - INFRA_ROLE_UNSPECIFIED = 0; - // INFRA_ROLE_EDITOR a microservice needs at least editor role to call this method - INFRA_ROLE_EDITOR = 1; - // INFRA_ROLE_VIEWER a microservice needs at least viewer role to call this method - INFRA_ROLE_VIEWER = 2; -} - -// MachineRole specifies what role a microservice needs to call this machine service -enum MachineRole { - // MACHINE_ROLE_UNSPECIFIED is not specified - MACHINE_ROLE_UNSPECIFIED = 0; - // MACHINE_ROLE_EDITOR a microservice needs at least editor role to call this method - MACHINE_ROLE_EDITOR = 1; - // MACHINE_ROLE_VIEWER a microservice needs at least viewer role to call this method - MACHINE_ROLE_VIEWER = 2; -} - // Visibility of a method enum Visibility { // VISIBILITY_UNSPECIFIED is not defined diff --git a/python/fits/api/v1/common_pb2.py b/python/fits/api/v1/common_pb2.py index 9aa1b6e..c63376a 100644 --- a/python/fits/api/v1/common_pb2.py +++ b/python/fits/api/v1/common_pb2.py @@ -28,7 +28,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18\x66its/api/v1/common.proto\x12\x0b\x66its.api.v1\x1a\x1b\x62uf/validate/validate.proto\x1a\"fits/api/v1/predefined_rules.proto\x1a google/protobuf/descriptor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"O\n\x06Paging\x12\x17\n\x04page\x18\x01 \x01(\x04H\x00R\x04page\x88\x01\x01\x12\x19\n\x05\x63ount\x18\x02 \x01(\x04H\x01R\x05\x63ount\x88\x01\x01\x42\x07\n\x05_pageB\x08\n\x06_count\"\x9c\x01\n\x06Labels\x12W\n\x06labels\x18\x01 \x03(\x0b\x32\x1f.fits.api.v1.Labels.LabelsEntryB\x1e\xbaH\x1b\x9a\x01\x18\"\x07r\x05\x10\x01\x18\x80\x02*\x07r\x05\x10\x00\x18\x80\x02\xb8\x95\xb8\xb1\x02\x01R\x06labels\x1a\x39\n\x0bLabelsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\xd9\x01\n\x04Meta\x12\x30\n\x06labels\x18\x01 \x01(\x0b\x32\x13.fits.api.v1.LabelsH\x00R\x06labels\x88\x01\x01\x12\x39\n\ncreated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAt\x12\x39\n\nupdated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x1e\n\ngeneration\x18\x04 \x01(\x04R\ngenerationB\t\n\x07_labels\"S\n\x0cUpdateLabels\x12+\n\x06update\x18\x01 \x01(\x0b\x32\x13.fits.api.v1.LabelsR\x06update\x12\x16\n\x06remove\x18\x02 \x03(\tR\x06remove\"\xa4\x01\n\nUpdateMeta\x12\x39\n\nupdated_at\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tupdatedAt\x12[\n\x10locking_strategy\x18\x02 \x01(\x0e\x32&.fits.api.v1.OptimisticLockingStrategyB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x0flockingStrategy*\x87\x01\n\nTenantRole\x12\x1b\n\x17TENANT_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11TENANT_ROLE_OWNER\x10\x01\x12\x16\n\x12TENANT_ROLE_EDITOR\x10\x02\x12\x16\n\x12TENANT_ROLE_VIEWER\x10\x03\x12\x15\n\x11TENANT_ROLE_GUEST\x10\x04*u\n\x0bProjectRole\x12\x1c\n\x18PROJECT_ROLE_UNSPECIFIED\x10\x00\x12\x16\n\x12PROJECT_ROLE_OWNER\x10\x01\x12\x17\n\x13PROJECT_ROLE_EDITOR\x10\x02\x12\x17\n\x13PROJECT_ROLE_VIEWER\x10\x03*U\n\tAdminRole\x12\x1a\n\x16\x41\x44MIN_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x41\x44MIN_ROLE_EDITOR\x10\x01\x12\x15\n\x11\x41\x44MIN_ROLE_VIEWER\x10\x02*U\n\tInfraRole\x12\x1a\n\x16INFRA_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11INFRA_ROLE_EDITOR\x10\x01\x12\x15\n\x11INFRA_ROLE_VIEWER\x10\x02*]\n\x0bMachineRole\x12\x1c\n\x18MACHINE_ROLE_UNSPECIFIED\x10\x00\x12\x17\n\x13MACHINE_ROLE_EDITOR\x10\x01\x12\x17\n\x13MACHINE_ROLE_VIEWER\x10\x02*T\n\nVisibility\x12\x1a\n\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x15\n\x11VISIBILITY_PUBLIC\x10\x01\x12\x13\n\x0fVISIBILITY_SELF\x10\x02*R\n\x08\x41uditing\x12\x18\n\x14\x41UDITING_UNSPECIFIED\x10\x00\x12\x15\n\x11\x41UDITING_INCLUDED\x10\x01\x12\x15\n\x11\x41UDITING_EXCLUDED\x10\x02*\x98\x01\n\x19OptimisticLockingStrategy\x12+\n\'OPTIMISTIC_LOCKING_STRATEGY_UNSPECIFIED\x10\x00\x12&\n\"OPTIMISTIC_LOCKING_STRATEGY_CLIENT\x10\x01\x12&\n\"OPTIMISTIC_LOCKING_STRATEGY_SERVER\x10\x02:\\\n\x0ctenant_roles\x12\x1e.google.protobuf.MethodOptions\x18\xb8\x8e\x03 \x03(\x0e\x32\x17.fits.api.v1.TenantRoleR\x0btenantRoles:_\n\rproject_roles\x12\x1e.google.protobuf.MethodOptions\x18\xb9\x8e\x03 \x03(\x0e\x32\x18.fits.api.v1.ProjectRoleR\x0cprojectRoles:Y\n\x0b\x61\x64min_roles\x12\x1e.google.protobuf.MethodOptions\x18\xba\x8e\x03 \x03(\x0e\x32\x16.fits.api.v1.AdminRoleR\nadminRoles:Y\n\nvisibility\x12\x1e.google.protobuf.MethodOptions\x18\xbb\x8e\x03 \x01(\x0e\x32\x17.fits.api.v1.VisibilityR\nvisibility:S\n\x08\x61uditing\x12\x1e.google.protobuf.MethodOptions\x18\xbc\x8e\x03 \x01(\x0e\x32\x15.fits.api.v1.AuditingR\x08\x61uditing:O\n\x11\x65num_string_value\x12!.google.protobuf.EnumValueOptions\x18\xa0\x96\x03 \x01(\tR\x0f\x65numStringValueB\x97\x01\n\x0f\x63om.fits.api.v1B\x0b\x43ommonProtoP\x01Z)github.com/fi-ts/api/go/fits/api/v1;apiv1\xa2\x02\x03\x46\x41X\xaa\x02\x0b\x46its.Api.V1\xca\x02\x0b\x46its\\Api\\V1\xe2\x02\x17\x46its\\Api\\V1\\GPBMetadata\xea\x02\rFits::Api::V1b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18\x66its/api/v1/common.proto\x12\x0b\x66its.api.v1\x1a\x1b\x62uf/validate/validate.proto\x1a\"fits/api/v1/predefined_rules.proto\x1a google/protobuf/descriptor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"O\n\x06Paging\x12\x17\n\x04page\x18\x01 \x01(\x04H\x00R\x04page\x88\x01\x01\x12\x19\n\x05\x63ount\x18\x02 \x01(\x04H\x01R\x05\x63ount\x88\x01\x01\x42\x07\n\x05_pageB\x08\n\x06_count\"\x9c\x01\n\x06Labels\x12W\n\x06labels\x18\x01 \x03(\x0b\x32\x1f.fits.api.v1.Labels.LabelsEntryB\x1e\xbaH\x1b\x9a\x01\x18\"\x07r\x05\x10\x01\x18\x80\x02*\x07r\x05\x10\x00\x18\x80\x02\xb8\x95\xb8\xb1\x02\x01R\x06labels\x1a\x39\n\x0bLabelsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\xd9\x01\n\x04Meta\x12\x30\n\x06labels\x18\x01 \x01(\x0b\x32\x13.fits.api.v1.LabelsH\x00R\x06labels\x88\x01\x01\x12\x39\n\ncreated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAt\x12\x39\n\nupdated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x1e\n\ngeneration\x18\x04 \x01(\x04R\ngenerationB\t\n\x07_labels\"S\n\x0cUpdateLabels\x12+\n\x06update\x18\x01 \x01(\x0b\x32\x13.fits.api.v1.LabelsR\x06update\x12\x16\n\x06remove\x18\x02 \x03(\tR\x06remove\"\xa4\x01\n\nUpdateMeta\x12\x39\n\nupdated_at\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tupdatedAt\x12[\n\x10locking_strategy\x18\x02 \x01(\x0e\x32&.fits.api.v1.OptimisticLockingStrategyB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x0flockingStrategy*\x87\x01\n\nTenantRole\x12\x1b\n\x17TENANT_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11TENANT_ROLE_OWNER\x10\x01\x12\x16\n\x12TENANT_ROLE_EDITOR\x10\x02\x12\x16\n\x12TENANT_ROLE_VIEWER\x10\x03\x12\x15\n\x11TENANT_ROLE_GUEST\x10\x04*u\n\x0bProjectRole\x12\x1c\n\x18PROJECT_ROLE_UNSPECIFIED\x10\x00\x12\x16\n\x12PROJECT_ROLE_OWNER\x10\x01\x12\x17\n\x13PROJECT_ROLE_EDITOR\x10\x02\x12\x17\n\x13PROJECT_ROLE_VIEWER\x10\x03*U\n\tAdminRole\x12\x1a\n\x16\x41\x44MIN_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x41\x44MIN_ROLE_EDITOR\x10\x01\x12\x15\n\x11\x41\x44MIN_ROLE_VIEWER\x10\x02*T\n\nVisibility\x12\x1a\n\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x15\n\x11VISIBILITY_PUBLIC\x10\x01\x12\x13\n\x0fVISIBILITY_SELF\x10\x02*R\n\x08\x41uditing\x12\x18\n\x14\x41UDITING_UNSPECIFIED\x10\x00\x12\x15\n\x11\x41UDITING_INCLUDED\x10\x01\x12\x15\n\x11\x41UDITING_EXCLUDED\x10\x02*\x98\x01\n\x19OptimisticLockingStrategy\x12+\n\'OPTIMISTIC_LOCKING_STRATEGY_UNSPECIFIED\x10\x00\x12&\n\"OPTIMISTIC_LOCKING_STRATEGY_CLIENT\x10\x01\x12&\n\"OPTIMISTIC_LOCKING_STRATEGY_SERVER\x10\x02:\\\n\x0ctenant_roles\x12\x1e.google.protobuf.MethodOptions\x18\xb8\x8e\x03 \x03(\x0e\x32\x17.fits.api.v1.TenantRoleR\x0btenantRoles:_\n\rproject_roles\x12\x1e.google.protobuf.MethodOptions\x18\xb9\x8e\x03 \x03(\x0e\x32\x18.fits.api.v1.ProjectRoleR\x0cprojectRoles:Y\n\x0b\x61\x64min_roles\x12\x1e.google.protobuf.MethodOptions\x18\xba\x8e\x03 \x03(\x0e\x32\x16.fits.api.v1.AdminRoleR\nadminRoles:Y\n\nvisibility\x12\x1e.google.protobuf.MethodOptions\x18\xbb\x8e\x03 \x01(\x0e\x32\x17.fits.api.v1.VisibilityR\nvisibility:S\n\x08\x61uditing\x12\x1e.google.protobuf.MethodOptions\x18\xbc\x8e\x03 \x01(\x0e\x32\x15.fits.api.v1.AuditingR\x08\x61uditing:O\n\x11\x65num_string_value\x12!.google.protobuf.EnumValueOptions\x18\xa0\x96\x03 \x01(\tR\x0f\x65numStringValueB\x97\x01\n\x0f\x63om.fits.api.v1B\x0b\x43ommonProtoP\x01Z)github.com/fi-ts/api/go/fits/api/v1;apiv1\xa2\x02\x03\x46\x41X\xaa\x02\x0b\x46its.Api.V1\xca\x02\x0b\x46its\\Api\\V1\xe2\x02\x17\x46its\\Api\\V1\\GPBMetadata\xea\x02\rFits::Api::V1b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -48,16 +48,12 @@ _globals['_PROJECTROLE']._serialized_end=1140 _globals['_ADMINROLE']._serialized_start=1142 _globals['_ADMINROLE']._serialized_end=1227 - _globals['_INFRAROLE']._serialized_start=1229 - _globals['_INFRAROLE']._serialized_end=1314 - _globals['_MACHINEROLE']._serialized_start=1316 - _globals['_MACHINEROLE']._serialized_end=1409 - _globals['_VISIBILITY']._serialized_start=1411 - _globals['_VISIBILITY']._serialized_end=1495 - _globals['_AUDITING']._serialized_start=1497 - _globals['_AUDITING']._serialized_end=1579 - _globals['_OPTIMISTICLOCKINGSTRATEGY']._serialized_start=1582 - _globals['_OPTIMISTICLOCKINGSTRATEGY']._serialized_end=1734 + _globals['_VISIBILITY']._serialized_start=1229 + _globals['_VISIBILITY']._serialized_end=1313 + _globals['_AUDITING']._serialized_start=1315 + _globals['_AUDITING']._serialized_end=1397 + _globals['_OPTIMISTICLOCKINGSTRATEGY']._serialized_start=1400 + _globals['_OPTIMISTICLOCKINGSTRATEGY']._serialized_end=1552 _globals['_PAGING']._serialized_start=173 _globals['_PAGING']._serialized_end=252 _globals['_LABELS']._serialized_start=255 diff --git a/python/fits/api/v1/common_pb2.pyi b/python/fits/api/v1/common_pb2.pyi index a104308..7c205e5 100644 --- a/python/fits/api/v1/common_pb2.pyi +++ b/python/fits/api/v1/common_pb2.pyi @@ -34,18 +34,6 @@ class AdminRole(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): ADMIN_ROLE_EDITOR: _ClassVar[AdminRole] ADMIN_ROLE_VIEWER: _ClassVar[AdminRole] -class InfraRole(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - INFRA_ROLE_UNSPECIFIED: _ClassVar[InfraRole] - INFRA_ROLE_EDITOR: _ClassVar[InfraRole] - INFRA_ROLE_VIEWER: _ClassVar[InfraRole] - -class MachineRole(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - MACHINE_ROLE_UNSPECIFIED: _ClassVar[MachineRole] - MACHINE_ROLE_EDITOR: _ClassVar[MachineRole] - MACHINE_ROLE_VIEWER: _ClassVar[MachineRole] - class Visibility(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () VISIBILITY_UNSPECIFIED: _ClassVar[Visibility] @@ -75,12 +63,6 @@ PROJECT_ROLE_VIEWER: ProjectRole ADMIN_ROLE_UNSPECIFIED: AdminRole ADMIN_ROLE_EDITOR: AdminRole ADMIN_ROLE_VIEWER: AdminRole -INFRA_ROLE_UNSPECIFIED: InfraRole -INFRA_ROLE_EDITOR: InfraRole -INFRA_ROLE_VIEWER: InfraRole -MACHINE_ROLE_UNSPECIFIED: MachineRole -MACHINE_ROLE_EDITOR: MachineRole -MACHINE_ROLE_VIEWER: MachineRole VISIBILITY_UNSPECIFIED: Visibility VISIBILITY_PUBLIC: Visibility VISIBILITY_SELF: Visibility diff --git a/python/fits/client/tests/conftest.py b/python/fits/client/tests/conftest.py index bdda0be..ba6bfbd 100644 --- a/python/fits/client/tests/conftest.py +++ b/python/fits/client/tests/conftest.py @@ -1,4 +1,3 @@ -from collections.abc import Iterator from typing import Any import pyqwest @@ -15,14 +14,6 @@ VersionServiceWSGIApplication, ) from fits.client.client import Client -from fits.infra.v1 import bmc_pb2 -from fits.infra.v1 import component_pb2 as infra_component_pb2 -from fits.infra.v1.bmc_connect import ( - BMCServiceWSGIApplication, -) -from fits.infra.v1.component_connect import ( - ComponentServiceWSGIApplication, -) class MockVersionService: @@ -70,49 +61,6 @@ def delete( return ip_pb2.IPServiceDeleteResponse() -class MockBMCService: - def __init__(self): - self.received_auth: str | None = None - - def update_b_m_c_info( - self, request: bmc_pb2.UpdateBMCInfoRequest, ctx: RequestContext - ) -> bmc_pb2.UpdateBMCInfoResponse: - self.received_auth = ctx.request_headers().get("authorization") - return bmc_pb2.UpdateBMCInfoResponse() - - def wait_for_b_m_c_command( - self, request: bmc_pb2.WaitForBMCCommandRequest, ctx: RequestContext - ) -> Iterator[bmc_pb2.WaitForBMCCommandResponse]: - self.received_auth = ctx.request_headers().get("authorization") - yield bmc_pb2.WaitForBMCCommandResponse(uuid="test-uuid", command_id="cmd-1") - - def b_m_c_command_done( - self, request: bmc_pb2.BMCCommandDoneRequest, ctx: RequestContext - ) -> bmc_pb2.BMCCommandDoneResponse: - return bmc_pb2.BMCCommandDoneResponse() - - -class MockComponentService: - def __init__(self): - self.pings: list[infra_component_pb2.ComponentServicePingRequest] = [] - - def ping( - self, - request: infra_component_pb2.ComponentServicePingRequest, - ctx: RequestContext, - ) -> infra_component_pb2.ComponentServicePingResponse: - self.pings.append( - infra_component_pb2.ComponentServicePingRequest( - type=request.type, - identifier=request.identifier, - started_at=request.started_at, - interval=request.interval, - version=request.version, - ) - ) - return infra_component_pb2.ComponentServicePingResponse() - - def _build_combined_wsgi_app(services: dict[str, Any]): """Build a combined WSGI app that dispatches by path prefix.""" @@ -138,22 +86,10 @@ def mock_ip_service(): return MockIPService() -@pytest.fixture -def mock_bmc_service(): - return MockBMCService() - - -@pytest.fixture -def mock_component_service(): - return MockComponentService() - - @pytest.fixture def test_client( mock_version_service, mock_ip_service, - mock_bmc_service, - mock_component_service, ): """Create a Client with WSGI-backed transport for testing.""" services = { @@ -161,10 +97,6 @@ def test_client( mock_version_service ), "/fits.api.v1.IPService": IPServiceWSGIApplication(mock_ip_service), - "/fits.infra.v1.BMCService": BMCServiceWSGIApplication(mock_bmc_service), - "/fits.infra.v1.ComponentService": ComponentServiceWSGIApplication( - mock_component_service - ), } transport = WSGITransport(_build_combined_wsgi_app(services)) c = Client(baseurl="http://test", timeout=10) diff --git a/python/fits/client/tests/test_client.py b/python/fits/client/tests/test_client.py index ebee1bc..692b06c 100644 --- a/python/fits/client/tests/test_client.py +++ b/python/fits/client/tests/test_client.py @@ -1,7 +1,7 @@ """Tests mirroring go/client/client_test.go. -Test_Client -> test_client_apiv2_version_get -Test_ClientInterceptors -> test_client_auth_header_unary, test_client_auth_header_streaming +Test_Client -> test_client_apiv1_version_get +Test_ClientInterceptors -> test_client_auth_header_ip_get """ import pyqwest @@ -19,20 +19,8 @@ VersionServiceWSGIApplication, ) from fits.client.client import Client -from fits.infra.v1 import bmc_pb2 -from fits.infra.v1.bmc_connect import ( - BMCServiceClientSync, - BMCServiceWSGIApplication, -) -from fits.infra.v1 import component_pb2 as infra_component_pb2 -from fits.infra.v1.component_connect import ( - ComponentServiceClientSync, - ComponentServiceWSGIApplication, -) from .conftest import ( - MockBMCService, - MockComponentService, MockIPService, MockVersionService, _build_combined_wsgi_app, @@ -46,37 +34,32 @@ class TestClient: """ def test_client_creates_service_groups(self, test_client): - """Client exposes adminv2, apiv2, infrav2 service groups.""" - assert test_client.apiv2() is not None - assert test_client.infrav2() is not None + """Client exposes the apiv1 service group.""" + assert test_client.apiv1() is not None - def test_client_apiv2_version_get(self, test_client, mock_version_service): + def test_client_apiv1_version_get(self, test_client, mock_version_service): """Version.Get returns the expected version through the Client wrapper.""" - resp = test_client.apiv2().version().get( + resp = test_client.apiv1().version().get( request=version_pb2.VersionServiceGetRequest() ) assert resp is not None assert resp.version.version == "1.0" - def test_client_apiv2_version_get_custom_version(self, mock_version_service): + def test_client_apiv1_version_get_custom_version(self, mock_version_service): """Client can be configured with a custom version response.""" mock_version_service._version = "2.5.3" vs = MockVersionService(version="2.5.3") ips = MockIPService() - bmc = MockBMCService() - cs = MockComponentService() services = { "/fits.api.v1.VersionService": VersionServiceWSGIApplication(vs), "/fits.api.v1.IPService": IPServiceWSGIApplication(ips), - "/fits.infra.v1.BMCService": BMCServiceWSGIApplication(bmc), - "/fits.infra.v1.ComponentService": ComponentServiceWSGIApplication(cs), } transport = WSGITransport(_build_combined_wsgi_app(services)) c = Client(baseurl="http://test", timeout=10) c._client = pyqwest.SyncClient(transport=transport) - resp = c.apiv2().version().get( + resp = c.apiv1().version().get( request=version_pb2.VersionServiceGetRequest() ) assert resp.version.version == "2.5.3" @@ -85,35 +68,13 @@ def test_client_apiv2_version_get_custom_version(self, mock_version_service): class TestClientInterceptors: """Mirrors Test_ClientInterceptors from client_test.go. - Tests that auth headers are correctly passed for both unary and streaming calls. + Tests that auth headers are correctly passed on unary calls. """ - def test_client_auth_header_unary(self, test_client, mock_bmc_service): - """Unary call has Authorization header set.""" - token = "test-bearer-token" - resp = test_client.infrav2().bmc().update_b_m_c_info( - request=bmc_pb2.UpdateBMCInfoRequest(), - headers={"authorization": f"Bearer {token}"}, - ) - assert resp is not None - assert mock_bmc_service.received_auth == f"Bearer {token}" - - def test_client_auth_header_streaming(self, test_client, mock_bmc_service): - """Streaming call has Authorization header set.""" - token = "test-stream-token" - stream = test_client.infrav2().bmc().wait_for_b_m_c_command( - request=bmc_pb2.WaitForBMCCommandRequest(), - headers={"authorization": f"Bearer {token}"}, - ) - assert stream is not None - for cmd in stream: - assert cmd.uuid == "test-uuid" - assert mock_bmc_service.received_auth == f"Bearer {token}" - def test_client_auth_header_ip_get(self, test_client, mock_ip_service): """IP Get call has Authorization header set.""" token = "ip-service-token" - resp = test_client.apiv2().ip().get( + resp = test_client.apiv1().ip().get( request=ip_pb2.IPServiceGetRequest(ip="10.0.0.1"), headers={"authorization": f"Bearer {token}"}, ) diff --git a/python/fits/client/tests/test_interceptor.py b/python/fits/client/tests/test_interceptor.py index 056ddb2..38e4b3f 100644 --- a/python/fits/client/tests/test_interceptor.py +++ b/python/fits/client/tests/test_interceptor.py @@ -64,27 +64,7 @@ class TestInterceptor: def test_interceptor_receives_request(self, mock_ip_service): """Interceptor can observe the service and method being called.""" ips = MockIPService() - from fits.infra.v1.bmc_connect import BMCServiceWSGIApplication - from fits.infra.v1.component_connect import ComponentServiceWSGIApplication from fits.api.v1.version_connect import VersionServiceWSGIApplication - from fits.infra.v1 import bmc_pb2 - from fits.infra.v1 import component_pb2 as infra_component_pb2 - - class NoopBMC: - def update_b_m_c_info(self, request, ctx): - from fits.infra.v1.bmc_pb2 import UpdateBMCInfoResponse - return UpdateBMCInfoResponse() - def wait_for_b_m_c_command(self, request, ctx): - from fits.infra.v1.bmc_pb2 import WaitForBMCCommandResponse - yield WaitForBMCCommandResponse() - def b_m_c_command_done(self, request, ctx): - from fits.infra.v1.bmc_pb2 import BMCCommandDoneResponse - return BMCCommandDoneResponse() - - class NoopComponent: - def ping(self, request, ctx): - from fits.infra.v1.component_pb2 import ComponentServicePingResponse - return ComponentServicePingResponse() class NoopVersion: def get(self, request, ctx): @@ -94,8 +74,6 @@ def get(self, request, ctx): services = { "/fits.api.v1.VersionService": VersionServiceWSGIApplication(NoopVersion()), "/fits.api.v1.IPService": IPServiceWSGIApplication(ips), - "/fits.infra.v1.BMCService": BMCServiceWSGIApplication(NoopBMC()), - "/fits.infra.v1.ComponentService": ComponentServiceWSGIApplication(NoopComponent()), } transport = WSGITransport(_build_combined_wsgi_app(services)) @@ -118,26 +96,8 @@ def get(self, request, ctx): def test_auth_interceptor_injects_token(self): """Auth interceptor injects Authorization header that the server receives.""" ips = MockIPService() - from fits.infra.v1.bmc_connect import BMCServiceWSGIApplication - from fits.infra.v1.component_connect import ComponentServiceWSGIApplication from fits.api.v1.version_connect import VersionServiceWSGIApplication - class NoopBMC: - def update_b_m_c_info(self, request, ctx): - from fits.infra.v1.bmc_pb2 import UpdateBMCInfoResponse - return UpdateBMCInfoResponse() - def wait_for_b_m_c_command(self, request, ctx): - from fits.infra.v1.bmc_pb2 import WaitForBMCCommandResponse - yield WaitForBMCCommandResponse() - def b_m_c_command_done(self, request, ctx): - from fits.infra.v1.bmc_pb2 import BMCCommandDoneResponse - return BMCCommandDoneResponse() - - class NoopComponent: - def ping(self, request, ctx): - from fits.infra.v1.component_pb2 import ComponentServicePingResponse - return ComponentServicePingResponse() - class NoopVersion: def get(self, request, ctx): from fits.api.v1.version_pb2 import VersionServiceGetResponse, Version @@ -146,8 +106,6 @@ def get(self, request, ctx): services = { "/fits.api.v1.VersionService": VersionServiceWSGIApplication(NoopVersion()), "/fits.api.v1.IPService": IPServiceWSGIApplication(ips), - "/fits.infra.v1.BMCService": BMCServiceWSGIApplication(NoopBMC()), - "/fits.infra.v1.ComponentService": ComponentServiceWSGIApplication(NoopComponent()), } transport = WSGITransport(_build_combined_wsgi_app(services)) @@ -165,7 +123,7 @@ def get(self, request, ctx): def test_interceptor_on_client_wrapper(self, test_client, mock_ip_service): """Client wrapper passes headers through to the underlying service.""" token = "wrapper-test-token" - resp = test_client.apiv2().ip().get( + resp = test_client.apiv1().ip().get( request=ip_pb2.IPServiceGetRequest(ip="5.6.7.8"), headers={"authorization": f"Bearer {token}"}, ) diff --git a/python/fits/client/tests/test_ping.py b/python/fits/client/tests/test_ping.py deleted file mode 100644 index e95fec6..0000000 --- a/python/fits/client/tests/test_ping.py +++ /dev/null @@ -1,103 +0,0 @@ -"""Tests mirroring go/client/ping_test.go. - -Tests the ComponentService.Ping RPC which is used by the Go client's Ping() method. -The Python client doesn't have a built-in Ping() method, but we test the underlying -ComponentService call that would be used to implement one. -""" - -import threading -import time -from datetime import timedelta - -import pytest -from google.protobuf import duration_pb2, timestamp_pb2 - -from fits.api.v1 import component_pb2 as api_component_pb2 -from fits.api.v1 import version_pb2 -from fits.infra.v1 import component_pb2 as infra_component_pb2 - - -class TestPing: - """Mirrors Test_Ping from ping_test.go. - - Verifies that ComponentServicePingRequest is correctly constructed and sent, - and that the mock service receives the expected fields. - """ - - def test_ping_request_fields(self, test_client, mock_component_service): - """Ping request contains correct component type, identifier, started_at, interval, version.""" - started_at = timestamp_pb2.Timestamp(seconds=1000) - interval = duration_pb2.Duration(seconds=5) - version = version_pb2.Version(version="1.0.0", git_sha1="abc123") - - resp = test_client.infrav2().component().ping( - request=infra_component_pb2.ComponentServicePingRequest( - type=api_component_pb2.COMPONENT_TYPE_METAL_CORE, - identifier="server01", - started_at=started_at, - interval=interval, - version=version, - ), - headers={"authorization": "Bearer test-token"}, - ) - - assert resp is not None - assert len(mock_component_service.pings) == 1 - - ping = mock_component_service.pings[0] - assert ping.type == api_component_pb2.COMPONENT_TYPE_METAL_CORE - assert ping.identifier == "server01" - assert ping.started_at.seconds == 1000 - assert ping.interval.seconds == 5 - assert ping.version.version == "1.0.0" - assert ping.version.git_sha1 == "abc123" - - def test_ping_multiple_requests(self, test_client, mock_component_service): - """Multiple ping calls are recorded correctly.""" - started_at = timestamp_pb2.Timestamp(seconds=2000) - interval = duration_pb2.Duration(seconds=10) - - for _ in range(3): - test_client.infrav2().component().ping( - request=infra_component_pb2.ComponentServicePingRequest( - type=api_component_pb2.COMPONENT_TYPE_METAL_CORE, - identifier="server02", - started_at=started_at, - interval=interval, - ), - headers={"authorization": "Bearer test-token"}, - ) - - assert len(mock_component_service.pings) == 3 - for ping in mock_component_service.pings: - assert ping.identifier == "server02" - assert ping.type == api_component_pb2.COMPONENT_TYPE_METAL_CORE - assert ping.started_at.seconds == 2000 - assert ping.interval.seconds == 10 - - def test_ping_background_simulation(self, test_client, mock_component_service): - """Simulate background pinging from a thread, similar to Go's ticker goroutine.""" - started_at = timestamp_pb2.Timestamp(seconds=3000) - interval = duration_pb2.Duration(seconds=1) - ping_count = 5 - - def do_pings(): - for _ in range(ping_count): - test_client.infrav2().component().ping( - request=infra_component_pb2.ComponentServicePingRequest( - type=api_component_pb2.COMPONENT_TYPE_METAL_CORE, - identifier="background-worker", - started_at=started_at, - interval=interval, - ), - headers={"authorization": "Bearer test-token"}, - ) - time.sleep(0.05) - - thread = threading.Thread(target=do_pings) - thread.start() - thread.join() - - assert len(mock_component_service.pings) == ping_count - for ping in mock_component_service.pings: - assert ping.identifier == "background-worker" From 762b39a71b67a530508cd5e2967c2394bb8841a1 Mon Sep 17 00:00:00 2001 From: Valentin Knabel Date: Mon, 7 Sep 2026 10:51:47 +0200 Subject: [PATCH 5/5] chore: review --- .github/workflows/main.yml | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec45b0c..b34a789 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: uses: actions/checkout@v7 - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@v7 with: go-version-file: "go.mod" cache: false @@ -68,7 +68,7 @@ jobs: uses: crate-ci/typos@master - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@v7 with: go-version-file: "go.mod" cache: false @@ -104,18 +104,20 @@ jobs: env: VERSION: ${{ env.tag }} - - name: Publish to Test PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.test_pypi_password }} - repository-url: https://test.pypi.org/legacy/ - skip-existing: true - packages-dir: python/dist - if: ${{ github.event_name != 'release' }} - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.pypi_password }} - packages-dir: python/dist - if: ${{ github.event_name == 'release' }} + # SKIP pypi push as not required at the moment + # + # - name: Publish to Test PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # password: ${{ secrets.test_pypi_password }} + # repository-url: https://test.pypi.org/legacy/ + # skip-existing: true + # packages-dir: python/dist + # if: ${{ github.event_name != 'release' }} + + # - name: Publish to PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # password: ${{ secrets.pypi_password }} + # packages-dir: python/dist + # if: ${{ github.event_name == 'release' }}