From 229d08b8e12c4685412324ac2fe9640f34aa9df5 Mon Sep 17 00:00:00 2001 From: "databricks-ci-ghec-2[bot]" <184307802+databricks-ci-ghec-2[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 03:13:19 +0000 Subject: [PATCH] Release sdk-go --- .agent/prompts/code-review.md | 2 +- .agent/rules/style-guide.md | 66 - .codegen/_last_sha | 2 +- .github/workflows/ci.yml | 39 + AGENTS.md | 1 - accessmanagement/CHANGELOG.md | 8 + accessmanagement/internal/version.go | 2 +- accessmanagement/v1/client.go | 297 + accessmanagement/v1/model.go | 59 + accessmanagement/v1/wire.go | 1147 ++++ agentkit/CHANGELOG.md | 8 + agentkit/internal/version.go | 2 +- agentkit/v1/wire.go | 1488 +++++ aifunctions/CHANGELOG.md | 8 + aifunctions/internal/version.go | 2 +- aifunctions/v1/client.go | 13 +- aifunctions/v1/model.go | 70 +- aifunctions/v1/wire.go | 672 ++ aigateway/CHANGELOG.md | 8 + aigateway/internal/version.go | 2 +- aigateway/v1/wire.go | 1714 +++++- aisearch/CHANGELOG.md | 8 + aisearch/internal/version.go | 2 +- aisearch/v1/wire.go | 936 +++ alerts/CHANGELOG.md | 8 + alerts/internal/version.go | 2 +- alerts/v1/wire.go | 361 ++ alerts/v2/client.go | 6 +- alerts/v2/model.go | 86 +- alerts/v2/wire.go | 409 ++ apps/CHANGELOG.md | 8 + apps/internal/version.go | 2 +- apps/v1/model.go | 3 + apps/v1/wire.go | 1691 +++++ authentication/CHANGELOG.md | 8 + authentication/internal/version.go | 2 +- authentication/v1/wire.go | 480 ++ budgetpolicy/CHANGELOG.md | 8 + budgetpolicy/internal/version.go | 2 +- budgetpolicy/v1/wire.go | 264 + budgets/CHANGELOG.md | 8 + budgets/internal/version.go | 2 +- budgets/v1/wire.go | 648 ++ cleanrooms/CHANGELOG.md | 8 + cleanrooms/internal/version.go | 2 +- cleanrooms/v1/wire.go | 1664 ++++- clusterlibraries/CHANGELOG.md | 8 + clusterlibraries/internal/version.go | 2 +- clusterlibraries/v2/wire.go | 313 + clusterpolicies/CHANGELOG.md | 8 + clusterpolicies/internal/version.go | 2 +- clusterpolicies/v2/wire.go | 576 ++ clusters/CHANGELOG.md | 8 + clusters/internal/version.go | 2 +- clusters/v2/wire.go | 2124 ++++++- commandexecution/CHANGELOG.md | 8 + commandexecution/internal/version.go | 2 +- commandexecution/v2/wire.go | 288 + computemigrations/CHANGELOG.md | 8 + computemigrations/internal/version.go | 2 +- computemigrations/v1/wire.go | 432 ++ customllms/CHANGELOG.md | 8 + customllms/internal/version.go | 2 +- customllms/v1/wire.go | 217 + database/CHANGELOG.md | 8 + database/internal/version.go | 2 +- database/v1/wire.go | 1224 ++++ dataclassification/CHANGELOG.md | 8 + dataclassification/internal/version.go | 2 +- dataclassification/v1/wire.go | 169 + dataquality/CHANGELOG.md | 8 + dataquality/internal/version.go | 2 +- dataquality/v1/wire.go | 600 ++ disasterrecovery/CHANGELOG.md | 8 + disasterrecovery/internal/version.go | 2 +- disasterrecovery/v1/wire.go | 481 ++ domains/CHANGELOG.md | 8 + domains/internal/version.go | 2 +- domains/v1/wire.go | 192 + environments/CHANGELOG.md | 8 + environments/internal/version.go | 2 +- environments/v1/wire.go | 408 ++ experiments/CHANGELOG.md | 8 + experiments/internal/version.go | 2 +- experiments/v1/wire.go | 2434 +++++++- features/CHANGELOG.md | 8 + features/internal/version.go | 2 +- features/v1/model.go | 16 +- features/v1/wire.go | 3448 ++++++++++- featurestore/CHANGELOG.md | 8 + featurestore/internal/version.go | 2 +- featurestore/v1/wire.go | 265 + files/CHANGELOG.md | 8 + files/internal/version.go | 2 +- files/v2/wire.go | 792 +++ forecasting/CHANGELOG.md | 8 + forecasting/internal/version.go | 2 +- forecasting/v1/wire.go | 96 + genie/CHANGELOG.md | 8 + genie/internal/version.go | 2 +- genie/v1/wire.go | 1760 +++++- genieagents/CHANGELOG.md | 8 + genieagents/internal/version.go | 2 +- genieagents/v1/wire.go | 745 +++ gitcredentials/CHANGELOG.md | 8 + gitcredentials/internal/version.go | 2 +- gitcredentials/v1/wire.go | 264 + globalinitscripts/CHANGELOG.md | 8 + globalinitscripts/internal/version.go | 2 +- globalinitscripts/v2/wire.go | 240 + instancepools/CHANGELOG.md | 8 + instancepools/internal/version.go | 2 +- instancepools/v2/wire.go | 529 ++ instanceprofiles/CHANGELOG.md | 8 + instanceprofiles/internal/version.go | 2 +- instanceprofiles/v2/wire.go | 217 + jobs/CHANGELOG.md | 8 + jobs/internal/version.go | 2 +- jobs/v2/wire.go | 5754 +++++++++++++++++- keyconfigurations/CHANGELOG.md | 8 + keyconfigurations/internal/version.go | 2 +- keyconfigurations/v1/wire.go | 336 + knowledge/CHANGELOG.md | 8 + knowledge/internal/version.go | 2 +- knowledge/v1/wire.go | 265 + knowledgeassistants/CHANGELOG.md | 8 + knowledgeassistants/internal/version.go | 2 +- knowledgeassistants/v1/wire.go | 601 ++ lakeview/CHANGELOG.md | 8 + lakeview/internal/version.go | 2 +- lakeview/v1/wire.go | 960 +++ lakewatch/CHANGELOG.md | 8 + lakewatch/internal/version.go | 2 +- lakewatch/v1/model.go | 46 +- lakewatch/v1/wire.go | 1264 +++- logdelivery/CHANGELOG.md | 8 + logdelivery/internal/version.go | 2 +- logdelivery/v1/wire.go | 264 + marketplaces/CHANGELOG.md | 8 + marketplaces/internal/version.go | 2 +- marketplaces/v1/wire.go | 2994 ++++++++- modelregistry/CHANGELOG.md | 8 + modelregistry/internal/version.go | 2 +- modelregistry/v1/wire.go | 1878 +++++- modelserving/CHANGELOG.md | 8 + modelserving/internal/version.go | 2 +- modelserving/v1/model.go | 154 +- modelserving/v1/wire.go | 1725 +++++- modelservingquery/CHANGELOG.md | 8 + modelservingquery/internal/version.go | 2 +- modelservingquery/v1/wire.go | 144 + networking/CHANGELOG.md | 8 + networking/internal/version.go | 2 +- networking/v1/wire.go | 3504 ++++++++++- notificationdestinations/CHANGELOG.md | 8 + notificationdestinations/internal/version.go | 2 +- notificationdestinations/v1/wire.go | 408 ++ oauth/CHANGELOG.md | 8 + oauth/internal/version.go | 2 +- oauth/v1/wire.go | 672 ++ pipelines/CHANGELOG.md | 8 + pipelines/internal/version.go | 2 +- pipelines/v2/wire.go | 2822 ++++++++- policyfamilies/CHANGELOG.md | 8 + policyfamilies/internal/version.go | 2 +- policyfamilies/v2/wire.go | 96 + postgres/CHANGELOG.md | 8 + postgres/internal/version.go | 2 +- postgres/v1/model.go | 52 +- postgres/v1/wire.go | 3692 ++++++++++- queries/CHANGELOG.md | 8 + queries/internal/version.go | 2 +- queries/v1/wire.go | 553 ++ queryhistory/CHANGELOG.md | 8 + queryhistory/internal/version.go | 2 +- queryhistory/v1/wire.go | 288 + repos/CHANGELOG.md | 8 + repos/internal/version.go | 2 +- repos/v1/wire.go | 312 + sandbox/CHANGELOG.md | 8 + sandbox/internal/version.go | 2 +- sandbox/v1/wire.go | 768 +++ scim/CHANGELOG.md | 8 + scim/internal/version.go | 2 +- scim/v1/wire.go | 1706 +++++- secrets/CHANGELOG.md | 8 + secrets/internal/version.go | 2 +- secrets/v1/wire.go | 600 ++ settings/CHANGELOG.md | 8 + settings/internal/version.go | 2 +- settings/v2/wire.go | 961 +++ sharing/CHANGELOG.md | 8 + sharing/internal/version.go | 2 +- sharing/v1/wire.go | 1780 +++++- softwareartifacts/CHANGELOG.md | 8 + softwareartifacts/internal/version.go | 2 +- softwareartifacts/v1/wire.go | 289 + statementexecution/CHANGELOG.md | 8 + statementexecution/internal/version.go | 2 +- statementexecution/v1/wire.go | 384 ++ storageconfigurations/CHANGELOG.md | 8 + storageconfigurations/internal/version.go | 2 +- storageconfigurations/v1/wire.go | 168 + supervisoragents/CHANGELOG.md | 8 + supervisoragents/internal/version.go | 2 +- supervisoragents/v1/wire.go | 649 ++ tagassignments/CHANGELOG.md | 8 + tagassignments/internal/version.go | 2 +- tagassignments/v1/wire.go | 169 + tagpolicies/CHANGELOG.md | 8 + tagpolicies/internal/version.go | 2 +- tagpolicies/v1/wire.go | 193 + tokenmanagement/CHANGELOG.md | 8 + tokenmanagement/internal/version.go | 2 +- tokenmanagement/v1/wire.go | 240 + tokens/CHANGELOG.md | 8 + tokens/internal/version.go | 2 +- tokens/v1/wire.go | 216 + uc/abacpolicies/CHANGELOG.md | 8 + uc/abacpolicies/internal/version.go | 2 +- uc/abacpolicies/v1/wire.go | 456 ++ uc/artifactallowlists/CHANGELOG.md | 8 + uc/artifactallowlists/internal/version.go | 2 +- uc/artifactallowlists/v1/wire.go | 96 + uc/catalogs/CHANGELOG.md | 8 + uc/catalogs/internal/version.go | 2 +- uc/catalogs/v1/wire.go | 288 + uc/connections/CHANGELOG.md | 8 + uc/connections/internal/version.go | 2 +- uc/connections/v1/wire.go | 240 + uc/credentials/CHANGELOG.md | 8 + uc/credentials/internal/version.go | 2 +- uc/credentials/v1/wire.go | 1542 ++++- uc/entitytagassignments/CHANGELOG.md | 8 + uc/entitytagassignments/internal/version.go | 2 +- uc/entitytagassignments/v1/wire.go | 169 + uc/externallineage/CHANGELOG.md | 8 + uc/externallineage/internal/version.go | 2 +- uc/externallineage/v1/wire.go | 504 ++ uc/externallocations/CHANGELOG.md | 8 + uc/externallocations/internal/version.go | 2 +- uc/externallocations/v1/wire.go | 336 + uc/externalmetadata/CHANGELOG.md | 8 + uc/externalmetadata/internal/version.go | 2 +- uc/externalmetadata/v1/wire.go | 169 + uc/functions/CHANGELOG.md | 8 + uc/functions/internal/version.go | 2 +- uc/functions/v1/wire.go | 408 ++ uc/grants/CHANGELOG.md | 8 + uc/grants/internal/version.go | 2 +- uc/grants/v1/wire.go | 337 + uc/metastores/CHANGELOG.md | 8 + uc/metastores/internal/version.go | 2 +- uc/metastores/v1/wire.go | 1008 +++ uc/onlinetables/CHANGELOG.md | 8 + uc/onlinetables/internal/version.go | 2 +- uc/onlinetables/v1/wire.go | 336 + uc/registeredmodels/CHANGELOG.md | 8 + uc/registeredmodels/internal/version.go | 2 +- uc/registeredmodels/v1/wire.go | 624 ++ uc/resourcequotas/CHANGELOG.md | 8 + uc/resourcequotas/internal/version.go | 2 +- uc/resourcequotas/v1/wire.go | 120 + uc/rfa/CHANGELOG.md | 8 + uc/rfa/internal/version.go | 2 +- uc/rfa/v1/wire.go | 265 + uc/schemas/CHANGELOG.md | 8 + uc/schemas/internal/version.go | 2 +- uc/schemas/v1/wire.go | 216 + uc/secrets/CHANGELOG.md | 8 + uc/secrets/internal/version.go | 2 +- uc/secrets/v1/wire.go | 169 + uc/systemschemas/CHANGELOG.md | 8 + uc/systemschemas/internal/version.go | 2 +- uc/systemschemas/v1/wire.go | 169 + uc/tables/CHANGELOG.md | 8 + uc/tables/internal/version.go | 2 +- uc/tables/v1/wire.go | 888 +++ uc/volumes/CHANGELOG.md | 8 + uc/volumes/internal/version.go | 2 +- uc/volumes/v1/wire.go | 240 + uc/workspacebindings/CHANGELOG.md | 8 + uc/workspacebindings/internal/version.go | 2 +- uc/workspacebindings/v1/wire.go | 216 + usagedashboards/CHANGELOG.md | 8 + usagedashboards/internal/version.go | 2 +- usagedashboards/v1/wire.go | 96 + vectorsearch/CHANGELOG.md | 8 + vectorsearch/internal/version.go | 2 +- vectorsearch/v1/wire.go | 1420 ++++- warehouses/CHANGELOG.md | 8 + warehouses/internal/version.go | 2 +- warehouses/v1/wire.go | 840 +++ workspacefiles/CHANGELOG.md | 8 + workspacefiles/internal/version.go | 2 +- workspacefiles/v1/wire.go | 312 + workspaces/CHANGELOG.md | 8 + workspaces/internal/version.go | 2 +- workspaces/v1/wire.go | 336 + 299 files changed, 79145 insertions(+), 450 deletions(-) delete mode 100644 .agent/rules/style-guide.md diff --git a/.agent/prompts/code-review.md b/.agent/prompts/code-review.md index c241f9b3..8ad869df 100644 --- a/.agent/prompts/code-review.md +++ b/.agent/prompts/code-review.md @@ -11,7 +11,7 @@ Review the given PR or code changes for the following concerns, in order of prio in `.agent/rules/testing.md`? 5. **API design** — Does the change follow the principles in `.agent/rules/api-design.md`? Is the exported surface minimal? -6. **Style** — Does the code follow `.agent/rules/style-guide.md`? Are names descriptive? +6. **Style** — Is the code idiomatic Go? Are names descriptive? Are doc comments present on exported symbols? For each issue found, state the file and line, the concern category, and a diff --git a/.agent/rules/style-guide.md b/.agent/rules/style-guide.md deleted file mode 100644 index 3665d8d3..00000000 --- a/.agent/rules/style-guide.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -description: "Go code style and naming conventions for the Databricks SDK." -globs: "**/*.go" -alwaysApply: false ---- - -# Code Style - -- Go 1.25+ idioms: range-over-int, `min`/`max` builtins -- Format with `gofmt` -- All exported functions and types need doc comments: `// FuncName does X.` -- Interface doc comments should explain the **contract/lifecycle** — when methods are called, - what callers expect, and when errors are appropriate — not just what they do -- Return early on errors; avoid deeply nested if-else chains -- Use `context.Context` as the first parameter for functions that do I/O - -## Naming - -- Acronyms are fully capitalized: `ID` not `Id`, `URL` not `Url`, `HTTP` not `Http` -- No `Get` prefix on methods — not idiomatic in Go. Use `HostType()` not `GetHostType()` -- Avoid abbreviations: `authTokenCommand` not `authTokenCmd` -- Variable names describe content, not origin: `workspaceHost` not `resolvedHost` -- Use specific names when multiple similar types exist: `httpClient` not `client` - -## Go Idioms - -- **Exhaustive switches**: prefer `switch` over `if-else` chains for type/enum dispatching. - Always include a `default` case that returns an error for unknown values -- **`sync.Once`** over manual double-checked locking with mutexes — it is safer and - respects Go's memory model -- **Scope variables tightly**: use `:=` inside `if` blocks when the variable is not needed - outside: `if err := json.Unmarshal(raw, &f); err != nil {` -- **Use stdlib functions** over manual equivalents: `math.Ceil`, `json.Marshal`, - `slices.Sort`, `slices.Compact`, `sort.Strings` -- **No forced line length**: Go does not mandate 80-char lines. Prefer keeping function - signatures on one line, or use one argument per line for very long signatures -- **Config structs over long parameter lists**: when a function takes many parameters, - group them in a config struct - ([Google Go style](https://google.github.io/styleguide/go/best-practices#option-structure)) -- **Don't alias imports unnecessarily**: only alias when there is a genuine name collision -- **Use `sync.Mutex` directly**, not through an interface — the zero value is valid and - needs no initialization - -## Code Organization - -- **Keep related code close together**: place constructors near the types they return, - move helper functions near their callers -- **Declare variables close to where they're used**: don't declare at the top of a function - if the variable is only needed 30 lines later -- **Inline simple helpers** when they obscure intent — a one-line function called once - adds indirection without value. Remove unnecessary intermediate variables that suggest - the value might be mutated when it won't be -- **Move branching out of callbacks**: if a visitor/callback is only needed conditionally, - check the condition first, then register the callback — don't put the `if` inside - -## Comments and Documentation - -- **Full sentences**: comments start with a capital letter and end with a period. - Ref: [Go Code Review Comments](https://go.dev/wiki/CodeReviewComments#comment-sentences) -- **Explain why, not what**: the code is self-explanatory for *what* it does; comments - should explain *why* a decision was made or why a non-obvious approach was chosen -- **Use Go doc links**: reference types with bracket syntax: `// implements the [TokenCache] interface` -- **Document public types thoroughly**: explain the purpose, which fields are optional, - and what the zero value means -- **Don't duplicate godoc**: if a method's doc comment says the same thing as the type's - doc comment, remove the redundancy diff --git a/.codegen/_last_sha b/.codegen/_last_sha index 2ff770d5..d5de729c 100644 --- a/.codegen/_last_sha +++ b/.codegen/_last_sha @@ -1 +1 @@ -18031a7808d9f57a2345de93ed4955f839f25e07 \ No newline at end of file +e13a7b6206adbdb6c4008e2a58b7cc785e32cb1c \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37b4e62d..d681691f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -121,3 +121,42 @@ jobs: - name: Fail on differences run: git diff --exit-code + + # Single required checks for the per-module matrices above. The ruleset + # requires these instead of every "tests (, )" and + # "lint ()" leg, so modules can be added or removed without a + # ruleset change. `if: always()` is load-bearing: without it a failed leg + # skips this job, and GitHub treats a skipped required check as passing. + test-result: + name: test-result + needs: [tests] + if: always() + runs-on: + group: databricks-protected-runner-group + labels: linux-ubuntu-latest + steps: + - name: Require every tests leg to succeed + env: + RESULT: ${{ needs.tests.result }} + run: | + if [ "$RESULT" != "success" ]; then + echo "::error::tests matrix result is '$RESULT'" + exit 1 + fi + + lint-result: + name: lint-result + needs: [lint] + if: always() + runs-on: + group: databricks-protected-runner-group + labels: linux-ubuntu-latest + steps: + - name: Require every lint leg to succeed + env: + RESULT: ${{ needs.lint.result }} + run: | + if [ "$RESULT" != "success" ]; then + echo "::error::lint matrix result is '$RESULT'" + exit 1 + fi diff --git a/AGENTS.md b/AGENTS.md index f824c311..7f269a89 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,7 +9,6 @@ For scoped coding rules, skills, and prompt templates, see the `.agent/` directo ### Rules (`.agent/rules/`) - **api-design.md** — API design principles for the Databricks SDK. - **error-handling.md** — Error handling conventions for the Databricks SDK. -- **style-guide.md** — Go code style and naming conventions for the Databricks SDK. - **testing.md** — Testing standards and anti-patterns for the Databricks SDK. ### Skills (`.agent/skills/`) diff --git a/accessmanagement/CHANGELOG.md b/accessmanagement/CHANGELOG.md index 864b753c..79c44032 100644 --- a/accessmanagement/CHANGELOG.md +++ b/accessmanagement/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/accessmanagement/internal/version.go b/accessmanagement/internal/version.go index eb7f6b8d..85585817 100644 --- a/accessmanagement/internal/version.go +++ b/accessmanagement/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-accessmanagement" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/accessmanagement/v1/client.go b/accessmanagement/v1/client.go index 89532a81..bb21401b 100644 --- a/accessmanagement/v1/client.go +++ b/accessmanagement/v1/client.go @@ -6,6 +6,8 @@ import ( "bytes" "context" "encoding/json" + "fmt" + "iter" "log/slog" "net/http" "net/url" @@ -791,6 +793,301 @@ func (c *internalClient) UpdateRuleSetProxy(ctx context.Context, req UpdateRuleS return resp, nil } +// Adds a group to the workspace's restricted list. The workspace allows at most +// 100 restricted sharing groups. Requires workspace admin. +func (c *internalClient) CreateRestrictedSharingGroup(ctx context.Context, req CreateRestrictedSharingGroupRequest, opts ...call.Option) (*RestrictedSharingGroup, error) { + wireReq, err := createRestrictedSharingGroupRequestToWire(&req) + if err != nil { + return nil, err + } + body, err := json.Marshal(wireReq.RestrictedSharingGroup) + if err != nil { + return nil, err + } + + headers := http.Header{} + headers.Set("Content-Type", "application/json") + if c.workspaceID != "" { + headers.Set("X-Databricks-Workspace-Id", c.workspaceID) + } + + baseURL, err := url.Parse(c.host) + if err != nil { + return nil, err + } + baseURL.Path = "/api/2.0/access-control/restricted-sharing-groups" + queryParams := url.Values{} + if err := addQueryValue(queryParams, "restricted_sharing_group_id", wireReq.RestrictedSharingGroupId); err != nil { + return nil, err + } + baseURL.RawQuery = queryParams.Encode() + urlStr := baseURL.String() + + var resp *RestrictedSharingGroup + + call := func(ctx context.Context) error { + httpReq, err := newHTTPRequest(ctx, httpRequestOptions{ + Method: "POST", + URL: urlStr, + Credentials: c.credentials, + UserAgent: c.userAgent, + Headers: headers, + Body: bytes.NewBuffer(body), + }) + if err != nil { + return err + } + + respBody, _, err := executeHTTPCall(httpCallOptions{ + req: httpReq, + client: c.httpClient, + logger: c.logger, + }) + if err != nil { + return err + } + var wireResp restrictedSharingGroupWire + if err := json.Unmarshal(respBody, &wireResp); err != nil { + return err + } + resp, err = restrictedSharingGroupFromWire(&wireResp) + if err != nil { + return err + } + return nil + } + + if err := c.executeCall(ctx, call, opts); err != nil { + return nil, err + } + return resp, nil +} + +// Removes a group from the workspace's restricted list. Requires workspace +// admin. +func (c *internalClient) DeleteRestrictedSharingGroup(ctx context.Context, req DeleteRestrictedSharingGroupRequest, opts ...call.Option) error { + + headers := http.Header{} + if c.workspaceID != "" { + headers.Set("X-Databricks-Workspace-Id", c.workspaceID) + } + + baseURL, err := url.Parse(c.host) + if err != nil { + return err + } + pb := pathBuilder{} + pb.literal("/api/2.0/access-control/") + if req.Name == nil { + return fmt.Errorf("path parameter %q is required", "name") + } + pb.singleSegment(*req.Name) + baseURL.Path, baseURL.RawPath = pb.build() + queryParams := url.Values{} + baseURL.RawQuery = queryParams.Encode() + urlStr := baseURL.String() + + call := func(ctx context.Context) error { + httpReq, err := newHTTPRequest(ctx, httpRequestOptions{ + Method: "DELETE", + URL: urlStr, + Credentials: c.credentials, + UserAgent: c.userAgent, + Headers: headers, + }) + if err != nil { + return err + } + + respBody, _, err := executeHTTPCall(httpCallOptions{ + req: httpReq, + client: c.httpClient, + logger: c.logger, + }) + if err != nil { + return err + } + _ = respBody + return nil + } + + if err := c.executeCall(ctx, call, opts); err != nil { + return err + } + return nil +} + +// Gets a restricted sharing group in the workspace. Use it to check whether a +// group is on the workspace's restricted list. Requires workspace admin. +func (c *internalClient) GetRestrictedSharingGroup(ctx context.Context, req GetRestrictedSharingGroupRequest, opts ...call.Option) (*RestrictedSharingGroup, error) { + + headers := http.Header{} + if c.workspaceID != "" { + headers.Set("X-Databricks-Workspace-Id", c.workspaceID) + } + + baseURL, err := url.Parse(c.host) + if err != nil { + return nil, err + } + pb := pathBuilder{} + pb.literal("/api/2.0/access-control/") + if req.Name == nil { + return nil, fmt.Errorf("path parameter %q is required", "name") + } + pb.singleSegment(*req.Name) + baseURL.Path, baseURL.RawPath = pb.build() + queryParams := url.Values{} + baseURL.RawQuery = queryParams.Encode() + urlStr := baseURL.String() + + var resp *RestrictedSharingGroup + + call := func(ctx context.Context) error { + httpReq, err := newHTTPRequest(ctx, httpRequestOptions{ + Method: "GET", + URL: urlStr, + Credentials: c.credentials, + UserAgent: c.userAgent, + Headers: headers, + }) + if err != nil { + return err + } + + respBody, _, err := executeHTTPCall(httpCallOptions{ + req: httpReq, + client: c.httpClient, + logger: c.logger, + }) + if err != nil { + return err + } + var wireResp restrictedSharingGroupWire + if err := json.Unmarshal(respBody, &wireResp); err != nil { + return err + } + resp, err = restrictedSharingGroupFromWire(&wireResp) + if err != nil { + return err + } + return nil + } + + if err := c.executeCall(ctx, call, opts); err != nil { + return nil, err + } + return resp, nil +} + +// Lists the restricted sharing groups in the workspace. Requires workspace +// admin. +func (c *internalClient) ListRestrictedSharingGroups(ctx context.Context, req ListRestrictedSharingGroupsRequest, opts ...call.Option) (*ListRestrictedSharingGroupsResponse, error) { + wireReq, err := listRestrictedSharingGroupsRequestToWire(&req) + if err != nil { + return nil, err + } + + headers := http.Header{} + if c.workspaceID != "" { + headers.Set("X-Databricks-Workspace-Id", c.workspaceID) + } + + baseURL, err := url.Parse(c.host) + if err != nil { + return nil, err + } + baseURL.Path = "/api/2.0/access-control/restricted-sharing-groups" + queryParams := url.Values{} + if err := addQueryValue(queryParams, "page_size", wireReq.PageSize); err != nil { + return nil, err + } + if err := addQueryValue(queryParams, "page_token", wireReq.PageToken); err != nil { + return nil, err + } + baseURL.RawQuery = queryParams.Encode() + urlStr := baseURL.String() + + var resp *ListRestrictedSharingGroupsResponse + + call := func(ctx context.Context) error { + httpReq, err := newHTTPRequest(ctx, httpRequestOptions{ + Method: "GET", + URL: urlStr, + Credentials: c.credentials, + UserAgent: c.userAgent, + Headers: headers, + }) + if err != nil { + return err + } + + respBody, _, err := executeHTTPCall(httpCallOptions{ + req: httpReq, + client: c.httpClient, + logger: c.logger, + }) + if err != nil { + return err + } + var wireResp listRestrictedSharingGroupsResponseWire + if err := json.Unmarshal(respBody, &wireResp); err != nil { + return err + } + resp, err = listRestrictedSharingGroupsResponseFromWire(&wireResp) + if err != nil { + return err + } + return nil + } + + if err := c.executeCall(ctx, call, opts); err != nil { + return nil, err + } + return resp, nil +} + +// ListRestrictedSharingGroupsIter returns an iterator that iterates +// over the results of ListRestrictedSharingGroups. +// +// For example: +// +// for item, err := range c.ListRestrictedSharingGroupsIter(ctx, ListRestrictedSharingGroupsRequest{}) { +// if err != nil { +// return err +// } +// fmt.Println(item) +// } +// +// Options opts are passed to each ListRestrictedSharingGroups call +// made by the iterator under the hood. +// +// Callers who need custom pagination logic should use +// ListRestrictedSharingGroups directly. +func (c *internalClient) ListRestrictedSharingGroupsIter(ctx context.Context, req ListRestrictedSharingGroupsRequest, opts ...call.Option) iter.Seq2[*RestrictedSharingGroup, error] { + return func(yield func(*RestrictedSharingGroup, error) bool) { + // Keep pagination state local to this traversal so reusing the iterator starts + // from the original request. Reference-bearing fields remain shared and read-only. + pageReq := req + for { + resp, err := c.ListRestrictedSharingGroups(ctx, pageReq, opts...) + if err != nil { + yield(nil, err) + return + } + for i := range resp.RestrictedSharingGroups { + if !yield(&resp.RestrictedSharingGroups[i], nil) { + return + } + } + if resp.NextPageToken == nil || *resp.NextPageToken == "" { + return + } + pageReq.PageToken = resp.NextPageToken + } + } +} + // Migrate Permissions. func (c *internalClient) MigratePermissions(ctx context.Context, req MigratePermissionsRequest, opts ...call.Option) (*MigratePermissionsResponse, error) { wireReq, err := migratePermissionsRequestToWire(&req) diff --git a/accessmanagement/v1/model.go b/accessmanagement/v1/model.go index 343a8e7a..babe91d6 100644 --- a/accessmanagement/v1/model.go +++ b/accessmanagement/v1/model.go @@ -157,6 +157,23 @@ type ConsistencyToken struct { Value *string } +// Request to add a workspace group to the workspace's restricted list.. +type CreateRestrictedSharingGroupRequest struct { + // The id of the workspace group to restrict: the numeric id of an existing and + // non-system workspace group. + RestrictedSharingGroupId *string + // The restricted sharing group to create. It has no client-set fields; the + // group is identified by restricted_sharing_group_id. + RestrictedSharingGroup *RestrictedSharingGroup +} + +// Request to remove a group from the workspace's restricted list.. +type DeleteRestrictedSharingGroupRequest struct { + // The name of the restricted sharing group to delete. Format: + // `restricted-sharing-groups/{restricted_sharing_group_id}` + Name *string +} + // Removes all permission assignments for a workspace given a principal.. type DeleteWorkspacePermissionAssignmentRequest struct { // The account ID. @@ -182,6 +199,13 @@ type GetObjectPermissionsRequest struct { RequestObjectId *string } +// Request to get a restricted sharing group in the caller's workspace.. +type GetRestrictedSharingGroupRequest struct { + // The name of the restricted sharing group to get. Format: + // `restricted-sharing-groups/{restricted_sharing_group_id}` + Name *string +} + type GetRuleSetRequest struct { // account ID. AccountId *string @@ -257,6 +281,26 @@ type ListPermissionLevelsResponse struct { PermissionLevels []PermissionsDescription } +// Request to list the restricted sharing groups in the caller's workspace.. +type ListRestrictedSharingGroupsRequest struct { + // The maximum number of groups to return. The service may return fewer. If + // unspecified or 0, at most 100 groups are returned. Values above 100 are + // coerced to 100. Negative values are rejected. + PageSize *int + // A page token from a previous ListRestrictedSharingGroups call. Provide this + // to retrieve the subsequent page. + PageToken *string +} + +// A page of restricted sharing groups in the caller's workspace.. +type ListRestrictedSharingGroupsResponse struct { + // The restricted sharing groups in the workspace. + RestrictedSharingGroups []RestrictedSharingGroup + // A token that can be sent as page_token to retrieve the next page. If this + // field is omitted, there are no subsequent pages. + NextPageToken *string +} + // Gets all the permission assignments for a workspace, given an account and a // workspace.. type ListWorkspacePermissionAssignmentsRequest struct { @@ -372,6 +416,21 @@ type ResourceInfo struct { LegacyAclPath *string } +// A RestrictedSharingGroup is a workspace group whose members cannot grant or +// revoke permissions on workspace assets while they have assumed the group or +// one of its child groups. Users acting as themselves are not affected.. +type RestrictedSharingGroup struct { + // The resource name of the restricted sharing group. Format: + // `restricted-sharing-groups/{restricted_sharing_group_id}` Example: + // `restricted-sharing-groups/123` + Name *string + // The id of the restricted workspace group: the numeric id of an existing and + // non-system workspace group. + RestrictedSharingGroupId *string + // The display name of the restricted workspace group. + GroupDisplayName *string +} + type Role struct { // Role to assign to a principal or a list of principals on a resource. Name *string diff --git a/accessmanagement/v1/wire.go b/accessmanagement/v1/wire.go index d7eb01fa..1add3d9e 100644 --- a/accessmanagement/v1/wire.go +++ b/accessmanagement/v1/wire.go @@ -123,6 +123,30 @@ func accessControlRequestFromWire(w *accessControlRequestWire) (*AccessControlRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccessControlRequest) MarshalJSON() ([]byte, error) { + w, err := accessControlRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccessControlRequest) UnmarshalJSON(data []byte) error { + var w accessControlRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accessControlRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accessControlResponseWire struct { UserName *string `json:"user_name,omitempty"` GroupName *string `json:"group_name,omitempty"` @@ -205,6 +229,30 @@ func accessControlResponseFromWire(w *accessControlResponseWire) (*AccessControl }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccessControlResponse) MarshalJSON() ([]byte, error) { + w, err := accessControlResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccessControlResponse) UnmarshalJSON(data []byte) error { + var w accessControlResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accessControlResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type actorWire struct { ActorId *wireInt64 `json:"actor_id,omitempty"` } @@ -257,6 +305,30 @@ func actorFromWire(w *actorWire) (*Actor, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Actor) MarshalJSON() ([]byte, error) { + w, err := actorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Actor) UnmarshalJSON(data []byte) error { + var w actorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := actorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type checkPolicyRequestWire struct { Actor *actorWire `json:"actor,omitempty"` Permission *string `json:"permission,omitempty"` @@ -318,6 +390,30 @@ func checkPolicyRequestFromWire(w *checkPolicyRequestWire) (*CheckPolicyRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CheckPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := checkPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CheckPolicyRequest) UnmarshalJSON(data []byte) error { + var w checkPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := checkPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type checkPolicyResponseWire struct { IsPermitted *bool `json:"is_permitted,omitempty"` ConsistencyToken *consistencyTokenWire `json:"consistency_token,omitempty"` @@ -351,6 +447,30 @@ func checkPolicyResponseFromWire(w *checkPolicyResponseWire) (*CheckPolicyRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CheckPolicyResponse) MarshalJSON() ([]byte, error) { + w, err := checkPolicyResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CheckPolicyResponse) UnmarshalJSON(data []byte) error { + var w checkPolicyResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := checkPolicyResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type consistencyTokenWire struct { Value *string `json:"value,omitempty"` } @@ -373,6 +493,133 @@ func consistencyTokenFromWire(w *consistencyTokenWire) (*ConsistencyToken, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ConsistencyToken) MarshalJSON() ([]byte, error) { + w, err := consistencyTokenToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ConsistencyToken) UnmarshalJSON(data []byte) error { + var w consistencyTokenWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := consistencyTokenFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type createRestrictedSharingGroupRequestWire struct { + RestrictedSharingGroupId *string `json:"restricted_sharing_group_id,omitempty"` + RestrictedSharingGroup *restrictedSharingGroupWire `json:"restricted_sharing_group,omitempty"` +} + +func createRestrictedSharingGroupRequestToWire(v *CreateRestrictedSharingGroupRequest) (*createRestrictedSharingGroupRequestWire, error) { + if v == nil { + return nil, nil + } + restrictedSharingGroupWireValue, err := restrictedSharingGroupToWire(v.RestrictedSharingGroup) + if err != nil { + return nil, fmt.Errorf("%s: %w", "CreateRestrictedSharingGroupRequest.RestrictedSharingGroup", err) + } + return &createRestrictedSharingGroupRequestWire{ + RestrictedSharingGroupId: v.RestrictedSharingGroupId, + RestrictedSharingGroup: restrictedSharingGroupWireValue, + }, nil +} + +func createRestrictedSharingGroupRequestFromWire(w *createRestrictedSharingGroupRequestWire) (*CreateRestrictedSharingGroupRequest, error) { + if w == nil { + return nil, nil + } + restrictedSharingGroupPublicValue, err := restrictedSharingGroupFromWire(w.RestrictedSharingGroup) + if err != nil { + return nil, fmt.Errorf("%s: %w", "CreateRestrictedSharingGroupRequest.RestrictedSharingGroup", err) + } + return &CreateRestrictedSharingGroupRequest{ + RestrictedSharingGroupId: w.RestrictedSharingGroupId, + RestrictedSharingGroup: restrictedSharingGroupPublicValue, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateRestrictedSharingGroupRequest) MarshalJSON() ([]byte, error) { + w, err := createRestrictedSharingGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateRestrictedSharingGroupRequest) UnmarshalJSON(data []byte) error { + var w createRestrictedSharingGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createRestrictedSharingGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type deleteRestrictedSharingGroupRequestWire struct { + Name *string `json:"name,omitempty"` +} + +func deleteRestrictedSharingGroupRequestToWire(v *DeleteRestrictedSharingGroupRequest) (*deleteRestrictedSharingGroupRequestWire, error) { + if v == nil { + return nil, nil + } + return &deleteRestrictedSharingGroupRequestWire{ + Name: v.Name, + }, nil +} + +func deleteRestrictedSharingGroupRequestFromWire(w *deleteRestrictedSharingGroupRequestWire) (*DeleteRestrictedSharingGroupRequest, error) { + if w == nil { + return nil, nil + } + return &DeleteRestrictedSharingGroupRequest{ + Name: w.Name, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRestrictedSharingGroupRequest) MarshalJSON() ([]byte, error) { + w, err := deleteRestrictedSharingGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRestrictedSharingGroupRequest) UnmarshalJSON(data []byte) error { + var w deleteRestrictedSharingGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRestrictedSharingGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteWorkspacePermissionAssignmentRequestWire struct { AccountId *string `json:"account_id,omitempty"` WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` @@ -417,6 +664,30 @@ func deleteWorkspacePermissionAssignmentRequestFromWire(w *deleteWorkspacePermis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteWorkspacePermissionAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := deleteWorkspacePermissionAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteWorkspacePermissionAssignmentRequest) UnmarshalJSON(data []byte) error { + var w deleteWorkspacePermissionAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteWorkspacePermissionAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteWorkspacePermissionAssignmentResponseWire struct { } @@ -434,6 +705,30 @@ func deleteWorkspacePermissionAssignmentResponseFromWire(w *deleteWorkspacePermi return &DeleteWorkspacePermissionAssignmentResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteWorkspacePermissionAssignmentResponse) MarshalJSON() ([]byte, error) { + w, err := deleteWorkspacePermissionAssignmentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteWorkspacePermissionAssignmentResponse) UnmarshalJSON(data []byte) error { + var w deleteWorkspacePermissionAssignmentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteWorkspacePermissionAssignmentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getObjectPermissionsRequestWire struct { RequestObjectType *string `json:"request_object_type,omitempty"` RequestObjectId *string `json:"request_object_id,omitempty"` @@ -459,6 +754,76 @@ func getObjectPermissionsRequestFromWire(w *getObjectPermissionsRequestWire) (*G }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetObjectPermissionsRequest) MarshalJSON() ([]byte, error) { + w, err := getObjectPermissionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetObjectPermissionsRequest) UnmarshalJSON(data []byte) error { + var w getObjectPermissionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getObjectPermissionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type getRestrictedSharingGroupRequestWire struct { + Name *string `json:"name,omitempty"` +} + +func getRestrictedSharingGroupRequestToWire(v *GetRestrictedSharingGroupRequest) (*getRestrictedSharingGroupRequestWire, error) { + if v == nil { + return nil, nil + } + return &getRestrictedSharingGroupRequestWire{ + Name: v.Name, + }, nil +} + +func getRestrictedSharingGroupRequestFromWire(w *getRestrictedSharingGroupRequestWire) (*GetRestrictedSharingGroupRequest, error) { + if w == nil { + return nil, nil + } + return &GetRestrictedSharingGroupRequest{ + Name: w.Name, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRestrictedSharingGroupRequest) MarshalJSON() ([]byte, error) { + w, err := getRestrictedSharingGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRestrictedSharingGroupRequest) UnmarshalJSON(data []byte) error { + var w getRestrictedSharingGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRestrictedSharingGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRuleSetRequestWire struct { AccountId *string `json:"account_id,omitempty"` Name *string `json:"name,omitempty"` @@ -487,6 +852,30 @@ func getRuleSetRequestFromWire(w *getRuleSetRequestWire) (*GetRuleSetRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRuleSetRequest) MarshalJSON() ([]byte, error) { + w, err := getRuleSetRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRuleSetRequest) UnmarshalJSON(data []byte) error { + var w getRuleSetRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRuleSetRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type grantRuleWire struct { Principals []string `json:"principals,omitempty"` Role *string `json:"role,omitempty"` @@ -512,6 +901,30 @@ func grantRuleFromWire(w *grantRuleWire) (*GrantRule, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GrantRule) MarshalJSON() ([]byte, error) { + w, err := grantRuleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GrantRule) UnmarshalJSON(data []byte) error { + var w grantRuleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := grantRuleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAssignableRolesForResourceRequestWire struct { AccountId *string `json:"account_id,omitempty"` Resource *string `json:"resource,omitempty"` @@ -537,6 +950,30 @@ func listAssignableRolesForResourceRequestFromWire(w *listAssignableRolesForReso }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAssignableRolesForResourceRequest) MarshalJSON() ([]byte, error) { + w, err := listAssignableRolesForResourceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAssignableRolesForResourceRequest) UnmarshalJSON(data []byte) error { + var w listAssignableRolesForResourceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAssignableRolesForResourceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAssignableRolesForResourceResponseWire struct { Roles []roleWire `json:"roles,omitempty"` } @@ -567,6 +1004,30 @@ func listAssignableRolesForResourceResponseFromWire(w *listAssignableRolesForRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAssignableRolesForResourceResponse) MarshalJSON() ([]byte, error) { + w, err := listAssignableRolesForResourceResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAssignableRolesForResourceResponse) UnmarshalJSON(data []byte) error { + var w listAssignableRolesForResourceResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAssignableRolesForResourceResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPermissionLevelsRequestWire struct { RequestObjectType *string `json:"request_object_type,omitempty"` RequestObjectId *string `json:"request_object_id,omitempty"` @@ -592,6 +1053,30 @@ func listPermissionLevelsRequestFromWire(w *listPermissionLevelsRequestWire) (*L }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPermissionLevelsRequest) MarshalJSON() ([]byte, error) { + w, err := listPermissionLevelsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPermissionLevelsRequest) UnmarshalJSON(data []byte) error { + var w listPermissionLevelsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPermissionLevelsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPermissionLevelsResponseWire struct { PermissionLevels []permissionsDescriptionWire `json:"permission_levels,omitempty"` } @@ -622,6 +1107,136 @@ func listPermissionLevelsResponseFromWire(w *listPermissionLevelsResponseWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPermissionLevelsResponse) MarshalJSON() ([]byte, error) { + w, err := listPermissionLevelsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPermissionLevelsResponse) UnmarshalJSON(data []byte) error { + var w listPermissionLevelsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPermissionLevelsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type listRestrictedSharingGroupsRequestWire struct { + PageSize *int `json:"page_size,omitempty"` + PageToken *string `json:"page_token,omitempty"` +} + +func listRestrictedSharingGroupsRequestToWire(v *ListRestrictedSharingGroupsRequest) (*listRestrictedSharingGroupsRequestWire, error) { + if v == nil { + return nil, nil + } + return &listRestrictedSharingGroupsRequestWire{ + PageSize: v.PageSize, + PageToken: v.PageToken, + }, nil +} + +func listRestrictedSharingGroupsRequestFromWire(w *listRestrictedSharingGroupsRequestWire) (*ListRestrictedSharingGroupsRequest, error) { + if w == nil { + return nil, nil + } + return &ListRestrictedSharingGroupsRequest{ + PageSize: w.PageSize, + PageToken: w.PageToken, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRestrictedSharingGroupsRequest) MarshalJSON() ([]byte, error) { + w, err := listRestrictedSharingGroupsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRestrictedSharingGroupsRequest) UnmarshalJSON(data []byte) error { + var w listRestrictedSharingGroupsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRestrictedSharingGroupsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type listRestrictedSharingGroupsResponseWire struct { + RestrictedSharingGroups []restrictedSharingGroupWire `json:"restricted_sharing_groups,omitempty"` + NextPageToken *string `json:"next_page_token,omitempty"` +} + +func listRestrictedSharingGroupsResponseToWire(v *ListRestrictedSharingGroupsResponse) (*listRestrictedSharingGroupsResponseWire, error) { + if v == nil { + return nil, nil + } + restrictedSharingGroupsWireValue, err := convertSlice(v.RestrictedSharingGroups, restrictedSharingGroupToWire) + if err != nil { + return nil, fmt.Errorf("%s: %w", "ListRestrictedSharingGroupsResponse.RestrictedSharingGroups", err) + } + return &listRestrictedSharingGroupsResponseWire{ + RestrictedSharingGroups: restrictedSharingGroupsWireValue, + NextPageToken: v.NextPageToken, + }, nil +} + +func listRestrictedSharingGroupsResponseFromWire(w *listRestrictedSharingGroupsResponseWire) (*ListRestrictedSharingGroupsResponse, error) { + if w == nil { + return nil, nil + } + restrictedSharingGroupsPublicValue, err := convertSlice(w.RestrictedSharingGroups, restrictedSharingGroupFromWire) + if err != nil { + return nil, fmt.Errorf("%s: %w", "ListRestrictedSharingGroupsResponse.RestrictedSharingGroups", err) + } + return &ListRestrictedSharingGroupsResponse{ + RestrictedSharingGroups: restrictedSharingGroupsPublicValue, + NextPageToken: w.NextPageToken, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRestrictedSharingGroupsResponse) MarshalJSON() ([]byte, error) { + w, err := listRestrictedSharingGroupsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRestrictedSharingGroupsResponse) UnmarshalJSON(data []byte) error { + var w listRestrictedSharingGroupsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRestrictedSharingGroupsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listWorkspacePermissionAssignmentsRequestWire struct { AccountId *string `json:"account_id,omitempty"` WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` @@ -655,6 +1270,30 @@ func listWorkspacePermissionAssignmentsRequestFromWire(w *listWorkspacePermissio }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListWorkspacePermissionAssignmentsRequest) MarshalJSON() ([]byte, error) { + w, err := listWorkspacePermissionAssignmentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListWorkspacePermissionAssignmentsRequest) UnmarshalJSON(data []byte) error { + var w listWorkspacePermissionAssignmentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listWorkspacePermissionAssignmentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listWorkspacePermissionAssignmentsResponseWire struct { PermissionAssignments []workspacePermissionAssignmentOutputWire `json:"permission_assignments,omitempty"` } @@ -685,6 +1324,30 @@ func listWorkspacePermissionAssignmentsResponseFromWire(w *listWorkspacePermissi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListWorkspacePermissionAssignmentsResponse) MarshalJSON() ([]byte, error) { + w, err := listWorkspacePermissionAssignmentsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListWorkspacePermissionAssignmentsResponse) UnmarshalJSON(data []byte) error { + var w listWorkspacePermissionAssignmentsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listWorkspacePermissionAssignmentsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listWorkspacePermissionsRequestWire struct { AccountId *string `json:"account_id,omitempty"` WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` @@ -718,6 +1381,30 @@ func listWorkspacePermissionsRequestFromWire(w *listWorkspacePermissionsRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListWorkspacePermissionsRequest) MarshalJSON() ([]byte, error) { + w, err := listWorkspacePermissionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListWorkspacePermissionsRequest) UnmarshalJSON(data []byte) error { + var w listWorkspacePermissionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listWorkspacePermissionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listWorkspacePermissionsResponseWire struct { Permissions []permissionOutputWire `json:"permissions,omitempty"` } @@ -748,6 +1435,30 @@ func listWorkspacePermissionsResponseFromWire(w *listWorkspacePermissionsRespons }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListWorkspacePermissionsResponse) MarshalJSON() ([]byte, error) { + w, err := listWorkspacePermissionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListWorkspacePermissionsResponse) UnmarshalJSON(data []byte) error { + var w listWorkspacePermissionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listWorkspacePermissionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type migratePermissionsRequestWire struct { WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` FromWorkspaceGroupName *string `json:"from_workspace_group_name,omitempty"` @@ -787,6 +1498,30 @@ func migratePermissionsRequestFromWire(w *migratePermissionsRequestWire) (*Migra }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MigratePermissionsRequest) MarshalJSON() ([]byte, error) { + w, err := migratePermissionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MigratePermissionsRequest) UnmarshalJSON(data []byte) error { + var w migratePermissionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := migratePermissionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type migratePermissionsResponseWire struct { PermissionsMigrated *int `json:"permissions_migrated,omitempty"` } @@ -809,6 +1544,30 @@ func migratePermissionsResponseFromWire(w *migratePermissionsResponseWire) (*Mig }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MigratePermissionsResponse) MarshalJSON() ([]byte, error) { + w, err := migratePermissionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MigratePermissionsResponse) UnmarshalJSON(data []byte) error { + var w migratePermissionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := migratePermissionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type permissionWire struct { PermissionLevel PermissionLevel `json:"permission_level,omitempty"` Inherited *bool `json:"inherited,omitempty"` @@ -837,6 +1596,30 @@ func permissionFromWire(w *permissionWire) (*Permission, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Permission) MarshalJSON() ([]byte, error) { + w, err := permissionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Permission) UnmarshalJSON(data []byte) error { + var w permissionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := permissionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type permissionOutputWire struct { PermissionLevel WorkspacePermission `json:"permission_level,omitempty"` Description *string `json:"description,omitempty"` @@ -862,6 +1645,30 @@ func permissionOutputFromWire(w *permissionOutputWire) (*PermissionOutput, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PermissionOutput) MarshalJSON() ([]byte, error) { + w, err := permissionOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PermissionOutput) UnmarshalJSON(data []byte) error { + var w permissionOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := permissionOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type permissionsDescriptionWire struct { PermissionLevel PermissionLevel `json:"permission_level,omitempty"` Description *string `json:"description,omitempty"` @@ -887,6 +1694,30 @@ func permissionsDescriptionFromWire(w *permissionsDescriptionWire) (*Permissions }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PermissionsDescription) MarshalJSON() ([]byte, error) { + w, err := permissionsDescriptionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PermissionsDescription) UnmarshalJSON(data []byte) error { + var w permissionsDescriptionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := permissionsDescriptionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type permissionsResponseWire struct { ObjectId *string `json:"object_id,omitempty"` ObjectType *string `json:"object_type,omitempty"` @@ -923,6 +1754,30 @@ func permissionsResponseFromWire(w *permissionsResponseWire) (*PermissionsRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PermissionsResponse) MarshalJSON() ([]byte, error) { + w, err := permissionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PermissionsResponse) UnmarshalJSON(data []byte) error { + var w permissionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := permissionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type principalOutputWire struct { UserName *string `json:"user_name,omitempty"` GroupName *string `json:"group_name,omitempty"` @@ -1005,6 +1860,30 @@ func principalOutputFromWire(w *principalOutputWire) (*PrincipalOutput, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PrincipalOutput) MarshalJSON() ([]byte, error) { + w, err := principalOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PrincipalOutput) UnmarshalJSON(data []byte) error { + var w principalOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := principalOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resourceInfoWire struct { Id *string `json:"id,omitempty"` ParentResourceInfo *resourceInfoWire `json:"parent_resource_info,omitempty"` @@ -1041,6 +1920,82 @@ func resourceInfoFromWire(w *resourceInfoWire) (*ResourceInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResourceInfo) MarshalJSON() ([]byte, error) { + w, err := resourceInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResourceInfo) UnmarshalJSON(data []byte) error { + var w resourceInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resourceInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type restrictedSharingGroupWire struct { + Name *string `json:"name,omitempty"` + RestrictedSharingGroupId *string `json:"restricted_sharing_group_id,omitempty"` + GroupDisplayName *string `json:"group_display_name,omitempty"` +} + +func restrictedSharingGroupToWire(v *RestrictedSharingGroup) (*restrictedSharingGroupWire, error) { + if v == nil { + return nil, nil + } + return &restrictedSharingGroupWire{ + Name: v.Name, + RestrictedSharingGroupId: v.RestrictedSharingGroupId, + GroupDisplayName: v.GroupDisplayName, + }, nil +} + +func restrictedSharingGroupFromWire(w *restrictedSharingGroupWire) (*RestrictedSharingGroup, error) { + if w == nil { + return nil, nil + } + return &RestrictedSharingGroup{ + Name: w.Name, + RestrictedSharingGroupId: w.RestrictedSharingGroupId, + GroupDisplayName: w.GroupDisplayName, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RestrictedSharingGroup) MarshalJSON() ([]byte, error) { + w, err := restrictedSharingGroupToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RestrictedSharingGroup) UnmarshalJSON(data []byte) error { + var w restrictedSharingGroupWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := restrictedSharingGroupFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type roleWire struct { Name *string `json:"name,omitempty"` } @@ -1063,6 +2018,30 @@ func roleFromWire(w *roleWire) (*Role, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Role) MarshalJSON() ([]byte, error) { + w, err := roleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Role) UnmarshalJSON(data []byte) error { + var w roleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := roleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ruleSetWire struct { Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` @@ -1099,6 +2078,30 @@ func ruleSetFromWire(w *ruleSetWire) (*RuleSet, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RuleSet) MarshalJSON() ([]byte, error) { + w, err := ruleSetToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RuleSet) UnmarshalJSON(data []byte) error { + var w ruleSetWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ruleSetFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ruleSetUpdateRequestWire struct { Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` @@ -1135,6 +2138,30 @@ func ruleSetUpdateRequestFromWire(w *ruleSetUpdateRequestWire) (*RuleSetUpdateRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RuleSetUpdateRequest) MarshalJSON() ([]byte, error) { + w, err := ruleSetUpdateRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RuleSetUpdateRequest) UnmarshalJSON(data []byte) error { + var w ruleSetUpdateRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ruleSetUpdateRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type setObjectPermissionsRequestWire struct { RequestObjectType *string `json:"request_object_type,omitempty"` RequestObjectId *string `json:"request_object_id,omitempty"` @@ -1171,6 +2198,30 @@ func setObjectPermissionsRequestFromWire(w *setObjectPermissionsRequestWire) (*S }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SetObjectPermissionsRequest) MarshalJSON() ([]byte, error) { + w, err := setObjectPermissionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SetObjectPermissionsRequest) UnmarshalJSON(data []byte) error { + var w setObjectPermissionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := setObjectPermissionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateObjectPermissionsRequestWire struct { RequestObjectType *string `json:"request_object_type,omitempty"` RequestObjectId *string `json:"request_object_id,omitempty"` @@ -1207,6 +2258,30 @@ func updateObjectPermissionsRequestFromWire(w *updateObjectPermissionsRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateObjectPermissionsRequest) MarshalJSON() ([]byte, error) { + w, err := updateObjectPermissionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateObjectPermissionsRequest) UnmarshalJSON(data []byte) error { + var w updateObjectPermissionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateObjectPermissionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateRuleSetRequestWire struct { AccountId *string `json:"account_id,omitempty"` Name *string `json:"name,omitempty"` @@ -1243,6 +2318,30 @@ func updateRuleSetRequestFromWire(w *updateRuleSetRequestWire) (*UpdateRuleSetRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateRuleSetRequest) MarshalJSON() ([]byte, error) { + w, err := updateRuleSetRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateRuleSetRequest) UnmarshalJSON(data []byte) error { + var w updateRuleSetRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateRuleSetRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateWorkspacePermissionAssignmentRequestWire struct { AccountId *string `json:"account_id,omitempty"` WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` @@ -1290,6 +2389,30 @@ func updateWorkspacePermissionAssignmentRequestFromWire(w *updateWorkspacePermis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateWorkspacePermissionAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := updateWorkspacePermissionAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateWorkspacePermissionAssignmentRequest) UnmarshalJSON(data []byte) error { + var w updateWorkspacePermissionAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateWorkspacePermissionAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type workspacePermissionAssignmentOutputWire struct { Principal *principalOutputWire `json:"principal,omitempty"` Permissions []WorkspacePermission `json:"permissions,omitempty"` @@ -1326,6 +2449,30 @@ func workspacePermissionAssignmentOutputFromWire(w *workspacePermissionAssignmen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WorkspacePermissionAssignmentOutput) MarshalJSON() ([]byte, error) { + w, err := workspacePermissionAssignmentOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WorkspacePermissionAssignmentOutput) UnmarshalJSON(data []byte) error { + var w workspacePermissionAssignmentOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := workspacePermissionAssignmentOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/agentkit/CHANGELOG.md b/agentkit/CHANGELOG.md index b975bb35..12c269e5 100644 --- a/agentkit/CHANGELOG.md +++ b/agentkit/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/agentkit/internal/version.go b/agentkit/internal/version.go index 014afaed..c81a778a 100644 --- a/agentkit/internal/version.go +++ b/agentkit/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-agentkit" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/agentkit/v1/wire.go b/agentkit/v1/wire.go index a5472cd6..c4781636 100644 --- a/agentkit/v1/wire.go +++ b/agentkit/v1/wire.go @@ -87,6 +87,30 @@ func appendSessionItemsRequestFromWire(w *appendSessionItemsRequestWire) (*Appen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppendSessionItemsRequest) MarshalJSON() ([]byte, error) { + w, err := appendSessionItemsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppendSessionItemsRequest) UnmarshalJSON(data []byte) error { + var w appendSessionItemsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appendSessionItemsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appendSessionItemsResponseWire struct { SessionItems []sessionItemWire `json:"session_items,omitempty"` } @@ -117,6 +141,30 @@ func appendSessionItemsResponseFromWire(w *appendSessionItemsResponseWire) (*App }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppendSessionItemsResponse) MarshalJSON() ([]byte, error) { + w, err := appendSessionItemsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppendSessionItemsResponse) UnmarshalJSON(data []byte) error { + var w appendSessionItemsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appendSessionItemsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clearSessionItemsRequestWire struct { Parent *string `json:"parent,omitempty"` } @@ -139,6 +187,30 @@ func clearSessionItemsRequestFromWire(w *clearSessionItemsRequestWire) (*ClearSe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClearSessionItemsRequest) MarshalJSON() ([]byte, error) { + w, err := clearSessionItemsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClearSessionItemsRequest) UnmarshalJSON(data []byte) error { + var w clearSessionItemsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clearSessionItemsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clearSessionItemsResponseWire struct { } @@ -156,6 +228,30 @@ func clearSessionItemsResponseFromWire(w *clearSessionItemsResponseWire) (*Clear return &ClearSessionItemsResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClearSessionItemsResponse) MarshalJSON() ([]byte, error) { + w, err := clearSessionItemsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClearSessionItemsResponse) UnmarshalJSON(data []byte) error { + var w clearSessionItemsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clearSessionItemsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createManagedMemoryEntryRequestWire struct { Parent *string `json:"parent,omitempty"` ManagedMemoryEntry *managedMemoryEntryWire `json:"managed_memory_entry,omitempty"` @@ -192,6 +288,30 @@ func createManagedMemoryEntryRequestFromWire(w *createManagedMemoryEntryRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateManagedMemoryEntryRequest) MarshalJSON() ([]byte, error) { + w, err := createManagedMemoryEntryRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateManagedMemoryEntryRequest) UnmarshalJSON(data []byte) error { + var w createManagedMemoryEntryRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createManagedMemoryEntryRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createManagedMemoryStoreRequestWire struct { ManagedMemoryStore *managedMemoryStoreWire `json:"managed_memory_store,omitempty"` ManagedMemoryStoreId *string `json:"managed_memory_store_id,omitempty"` @@ -225,6 +345,30 @@ func createManagedMemoryStoreRequestFromWire(w *createManagedMemoryStoreRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateManagedMemoryStoreRequest) MarshalJSON() ([]byte, error) { + w, err := createManagedMemoryStoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateManagedMemoryStoreRequest) UnmarshalJSON(data []byte) error { + var w createManagedMemoryStoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createManagedMemoryStoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createSessionRequestWire struct { Session *sessionWire `json:"session,omitempty"` SessionId *string `json:"session_id,omitempty"` @@ -261,6 +405,30 @@ func createSessionRequestFromWire(w *createSessionRequestWire) (*CreateSessionRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateSessionRequest) MarshalJSON() ([]byte, error) { + w, err := createSessionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateSessionRequest) UnmarshalJSON(data []byte) error { + var w createSessionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createSessionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createSessionStoreRequestWire struct { SessionStore *sessionStoreWire `json:"session_store,omitempty"` SessionStoreId *string `json:"session_store_id,omitempty"` @@ -294,6 +462,30 @@ func createSessionStoreRequestFromWire(w *createSessionStoreRequestWire) (*Creat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateSessionStoreRequest) MarshalJSON() ([]byte, error) { + w, err := createSessionStoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateSessionStoreRequest) UnmarshalJSON(data []byte) error { + var w createSessionStoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createSessionStoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteManagedMemoryEntryRequestWire struct { Name *string `json:"name,omitempty"` } @@ -316,6 +508,30 @@ func deleteManagedMemoryEntryRequestFromWire(w *deleteManagedMemoryEntryRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteManagedMemoryEntryRequest) MarshalJSON() ([]byte, error) { + w, err := deleteManagedMemoryEntryRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteManagedMemoryEntryRequest) UnmarshalJSON(data []byte) error { + var w deleteManagedMemoryEntryRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteManagedMemoryEntryRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteManagedMemoryStoreRequestWire struct { Name *string `json:"name,omitempty"` } @@ -338,6 +554,30 @@ func deleteManagedMemoryStoreRequestFromWire(w *deleteManagedMemoryStoreRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteManagedMemoryStoreRequest) MarshalJSON() ([]byte, error) { + w, err := deleteManagedMemoryStoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteManagedMemoryStoreRequest) UnmarshalJSON(data []byte) error { + var w deleteManagedMemoryStoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteManagedMemoryStoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteSessionRequestWire struct { Name *string `json:"name,omitempty"` } @@ -360,6 +600,30 @@ func deleteSessionRequestFromWire(w *deleteSessionRequestWire) (*DeleteSessionRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteSessionRequest) MarshalJSON() ([]byte, error) { + w, err := deleteSessionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteSessionRequest) UnmarshalJSON(data []byte) error { + var w deleteSessionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteSessionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteSessionStoreRequestWire struct { Name *string `json:"name,omitempty"` } @@ -382,6 +646,30 @@ func deleteSessionStoreRequestFromWire(w *deleteSessionStoreRequestWire) (*Delet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteSessionStoreRequest) MarshalJSON() ([]byte, error) { + w, err := deleteSessionStoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteSessionStoreRequest) UnmarshalJSON(data []byte) error { + var w deleteSessionStoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteSessionStoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type extractMemoriesRequestWire struct { MemoryStore *string `json:"memory_store,omitempty"` SessionStore *string `json:"session_store,omitempty"` @@ -416,6 +704,30 @@ func extractMemoriesRequestFromWire(w *extractMemoriesRequestWire) (*ExtractMemo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExtractMemoriesRequest) MarshalJSON() ([]byte, error) { + w, err := extractMemoriesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExtractMemoriesRequest) UnmarshalJSON(data []byte) error { + var w extractMemoriesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := extractMemoriesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type extractMemoriesResponseWire struct { Name *string `json:"name,omitempty"` Entries []managedMemoryEntryWire `json:"entries,omitempty"` @@ -449,6 +761,30 @@ func extractMemoriesResponseFromWire(w *extractMemoriesResponseWire) (*ExtractMe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExtractMemoriesResponse) MarshalJSON() ([]byte, error) { + w, err := extractMemoriesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExtractMemoriesResponse) UnmarshalJSON(data []byte) error { + var w extractMemoriesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := extractMemoriesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type forkSessionRequestWire struct { SourceSessionId *string `json:"source_session_id,omitempty"` UpToItemId *string `json:"up_to_item_id,omitempty"` @@ -486,6 +822,30 @@ func forkSessionRequestFromWire(w *forkSessionRequestWire) (*ForkSessionRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ForkSessionRequest) MarshalJSON() ([]byte, error) { + w, err := forkSessionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ForkSessionRequest) UnmarshalJSON(data []byte) error { + var w forkSessionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := forkSessionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type forkSessionResponseWire struct { Session *sessionWire `json:"session,omitempty"` } @@ -516,6 +876,30 @@ func forkSessionResponseFromWire(w *forkSessionResponseWire) (*ForkSessionRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ForkSessionResponse) MarshalJSON() ([]byte, error) { + w, err := forkSessionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ForkSessionResponse) UnmarshalJSON(data []byte) error { + var w forkSessionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := forkSessionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getManagedMemoryEntryRequestWire struct { Name *string `json:"name,omitempty"` View ManagedMemoryEntryView `json:"view,omitempty"` @@ -541,6 +925,30 @@ func getManagedMemoryEntryRequestFromWire(w *getManagedMemoryEntryRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetManagedMemoryEntryRequest) MarshalJSON() ([]byte, error) { + w, err := getManagedMemoryEntryRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetManagedMemoryEntryRequest) UnmarshalJSON(data []byte) error { + var w getManagedMemoryEntryRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getManagedMemoryEntryRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getManagedMemoryStoreRequestWire struct { Name *string `json:"name,omitempty"` } @@ -563,6 +971,30 @@ func getManagedMemoryStoreRequestFromWire(w *getManagedMemoryStoreRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetManagedMemoryStoreRequest) MarshalJSON() ([]byte, error) { + w, err := getManagedMemoryStoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetManagedMemoryStoreRequest) UnmarshalJSON(data []byte) error { + var w getManagedMemoryStoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getManagedMemoryStoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getMemoryStorePermissionRequestWire struct { Name *string `json:"name,omitempty"` } @@ -585,6 +1017,30 @@ func getMemoryStorePermissionRequestFromWire(w *getMemoryStorePermissionRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetMemoryStorePermissionRequest) MarshalJSON() ([]byte, error) { + w, err := getMemoryStorePermissionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetMemoryStorePermissionRequest) UnmarshalJSON(data []byte) error { + var w getMemoryStorePermissionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getMemoryStorePermissionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSessionRequestWire struct { Name *string `json:"name,omitempty"` } @@ -607,6 +1063,30 @@ func getSessionRequestFromWire(w *getSessionRequestWire) (*GetSessionRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSessionRequest) MarshalJSON() ([]byte, error) { + w, err := getSessionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSessionRequest) UnmarshalJSON(data []byte) error { + var w getSessionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSessionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSessionStorePermissionRequestWire struct { Name *string `json:"name,omitempty"` } @@ -629,6 +1109,30 @@ func getSessionStorePermissionRequestFromWire(w *getSessionStorePermissionReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSessionStorePermissionRequest) MarshalJSON() ([]byte, error) { + w, err := getSessionStorePermissionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSessionStorePermissionRequest) UnmarshalJSON(data []byte) error { + var w getSessionStorePermissionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSessionStorePermissionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSessionStoreRequestWire struct { Name *string `json:"name,omitempty"` } @@ -651,6 +1155,30 @@ func getSessionStoreRequestFromWire(w *getSessionStoreRequestWire) (*GetSessionS }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSessionStoreRequest) MarshalJSON() ([]byte, error) { + w, err := getSessionStoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSessionStoreRequest) UnmarshalJSON(data []byte) error { + var w getSessionStoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSessionStoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type grantMemoryStorePermissionRequestWire struct { Name *string `json:"name,omitempty"` Principal *storePrincipalWire `json:"principal,omitempty"` @@ -687,6 +1215,30 @@ func grantMemoryStorePermissionRequestFromWire(w *grantMemoryStorePermissionRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GrantMemoryStorePermissionRequest) MarshalJSON() ([]byte, error) { + w, err := grantMemoryStorePermissionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GrantMemoryStorePermissionRequest) UnmarshalJSON(data []byte) error { + var w grantMemoryStorePermissionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := grantMemoryStorePermissionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type grantMemoryStorePermissionResponseWire struct { } @@ -704,6 +1256,30 @@ func grantMemoryStorePermissionResponseFromWire(w *grantMemoryStorePermissionRes return &GrantMemoryStorePermissionResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GrantMemoryStorePermissionResponse) MarshalJSON() ([]byte, error) { + w, err := grantMemoryStorePermissionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GrantMemoryStorePermissionResponse) UnmarshalJSON(data []byte) error { + var w grantMemoryStorePermissionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := grantMemoryStorePermissionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type grantSessionStorePermissionRequestWire struct { Name *string `json:"name,omitempty"` Principal *storePrincipalWire `json:"principal,omitempty"` @@ -740,6 +1316,30 @@ func grantSessionStorePermissionRequestFromWire(w *grantSessionStorePermissionRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GrantSessionStorePermissionRequest) MarshalJSON() ([]byte, error) { + w, err := grantSessionStorePermissionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GrantSessionStorePermissionRequest) UnmarshalJSON(data []byte) error { + var w grantSessionStorePermissionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := grantSessionStorePermissionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type grantSessionStorePermissionResponseWire struct { } @@ -757,6 +1357,30 @@ func grantSessionStorePermissionResponseFromWire(w *grantSessionStorePermissionR return &GrantSessionStorePermissionResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GrantSessionStorePermissionResponse) MarshalJSON() ([]byte, error) { + w, err := grantSessionStorePermissionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GrantSessionStorePermissionResponse) UnmarshalJSON(data []byte) error { + var w grantSessionStorePermissionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := grantSessionStorePermissionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listManagedMemoryEntriesRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -797,6 +1421,30 @@ func listManagedMemoryEntriesRequestFromWire(w *listManagedMemoryEntriesRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListManagedMemoryEntriesRequest) MarshalJSON() ([]byte, error) { + w, err := listManagedMemoryEntriesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListManagedMemoryEntriesRequest) UnmarshalJSON(data []byte) error { + var w listManagedMemoryEntriesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listManagedMemoryEntriesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listManagedMemoryEntriesResponseWire struct { ManagedMemoryEntries []managedMemoryEntryWire `json:"managed_memory_entries,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -830,6 +1478,30 @@ func listManagedMemoryEntriesResponseFromWire(w *listManagedMemoryEntriesRespons }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListManagedMemoryEntriesResponse) MarshalJSON() ([]byte, error) { + w, err := listManagedMemoryEntriesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListManagedMemoryEntriesResponse) UnmarshalJSON(data []byte) error { + var w listManagedMemoryEntriesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listManagedMemoryEntriesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listManagedMemoryStoresRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -855,6 +1527,30 @@ func listManagedMemoryStoresRequestFromWire(w *listManagedMemoryStoresRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListManagedMemoryStoresRequest) MarshalJSON() ([]byte, error) { + w, err := listManagedMemoryStoresRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListManagedMemoryStoresRequest) UnmarshalJSON(data []byte) error { + var w listManagedMemoryStoresRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listManagedMemoryStoresRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listManagedMemoryStoresResponseWire struct { ManagedMemoryStores []managedMemoryStoreWire `json:"managed_memory_stores,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -888,6 +1584,30 @@ func listManagedMemoryStoresResponseFromWire(w *listManagedMemoryStoresResponseW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListManagedMemoryStoresResponse) MarshalJSON() ([]byte, error) { + w, err := listManagedMemoryStoresResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListManagedMemoryStoresResponse) UnmarshalJSON(data []byte) error { + var w listManagedMemoryStoresResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listManagedMemoryStoresResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listMemoryStorePermissionsRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -916,6 +1636,30 @@ func listMemoryStorePermissionsRequestFromWire(w *listMemoryStorePermissionsRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListMemoryStorePermissionsRequest) MarshalJSON() ([]byte, error) { + w, err := listMemoryStorePermissionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListMemoryStorePermissionsRequest) UnmarshalJSON(data []byte) error { + var w listMemoryStorePermissionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listMemoryStorePermissionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listMemoryStorePermissionsResponseWire struct { MemoryStorePermissions []memoryStorePermissionWire `json:"memory_store_permissions,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -949,6 +1693,30 @@ func listMemoryStorePermissionsResponseFromWire(w *listMemoryStorePermissionsRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListMemoryStorePermissionsResponse) MarshalJSON() ([]byte, error) { + w, err := listMemoryStorePermissionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListMemoryStorePermissionsResponse) UnmarshalJSON(data []byte) error { + var w listMemoryStorePermissionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listMemoryStorePermissionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSessionItemsRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -980,6 +1748,30 @@ func listSessionItemsRequestFromWire(w *listSessionItemsRequestWire) (*ListSessi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSessionItemsRequest) MarshalJSON() ([]byte, error) { + w, err := listSessionItemsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSessionItemsRequest) UnmarshalJSON(data []byte) error { + var w listSessionItemsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSessionItemsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSessionItemsResponseWire struct { SessionItems []sessionItemWire `json:"session_items,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1013,6 +1805,30 @@ func listSessionItemsResponseFromWire(w *listSessionItemsResponseWire) (*ListSes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSessionItemsResponse) MarshalJSON() ([]byte, error) { + w, err := listSessionItemsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSessionItemsResponse) UnmarshalJSON(data []byte) error { + var w listSessionItemsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSessionItemsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSessionStorePermissionsRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -1041,6 +1857,30 @@ func listSessionStorePermissionsRequestFromWire(w *listSessionStorePermissionsRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSessionStorePermissionsRequest) MarshalJSON() ([]byte, error) { + w, err := listSessionStorePermissionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSessionStorePermissionsRequest) UnmarshalJSON(data []byte) error { + var w listSessionStorePermissionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSessionStorePermissionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSessionStorePermissionsResponseWire struct { SessionStorePermissions []sessionStorePermissionWire `json:"session_store_permissions,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1074,6 +1914,30 @@ func listSessionStorePermissionsResponseFromWire(w *listSessionStorePermissionsR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSessionStorePermissionsResponse) MarshalJSON() ([]byte, error) { + w, err := listSessionStorePermissionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSessionStorePermissionsResponse) UnmarshalJSON(data []byte) error { + var w listSessionStorePermissionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSessionStorePermissionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSessionStoresRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -1099,6 +1963,30 @@ func listSessionStoresRequestFromWire(w *listSessionStoresRequestWire) (*ListSes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSessionStoresRequest) MarshalJSON() ([]byte, error) { + w, err := listSessionStoresRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSessionStoresRequest) UnmarshalJSON(data []byte) error { + var w listSessionStoresRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSessionStoresRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSessionStoresResponseWire struct { SessionStores []sessionStoreWire `json:"session_stores,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1132,6 +2020,30 @@ func listSessionStoresResponseFromWire(w *listSessionStoresResponseWire) (*ListS }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSessionStoresResponse) MarshalJSON() ([]byte, error) { + w, err := listSessionStoresResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSessionStoresResponse) UnmarshalJSON(data []byte) error { + var w listSessionStoresResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSessionStoresResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSessionsRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -1166,6 +2078,30 @@ func listSessionsRequestFromWire(w *listSessionsRequestWire) (*ListSessionsReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSessionsRequest) MarshalJSON() ([]byte, error) { + w, err := listSessionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSessionsRequest) UnmarshalJSON(data []byte) error { + var w listSessionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSessionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSessionsResponseWire struct { Sessions []sessionWire `json:"sessions,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1199,6 +2135,30 @@ func listSessionsResponseFromWire(w *listSessionsResponseWire) (*ListSessionsRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSessionsResponse) MarshalJSON() ([]byte, error) { + w, err := listSessionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSessionsResponse) UnmarshalJSON(data []byte) error { + var w listSessionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSessionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type managedMemoryEntryWire struct { Name *string `json:"name,omitempty"` ActorId *string `json:"actor_id,omitempty"` @@ -1245,6 +2205,30 @@ func managedMemoryEntryFromWire(w *managedMemoryEntryWire) (*ManagedMemoryEntry, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ManagedMemoryEntry) MarshalJSON() ([]byte, error) { + w, err := managedMemoryEntryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ManagedMemoryEntry) UnmarshalJSON(data []byte) error { + var w managedMemoryEntryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := managedMemoryEntryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type managedMemoryEntrySearchResultWire struct { ManagedMemoryEntry *managedMemoryEntryWire `json:"managed_memory_entry,omitempty"` Score *float64 `json:"score,omitempty"` @@ -1278,6 +2262,30 @@ func managedMemoryEntrySearchResultFromWire(w *managedMemoryEntrySearchResultWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ManagedMemoryEntrySearchResult) MarshalJSON() ([]byte, error) { + w, err := managedMemoryEntrySearchResultToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ManagedMemoryEntrySearchResult) UnmarshalJSON(data []byte) error { + var w managedMemoryEntrySearchResultWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := managedMemoryEntrySearchResultFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type managedMemoryStoreWire struct { Name *string `json:"name,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -1340,6 +2348,30 @@ func managedMemoryStoreFromWire(w *managedMemoryStoreWire) (*ManagedMemoryStore, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ManagedMemoryStore) MarshalJSON() ([]byte, error) { + w, err := managedMemoryStoreToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ManagedMemoryStore) UnmarshalJSON(data []byte) error { + var w managedMemoryStoreWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := managedMemoryStoreFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type memoryStorePermissionWire struct { Principal *storePrincipalWire `json:"principal,omitempty"` Permission PermissionLevel `json:"permission,omitempty"` @@ -1373,6 +2405,30 @@ func memoryStorePermissionFromWire(w *memoryStorePermissionWire) (*MemoryStorePe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MemoryStorePermission) MarshalJSON() ([]byte, error) { + w, err := memoryStorePermissionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MemoryStorePermission) UnmarshalJSON(data []byte) error { + var w memoryStorePermissionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := memoryStorePermissionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type popSessionItemRequestWire struct { Parent *string `json:"parent,omitempty"` } @@ -1395,6 +2451,30 @@ func popSessionItemRequestFromWire(w *popSessionItemRequestWire) (*PopSessionIte }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PopSessionItemRequest) MarshalJSON() ([]byte, error) { + w, err := popSessionItemRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PopSessionItemRequest) UnmarshalJSON(data []byte) error { + var w popSessionItemRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := popSessionItemRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type popSessionItemResponseWire struct { Item *sessionItemWire `json:"item,omitempty"` } @@ -1425,6 +2505,30 @@ func popSessionItemResponseFromWire(w *popSessionItemResponseWire) (*PopSessionI }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PopSessionItemResponse) MarshalJSON() ([]byte, error) { + w, err := popSessionItemResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PopSessionItemResponse) UnmarshalJSON(data []byte) error { + var w popSessionItemResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := popSessionItemResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type revokeMemoryStorePermissionRequestWire struct { Name *string `json:"name,omitempty"` Principal *storePrincipalWire `json:"principal,omitempty"` @@ -1458,6 +2562,30 @@ func revokeMemoryStorePermissionRequestFromWire(w *revokeMemoryStorePermissionRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RevokeMemoryStorePermissionRequest) MarshalJSON() ([]byte, error) { + w, err := revokeMemoryStorePermissionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RevokeMemoryStorePermissionRequest) UnmarshalJSON(data []byte) error { + var w revokeMemoryStorePermissionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := revokeMemoryStorePermissionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type revokeMemoryStorePermissionResponseWire struct { } @@ -1475,6 +2603,30 @@ func revokeMemoryStorePermissionResponseFromWire(w *revokeMemoryStorePermissionR return &RevokeMemoryStorePermissionResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RevokeMemoryStorePermissionResponse) MarshalJSON() ([]byte, error) { + w, err := revokeMemoryStorePermissionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RevokeMemoryStorePermissionResponse) UnmarshalJSON(data []byte) error { + var w revokeMemoryStorePermissionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := revokeMemoryStorePermissionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type revokeSessionStorePermissionRequestWire struct { Name *string `json:"name,omitempty"` Principal *storePrincipalWire `json:"principal,omitempty"` @@ -1508,6 +2660,30 @@ func revokeSessionStorePermissionRequestFromWire(w *revokeSessionStorePermission }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RevokeSessionStorePermissionRequest) MarshalJSON() ([]byte, error) { + w, err := revokeSessionStorePermissionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RevokeSessionStorePermissionRequest) UnmarshalJSON(data []byte) error { + var w revokeSessionStorePermissionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := revokeSessionStorePermissionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type revokeSessionStorePermissionResponseWire struct { } @@ -1525,6 +2701,30 @@ func revokeSessionStorePermissionResponseFromWire(w *revokeSessionStorePermissio return &RevokeSessionStorePermissionResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RevokeSessionStorePermissionResponse) MarshalJSON() ([]byte, error) { + w, err := revokeSessionStorePermissionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RevokeSessionStorePermissionResponse) UnmarshalJSON(data []byte) error { + var w revokeSessionStorePermissionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := revokeSessionStorePermissionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchManagedMemoryEntriesRequestWire struct { Parent *string `json:"parent,omitempty"` ActorId *string `json:"actor_id,omitempty"` @@ -1571,6 +2771,30 @@ func searchManagedMemoryEntriesRequestFromWire(w *searchManagedMemoryEntriesRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchManagedMemoryEntriesRequest) MarshalJSON() ([]byte, error) { + w, err := searchManagedMemoryEntriesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchManagedMemoryEntriesRequest) UnmarshalJSON(data []byte) error { + var w searchManagedMemoryEntriesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchManagedMemoryEntriesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchManagedMemoryEntriesResponseWire struct { ManagedMemoryEntries []managedMemoryEntryWire `json:"managed_memory_entries,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1615,6 +2839,30 @@ func searchManagedMemoryEntriesResponseFromWire(w *searchManagedMemoryEntriesRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchManagedMemoryEntriesResponse) MarshalJSON() ([]byte, error) { + w, err := searchManagedMemoryEntriesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchManagedMemoryEntriesResponse) UnmarshalJSON(data []byte) error { + var w searchManagedMemoryEntriesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchManagedMemoryEntriesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sessionWire struct { SessionId *string `json:"session_id,omitempty"` ActorId *string `json:"actor_id,omitempty"` @@ -1661,6 +2909,30 @@ func sessionFromWire(w *sessionWire) (*Session, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Session) MarshalJSON() ([]byte, error) { + w, err := sessionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Session) UnmarshalJSON(data []byte) error { + var w sessionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sessionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sessionItemWire struct { ItemId *string `json:"item_id,omitempty"` Data json.RawMessage `json:"data,omitempty"` @@ -1689,6 +2961,30 @@ func sessionItemFromWire(w *sessionItemWire) (*SessionItem, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SessionItem) MarshalJSON() ([]byte, error) { + w, err := sessionItemToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SessionItem) UnmarshalJSON(data []byte) error { + var w sessionItemWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sessionItemFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sessionStoreWire struct { CreatorUserId *string `json:"creator_user_id,omitempty"` CreateTime *types.Time `json:"create_time,omitempty"` @@ -1726,6 +3022,30 @@ func sessionStoreFromWire(w *sessionStoreWire) (*SessionStore, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SessionStore) MarshalJSON() ([]byte, error) { + w, err := sessionStoreToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SessionStore) UnmarshalJSON(data []byte) error { + var w sessionStoreWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sessionStoreFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sessionStorePermissionWire struct { Principal *storePrincipalWire `json:"principal,omitempty"` Permission PermissionLevel `json:"permission,omitempty"` @@ -1759,6 +3079,30 @@ func sessionStorePermissionFromWire(w *sessionStorePermissionWire) (*SessionStor }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SessionStorePermission) MarshalJSON() ([]byte, error) { + w, err := sessionStorePermissionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SessionStorePermission) UnmarshalJSON(data []byte) error { + var w sessionStorePermissionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sessionStorePermissionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type storageBackendWire struct { BackendType StorageBackendType `json:"backend_type,omitempty"` BackendId *string `json:"backend_id,omitempty"` @@ -1784,6 +3128,30 @@ func storageBackendFromWire(w *storageBackendWire) (*StorageBackend, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StorageBackend) MarshalJSON() ([]byte, error) { + w, err := storageBackendToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StorageBackend) UnmarshalJSON(data []byte) error { + var w storageBackendWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := storageBackendFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type storePrincipalWire struct { Name *string `json:"name,omitempty"` PrincipalType PrincipalType `json:"principal_type,omitempty"` @@ -1809,6 +3177,30 @@ func storePrincipalFromWire(w *storePrincipalWire) (*StorePrincipal, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StorePrincipal) MarshalJSON() ([]byte, error) { + w, err := storePrincipalToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StorePrincipal) UnmarshalJSON(data []byte) error { + var w storePrincipalWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := storePrincipalFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateManagedMemoryEntryRequestWire struct { ManagedMemoryEntry *managedMemoryEntryWire `json:"managed_memory_entry,omitempty"` UpdateMask *types.FieldMask[ManagedMemoryEntry] `json:"update_mask,omitempty"` @@ -1842,6 +3234,30 @@ func updateManagedMemoryEntryRequestFromWire(w *updateManagedMemoryEntryRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateManagedMemoryEntryRequest) MarshalJSON() ([]byte, error) { + w, err := updateManagedMemoryEntryRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateManagedMemoryEntryRequest) UnmarshalJSON(data []byte) error { + var w updateManagedMemoryEntryRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateManagedMemoryEntryRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateManagedMemoryStoreRequestWire struct { ManagedMemoryStore *managedMemoryStoreWire `json:"managed_memory_store,omitempty"` UpdateMask *types.FieldMask[ManagedMemoryStore] `json:"update_mask,omitempty"` @@ -1875,6 +3291,30 @@ func updateManagedMemoryStoreRequestFromWire(w *updateManagedMemoryStoreRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateManagedMemoryStoreRequest) MarshalJSON() ([]byte, error) { + w, err := updateManagedMemoryStoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateManagedMemoryStoreRequest) UnmarshalJSON(data []byte) error { + var w updateManagedMemoryStoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateManagedMemoryStoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateSessionRequestWire struct { Session *sessionWire `json:"session,omitempty"` UpdateMask *types.FieldMask[Session] `json:"update_mask,omitempty"` @@ -1908,6 +3348,30 @@ func updateSessionRequestFromWire(w *updateSessionRequestWire) (*UpdateSessionRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateSessionRequest) MarshalJSON() ([]byte, error) { + w, err := updateSessionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateSessionRequest) UnmarshalJSON(data []byte) error { + var w updateSessionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateSessionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateSessionStoreRequestWire struct { SessionStore *sessionStoreWire `json:"session_store,omitempty"` UpdateMask *types.FieldMask[SessionStore] `json:"update_mask,omitempty"` @@ -1941,6 +3405,30 @@ func updateSessionStoreRequestFromWire(w *updateSessionStoreRequestWire) (*Updat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateSessionStoreRequest) MarshalJSON() ([]byte, error) { + w, err := updateSessionStoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateSessionStoreRequest) UnmarshalJSON(data []byte) error { + var w updateSessionStoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateSessionStoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/aifunctions/CHANGELOG.md b/aifunctions/CHANGELOG.md index 6bc647bf..a2b4e513 100644 --- a/aifunctions/CHANGELOG.md +++ b/aifunctions/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.8.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.7.0 (2026-11-11) ## Release v0.6.0 (2026-11-10) diff --git a/aifunctions/internal/version.go b/aifunctions/internal/version.go index 128f8f76..ce171ccc 100644 --- a/aifunctions/internal/version.go +++ b/aifunctions/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-aifunctions" -const Version = "0.7.0" +const Version = "0.8.0" diff --git a/aifunctions/v1/client.go b/aifunctions/v1/client.go index 2676d4de..8f110cba 100644 --- a/aifunctions/v1/client.go +++ b/aifunctions/v1/client.go @@ -78,8 +78,8 @@ func NewClient(ctx context.Context, opts ...client.Option) (*Client, error) { }, nil } -// Cancel a batch. Cancellation is asynchronous: requests in flight drain first, -// so read the batch to observe the `CANCELLING` and `CANCELLED` statuses. +// Starts the asynchronous cancellation of a batch. Requests in progress are +// drained first. Cancellation is best effort, so the batch can still complete. func (c *internalClient) CancelBatch(ctx context.Context, req CancelBatchRequest, opts ...call.Option) (*CancelBatchResponse, error) { wireReq, err := cancelBatchRequestToWire(&req) if err != nil { @@ -146,8 +146,9 @@ func (c *internalClient) CancelBatch(ctx context.Context, req CancelBatchRequest return resp, nil } -// Run an AI function over every request in a file on a Unity Catalog volume. -// The batch runs asynchronously; read it to follow its progress. +// Creates a batch that runs an AI function on every request in a JSONL file on +// a Unity Catalog volume. The batch runs asynchronously. To follow its +// progress, get the batch. func (c *internalClient) CreateBatch(ctx context.Context, req CreateBatchRequest, opts ...call.Option) (*Batch, error) { wireReq, err := createBatchRequestToWire(&req) if err != nil { @@ -213,7 +214,7 @@ func (c *internalClient) CreateBatch(ctx context.Context, req CreateBatchRequest return resp, nil } -// Read one batch, with its status and progress. +// Gets the latest status and progress of a batch. func (c *internalClient) GetBatch(ctx context.Context, req GetBatchRequest, opts ...call.Option) (*Batch, error) { headers := http.Header{} @@ -275,7 +276,7 @@ func (c *internalClient) GetBatch(ctx context.Context, req GetBatchRequest, opts return resp, nil } -// List the batches the caller created in this workspace. +// Lists the batches that the caller created in this workspace. func (c *internalClient) ListBatches(ctx context.Context, req ListBatchesRequest, opts ...call.Option) (*ListBatchesResponse, error) { wireReq, err := listBatchesRequestToWire(&req) if err != nil { diff --git a/aifunctions/v1/model.go b/aifunctions/v1/model.go index d4c05a76..f074dfe7 100644 --- a/aifunctions/v1/model.go +++ b/aifunctions/v1/model.go @@ -13,20 +13,20 @@ type BatchStatus string const ( BatchStatus_Unspecified BatchStatus = "" - // Accepted, not started yet. + // The service is preparing to run the batch. BatchStatus_Pending BatchStatus = "PENDING" - // Requests are being processed. + // The batch is in progress. BatchStatus_InProgress BatchStatus = "IN_PROGRESS" - // Every request is processed and the output file is being written. + // The service processed every request and is writing the output file. BatchStatus_Finalizing BatchStatus = "FINALIZING" - // The output is written and available. + // The batch completed and the output file is written. A request that failed has + // an `error` line in the output file. BatchStatus_Completed BatchStatus = "COMPLETED" - // The completion window elapsed. The output holds the requests that finished in - // time. - BatchStatus_Expired BatchStatus = "EXPIRED" - // Cancellation was accepted and requests in flight are draining. + // The batch is being cancelled. Requests in progress are drained and the output + // file is written. BatchStatus_Cancelling BatchStatus = "CANCELLING" - // Cancellation finished. No output file is written. + // The batch was cancelled. If it had started, the output file holds the results + // of the requests that finished. BatchStatus_Cancelled BatchStatus = "CANCELLED" // The batch failed. BatchStatus_Failed BatchStatus = "FAILED" @@ -351,46 +351,51 @@ type AiParseDocumentResponseMetadata struct { FileMetadata *AiParseDocumentFileMetadata } -// An asynchronous run of one AI function over a file of requests.. +// The AI Functions Asynchronous API lets you process large volumes of requests +// as a batch in a single call.. type Batch struct { - // ID of the batch, in the form `batch_`. The service assigns it. + // Output only. Identifier. Resource name of the batch, returned by create. + // Format: `batch_`. Name *string - // The AI function to run for every request, for example `ai_extract`. + // The AI function, for example `ai_parse_document`. Endpoint *string - // Path of the JSONL input file on a Unity Catalog volume. Each line is one - // request. + // Unity Catalog volume path of the JSONL input file. Each line is one request, + // in the form `{"custom_id": ..., "body": ...}`. The file can hold up to 50,000 + // requests and be up to 200 MiB. InputRef *string - // Function options applied to every request in the batch, for example the - // extraction schema. + // Parameters of the function other than its input, applied to every request in + // the batch, for example `schema` for `ai_extract`. Put function options, such + // as `version`, in a nested `options` object. For the parameters of each + // function, see [AI Functions](/large-language-models/ai-functions). Params map[string]json.RawMessage - // Path on a Unity Catalog volume to write the JSONL output to. When it is - // omitted, the output stays on Databricks-managed storage and a finished batch - // returns a short-lived download URL in this field instead. + // Unity Catalog volume path to write the JSONL output file to. If the path is a + // directory, the file is `/_output.jsonl`. OutputRef *string - // Output only. Status of the batch. + // Output only. The status of the batch. Status BatchStatus - // Output only. Time the batch was created. + // Output only. The time when the batch was created. CreateTime *types.Time - // Output only. Request counts. Returned when one batch is read, not when - // batches are listed. + // Output only. The number of requests in the batch, by result. Returned when + // you get a batch, not when you list batches. RequestCounts *BatchRequestCounts - // Output only. Percentage of the requests that finished, from 0 to 100. - // Returned when one batch is read, not when batches are listed. + // Output only. The percentage of requests that are processed, from 0 to 100. + // Returned when you get a batch, not when you list batches. PercentComplete *float64 } // Counts of the requests in a batch.. type BatchRequestCounts struct { - // Output only. Number of requests in the input file. + // Output only. The number of requests in the batch. Total *int64 - // Output only. Number of requests that finished successfully. + // Output only. The number of requests that were processed successfully. Succeeded *int64 - // Output only. Number of requests that failed and will not be retried. + // Output only. The number of requests that failed. The service does not retry + // them. Failed *int64 } type CancelBatchRequest struct { - // ID of the batch, in the form `batch_`. + // Resource name of the batch. Format: `batch_`. Name *string } @@ -403,20 +408,21 @@ type CreateBatchRequest struct { } type GetBatchRequest struct { - // ID of the batch, in the form `batch_`. + // Resource name of the batch. Format: `batch_`. Name *string } type ListBatchesRequest struct { // Maximum number of batches to return in one page. PageSize *int - // Page token from an earlier response. Omit it to read the first page. + // A page token from a previous call to list batches. Omit it to get the first + // page. PageToken *string } type ListBatchesResponse struct { // The batches in this page. Batches []Batch - // Token that reads the next page. It is empty on the last page. + // A token to get the next page. It is empty on the last page. NextPageToken *string } diff --git a/aifunctions/v1/wire.go b/aifunctions/v1/wire.go index 8535f335..6b5f54f8 100644 --- a/aifunctions/v1/wire.go +++ b/aifunctions/v1/wire.go @@ -88,6 +88,30 @@ func aiClassifyOptionsFromWire(w *aiClassifyOptionsWire) (*AiClassifyOptions, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiClassifyOptions) MarshalJSON() ([]byte, error) { + w, err := aiClassifyOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiClassifyOptions) UnmarshalJSON(data []byte) error { + var w aiClassifyOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiClassifyOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiClassifyRequestWire struct { Content json.RawMessage `json:"content,omitempty"` Labels json.RawMessage `json:"labels,omitempty"` @@ -124,6 +148,30 @@ func aiClassifyRequestFromWire(w *aiClassifyRequestWire) (*AiClassifyRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiClassifyRequest) MarshalJSON() ([]byte, error) { + w, err := aiClassifyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiClassifyRequest) UnmarshalJSON(data []byte) error { + var w aiClassifyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiClassifyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiClassifyResponseWire struct { Response json.RawMessage `json:"response,omitempty"` Metadata *aiClassifyResponseMetadataWire `json:"metadata,omitempty"` @@ -157,6 +205,30 @@ func aiClassifyResponseFromWire(w *aiClassifyResponseWire) (*AiClassifyResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiClassifyResponse) MarshalJSON() ([]byte, error) { + w, err := aiClassifyResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiClassifyResponse) UnmarshalJSON(data []byte) error { + var w aiClassifyResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiClassifyResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiClassifyResponseMetadataWire struct { Version *string `json:"version,omitempty"` } @@ -179,6 +251,30 @@ func aiClassifyResponseMetadataFromWire(w *aiClassifyResponseMetadataWire) (*AiC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiClassifyResponseMetadata) MarshalJSON() ([]byte, error) { + w, err := aiClassifyResponseMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiClassifyResponseMetadata) UnmarshalJSON(data []byte) error { + var w aiClassifyResponseMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiClassifyResponseMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiDecideOptionsWire struct { Version *string `json:"version,omitempty"` } @@ -201,6 +297,30 @@ func aiDecideOptionsFromWire(w *aiDecideOptionsWire) (*AiDecideOptions, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiDecideOptions) MarshalJSON() ([]byte, error) { + w, err := aiDecideOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiDecideOptions) UnmarshalJSON(data []byte) error { + var w aiDecideOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiDecideOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiDecideRequestWire struct { State json.RawMessage `json:"state,omitempty"` Questions json.RawMessage `json:"questions,omitempty"` @@ -237,6 +357,30 @@ func aiDecideRequestFromWire(w *aiDecideRequestWire) (*AiDecideRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiDecideRequest) MarshalJSON() ([]byte, error) { + w, err := aiDecideRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiDecideRequest) UnmarshalJSON(data []byte) error { + var w aiDecideRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiDecideRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiDecideResponseWire struct { Response json.RawMessage `json:"response,omitempty"` Metadata *aiDecideResponseMetadataWire `json:"metadata,omitempty"` @@ -270,6 +414,30 @@ func aiDecideResponseFromWire(w *aiDecideResponseWire) (*AiDecideResponse, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiDecideResponse) MarshalJSON() ([]byte, error) { + w, err := aiDecideResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiDecideResponse) UnmarshalJSON(data []byte) error { + var w aiDecideResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiDecideResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiDecideResponseMetadataWire struct { Version *string `json:"version,omitempty"` } @@ -292,6 +460,30 @@ func aiDecideResponseMetadataFromWire(w *aiDecideResponseMetadataWire) (*AiDecid }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiDecideResponseMetadata) MarshalJSON() ([]byte, error) { + w, err := aiDecideResponseMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiDecideResponseMetadata) UnmarshalJSON(data []byte) error { + var w aiDecideResponseMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiDecideResponseMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiExtractBboxWire struct { Coord []wireInt64 `json:"coord,omitempty"` PageId *wireInt64 `json:"page_id,omitempty"` @@ -333,6 +525,30 @@ func aiExtractBboxFromWire(w *aiExtractBboxWire) (*AiExtractBbox, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiExtractBbox) MarshalJSON() ([]byte, error) { + w, err := aiExtractBboxToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiExtractBbox) UnmarshalJSON(data []byte) error { + var w aiExtractBboxWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiExtractBboxFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiExtractCitationWire struct { Id *wireInt64 `json:"id,omitempty"` Start *wireInt64 `json:"start,omitempty"` @@ -396,6 +612,30 @@ func aiExtractCitationFromWire(w *aiExtractCitationWire) (*AiExtractCitation, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiExtractCitation) MarshalJSON() ([]byte, error) { + w, err := aiExtractCitationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiExtractCitation) UnmarshalJSON(data []byte) error { + var w aiExtractCitationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiExtractCitationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiExtractOptionsWire struct { Instructions *string `json:"instructions,omitempty"` Version *string `json:"version,omitempty"` @@ -430,6 +670,30 @@ func aiExtractOptionsFromWire(w *aiExtractOptionsWire) (*AiExtractOptions, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiExtractOptions) MarshalJSON() ([]byte, error) { + w, err := aiExtractOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiExtractOptions) UnmarshalJSON(data []byte) error { + var w aiExtractOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiExtractOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiExtractRequestWire struct { Content json.RawMessage `json:"content,omitempty"` Schema json.RawMessage `json:"schema,omitempty"` @@ -466,6 +730,30 @@ func aiExtractRequestFromWire(w *aiExtractRequestWire) (*AiExtractRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiExtractRequest) MarshalJSON() ([]byte, error) { + w, err := aiExtractRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiExtractRequest) UnmarshalJSON(data []byte) error { + var w aiExtractRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiExtractRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiExtractResponseWire struct { Response json.RawMessage `json:"response,omitempty"` Metadata *aiExtractResponseMetadataWire `json:"metadata,omitempty"` @@ -499,6 +787,30 @@ func aiExtractResponseFromWire(w *aiExtractResponseWire) (*AiExtractResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiExtractResponse) MarshalJSON() ([]byte, error) { + w, err := aiExtractResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiExtractResponse) UnmarshalJSON(data []byte) error { + var w aiExtractResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiExtractResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiExtractResponseMetadataWire struct { Version *string `json:"version,omitempty"` Mode *string `json:"mode,omitempty"` @@ -538,6 +850,30 @@ func aiExtractResponseMetadataFromWire(w *aiExtractResponseMetadataWire) (*AiExt }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiExtractResponseMetadata) MarshalJSON() ([]byte, error) { + w, err := aiExtractResponseMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiExtractResponseMetadata) UnmarshalJSON(data []byte) error { + var w aiExtractResponseMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiExtractResponseMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiParseDocumentFileMetadataWire struct { FilePath *string `json:"file_path,omitempty"` FileName *string `json:"file_name,omitempty"` @@ -577,6 +913,30 @@ func aiParseDocumentFileMetadataFromWire(w *aiParseDocumentFileMetadataWire) (*A }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiParseDocumentFileMetadata) MarshalJSON() ([]byte, error) { + w, err := aiParseDocumentFileMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiParseDocumentFileMetadata) UnmarshalJSON(data []byte) error { + var w aiParseDocumentFileMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiParseDocumentFileMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiParseDocumentOptionsWire struct { Version *string `json:"version,omitempty"` DescriptionElementTypes *string `json:"description_element_types,omitempty"` @@ -608,6 +968,30 @@ func aiParseDocumentOptionsFromWire(w *aiParseDocumentOptionsWire) (*AiParseDocu }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiParseDocumentOptions) MarshalJSON() ([]byte, error) { + w, err := aiParseDocumentOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiParseDocumentOptions) UnmarshalJSON(data []byte) error { + var w aiParseDocumentOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiParseDocumentOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiParseDocumentPageErrorWire struct { ErrorMessage *string `json:"error_message,omitempty"` PageId *wireInt64 `json:"page_id,omitempty"` @@ -641,6 +1025,30 @@ func aiParseDocumentPageErrorFromWire(w *aiParseDocumentPageErrorWire) (*AiParse }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiParseDocumentPageError) MarshalJSON() ([]byte, error) { + w, err := aiParseDocumentPageErrorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiParseDocumentPageError) UnmarshalJSON(data []byte) error { + var w aiParseDocumentPageErrorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiParseDocumentPageErrorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiParseDocumentRequestWire struct { Content *string `json:"content,omitempty"` Options *aiParseDocumentOptionsWire `json:"options,omitempty"` @@ -674,6 +1082,30 @@ func aiParseDocumentRequestFromWire(w *aiParseDocumentRequestWire) (*AiParseDocu }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiParseDocumentRequest) MarshalJSON() ([]byte, error) { + w, err := aiParseDocumentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiParseDocumentRequest) UnmarshalJSON(data []byte) error { + var w aiParseDocumentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiParseDocumentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiParseDocumentResponseWire struct { Document json.RawMessage `json:"document,omitempty"` ErrorStatus []aiParseDocumentPageErrorWire `json:"error_status,omitempty"` @@ -718,6 +1150,30 @@ func aiParseDocumentResponseFromWire(w *aiParseDocumentResponseWire) (*AiParseDo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiParseDocumentResponse) MarshalJSON() ([]byte, error) { + w, err := aiParseDocumentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiParseDocumentResponse) UnmarshalJSON(data []byte) error { + var w aiParseDocumentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiParseDocumentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiParseDocumentResponseMetadataWire struct { Id *string `json:"id,omitempty"` Version *string `json:"version,omitempty"` @@ -754,6 +1210,30 @@ func aiParseDocumentResponseMetadataFromWire(w *aiParseDocumentResponseMetadataW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiParseDocumentResponseMetadata) MarshalJSON() ([]byte, error) { + w, err := aiParseDocumentResponseMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiParseDocumentResponseMetadata) UnmarshalJSON(data []byte) error { + var w aiParseDocumentResponseMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiParseDocumentResponseMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type batchWire struct { Name *string `json:"name,omitempty"` Endpoint *string `json:"endpoint,omitempty"` @@ -808,6 +1288,30 @@ func batchFromWire(w *batchWire) (*Batch, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Batch) MarshalJSON() ([]byte, error) { + w, err := batchToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Batch) UnmarshalJSON(data []byte) error { + var w batchWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := batchFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type batchRequestCountsWire struct { Total *wireInt64 `json:"total,omitempty"` Succeeded *wireInt64 `json:"succeeded,omitempty"` @@ -860,6 +1364,30 @@ func batchRequestCountsFromWire(w *batchRequestCountsWire) (*BatchRequestCounts, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BatchRequestCounts) MarshalJSON() ([]byte, error) { + w, err := batchRequestCountsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BatchRequestCounts) UnmarshalJSON(data []byte) error { + var w batchRequestCountsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := batchRequestCountsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cancelBatchRequestWire struct { Name *string `json:"name,omitempty"` } @@ -882,6 +1410,30 @@ func cancelBatchRequestFromWire(w *cancelBatchRequestWire) (*CancelBatchRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelBatchRequest) MarshalJSON() ([]byte, error) { + w, err := cancelBatchRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelBatchRequest) UnmarshalJSON(data []byte) error { + var w cancelBatchRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelBatchRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cancelBatchResponseWire struct { } @@ -899,6 +1451,30 @@ func cancelBatchResponseFromWire(w *cancelBatchResponseWire) (*CancelBatchRespon return &CancelBatchResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelBatchResponse) MarshalJSON() ([]byte, error) { + w, err := cancelBatchResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelBatchResponse) UnmarshalJSON(data []byte) error { + var w cancelBatchResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelBatchResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createBatchRequestWire struct { Batch *batchWire `json:"batch,omitempty"` } @@ -929,6 +1505,30 @@ func createBatchRequestFromWire(w *createBatchRequestWire) (*CreateBatchRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateBatchRequest) MarshalJSON() ([]byte, error) { + w, err := createBatchRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateBatchRequest) UnmarshalJSON(data []byte) error { + var w createBatchRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createBatchRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getBatchRequestWire struct { Name *string `json:"name,omitempty"` } @@ -951,6 +1551,30 @@ func getBatchRequestFromWire(w *getBatchRequestWire) (*GetBatchRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetBatchRequest) MarshalJSON() ([]byte, error) { + w, err := getBatchRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetBatchRequest) UnmarshalJSON(data []byte) error { + var w getBatchRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getBatchRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listBatchesRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -976,6 +1600,30 @@ func listBatchesRequestFromWire(w *listBatchesRequestWire) (*ListBatchesRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListBatchesRequest) MarshalJSON() ([]byte, error) { + w, err := listBatchesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListBatchesRequest) UnmarshalJSON(data []byte) error { + var w listBatchesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listBatchesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listBatchesResponseWire struct { Batches []batchWire `json:"batches,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1009,6 +1657,30 @@ func listBatchesResponseFromWire(w *listBatchesResponseWire) (*ListBatchesRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListBatchesResponse) MarshalJSON() ([]byte, error) { + w, err := listBatchesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListBatchesResponse) UnmarshalJSON(data []byte) error { + var w listBatchesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listBatchesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/aigateway/CHANGELOG.md b/aigateway/CHANGELOG.md index c896bc20..790f0cc4 100644 --- a/aigateway/CHANGELOG.md +++ b/aigateway/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.20.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.19.0 (2026-11-11) ## Release v0.18.0 (2026-11-10) diff --git a/aigateway/internal/version.go b/aigateway/internal/version.go index 63e68f66..b34334c4 100644 --- a/aigateway/internal/version.go +++ b/aigateway/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-aigateway" -const Version = "0.19.0" +const Version = "0.20.0" diff --git a/aigateway/v1/wire.go b/aigateway/v1/wire.go index 34b898c0..edec71df 100644 --- a/aigateway/v1/wire.go +++ b/aigateway/v1/wire.go @@ -90,6 +90,30 @@ func createMcpServiceRequestFromWire(w *createMcpServiceRequestWire) (*CreateMcp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateMcpServiceRequest) MarshalJSON() ([]byte, error) { + w, err := createMcpServiceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateMcpServiceRequest) UnmarshalJSON(data []byte) error { + var w createMcpServiceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createMcpServiceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createMcpServiceUserMappedCredentialRequestWire struct { Name *string `json:"name,omitempty"` Login *mcpServiceUserMappedCredentialLoginWire `json:"login,omitempty"` @@ -123,6 +147,30 @@ func createMcpServiceUserMappedCredentialRequestFromWire(w *createMcpServiceUser }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateMcpServiceUserMappedCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := createMcpServiceUserMappedCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateMcpServiceUserMappedCredentialRequest) UnmarshalJSON(data []byte) error { + var w createMcpServiceUserMappedCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createMcpServiceUserMappedCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createModelProviderServiceRequestWire struct { Parent *string `json:"parent,omitempty"` ModelProviderServiceId *string `json:"model_provider_service_id,omitempty"` @@ -159,6 +207,30 @@ func createModelProviderServiceRequestFromWire(w *createModelProviderServiceRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateModelProviderServiceRequest) MarshalJSON() ([]byte, error) { + w, err := createModelProviderServiceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateModelProviderServiceRequest) UnmarshalJSON(data []byte) error { + var w createModelProviderServiceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createModelProviderServiceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createModelServiceRequestWire struct { Parent *string `json:"parent,omitempty"` ModelServiceId *string `json:"model_service_id,omitempty"` @@ -195,6 +267,30 @@ func createModelServiceRequestFromWire(w *createModelServiceRequestWire) (*Creat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateModelServiceRequest) MarshalJSON() ([]byte, error) { + w, err := createModelServiceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateModelServiceRequest) UnmarshalJSON(data []byte) error { + var w createModelServiceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createModelServiceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createSkillRequestWire struct { Parent *string `json:"parent,omitempty"` SkillId *string `json:"skill_id,omitempty"` @@ -231,6 +327,30 @@ func createSkillRequestFromWire(w *createSkillRequestWire) (*CreateSkillRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateSkillRequest) MarshalJSON() ([]byte, error) { + w, err := createSkillRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateSkillRequest) UnmarshalJSON(data []byte) error { + var w createSkillRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createSkillRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteMcpServiceRequestWire struct { Name *string `json:"name,omitempty"` Etag []byte `json:"etag,omitempty"` @@ -256,6 +376,30 @@ func deleteMcpServiceRequestFromWire(w *deleteMcpServiceRequestWire) (*DeleteMcp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteMcpServiceRequest) MarshalJSON() ([]byte, error) { + w, err := deleteMcpServiceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteMcpServiceRequest) UnmarshalJSON(data []byte) error { + var w deleteMcpServiceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteMcpServiceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteMcpServiceUserMappedCredentialRequestWire struct { Name *string `json:"name,omitempty"` } @@ -278,6 +422,30 @@ func deleteMcpServiceUserMappedCredentialRequestFromWire(w *deleteMcpServiceUser }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteMcpServiceUserMappedCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := deleteMcpServiceUserMappedCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteMcpServiceUserMappedCredentialRequest) UnmarshalJSON(data []byte) error { + var w deleteMcpServiceUserMappedCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteMcpServiceUserMappedCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteMcpServiceUserMappedCredentialResponseWire struct { } @@ -295,6 +463,30 @@ func deleteMcpServiceUserMappedCredentialResponseFromWire(w *deleteMcpServiceUse return &DeleteMcpServiceUserMappedCredentialResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteMcpServiceUserMappedCredentialResponse) MarshalJSON() ([]byte, error) { + w, err := deleteMcpServiceUserMappedCredentialResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteMcpServiceUserMappedCredentialResponse) UnmarshalJSON(data []byte) error { + var w deleteMcpServiceUserMappedCredentialResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteMcpServiceUserMappedCredentialResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteModelProviderServiceRequestWire struct { Name *string `json:"name,omitempty"` Etag []byte `json:"etag,omitempty"` @@ -320,6 +512,30 @@ func deleteModelProviderServiceRequestFromWire(w *deleteModelProviderServiceRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteModelProviderServiceRequest) MarshalJSON() ([]byte, error) { + w, err := deleteModelProviderServiceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteModelProviderServiceRequest) UnmarshalJSON(data []byte) error { + var w deleteModelProviderServiceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteModelProviderServiceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteModelServiceRequestWire struct { Name *string `json:"name,omitempty"` Etag []byte `json:"etag,omitempty"` @@ -345,6 +561,30 @@ func deleteModelServiceRequestFromWire(w *deleteModelServiceRequestWire) (*Delet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteModelServiceRequest) MarshalJSON() ([]byte, error) { + w, err := deleteModelServiceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteModelServiceRequest) UnmarshalJSON(data []byte) error { + var w deleteModelServiceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteModelServiceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteSkillRequestWire struct { Name *string `json:"name,omitempty"` Etag []byte `json:"etag,omitempty"` @@ -370,6 +610,30 @@ func deleteSkillRequestFromWire(w *deleteSkillRequestWire) (*DeleteSkillRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteSkillRequest) MarshalJSON() ([]byte, error) { + w, err := deleteSkillRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteSkillRequest) UnmarshalJSON(data []byte) error { + var w deleteSkillRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteSkillRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type finalizeSkillRequestWire struct { Name *string `json:"name,omitempty"` } @@ -392,6 +656,30 @@ func finalizeSkillRequestFromWire(w *finalizeSkillRequestWire) (*FinalizeSkillRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FinalizeSkillRequest) MarshalJSON() ([]byte, error) { + w, err := finalizeSkillRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FinalizeSkillRequest) UnmarshalJSON(data []byte) error { + var w finalizeSkillRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := finalizeSkillRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getMcpServiceRequestWire struct { Name *string `json:"name,omitempty"` } @@ -414,6 +702,30 @@ func getMcpServiceRequestFromWire(w *getMcpServiceRequestWire) (*GetMcpServiceRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetMcpServiceRequest) MarshalJSON() ([]byte, error) { + w, err := getMcpServiceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetMcpServiceRequest) UnmarshalJSON(data []byte) error { + var w getMcpServiceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getMcpServiceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getMcpServiceUserMappedCredentialRequestWire struct { Name *string `json:"name,omitempty"` } @@ -436,6 +748,30 @@ func getMcpServiceUserMappedCredentialRequestFromWire(w *getMcpServiceUserMapped }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetMcpServiceUserMappedCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := getMcpServiceUserMappedCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetMcpServiceUserMappedCredentialRequest) UnmarshalJSON(data []byte) error { + var w getMcpServiceUserMappedCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getMcpServiceUserMappedCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getModelProviderServiceRequestWire struct { Name *string `json:"name,omitempty"` } @@ -458,6 +794,30 @@ func getModelProviderServiceRequestFromWire(w *getModelProviderServiceRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetModelProviderServiceRequest) MarshalJSON() ([]byte, error) { + w, err := getModelProviderServiceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetModelProviderServiceRequest) UnmarshalJSON(data []byte) error { + var w getModelProviderServiceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getModelProviderServiceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getModelServiceRequestWire struct { Name *string `json:"name,omitempty"` } @@ -480,6 +840,30 @@ func getModelServiceRequestFromWire(w *getModelServiceRequestWire) (*GetModelSer }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetModelServiceRequest) MarshalJSON() ([]byte, error) { + w, err := getModelServiceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetModelServiceRequest) UnmarshalJSON(data []byte) error { + var w getModelServiceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getModelServiceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSkillRequestWire struct { Name *string `json:"name,omitempty"` } @@ -502,6 +886,30 @@ func getSkillRequestFromWire(w *getSkillRequestWire) (*GetSkillRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSkillRequest) MarshalJSON() ([]byte, error) { + w, err := getSkillRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSkillRequest) UnmarshalJSON(data []byte) error { + var w getSkillRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSkillRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type inferenceTableConfigWire struct { Parent *string `json:"parent,omitempty"` TableNamePrefix *string `json:"table_name_prefix,omitempty"` @@ -533,6 +941,30 @@ func inferenceTableConfigFromWire(w *inferenceTableConfigWire) (*InferenceTableC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InferenceTableConfig) MarshalJSON() ([]byte, error) { + w, err := inferenceTableConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InferenceTableConfig) UnmarshalJSON(data []byte) error { + var w inferenceTableConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := inferenceTableConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listMcpServicesRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -564,6 +996,30 @@ func listMcpServicesRequestFromWire(w *listMcpServicesRequestWire) (*ListMcpServ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListMcpServicesRequest) MarshalJSON() ([]byte, error) { + w, err := listMcpServicesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListMcpServicesRequest) UnmarshalJSON(data []byte) error { + var w listMcpServicesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listMcpServicesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listMcpServicesResponseWire struct { McpServices []mcpServiceWire `json:"mcp_services,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -597,6 +1053,30 @@ func listMcpServicesResponseFromWire(w *listMcpServicesResponseWire) (*ListMcpSe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListMcpServicesResponse) MarshalJSON() ([]byte, error) { + w, err := listMcpServicesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListMcpServicesResponse) UnmarshalJSON(data []byte) error { + var w listMcpServicesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listMcpServicesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listModelProviderServicesRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -628,6 +1108,30 @@ func listModelProviderServicesRequestFromWire(w *listModelProviderServicesReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListModelProviderServicesRequest) MarshalJSON() ([]byte, error) { + w, err := listModelProviderServicesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListModelProviderServicesRequest) UnmarshalJSON(data []byte) error { + var w listModelProviderServicesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listModelProviderServicesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listModelProviderServicesResponseWire struct { ModelProviderServices []modelProviderServiceWire `json:"model_provider_services,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -661,6 +1165,30 @@ func listModelProviderServicesResponseFromWire(w *listModelProviderServicesRespo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListModelProviderServicesResponse) MarshalJSON() ([]byte, error) { + w, err := listModelProviderServicesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListModelProviderServicesResponse) UnmarshalJSON(data []byte) error { + var w listModelProviderServicesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listModelProviderServicesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listModelServicesRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -692,6 +1220,30 @@ func listModelServicesRequestFromWire(w *listModelServicesRequestWire) (*ListMod }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListModelServicesRequest) MarshalJSON() ([]byte, error) { + w, err := listModelServicesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListModelServicesRequest) UnmarshalJSON(data []byte) error { + var w listModelServicesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listModelServicesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listModelServicesResponseWire struct { ModelServices []modelServiceWire `json:"model_services,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -725,6 +1277,30 @@ func listModelServicesResponseFromWire(w *listModelServicesResponseWire) (*ListM }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListModelServicesResponse) MarshalJSON() ([]byte, error) { + w, err := listModelServicesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListModelServicesResponse) UnmarshalJSON(data []byte) error { + var w listModelServicesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listModelServicesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSkillsRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -753,6 +1329,30 @@ func listSkillsRequestFromWire(w *listSkillsRequestWire) (*ListSkillsRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSkillsRequest) MarshalJSON() ([]byte, error) { + w, err := listSkillsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSkillsRequest) UnmarshalJSON(data []byte) error { + var w listSkillsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSkillsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSkillsResponseWire struct { Skills []skillWire `json:"skills,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -786,6 +1386,30 @@ func listSkillsResponseFromWire(w *listSkillsResponseWire) (*ListSkillsResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSkillsResponse) MarshalJSON() ([]byte, error) { + w, err := listSkillsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSkillsResponse) UnmarshalJSON(data []byte) error { + var w listSkillsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSkillsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type mcpServiceWire struct { Name *string `json:"name,omitempty"` EffectiveOwner *string `json:"effective_owner,omitempty"` @@ -843,6 +1467,30 @@ func mcpServiceFromWire(w *mcpServiceWire) (*McpService, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v McpService) MarshalJSON() ([]byte, error) { + w, err := mcpServiceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *McpService) UnmarshalJSON(data []byte) error { + var w mcpServiceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := mcpServiceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type mcpServiceConfigWire struct { SourceConnection *mcpServiceConfig_SourceConnectionWire `json:"source_connection,omitempty"` IncludeToolSelectors []string `json:"include_tool_selectors,omitempty"` @@ -909,6 +1557,30 @@ func mcpServiceConfigFromWire(w *mcpServiceConfigWire) (*McpServiceConfig, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v McpServiceConfig) MarshalJSON() ([]byte, error) { + w, err := mcpServiceConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *McpServiceConfig) UnmarshalJSON(data []byte) error { + var w mcpServiceConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := mcpServiceConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type mcpServiceConfig_SourceConnectionWire struct { Name *string `json:"name,omitempty"` IsDeleted *bool `json:"is_deleted,omitempty"` @@ -930,11 +1602,35 @@ func mcpServiceConfig_SourceConnectionFromWire(w *mcpServiceConfig_SourceConnect if w == nil { return nil, nil } - return &McpServiceConfig_SourceConnection{ - Name: w.Name, - IsDeleted: w.IsDeleted, - Options: w.Options, - }, nil + return &McpServiceConfig_SourceConnection{ + Name: w.Name, + IsDeleted: w.IsDeleted, + Options: w.Options, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v McpServiceConfig_SourceConnection) MarshalJSON() ([]byte, error) { + w, err := mcpServiceConfig_SourceConnectionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *McpServiceConfig_SourceConnection) UnmarshalJSON(data []byte) error { + var w mcpServiceConfig_SourceConnectionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := mcpServiceConfig_SourceConnectionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil } type mcpServiceUserMappedCredentialWire struct { @@ -970,6 +1666,30 @@ func mcpServiceUserMappedCredentialFromWire(w *mcpServiceUserMappedCredentialWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v McpServiceUserMappedCredential) MarshalJSON() ([]byte, error) { + w, err := mcpServiceUserMappedCredentialToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *McpServiceUserMappedCredential) UnmarshalJSON(data []byte) error { + var w mcpServiceUserMappedCredentialWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := mcpServiceUserMappedCredentialFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type mcpServiceUserMappedCredentialLoginWire struct { Options map[string]string `json:"options,omitempty"` } @@ -992,6 +1712,30 @@ func mcpServiceUserMappedCredentialLoginFromWire(w *mcpServiceUserMappedCredenti }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v McpServiceUserMappedCredentialLogin) MarshalJSON() ([]byte, error) { + w, err := mcpServiceUserMappedCredentialLoginToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *McpServiceUserMappedCredentialLogin) UnmarshalJSON(data []byte) error { + var w mcpServiceUserMappedCredentialLoginWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := mcpServiceUserMappedCredentialLoginFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceWire struct { Name *string `json:"name,omitempty"` EffectiveOwner *string `json:"effective_owner,omitempty"` @@ -1049,6 +1793,30 @@ func modelProviderServiceFromWire(w *modelProviderServiceWire) (*ModelProviderSe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderService) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderService) UnmarshalJSON(data []byte) error { + var w modelProviderServiceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfigWire struct { ProviderType ModelProviderServiceConfig_ExternalModelProviderType `json:"provider_type,omitempty"` Openai *modelProviderServiceConfig_OpenAiProviderConfigWire `json:"openai,omitempty"` @@ -1300,6 +2068,30 @@ func modelProviderServiceConfigFromWire(w *modelProviderServiceConfigWire) (*Mod }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_AmazonBedrockProviderConfigWire struct { Direct *modelProviderServiceConfig_AmazonBedrockProviderDirectConfigWire `json:"direct,omitempty"` } @@ -1352,6 +2144,30 @@ func modelProviderServiceConfig_AmazonBedrockProviderConfigFromWire(w *modelProv }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_AmazonBedrockProviderConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_AmazonBedrockProviderConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_AmazonBedrockProviderConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_AmazonBedrockProviderConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_AmazonBedrockProviderConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_AmazonBedrockProviderDirectConfigWire struct { Region *string `json:"region,omitempty"` ServiceCredential *modelProviderServiceConfig_ServiceCredentialWire `json:"service_credential,omitempty"` @@ -1427,6 +2243,30 @@ func modelProviderServiceConfig_AmazonBedrockProviderDirectConfigFromWire(w *mod }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_AmazonBedrockProviderDirectConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_AmazonBedrockProviderDirectConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_AmazonBedrockProviderDirectConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_AmazonBedrockProviderDirectConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_AmazonBedrockProviderDirectConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_AnthropicProviderConfigWire struct { Direct *modelProviderServiceConfig_AnthropicProviderDirectConfigWire `json:"direct,omitempty"` Relayed *modelProviderServiceConfig_AnthropicProviderRelayedConfigWire `json:"relayed,omitempty"` @@ -1499,6 +2339,30 @@ func modelProviderServiceConfig_AnthropicProviderConfigFromWire(w *modelProvider }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_AnthropicProviderConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_AnthropicProviderConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_AnthropicProviderConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_AnthropicProviderConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_AnthropicProviderConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_AnthropicProviderDirectConfigWire struct { ApiKey *modelProviderServiceConfig_ProviderSecretWire `json:"api_key,omitempty"` } @@ -1551,6 +2415,30 @@ func modelProviderServiceConfig_AnthropicProviderDirectConfigFromWire(w *modelPr }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_AnthropicProviderDirectConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_AnthropicProviderDirectConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_AnthropicProviderDirectConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_AnthropicProviderDirectConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_AnthropicProviderDirectConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_AnthropicProviderRelayedConfigWire struct { } @@ -1568,6 +2456,30 @@ func modelProviderServiceConfig_AnthropicProviderRelayedConfigFromWire(w *modelP return &ModelProviderServiceConfig_AnthropicProviderRelayedConfig{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_AnthropicProviderRelayedConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_AnthropicProviderRelayedConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_AnthropicProviderRelayedConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_AnthropicProviderRelayedConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_AnthropicProviderRelayedConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_AwsAccessKeyWire struct { AccessKeyId *string `json:"access_key_id,omitempty"` SecretAccessKey *modelProviderServiceConfig_ProviderSecretWire `json:"secret_access_key,omitempty"` @@ -1601,6 +2513,30 @@ func modelProviderServiceConfig_AwsAccessKeyFromWire(w *modelProviderServiceConf }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_AwsAccessKey) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_AwsAccessKeyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_AwsAccessKey) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_AwsAccessKeyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_AwsAccessKeyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_AzureOpenAiProviderConfigWire struct { Direct *modelProviderServiceConfig_AzureOpenAiProviderDirectConfigWire `json:"direct,omitempty"` } @@ -1653,6 +2589,30 @@ func modelProviderServiceConfig_AzureOpenAiProviderConfigFromWire(w *modelProvid }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_AzureOpenAiProviderConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_AzureOpenAiProviderConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_AzureOpenAiProviderConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_AzureOpenAiProviderConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_AzureOpenAiProviderConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_AzureOpenAiProviderDirectConfigWire struct { BaseUrl *string `json:"base_url,omitempty"` ApiKey *modelProviderServiceConfig_ProviderSecretWire `json:"api_key,omitempty"` @@ -1748,6 +2708,30 @@ func modelProviderServiceConfig_AzureOpenAiProviderDirectConfigFromWire(w *model }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_AzureOpenAiProviderDirectConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_AzureOpenAiProviderDirectConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_AzureOpenAiProviderDirectConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_AzureOpenAiProviderDirectConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_AzureOpenAiProviderDirectConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_CustomProviderApiKeyHeaderAuthWire struct { ApiKeyName *string `json:"api_key_name,omitempty"` ApiKeyValue *modelProviderServiceConfig_ProviderSecretWire `json:"api_key_value,omitempty"` @@ -1781,6 +2765,30 @@ func modelProviderServiceConfig_CustomProviderApiKeyHeaderAuthFromWire(w *modelP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_CustomProviderApiKeyHeaderAuth) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_CustomProviderApiKeyHeaderAuthToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_CustomProviderApiKeyHeaderAuth) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_CustomProviderApiKeyHeaderAuthWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_CustomProviderApiKeyHeaderAuthFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_CustomProviderConfigWire struct { Direct *modelProviderServiceConfig_CustomProviderDirectConfigWire `json:"direct,omitempty"` } @@ -1833,6 +2841,30 @@ func modelProviderServiceConfig_CustomProviderConfigFromWire(w *modelProviderSer }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_CustomProviderConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_CustomProviderConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_CustomProviderConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_CustomProviderConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_CustomProviderConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_CustomProviderDirectConfigWire struct { BaseUrl *string `json:"base_url,omitempty"` ApiKey *modelProviderServiceConfig_ProviderSecretWire `json:"api_key,omitempty"` @@ -1908,6 +2940,30 @@ func modelProviderServiceConfig_CustomProviderDirectConfigFromWire(w *modelProvi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_CustomProviderDirectConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_CustomProviderDirectConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_CustomProviderDirectConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_CustomProviderDirectConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_CustomProviderDirectConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_EntraServicePrincipalWire struct { TenantId *string `json:"tenant_id,omitempty"` ClientId *string `json:"client_id,omitempty"` @@ -1966,6 +3022,30 @@ func modelProviderServiceConfig_EntraServicePrincipalFromWire(w *modelProviderSe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_EntraServicePrincipal) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_EntraServicePrincipalToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_EntraServicePrincipal) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_EntraServicePrincipalWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_EntraServicePrincipalFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_GeminiEnterpriseProviderConfigWire struct { Direct *modelProviderServiceConfig_GeminiEnterpriseProviderDirectConfigWire `json:"direct,omitempty"` } @@ -2018,6 +3098,30 @@ func modelProviderServiceConfig_GeminiEnterpriseProviderConfigFromWire(w *modelP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_GeminiEnterpriseProviderConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_GeminiEnterpriseProviderConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_GeminiEnterpriseProviderConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_GeminiEnterpriseProviderConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_GeminiEnterpriseProviderConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_GeminiEnterpriseProviderDirectConfigWire struct { ApiKey *modelProviderServiceConfig_ProviderSecretWire `json:"api_key,omitempty"` ServiceCredential *modelProviderServiceConfig_ServiceCredentialWire `json:"service_credential,omitempty"` @@ -2096,6 +3200,30 @@ func modelProviderServiceConfig_GeminiEnterpriseProviderDirectConfigFromWire(w * }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_GeminiEnterpriseProviderDirectConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_GeminiEnterpriseProviderDirectConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_GeminiEnterpriseProviderDirectConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_GeminiEnterpriseProviderDirectConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_GeminiEnterpriseProviderDirectConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_MicrosoftFoundryProviderConfigWire struct { Direct *modelProviderServiceConfig_MicrosoftFoundryProviderDirectConfigWire `json:"direct,omitempty"` } @@ -2148,6 +3276,30 @@ func modelProviderServiceConfig_MicrosoftFoundryProviderConfigFromWire(w *modelP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_MicrosoftFoundryProviderConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_MicrosoftFoundryProviderConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_MicrosoftFoundryProviderConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_MicrosoftFoundryProviderConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_MicrosoftFoundryProviderConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_MicrosoftFoundryProviderDirectConfigWire struct { BaseUrl *string `json:"base_url,omitempty"` ApiKey *modelProviderServiceConfig_ProviderSecretWire `json:"api_key,omitempty"` @@ -2243,6 +3395,30 @@ func modelProviderServiceConfig_MicrosoftFoundryProviderDirectConfigFromWire(w * }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_MicrosoftFoundryProviderDirectConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_MicrosoftFoundryProviderDirectConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_MicrosoftFoundryProviderDirectConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_MicrosoftFoundryProviderDirectConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_MicrosoftFoundryProviderDirectConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_ModelTargetConfigWire struct { Model *string `json:"model,omitempty"` NativeApiTypes []string `json:"native_api_types,omitempty"` @@ -2271,6 +3447,30 @@ func modelProviderServiceConfig_ModelTargetConfigFromWire(w *modelProviderServic }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_ModelTargetConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_ModelTargetConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_ModelTargetConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_ModelTargetConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_ModelTargetConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_OpenAiProviderConfigWire struct { Direct *modelProviderServiceConfig_OpenAiProviderDirectConfigWire `json:"direct,omitempty"` } @@ -2323,6 +3523,30 @@ func modelProviderServiceConfig_OpenAiProviderConfigFromWire(w *modelProviderSer }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_OpenAiProviderConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_OpenAiProviderConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_OpenAiProviderConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_OpenAiProviderConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_OpenAiProviderConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_OpenAiProviderDirectConfigWire struct { ApiKey *modelProviderServiceConfig_ProviderSecretWire `json:"api_key,omitempty"` Organization *string `json:"organization,omitempty"` @@ -2381,6 +3605,30 @@ func modelProviderServiceConfig_OpenAiProviderDirectConfigFromWire(w *modelProvi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_OpenAiProviderDirectConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_OpenAiProviderDirectConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_OpenAiProviderDirectConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_OpenAiProviderDirectConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_OpenAiProviderDirectConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_ProviderPricingConfigWire struct { DefaultDiscountBasisPoints *int `json:"default_discount_basis_points,omitempty"` } @@ -2403,6 +3651,30 @@ func modelProviderServiceConfig_ProviderPricingConfigFromWire(w *modelProviderSe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_ProviderPricingConfig) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_ProviderPricingConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_ProviderPricingConfig) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_ProviderPricingConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_ProviderPricingConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_ProviderSecretWire struct { Plaintext *string `json:"plaintext,omitempty"` SecretReference *modelProviderServiceConfig_SecretReferenceWire `json:"secret_reference,omitempty"` @@ -2467,6 +3739,30 @@ func modelProviderServiceConfig_ProviderSecretFromWire(w *modelProviderServiceCo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_ProviderSecret) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_ProviderSecretToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_ProviderSecret) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_ProviderSecretWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_ProviderSecretFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_SecretReferenceWire struct { Name *string `json:"name,omitempty"` } @@ -2489,6 +3785,30 @@ func modelProviderServiceConfig_SecretReferenceFromWire(w *modelProviderServiceC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_SecretReference) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_SecretReferenceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_SecretReference) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_SecretReferenceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_SecretReferenceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelProviderServiceConfig_ServiceCredentialWire struct { Name *string `json:"name,omitempty"` } @@ -2511,6 +3831,30 @@ func modelProviderServiceConfig_ServiceCredentialFromWire(w *modelProviderServic }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelProviderServiceConfig_ServiceCredential) MarshalJSON() ([]byte, error) { + w, err := modelProviderServiceConfig_ServiceCredentialToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelProviderServiceConfig_ServiceCredential) UnmarshalJSON(data []byte) error { + var w modelProviderServiceConfig_ServiceCredentialWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelProviderServiceConfig_ServiceCredentialFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelServiceWire struct { Name *string `json:"name,omitempty"` EffectiveOwner *string `json:"effective_owner,omitempty"` @@ -2571,6 +3915,30 @@ func modelServiceFromWire(w *modelServiceWire) (*ModelService, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelService) MarshalJSON() ([]byte, error) { + w, err := modelServiceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelService) UnmarshalJSON(data []byte) error { + var w modelServiceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelServiceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelServiceConfigWire struct { Routing *modelServiceConfig_RoutingConfigWire `json:"routing,omitempty"` RateLimits []rateLimitWire `json:"rate_limits,omitempty"` @@ -2623,6 +3991,30 @@ func modelServiceConfigFromWire(w *modelServiceConfigWire) (*ModelServiceConfig, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelServiceConfig) MarshalJSON() ([]byte, error) { + w, err := modelServiceConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelServiceConfig) UnmarshalJSON(data []byte) error { + var w modelServiceConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelServiceConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelServiceConfig_DestinationConfigWire struct { Name *string `json:"name,omitempty"` DestinationType ModelServiceConfig_DestinationConfig_DestinationType `json:"destination_type,omitempty"` @@ -2727,6 +4119,30 @@ func modelServiceConfig_DestinationConfigFromWire(w *modelServiceConfig_Destinat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelServiceConfig_DestinationConfig) MarshalJSON() ([]byte, error) { + w, err := modelServiceConfig_DestinationConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelServiceConfig_DestinationConfig) UnmarshalJSON(data []byte) error { + var w modelServiceConfig_DestinationConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelServiceConfig_DestinationConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelServiceConfig_ExternalModelConfigWire struct { ModelProviderService *string `json:"model_provider_service,omitempty"` Target *modelProviderServiceConfig_ModelTargetConfigWire `json:"target,omitempty"` @@ -2760,6 +4176,30 @@ func modelServiceConfig_ExternalModelConfigFromWire(w *modelServiceConfig_Extern }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelServiceConfig_ExternalModelConfig) MarshalJSON() ([]byte, error) { + w, err := modelServiceConfig_ExternalModelConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelServiceConfig_ExternalModelConfig) UnmarshalJSON(data []byte) error { + var w modelServiceConfig_ExternalModelConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelServiceConfig_ExternalModelConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelServiceConfig_FallbackConfigWire struct { Destinations []modelServiceConfig_DestinationConfigWire `json:"destinations,omitempty"` } @@ -2790,6 +4230,30 @@ func modelServiceConfig_FallbackConfigFromWire(w *modelServiceConfig_FallbackCon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelServiceConfig_FallbackConfig) MarshalJSON() ([]byte, error) { + w, err := modelServiceConfig_FallbackConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelServiceConfig_FallbackConfig) UnmarshalJSON(data []byte) error { + var w modelServiceConfig_FallbackConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelServiceConfig_FallbackConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelServiceConfig_PayPerTokenConfigWire struct { Model *string `json:"model,omitempty"` } @@ -2812,6 +4276,30 @@ func modelServiceConfig_PayPerTokenConfigFromWire(w *modelServiceConfig_PayPerTo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelServiceConfig_PayPerTokenConfig) MarshalJSON() ([]byte, error) { + w, err := modelServiceConfig_PayPerTokenConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelServiceConfig_PayPerTokenConfig) UnmarshalJSON(data []byte) error { + var w modelServiceConfig_PayPerTokenConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelServiceConfig_PayPerTokenConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelServiceConfig_ProvisionedThroughputConfigWire struct { ModelServingEndpoint *string `json:"model_serving_endpoint,omitempty"` Model *string `json:"model,omitempty"` @@ -2837,6 +4325,30 @@ func modelServiceConfig_ProvisionedThroughputConfigFromWire(w *modelServiceConfi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelServiceConfig_ProvisionedThroughputConfig) MarshalJSON() ([]byte, error) { + w, err := modelServiceConfig_ProvisionedThroughputConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelServiceConfig_ProvisionedThroughputConfig) UnmarshalJSON(data []byte) error { + var w modelServiceConfig_ProvisionedThroughputConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelServiceConfig_ProvisionedThroughputConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelServiceConfig_RoutingConfigWire struct { Destinations []modelServiceConfig_DestinationConfigWire `json:"destinations,omitempty"` Fallback *modelServiceConfig_FallbackConfigWire `json:"fallback,omitempty"` @@ -2878,6 +4390,30 @@ func modelServiceConfig_RoutingConfigFromWire(w *modelServiceConfig_RoutingConfi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelServiceConfig_RoutingConfig) MarshalJSON() ([]byte, error) { + w, err := modelServiceConfig_RoutingConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelServiceConfig_RoutingConfig) UnmarshalJSON(data []byte) error { + var w modelServiceConfig_RoutingConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelServiceConfig_RoutingConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type provisioningInfoWire struct { State ProvisioningInfo_State `json:"state,omitempty"` } @@ -2900,6 +4436,30 @@ func provisioningInfoFromWire(w *provisioningInfoWire) (*ProvisioningInfo, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProvisioningInfo) MarshalJSON() ([]byte, error) { + w, err := provisioningInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProvisioningInfo) UnmarshalJSON(data []byte) error { + var w provisioningInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := provisioningInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rateLimitWire struct { Key RateLimit_RateLimitKey `json:"key,omitempty"` RenewalPeriod RateLimit_RateLimitRenewalPeriod `json:"renewal_period,omitempty"` @@ -2950,6 +4510,30 @@ func rateLimitFromWire(w *rateLimitWire) (*RateLimit, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RateLimit) MarshalJSON() ([]byte, error) { + w, err := rateLimitToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RateLimit) UnmarshalJSON(data []byte) error { + var w rateLimitWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rateLimitFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type skillWire struct { Name *string `json:"name,omitempty"` BundleName *string `json:"bundle_name,omitempty"` @@ -3005,6 +4589,30 @@ func skillFromWire(w *skillWire) (*Skill, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Skill) MarshalJSON() ([]byte, error) { + w, err := skillToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Skill) UnmarshalJSON(data []byte) error { + var w skillWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := skillFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateMcpServiceRequestWire struct { McpService *mcpServiceWire `json:"mcp_service,omitempty"` UpdateMask *types.FieldMask[McpService] `json:"update_mask,omitempty"` @@ -3041,6 +4649,30 @@ func updateMcpServiceRequestFromWire(w *updateMcpServiceRequestWire) (*UpdateMcp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateMcpServiceRequest) MarshalJSON() ([]byte, error) { + w, err := updateMcpServiceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateMcpServiceRequest) UnmarshalJSON(data []byte) error { + var w updateMcpServiceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateMcpServiceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateModelProviderServiceRequestWire struct { ModelProviderService *modelProviderServiceWire `json:"model_provider_service,omitempty"` UpdateMask *types.FieldMask[ModelProviderService] `json:"update_mask,omitempty"` @@ -3077,6 +4709,30 @@ func updateModelProviderServiceRequestFromWire(w *updateModelProviderServiceRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateModelProviderServiceRequest) MarshalJSON() ([]byte, error) { + w, err := updateModelProviderServiceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateModelProviderServiceRequest) UnmarshalJSON(data []byte) error { + var w updateModelProviderServiceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateModelProviderServiceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateModelServiceRequestWire struct { ModelService *modelServiceWire `json:"model_service,omitempty"` UpdateMask *types.FieldMask[ModelService] `json:"update_mask,omitempty"` @@ -3113,6 +4769,30 @@ func updateModelServiceRequestFromWire(w *updateModelServiceRequestWire) (*Updat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateModelServiceRequest) MarshalJSON() ([]byte, error) { + w, err := updateModelServiceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateModelServiceRequest) UnmarshalJSON(data []byte) error { + var w updateModelServiceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateModelServiceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateSkillRequestWire struct { Skill *skillWire `json:"skill,omitempty"` UpdateMask *types.FieldMask[Skill] `json:"update_mask,omitempty"` @@ -3149,6 +4829,30 @@ func updateSkillRequestFromWire(w *updateSkillRequestWire) (*UpdateSkillRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateSkillRequest) MarshalJSON() ([]byte, error) { + w, err := updateSkillRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateSkillRequest) UnmarshalJSON(data []byte) error { + var w updateSkillRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateSkillRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/aisearch/CHANGELOG.md b/aisearch/CHANGELOG.md index 916ee892..881e3b20 100644 --- a/aisearch/CHANGELOG.md +++ b/aisearch/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.9.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.8.0 (2026-11-11) ## Release v0.7.0 (2026-11-10) diff --git a/aisearch/internal/version.go b/aisearch/internal/version.go index 9365fc07..780f8775 100644 --- a/aisearch/internal/version.go +++ b/aisearch/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-aisearch" -const Version = "0.8.0" +const Version = "0.9.0" diff --git a/aisearch/v1/wire.go b/aisearch/v1/wire.go index 90ae3569..9d723159 100644 --- a/aisearch/v1/wire.go +++ b/aisearch/v1/wire.go @@ -79,6 +79,30 @@ func columnInfoFromWire(w *columnInfoWire) (*ColumnInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ColumnInfo) MarshalJSON() ([]byte, error) { + w, err := columnInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ColumnInfo) UnmarshalJSON(data []byte) error { + var w columnInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := columnInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createEndpointRequestWire struct { Parent *string `json:"parent,omitempty"` Endpoint *endpointWire `json:"endpoint,omitempty"` @@ -115,6 +139,30 @@ func createEndpointRequestFromWire(w *createEndpointRequestWire) (*CreateEndpoin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := createEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateEndpointRequest) UnmarshalJSON(data []byte) error { + var w createEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createIndexRequestWire struct { Parent *string `json:"parent,omitempty"` Index *indexWire `json:"index,omitempty"` @@ -151,6 +199,30 @@ func createIndexRequestFromWire(w *createIndexRequestWire) (*CreateIndexRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateIndexRequest) MarshalJSON() ([]byte, error) { + w, err := createIndexRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateIndexRequest) UnmarshalJSON(data []byte) error { + var w createIndexRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createIndexRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type customTagWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -176,6 +248,30 @@ func customTagFromWire(w *customTagWire) (*CustomTag, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CustomTag) MarshalJSON() ([]byte, error) { + w, err := customTagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CustomTag) UnmarshalJSON(data []byte) error { + var w customTagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := customTagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dataModificationResultWire struct { SuccessRowCount *wireInt64 `json:"success_row_count,omitempty"` FailedPrimaryKeys []string `json:"failed_primary_keys,omitempty"` @@ -209,6 +305,30 @@ func dataModificationResultFromWire(w *dataModificationResultWire) (*DataModific }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DataModificationResult) MarshalJSON() ([]byte, error) { + w, err := dataModificationResultToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DataModificationResult) UnmarshalJSON(data []byte) error { + var w dataModificationResultWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dataModificationResultFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteEndpointRequestWire struct { Name *string `json:"name,omitempty"` } @@ -231,6 +351,30 @@ func deleteEndpointRequestFromWire(w *deleteEndpointRequestWire) (*DeleteEndpoin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := deleteEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteEndpointRequest) UnmarshalJSON(data []byte) error { + var w deleteEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteIndexRequestWire struct { Name *string `json:"name,omitempty"` } @@ -253,6 +397,30 @@ func deleteIndexRequestFromWire(w *deleteIndexRequestWire) (*DeleteIndexRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteIndexRequest) MarshalJSON() ([]byte, error) { + w, err := deleteIndexRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteIndexRequest) UnmarshalJSON(data []byte) error { + var w deleteIndexRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteIndexRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deltaSyncIndexSpecWire struct { SourceTable *string `json:"source_table,omitempty"` EmbeddingSourceColumns []embeddingSourceColumnWire `json:"embedding_source_columns,omitempty"` @@ -309,6 +477,30 @@ func deltaSyncIndexSpecFromWire(w *deltaSyncIndexSpecWire) (*DeltaSyncIndexSpec, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeltaSyncIndexSpec) MarshalJSON() ([]byte, error) { + w, err := deltaSyncIndexSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeltaSyncIndexSpec) UnmarshalJSON(data []byte) error { + var w deltaSyncIndexSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deltaSyncIndexSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type directAccessIndexSpecWire struct { EmbeddingVectorColumns []embeddingVectorColumnWire `json:"embedding_vector_columns,omitempty"` SchemaJson *string `json:"schema_json,omitempty"` @@ -353,6 +545,30 @@ func directAccessIndexSpecFromWire(w *directAccessIndexSpecWire) (*DirectAccessI }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DirectAccessIndexSpec) MarshalJSON() ([]byte, error) { + w, err := directAccessIndexSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DirectAccessIndexSpec) UnmarshalJSON(data []byte) error { + var w directAccessIndexSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := directAccessIndexSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type embeddingSourceColumnWire struct { Name *string `json:"name,omitempty"` EmbeddingModelEndpoint *string `json:"embedding_model_endpoint,omitempty"` @@ -381,6 +597,30 @@ func embeddingSourceColumnFromWire(w *embeddingSourceColumnWire) (*EmbeddingSour }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EmbeddingSourceColumn) MarshalJSON() ([]byte, error) { + w, err := embeddingSourceColumnToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EmbeddingSourceColumn) UnmarshalJSON(data []byte) error { + var w embeddingSourceColumnWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := embeddingSourceColumnFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type embeddingVectorColumnWire struct { Name *string `json:"name,omitempty"` EmbeddingDimension *int `json:"embedding_dimension,omitempty"` @@ -406,6 +646,30 @@ func embeddingVectorColumnFromWire(w *embeddingVectorColumnWire) (*EmbeddingVect }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EmbeddingVectorColumn) MarshalJSON() ([]byte, error) { + w, err := embeddingVectorColumnToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EmbeddingVectorColumn) UnmarshalJSON(data []byte) error { + var w embeddingVectorColumnWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := embeddingVectorColumnFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointWire struct { Name *string `json:"name,omitempty"` Creator *string `json:"creator,omitempty"` @@ -508,6 +772,30 @@ func endpointFromWire(w *endpointWire) (*Endpoint, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Endpoint) MarshalJSON() ([]byte, error) { + w, err := endpointToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Endpoint) UnmarshalJSON(data []byte) error { + var w endpointWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointScalingInfoWire struct { State ScalingChangeState `json:"state,omitempty"` RequestedTargetQps *wireInt64 `json:"requested_target_qps,omitempty"` @@ -556,6 +844,30 @@ func endpointScalingInfoFromWire(w *endpointScalingInfoWire) (*EndpointScalingIn }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointScalingInfo) MarshalJSON() ([]byte, error) { + w, err := endpointScalingInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointScalingInfo) UnmarshalJSON(data []byte) error { + var w endpointScalingInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointScalingInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointStatusWire struct { State EndpointStatus_State `json:"state,omitempty"` Message *string `json:"message,omitempty"` @@ -581,6 +893,30 @@ func endpointStatusFromWire(w *endpointStatusWire) (*EndpointStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointStatus) MarshalJSON() ([]byte, error) { + w, err := endpointStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointStatus) UnmarshalJSON(data []byte) error { + var w endpointStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointThroughputInfoWire struct { RequestedConcurrency *float64 `json:"requested_concurrency,omitempty"` CurrentConcurrency *float64 `json:"current_concurrency,omitempty"` @@ -627,6 +963,30 @@ func endpointThroughputInfoFromWire(w *endpointThroughputInfoWire) (*EndpointThr }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointThroughputInfo) MarshalJSON() ([]byte, error) { + w, err := endpointThroughputInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointThroughputInfo) UnmarshalJSON(data []byte) error { + var w endpointThroughputInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointThroughputInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type facetResultDataWire struct { FacetRowCount *int `json:"facet_row_count,omitempty"` FacetArray [][]json.RawMessage `json:"facet_array,omitempty"` @@ -652,6 +1012,30 @@ func facetResultDataFromWire(w *facetResultDataWire) (*FacetResultData, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FacetResultData) MarshalJSON() ([]byte, error) { + w, err := facetResultDataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FacetResultData) UnmarshalJSON(data []byte) error { + var w facetResultDataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := facetResultDataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getEndpointRequestWire struct { Name *string `json:"name,omitempty"` } @@ -674,6 +1058,30 @@ func getEndpointRequestFromWire(w *getEndpointRequestWire) (*GetEndpointRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := getEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetEndpointRequest) UnmarshalJSON(data []byte) error { + var w getEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getIndexRequestWire struct { Name *string `json:"name,omitempty"` } @@ -696,6 +1104,30 @@ func getIndexRequestFromWire(w *getIndexRequestWire) (*GetIndexRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetIndexRequest) MarshalJSON() ([]byte, error) { + w, err := getIndexRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetIndexRequest) UnmarshalJSON(data []byte) error { + var w getIndexRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getIndexRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type indexWire struct { Name *string `json:"name,omitempty"` Endpoint *string `json:"endpoint,omitempty"` @@ -797,6 +1229,30 @@ func indexFromWire(w *indexWire) (*Index, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Index) MarshalJSON() ([]byte, error) { + w, err := indexToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Index) UnmarshalJSON(data []byte) error { + var w indexWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := indexFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type indexStatusWire struct { Message *string `json:"message,omitempty"` IndexedRowCount *wireInt64 `json:"indexed_row_count,omitempty"` @@ -836,6 +1292,30 @@ func indexStatusFromWire(w *indexStatusWire) (*IndexStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IndexStatus) MarshalJSON() ([]byte, error) { + w, err := indexStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IndexStatus) UnmarshalJSON(data []byte) error { + var w indexStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := indexStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listEndpointsRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -864,6 +1344,30 @@ func listEndpointsRequestFromWire(w *listEndpointsRequestWire) (*ListEndpointsRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListEndpointsRequest) MarshalJSON() ([]byte, error) { + w, err := listEndpointsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListEndpointsRequest) UnmarshalJSON(data []byte) error { + var w listEndpointsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listEndpointsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listEndpointsResponseWire struct { Endpoints []endpointWire `json:"endpoints,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -897,6 +1401,30 @@ func listEndpointsResponseFromWire(w *listEndpointsResponseWire) (*ListEndpoints }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListEndpointsResponse) MarshalJSON() ([]byte, error) { + w, err := listEndpointsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListEndpointsResponse) UnmarshalJSON(data []byte) error { + var w listEndpointsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listEndpointsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listIndexesRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -925,6 +1453,30 @@ func listIndexesRequestFromWire(w *listIndexesRequestWire) (*ListIndexesRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListIndexesRequest) MarshalJSON() ([]byte, error) { + w, err := listIndexesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListIndexesRequest) UnmarshalJSON(data []byte) error { + var w listIndexesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listIndexesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listIndexesResponseWire struct { Indexes []indexWire `json:"indexes,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -958,6 +1510,30 @@ func listIndexesResponseFromWire(w *listIndexesResponseWire) (*ListIndexesRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListIndexesResponse) MarshalJSON() ([]byte, error) { + w, err := listIndexesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListIndexesResponse) UnmarshalJSON(data []byte) error { + var w listIndexesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listIndexesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queryIndexRequestWire struct { Name *string `json:"name,omitempty"` Columns []string `json:"columns,omitempty"` @@ -1024,6 +1600,30 @@ func queryIndexRequestFromWire(w *queryIndexRequestWire) (*QueryIndexRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueryIndexRequest) MarshalJSON() ([]byte, error) { + w, err := queryIndexRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueryIndexRequest) UnmarshalJSON(data []byte) error { + var w queryIndexRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queryIndexRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queryIndexResponseWire struct { Manifest *resultManifestWire `json:"manifest,omitempty"` Result *resultDataWire `json:"result,omitempty"` @@ -1076,6 +1676,30 @@ func queryIndexResponseFromWire(w *queryIndexResponseWire) (*QueryIndexResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueryIndexResponse) MarshalJSON() ([]byte, error) { + w, err := queryIndexResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueryIndexResponse) UnmarshalJSON(data []byte) error { + var w queryIndexResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queryIndexResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type removeDataRequestWire struct { Name *string `json:"name,omitempty"` PrimaryKeys []string `json:"primary_keys,omitempty"` @@ -1101,6 +1725,30 @@ func removeDataRequestFromWire(w *removeDataRequestWire) (*RemoveDataRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RemoveDataRequest) MarshalJSON() ([]byte, error) { + w, err := removeDataRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RemoveDataRequest) UnmarshalJSON(data []byte) error { + var w removeDataRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := removeDataRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type removeDataResponseWire struct { Status DataModificationStatus `json:"status,omitempty"` Result *dataModificationResultWire `json:"result,omitempty"` @@ -1134,6 +1782,30 @@ func removeDataResponseFromWire(w *removeDataResponseWire) (*RemoveDataResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RemoveDataResponse) MarshalJSON() ([]byte, error) { + w, err := removeDataResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RemoveDataResponse) UnmarshalJSON(data []byte) error { + var w removeDataResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := removeDataResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rerankerConfigWire struct { Model *string `json:"model,omitempty"` Parameters *rerankerConfig_RerankerParametersWire `json:"parameters,omitempty"` @@ -1170,6 +1842,30 @@ func rerankerConfigFromWire(w *rerankerConfigWire) (*RerankerConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RerankerConfig) MarshalJSON() ([]byte, error) { + w, err := rerankerConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RerankerConfig) UnmarshalJSON(data []byte) error { + var w rerankerConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rerankerConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rerankerConfig_RerankerParametersWire struct { ColumnsToRerank []string `json:"columns_to_rerank,omitempty"` } @@ -1192,6 +1888,30 @@ func rerankerConfig_RerankerParametersFromWire(w *rerankerConfig_RerankerParamet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RerankerConfig_RerankerParameters) MarshalJSON() ([]byte, error) { + w, err := rerankerConfig_RerankerParametersToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RerankerConfig_RerankerParameters) UnmarshalJSON(data []byte) error { + var w rerankerConfig_RerankerParametersWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rerankerConfig_RerankerParametersFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resultDataWire struct { RowCount *int `json:"row_count,omitempty"` DataArray [][]json.RawMessage `json:"data_array,omitempty"` @@ -1217,6 +1937,30 @@ func resultDataFromWire(w *resultDataWire) (*ResultData, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResultData) MarshalJSON() ([]byte, error) { + w, err := resultDataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResultData) UnmarshalJSON(data []byte) error { + var w resultDataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resultDataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resultManifestWire struct { ColumnCount *int `json:"column_count,omitempty"` Columns []columnInfoWire `json:"columns,omitempty"` @@ -1264,6 +2008,30 @@ func resultManifestFromWire(w *resultManifestWire) (*ResultManifest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResultManifest) MarshalJSON() ([]byte, error) { + w, err := resultManifestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResultManifest) UnmarshalJSON(data []byte) error { + var w resultManifestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resultManifestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type scanIndexRequestWire struct { Name *string `json:"name,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -1292,6 +2060,30 @@ func scanIndexRequestFromWire(w *scanIndexRequestWire) (*ScanIndexRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ScanIndexRequest) MarshalJSON() ([]byte, error) { + w, err := scanIndexRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ScanIndexRequest) UnmarshalJSON(data []byte) error { + var w scanIndexRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := scanIndexRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type scanIndexResponseWire struct { Data []map[string]json.RawMessage `json:"data,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1317,6 +2109,30 @@ func scanIndexResponseFromWire(w *scanIndexResponseWire) (*ScanIndexResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ScanIndexResponse) MarshalJSON() ([]byte, error) { + w, err := scanIndexResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ScanIndexResponse) UnmarshalJSON(data []byte) error { + var w scanIndexResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := scanIndexResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncIndexRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1339,6 +2155,30 @@ func syncIndexRequestFromWire(w *syncIndexRequestWire) (*SyncIndexRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncIndexRequest) MarshalJSON() ([]byte, error) { + w, err := syncIndexRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncIndexRequest) UnmarshalJSON(data []byte) error { + var w syncIndexRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncIndexRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncIndexResponseWire struct { } @@ -1356,6 +2196,30 @@ func syncIndexResponseFromWire(w *syncIndexResponseWire) (*SyncIndexResponse, er return &SyncIndexResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncIndexResponse) MarshalJSON() ([]byte, error) { + w, err := syncIndexResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncIndexResponse) UnmarshalJSON(data []byte) error { + var w syncIndexResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncIndexResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateEndpointRequestWire struct { Endpoint *endpointWire `json:"endpoint,omitempty"` UpdateMask *types.FieldMask[Endpoint] `json:"update_mask,omitempty"` @@ -1389,6 +2253,30 @@ func updateEndpointRequestFromWire(w *updateEndpointRequestWire) (*UpdateEndpoin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := updateEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateEndpointRequest) UnmarshalJSON(data []byte) error { + var w updateEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type upsertDataRequestWire struct { Name *string `json:"name,omitempty"` InputsJson *string `json:"inputs_json,omitempty"` @@ -1414,6 +2302,30 @@ func upsertDataRequestFromWire(w *upsertDataRequestWire) (*UpsertDataRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpsertDataRequest) MarshalJSON() ([]byte, error) { + w, err := upsertDataRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpsertDataRequest) UnmarshalJSON(data []byte) error { + var w upsertDataRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := upsertDataRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type upsertDataResponseWire struct { Status DataModificationStatus `json:"status,omitempty"` Result *dataModificationResultWire `json:"result,omitempty"` @@ -1447,6 +2359,30 @@ func upsertDataResponseFromWire(w *upsertDataResponseWire) (*UpsertDataResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpsertDataResponse) MarshalJSON() ([]byte, error) { + w, err := upsertDataResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpsertDataResponse) UnmarshalJSON(data []byte) error { + var w upsertDataResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := upsertDataResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/alerts/CHANGELOG.md b/alerts/CHANGELOG.md index c6253f80..f0a43254 100644 --- a/alerts/CHANGELOG.md +++ b/alerts/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.8.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.7.0 (2026-11-11) ## Release v0.6.0 (2026-11-10) diff --git a/alerts/internal/version.go b/alerts/internal/version.go index 2c0d07c1..2ccae31c 100644 --- a/alerts/internal/version.go +++ b/alerts/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-alerts" -const Version = "0.7.0" +const Version = "0.8.0" diff --git a/alerts/v1/wire.go b/alerts/v1/wire.go index c3404514..b492c753 100644 --- a/alerts/v1/wire.go +++ b/alerts/v1/wire.go @@ -3,6 +3,7 @@ package alerts import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -80,6 +81,30 @@ func alertFromWire(w *alertWire) (*Alert, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Alert) MarshalJSON() ([]byte, error) { + w, err := alertToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Alert) UnmarshalJSON(data []byte) error { + var w alertWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertConditionWire struct { Op AlertOperator `json:"op,omitempty"` Operand *alertOperandWire `json:"operand,omitempty"` @@ -127,6 +152,30 @@ func alertConditionFromWire(w *alertConditionWire) (*AlertCondition, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertCondition) MarshalJSON() ([]byte, error) { + w, err := alertConditionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertCondition) UnmarshalJSON(data []byte) error { + var w alertConditionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertConditionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertOperandWire struct { Value *alertOperandValueWire `json:"value,omitempty"` Column *alertOperandColumnWire `json:"column,omitempty"` @@ -199,6 +248,30 @@ func alertOperandFromWire(w *alertOperandWire) (*AlertOperand, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertOperand) MarshalJSON() ([]byte, error) { + w, err := alertOperandToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertOperand) UnmarshalJSON(data []byte) error { + var w alertOperandWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertOperandFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertOperandColumnWire struct { Name *string `json:"name,omitempty"` } @@ -221,6 +294,30 @@ func alertOperandColumnFromWire(w *alertOperandColumnWire) (*AlertOperandColumn, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertOperandColumn) MarshalJSON() ([]byte, error) { + w, err := alertOperandColumnToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertOperandColumn) UnmarshalJSON(data []byte) error { + var w alertOperandColumnWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertOperandColumnFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertOperandValueWire struct { StringValue *string `json:"string_value,omitempty"` DoubleValue *float64 `json:"double_value,omitempty"` @@ -289,6 +386,30 @@ func alertOperandValueFromWire(w *alertOperandValueWire) (*AlertOperandValue, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertOperandValue) MarshalJSON() ([]byte, error) { + w, err := alertOperandValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertOperandValue) UnmarshalJSON(data []byte) error { + var w alertOperandValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertOperandValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAlertRequestWire struct { Alert *createAlertRequestAlertWire `json:"alert,omitempty"` AutoResolveDisplayName *bool `json:"auto_resolve_display_name,omitempty"` @@ -322,6 +443,30 @@ func createAlertRequestFromWire(w *createAlertRequestWire) (*CreateAlertRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAlertRequest) MarshalJSON() ([]byte, error) { + w, err := createAlertRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAlertRequest) UnmarshalJSON(data []byte) error { + var w createAlertRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAlertRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAlertRequestAlertWire struct { DisplayName *string `json:"display_name,omitempty"` QueryId *string `json:"query_id,omitempty"` @@ -373,6 +518,30 @@ func createAlertRequestAlertFromWire(w *createAlertRequestAlertWire) (*CreateAle }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAlertRequestAlert) MarshalJSON() ([]byte, error) { + w, err := createAlertRequestAlertToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAlertRequestAlert) UnmarshalJSON(data []byte) error { + var w createAlertRequestAlertWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAlertRequestAlertFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type emptyWire struct { } @@ -390,6 +559,30 @@ func emptyFromWire(w *emptyWire) (*Empty, error) { return &Empty{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Empty) MarshalJSON() ([]byte, error) { + w, err := emptyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Empty) UnmarshalJSON(data []byte) error { + var w emptyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := emptyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAlertRequestWire struct { Id *string `json:"id,omitempty"` } @@ -412,6 +605,30 @@ func getAlertRequestFromWire(w *getAlertRequestWire) (*GetAlertRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAlertRequest) MarshalJSON() ([]byte, error) { + w, err := getAlertRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAlertRequest) UnmarshalJSON(data []byte) error { + var w getAlertRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAlertRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAlertsRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -437,6 +654,30 @@ func listAlertsRequestFromWire(w *listAlertsRequestWire) (*ListAlertsRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAlertsRequest) MarshalJSON() ([]byte, error) { + w, err := listAlertsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAlertsRequest) UnmarshalJSON(data []byte) error { + var w listAlertsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAlertsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAlertsResponseWire struct { Results []listAlertsResponseAlertWire `json:"results,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -470,6 +711,30 @@ func listAlertsResponseFromWire(w *listAlertsResponseWire) (*ListAlertsResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAlertsResponse) MarshalJSON() ([]byte, error) { + w, err := listAlertsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAlertsResponse) UnmarshalJSON(data []byte) error { + var w listAlertsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAlertsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAlertsResponseAlertWire struct { Id *string `json:"id,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -539,6 +804,30 @@ func listAlertsResponseAlertFromWire(w *listAlertsResponseAlertWire) (*ListAlert }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAlertsResponseAlert) MarshalJSON() ([]byte, error) { + w, err := listAlertsResponseAlertToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAlertsResponseAlert) UnmarshalJSON(data []byte) error { + var w listAlertsResponseAlertWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAlertsResponseAlertFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type trashAlertRequestWire struct { Id *string `json:"id,omitempty"` } @@ -561,6 +850,30 @@ func trashAlertRequestFromWire(w *trashAlertRequestWire) (*TrashAlertRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TrashAlertRequest) MarshalJSON() ([]byte, error) { + w, err := trashAlertRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TrashAlertRequest) UnmarshalJSON(data []byte) error { + var w trashAlertRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := trashAlertRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateAlertRequestWire struct { Alert *updateAlertRequestAlertWire `json:"alert,omitempty"` UpdateMask *types.FieldMask[UpdateAlertRequestAlert] `json:"update_mask,omitempty"` @@ -600,6 +913,30 @@ func updateAlertRequestFromWire(w *updateAlertRequestWire) (*UpdateAlertRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateAlertRequest) MarshalJSON() ([]byte, error) { + w, err := updateAlertRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateAlertRequest) UnmarshalJSON(data []byte) error { + var w updateAlertRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateAlertRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateAlertRequestAlertWire struct { DisplayName *string `json:"display_name,omitempty"` QueryId *string `json:"query_id,omitempty"` @@ -651,6 +988,30 @@ func updateAlertRequestAlertFromWire(w *updateAlertRequestAlertWire) (*UpdateAle }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateAlertRequestAlert) MarshalJSON() ([]byte, error) { + w, err := updateAlertRequestAlertToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateAlertRequestAlert) UnmarshalJSON(data []byte) error { + var w updateAlertRequestAlertWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateAlertRequestAlertFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/alerts/v2/client.go b/alerts/v2/client.go index 3c96c1f7..0b4f02a7 100644 --- a/alerts/v2/client.go +++ b/alerts/v2/client.go @@ -77,7 +77,8 @@ func NewClient(ctx context.Context, opts ...client.Option) (*Client, error) { }, nil } -// Create Alert +// Creates an alert that runs `query_text` on the given schedule and evaluates +// the result against the configured condition. func (c *internalClient) CreateAlert(ctx context.Context, req CreateAlertRequest, opts ...call.Option) (*Alert, error) { wireReq, err := createAlertRequestToWire(&req) if err != nil { @@ -379,7 +380,8 @@ func (c *internalClient) TrashAlert(ctx context.Context, req TrashAlertRequest, return resp, nil } -// Update alert +// Updates an alert. Only the fields listed in `update_mask` are changed; all +// other fields keep their current values. func (c *internalClient) UpdateAlert(ctx context.Context, req UpdateAlertRequest, opts ...call.Option) (*Alert, error) { wireReq, err := updateAlertRequestToWire(&req) if err != nil { diff --git a/alerts/v2/model.go b/alerts/v2/model.go index ae236563..b9f1243e 100644 --- a/alerts/v2/model.go +++ b/alerts/v2/model.go @@ -76,6 +76,9 @@ const ( SchedulePauseStatus_Paused SchedulePauseStatus = "PAUSED" ) +// A SQL alert. An alert runs a query on a schedule, evaluates the result +// against a condition, and notifies users or notification destinations when the +// condition is met.. type Alert struct { // The canonical identifier of the alert to retrieve information about. Id *string `fieldmask:"id"` @@ -95,21 +98,27 @@ type Alert struct { QueryText *string `fieldmask:"query_text"` // ID of the SQL warehouse attached to the alert. WarehouseId *string `fieldmask:"warehouse_id"` - // The run as username or application ID of service principal. On Create and - // Update, this field can be set to application ID of an active service - // principal. Setting this field requires the servicePrincipal/user role. // Deprecated: Use `run_as` field instead. This field will be removed in a - // future release. - RunAsUserName *string `fieldmask:"run_as_user_name"` - Evaluation *AlertEvaluation `fieldmask:"evaluation"` - Schedule *CronSchedule `fieldmask:"schedule"` - // Indicates whether the query is trashed. + // future release. The run as username or application ID of service principal. + // On Create and Update, this field can be set to application ID of an active + // service principal. Setting this field requires the servicePrincipal/user + // role. + RunAsUserName *string `fieldmask:"run_as_user_name"` + // Condition evaluated against the query result, and who is notified when it is + // met. + Evaluation *AlertEvaluation `fieldmask:"evaluation"` + // Schedule on which the alert runs its query and evaluates the condition. + Schedule *CronSchedule `fieldmask:"schedule"` + // Indicates whether the alert is active (`ACTIVE`) or has been moved to the + // trash (`DELETED`). LifecycleState AlertLifecycleState `fieldmask:"lifecycle_state"` - // Custom summary for the alert. Interpreted according to - // `custom_template_format`. + // Custom summary for the alert, used as the notification subject. Interpreted + // according to `custom_template_format`. CustomSummary *string `fieldmask:"custom_summary"` - // Custom description for the alert. Interpreted according to - // `custom_template_format`. + // Custom description for the alert, used as the notification body. Interpreted + // according to `custom_template_format`. The available template variables are + // listed at + // https://docs.databricks.com/aws/en/sql/user/alerts/create#notification-templates. CustomDescription *string `fieldmask:"custom_description"` // Specifies the identity that will be used to run the alert. This field allows // you to configure alerts to run as a specific user or service principal. - For @@ -157,22 +166,29 @@ type Alert struct { type AlertEvaluation struct { // Source column from result to use to evaluate alert Source *AlertOperandColumn `fieldmask:"source"` - // Operator used for comparison in alert evaluation. + // Operator used for comparison in alert evaluation. The alert is triggered when + // the comparison of the source value with the threshold is true. `IS_NULL` and + // `IS_NOT_NULL` take no threshold. ComparisonOperator ComparisonOperator `fieldmask:"comparison_operator"` - // Threshold to user for alert evaluation, can be a column or a value. + // Threshold to compare the source column against, either another column or a + // fixed value. Not needed when `comparison_operator` is `IS_NULL` or + // `IS_NOT_NULL`. Threshold *AlertOperand `fieldmask:"threshold"` // User or Notification Destination to notify when alert is triggered. Notification *AlertNotification `fieldmask:"notification"` - // Latest state of alert evaluation. + // Latest state of alert evaluation: `TRIGGERED` when the condition was met, + // `OK` when it was not, and `ERROR` when the evaluation failed. State AlertEvaluationState `fieldmask:"state"` // Timestamp of the last evaluation. LastEvaluatedAt *types.Time `fieldmask:"last_evaluated_at"` - // Alert state if result is empty. Please avoid setting this field to be - // `UNKNOWN` because `UNKNOWN` state is planned to be deprecated. + // Alert state if result is empty. If not set, an empty result sets the state to + // `ERROR`. Please avoid setting this field to be `UNKNOWN` because `UNKNOWN` + // state is planned to be deprecated. EmptyResultState AlertEvaluationState `fieldmask:"empty_result_state"` } type AlertNotification struct { + // Users and notification destinations that receive notifications. Subscriptions []AlertSubscription `fieldmask:"subscriptions"` // Number of seconds an alert waits after being triggered before it is allowed // to send another notification. If set to 0 or omitted, the alert will not send @@ -197,6 +213,7 @@ type isAlertOperand_Operand interface { } // AlertOperand_Operand_Column selects Column for AlertOperand.Operand. +// Compare the source against another column of the query result. type AlertOperand_Operand_Column struct { Column AlertOperandColumn `fieldmask:"column"` } @@ -204,6 +221,7 @@ type AlertOperand_Operand_Column struct { func (*AlertOperand_Operand_Column) isAlertOperand_Operand() {} // AlertOperand_Operand_Value selects Value for AlertOperand.Operand. +// Compare the source against a fixed value. type AlertOperand_Operand_Value struct { Value AlertOperandValue `fieldmask:"value"` } @@ -216,9 +234,14 @@ type alertOperandOperandFieldMaskMetadata struct { } type AlertOperandColumn struct { - Name *string `fieldmask:"name"` + // Name of the column in the query result. + Name *string `fieldmask:"name"` + // Label for the column in notifications. Defaults to `name`. Display *string `fieldmask:"display"` - // If not set, the behavior is equivalent to using `First row` in the UI. + // Aggregation applied to the column across all rows of the query result: `SUM`, + // `COUNT`, `COUNT_DISTINCT`, `AVG`, `MEDIAN`, `MIN`, `MAX` or `STDDEV`. If not + // set, the value in the first row is used, which is equivalent to using `First + // row` in the UI. Aggregation Aggregation `fieldmask:"aggregation"` } @@ -234,6 +257,7 @@ type isAlertOperandValue_Value interface { } // AlertOperandValue_Value_StringValue selects StringValue for AlertOperandValue.Value. +// String threshold, for string or timestamp columns. type AlertOperandValue_Value_StringValue struct { StringValue string `fieldmask:"string_value"` } @@ -241,6 +265,7 @@ type AlertOperandValue_Value_StringValue struct { func (*AlertOperandValue_Value_StringValue) isAlertOperandValue_Value() {} // AlertOperandValue_Value_DoubleValue selects DoubleValue for AlertOperandValue.Value. +// Numeric threshold, for numeric columns. type AlertOperandValue_Value_DoubleValue struct { DoubleValue float64 `fieldmask:"double_value"` } @@ -248,6 +273,7 @@ type AlertOperandValue_Value_DoubleValue struct { func (*AlertOperandValue_Value_DoubleValue) isAlertOperandValue_Value() {} // AlertOperandValue_Value_BoolValue selects BoolValue for AlertOperandValue.Value. +// Boolean threshold, for boolean columns. type AlertOperandValue_Value_BoolValue struct { BoolValue bool `fieldmask:"bool_value"` } @@ -318,6 +344,7 @@ type isAlertSubscription_SubscriptionType interface { } // AlertSubscription_SubscriptionType_UserEmail selects UserEmail for AlertSubscription.SubscriptionType. +// Email address of the workspace user to notify. type AlertSubscription_SubscriptionType_UserEmail struct { UserEmail string } @@ -325,6 +352,8 @@ type AlertSubscription_SubscriptionType_UserEmail struct { func (*AlertSubscription_SubscriptionType_UserEmail) isAlertSubscription_SubscriptionType() {} // AlertSubscription_SubscriptionType_DestinationId selects DestinationId for AlertSubscription.SubscriptionType. +// ID of the notification destination to notify, as returned by the Notification +// Destinations API. type AlertSubscription_SubscriptionType_DestinationId struct { DestinationId string } @@ -337,7 +366,7 @@ type CreateAlertRequest struct { type CronSchedule struct { // A cron expression using quartz syntax that specifies the schedule for this - // pipeline. Should use the quartz format described here: + // alert. Should use the quartz format described here: // http://www.quartz-scheduler.org/documentation/quartz-2.1.7/tutorials/tutorial-lesson-06.html QuartzCronSchedule *string `fieldmask:"quartz_cron_schedule"` // A Java timezone id. The schedule will be resolved using this timezone. This @@ -345,7 +374,8 @@ type CronSchedule struct { // https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-timezone.html // for details. TimezoneId *string `fieldmask:"timezone_id"` - // Indicate whether this schedule is paused or not. + // Indicates whether this schedule is paused. While paused, the alert is not + // evaluated. PauseStatus SchedulePauseStatus `fieldmask:"pause_status"` } @@ -355,12 +385,17 @@ type Empty struct { } type GetAlertRequest struct { + // ID of the alert to retrieve, as returned in the alert's `id` field. Id *string } type ListAlertsRequest struct { + // Page token returned as `next_page_token` by a previous call. Omit it to + // retrieve the first page. PageToken *string - PageSize *int + // Maximum number of alerts to return per page. Values above 100 are coerced to + // 100. + PageSize *int } type ListAlertsResponse struct { @@ -369,6 +404,7 @@ type ListAlertsResponse struct { } type TrashAlertRequest struct { + // ID of the alert to move to the trash. Id *string // Whether to permanently delete the alert. If not set, the alert will only be // soft deleted. @@ -376,6 +412,10 @@ type TrashAlertRequest struct { } type UpdateAlertRequest struct { - Alert *Alert + Alert *Alert + // Comma-separated list of the alert fields to update, for example + // `display_name,query_text` or `schedule.pause_status`. Only the listed fields + // are changed; all other fields keep their current values. `parent_path` cannot + // be updated. UpdateMask *types.FieldMask[Alert] } diff --git a/alerts/v2/wire.go b/alerts/v2/wire.go index 8729aa8d..5ea4d084 100644 --- a/alerts/v2/wire.go +++ b/alerts/v2/wire.go @@ -3,6 +3,7 @@ package alerts import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -121,6 +122,30 @@ func alertFromWire(w *alertWire) (*Alert, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Alert) MarshalJSON() ([]byte, error) { + w, err := alertToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Alert) UnmarshalJSON(data []byte) error { + var w alertWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertEvaluationWire struct { Source *alertOperandColumnWire `json:"source,omitempty"` ComparisonOperator ComparisonOperator `json:"comparison_operator,omitempty"` @@ -185,6 +210,30 @@ func alertEvaluationFromWire(w *alertEvaluationWire) (*AlertEvaluation, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertEvaluation) MarshalJSON() ([]byte, error) { + w, err := alertEvaluationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertEvaluation) UnmarshalJSON(data []byte) error { + var w alertEvaluationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertEvaluationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertNotificationWire struct { Subscriptions []alertSubscriptionWire `json:"subscriptions,omitempty"` RetriggerSeconds *int `json:"retrigger_seconds,omitempty"` @@ -221,6 +270,30 @@ func alertNotificationFromWire(w *alertNotificationWire) (*AlertNotification, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertNotification) MarshalJSON() ([]byte, error) { + w, err := alertNotificationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertNotification) UnmarshalJSON(data []byte) error { + var w alertNotificationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertNotificationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertOperandWire struct { Column *alertOperandColumnWire `json:"column,omitempty"` Value *alertOperandValueWire `json:"value,omitempty"` @@ -293,6 +366,30 @@ func alertOperandFromWire(w *alertOperandWire) (*AlertOperand, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertOperand) MarshalJSON() ([]byte, error) { + w, err := alertOperandToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertOperand) UnmarshalJSON(data []byte) error { + var w alertOperandWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertOperandFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertOperandColumnWire struct { Name *string `json:"name,omitempty"` Display *string `json:"display,omitempty"` @@ -321,6 +418,30 @@ func alertOperandColumnFromWire(w *alertOperandColumnWire) (*AlertOperandColumn, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertOperandColumn) MarshalJSON() ([]byte, error) { + w, err := alertOperandColumnToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertOperandColumn) UnmarshalJSON(data []byte) error { + var w alertOperandColumnWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertOperandColumnFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertOperandValueWire struct { StringValue *string `json:"string_value,omitempty"` DoubleValue *float64 `json:"double_value,omitempty"` @@ -389,6 +510,30 @@ func alertOperandValueFromWire(w *alertOperandValueWire) (*AlertOperandValue, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertOperandValue) MarshalJSON() ([]byte, error) { + w, err := alertOperandValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertOperandValue) UnmarshalJSON(data []byte) error { + var w alertOperandValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertOperandValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertRunAsWire struct { UserName *string `json:"user_name,omitempty"` ServicePrincipalName *string `json:"service_principal_name,omitempty"` @@ -445,6 +590,30 @@ func alertRunAsFromWire(w *alertRunAsWire) (*AlertRunAs, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertRunAs) MarshalJSON() ([]byte, error) { + w, err := alertRunAsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertRunAs) UnmarshalJSON(data []byte) error { + var w alertRunAsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertRunAsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertStatementParameterWire struct { Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` @@ -473,6 +642,30 @@ func alertStatementParameterFromWire(w *alertStatementParameterWire) (*AlertStat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertStatementParameter) MarshalJSON() ([]byte, error) { + w, err := alertStatementParameterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertStatementParameter) UnmarshalJSON(data []byte) error { + var w alertStatementParameterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertStatementParameterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertSubscriptionWire struct { UserEmail *string `json:"user_email,omitempty"` DestinationId *string `json:"destination_id,omitempty"` @@ -529,6 +722,30 @@ func alertSubscriptionFromWire(w *alertSubscriptionWire) (*AlertSubscription, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertSubscription) MarshalJSON() ([]byte, error) { + w, err := alertSubscriptionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertSubscription) UnmarshalJSON(data []byte) error { + var w alertSubscriptionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertSubscriptionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAlertRequestWire struct { Alert *alertWire `json:"alert,omitempty"` } @@ -559,6 +776,30 @@ func createAlertRequestFromWire(w *createAlertRequestWire) (*CreateAlertRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAlertRequest) MarshalJSON() ([]byte, error) { + w, err := createAlertRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAlertRequest) UnmarshalJSON(data []byte) error { + var w createAlertRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAlertRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cronScheduleWire struct { QuartzCronSchedule *string `json:"quartz_cron_schedule,omitempty"` TimezoneId *string `json:"timezone_id,omitempty"` @@ -587,6 +828,30 @@ func cronScheduleFromWire(w *cronScheduleWire) (*CronSchedule, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CronSchedule) MarshalJSON() ([]byte, error) { + w, err := cronScheduleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CronSchedule) UnmarshalJSON(data []byte) error { + var w cronScheduleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cronScheduleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type emptyWire struct { } @@ -604,6 +869,30 @@ func emptyFromWire(w *emptyWire) (*Empty, error) { return &Empty{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Empty) MarshalJSON() ([]byte, error) { + w, err := emptyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Empty) UnmarshalJSON(data []byte) error { + var w emptyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := emptyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAlertRequestWire struct { Id *string `json:"id,omitempty"` } @@ -626,6 +915,30 @@ func getAlertRequestFromWire(w *getAlertRequestWire) (*GetAlertRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAlertRequest) MarshalJSON() ([]byte, error) { + w, err := getAlertRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAlertRequest) UnmarshalJSON(data []byte) error { + var w getAlertRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAlertRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAlertsRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -651,6 +964,30 @@ func listAlertsRequestFromWire(w *listAlertsRequestWire) (*ListAlertsRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAlertsRequest) MarshalJSON() ([]byte, error) { + w, err := listAlertsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAlertsRequest) UnmarshalJSON(data []byte) error { + var w listAlertsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAlertsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAlertsResponseWire struct { Alerts []alertWire `json:"alerts,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -684,6 +1021,30 @@ func listAlertsResponseFromWire(w *listAlertsResponseWire) (*ListAlertsResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAlertsResponse) MarshalJSON() ([]byte, error) { + w, err := listAlertsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAlertsResponse) UnmarshalJSON(data []byte) error { + var w listAlertsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAlertsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type trashAlertRequestWire struct { Id *string `json:"id,omitempty"` Purge *bool `json:"purge,omitempty"` @@ -709,6 +1070,30 @@ func trashAlertRequestFromWire(w *trashAlertRequestWire) (*TrashAlertRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TrashAlertRequest) MarshalJSON() ([]byte, error) { + w, err := trashAlertRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TrashAlertRequest) UnmarshalJSON(data []byte) error { + var w trashAlertRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := trashAlertRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateAlertRequestWire struct { Alert *alertWire `json:"alert,omitempty"` UpdateMask *types.FieldMask[Alert] `json:"update_mask,omitempty"` @@ -742,6 +1127,30 @@ func updateAlertRequestFromWire(w *updateAlertRequestWire) (*UpdateAlertRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateAlertRequest) MarshalJSON() ([]byte, error) { + w, err := updateAlertRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateAlertRequest) UnmarshalJSON(data []byte) error { + var w updateAlertRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateAlertRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/apps/CHANGELOG.md b/apps/CHANGELOG.md index bdca53bf..88179299 100644 --- a/apps/CHANGELOG.md +++ b/apps/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.9.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.8.0 (2026-11-11) ## Release v0.7.0 (2026-11-10) diff --git a/apps/internal/version.go b/apps/internal/version.go index ea03d2a0..193147bc 100644 --- a/apps/internal/version.go +++ b/apps/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-apps" -const Version = "0.8.0" +const Version = "0.9.0" diff --git a/apps/v1/model.go b/apps/v1/model.go index 5006f7e4..de3b9d21 100644 --- a/apps/v1/model.go +++ b/apps/v1/model.go @@ -736,6 +736,9 @@ type App struct { // Name of the space this app belongs to. Space *string `fieldmask:"space"` DeploymentSource isApp_DeploymentSource + // Resources added to the app, plus the resources it inherits from its space. + // Empty for apps that are not in a space. + EffectiveResources []AppResource `fieldmask:"effective_resources"` // Forward the user's access token to the app. Requires stopping and starting // app compute to take effect. ForwardUserAccessToken *bool `fieldmask:"forward_user_access_token"` diff --git a/apps/v1/wire.go b/apps/v1/wire.go index 95efb329..950480c5 100644 --- a/apps/v1/wire.go +++ b/apps/v1/wire.go @@ -85,6 +85,30 @@ func apiErrorFromWire(w *apiErrorWire) (*ApiError, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApiError) MarshalJSON() ([]byte, error) { + w, err := apiErrorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApiError) UnmarshalJSON(data []byte) error { + var w apiErrorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := apiErrorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appWire struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` @@ -121,6 +145,7 @@ type appWire struct { Space *string `json:"space,omitempty"` SourceCodePath *string `json:"source_code_path,omitempty"` GitSource *gitSourceWire `json:"git_source,omitempty"` + EffectiveResources []appResourceWire `json:"effective_resources,omitempty"` ForwardUserAccessToken *bool `json:"forward_user_access_token,omitempty"` } @@ -164,6 +189,10 @@ func appToWire(v *App) (*appWire, error) { if err != nil { return nil, fmt.Errorf("%s: %w", "App.TelemetryExportDestinations", err) } + effectiveResourcesWireValue, err := convertSlice(v.EffectiveResources, appResourceToWire) + if err != nil { + return nil, fmt.Errorf("%s: %w", "App.EffectiveResources", err) + } var deploymentSourceSourceCodePathWire *string var deploymentSourceGitSourceWire *gitSourceWire switch value := v.DeploymentSource.(type) { @@ -219,6 +248,7 @@ func appToWire(v *App) (*appWire, error) { Space: v.Space, SourceCodePath: deploymentSourceSourceCodePathWire, GitSource: deploymentSourceGitSourceWire, + EffectiveResources: effectiveResourcesWireValue, ForwardUserAccessToken: v.ForwardUserAccessToken, }, nil } @@ -273,6 +303,10 @@ func appFromWire(w *appWire) (*App, error) { if err != nil { return nil, fmt.Errorf("%s: %w", "App.TelemetryExportDestinations", err) } + effectiveResourcesPublicValue, err := convertSlice(w.EffectiveResources, appResourceFromWire) + if err != nil { + return nil, fmt.Errorf("%s: %w", "App.EffectiveResources", err) + } var deploymentSourceSelection isApp_DeploymentSource switch { case w.SourceCodePath != nil: @@ -318,11 +352,36 @@ func appFromWire(w *appWire) (*App, error) { TelemetryExportDestinations: telemetryExportDestinationsPublicValue, ThumbnailUrl: w.ThumbnailUrl, Space: w.Space, + EffectiveResources: effectiveResourcesPublicValue, ForwardUserAccessToken: w.ForwardUserAccessToken, DeploymentSource: deploymentSourceSelection, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v App) MarshalJSON() ([]byte, error) { + w, err := appToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *App) UnmarshalJSON(data []byte) error { + var w appWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appDeploymentWire struct { DeploymentId *string `json:"deployment_id,omitempty"` SourceCodePath *string `json:"source_code_path,omitempty"` @@ -418,6 +477,30 @@ func appDeploymentFromWire(w *appDeploymentWire) (*AppDeployment, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppDeployment) MarshalJSON() ([]byte, error) { + w, err := appDeploymentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppDeployment) UnmarshalJSON(data []byte) error { + var w appDeploymentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appDeploymentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appDeploymentArtifactsWire struct { SourceCodePath *string `json:"source_code_path,omitempty"` } @@ -440,6 +523,30 @@ func appDeploymentArtifactsFromWire(w *appDeploymentArtifactsWire) (*AppDeployme }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppDeploymentArtifacts) MarshalJSON() ([]byte, error) { + w, err := appDeploymentArtifactsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppDeploymentArtifacts) UnmarshalJSON(data []byte) error { + var w appDeploymentArtifactsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appDeploymentArtifactsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appDeploymentStatusWire struct { State AppDeployment_State `json:"state,omitempty"` Message *string `json:"message,omitempty"` @@ -465,6 +572,30 @@ func appDeploymentStatusFromWire(w *appDeploymentStatusWire) (*AppDeploymentStat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppDeploymentStatus) MarshalJSON() ([]byte, error) { + w, err := appDeploymentStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppDeploymentStatus) UnmarshalJSON(data []byte) error { + var w appDeploymentStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appDeploymentStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appHealthCheckWire struct { Path *string `json:"path,omitempty"` Timeout *types.Duration `json:"timeout,omitempty"` @@ -490,6 +621,30 @@ func appHealthCheckFromWire(w *appHealthCheckWire) (*AppHealthCheck, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppHealthCheck) MarshalJSON() ([]byte, error) { + w, err := appHealthCheckToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppHealthCheck) UnmarshalJSON(data []byte) error { + var w appHealthCheckWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appHealthCheckFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appManifestWire struct { Version *int `json:"version,omitempty"` Name *string `json:"name,omitempty"` @@ -529,6 +684,30 @@ func appManifestFromWire(w *appManifestWire) (*AppManifest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppManifest) MarshalJSON() ([]byte, error) { + w, err := appManifestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppManifest) UnmarshalJSON(data []byte) error { + var w appManifestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appManifestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appManifest_AppResourceExperimentSpecWire struct { Permission AppManifest_AppResourceExperimentSpec_ExperimentPermission `json:"permission,omitempty"` } @@ -551,6 +730,30 @@ func appManifest_AppResourceExperimentSpecFromWire(w *appManifest_AppResourceExp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppManifest_AppResourceExperimentSpec) MarshalJSON() ([]byte, error) { + w, err := appManifest_AppResourceExperimentSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppManifest_AppResourceExperimentSpec) UnmarshalJSON(data []byte) error { + var w appManifest_AppResourceExperimentSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appManifest_AppResourceExperimentSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appManifest_AppResourceJobSpecWire struct { Permission AppManifest_AppResourceJobSpec_JobPermission `json:"permission,omitempty"` } @@ -573,6 +776,30 @@ func appManifest_AppResourceJobSpecFromWire(w *appManifest_AppResourceJobSpecWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppManifest_AppResourceJobSpec) MarshalJSON() ([]byte, error) { + w, err := appManifest_AppResourceJobSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppManifest_AppResourceJobSpec) UnmarshalJSON(data []byte) error { + var w appManifest_AppResourceJobSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appManifest_AppResourceJobSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appManifest_AppResourceSecretSpecWire struct { Permission AppManifest_AppResourceSecretSpec_SecretPermission `json:"permission,omitempty"` } @@ -595,6 +822,30 @@ func appManifest_AppResourceSecretSpecFromWire(w *appManifest_AppResourceSecretS }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppManifest_AppResourceSecretSpec) MarshalJSON() ([]byte, error) { + w, err := appManifest_AppResourceSecretSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppManifest_AppResourceSecretSpec) UnmarshalJSON(data []byte) error { + var w appManifest_AppResourceSecretSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appManifest_AppResourceSecretSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appManifest_AppResourceServingEndpointSpecWire struct { Permission AppManifest_AppResourceServingEndpointSpec_ServingEndpointPermission `json:"permission,omitempty"` } @@ -617,6 +868,30 @@ func appManifest_AppResourceServingEndpointSpecFromWire(w *appManifest_AppResour }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppManifest_AppResourceServingEndpointSpec) MarshalJSON() ([]byte, error) { + w, err := appManifest_AppResourceServingEndpointSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppManifest_AppResourceServingEndpointSpec) UnmarshalJSON(data []byte) error { + var w appManifest_AppResourceServingEndpointSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appManifest_AppResourceServingEndpointSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appManifest_AppResourceSpecWire struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` @@ -775,6 +1050,30 @@ func appManifest_AppResourceSpecFromWire(w *appManifest_AppResourceSpecWire) (*A }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppManifest_AppResourceSpec) MarshalJSON() ([]byte, error) { + w, err := appManifest_AppResourceSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppManifest_AppResourceSpec) UnmarshalJSON(data []byte) error { + var w appManifest_AppResourceSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appManifest_AppResourceSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appManifest_AppResourceSqlWarehouseSpecWire struct { Permission AppManifest_AppResourceSqlWarehouseSpec_SqlWarehousePermission `json:"permission,omitempty"` } @@ -797,6 +1096,30 @@ func appManifest_AppResourceSqlWarehouseSpecFromWire(w *appManifest_AppResourceS }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppManifest_AppResourceSqlWarehouseSpec) MarshalJSON() ([]byte, error) { + w, err := appManifest_AppResourceSqlWarehouseSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppManifest_AppResourceSqlWarehouseSpec) UnmarshalJSON(data []byte) error { + var w appManifest_AppResourceSqlWarehouseSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appManifest_AppResourceSqlWarehouseSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appManifest_AppResourceUcSecurableSpecWire struct { SecurableType AppManifest_AppResourceUcSecurableSpec_UcSecurableType `json:"securable_type,omitempty"` Permission AppManifest_AppResourceUcSecurableSpec_UcSecurablePermission `json:"permission,omitempty"` @@ -822,6 +1145,30 @@ func appManifest_AppResourceUcSecurableSpecFromWire(w *appManifest_AppResourceUc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppManifest_AppResourceUcSecurableSpec) MarshalJSON() ([]byte, error) { + w, err := appManifest_AppResourceUcSecurableSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppManifest_AppResourceUcSecurableSpec) UnmarshalJSON(data []byte) error { + var w appManifest_AppResourceUcSecurableSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appManifest_AppResourceUcSecurableSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appResourceWire struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` @@ -1060,6 +1407,30 @@ func appResourceFromWire(w *appResourceWire) (*AppResource, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppResource) MarshalJSON() ([]byte, error) { + w, err := appResourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppResource) UnmarshalJSON(data []byte) error { + var w appResourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appResourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appResourceAppWire struct { Name *string `json:"name,omitempty"` Permission AppResourceApp_AppPermission `json:"permission,omitempty"` @@ -1085,6 +1456,30 @@ func appResourceAppFromWire(w *appResourceAppWire) (*AppResourceApp, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppResourceApp) MarshalJSON() ([]byte, error) { + w, err := appResourceAppToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppResourceApp) UnmarshalJSON(data []byte) error { + var w appResourceAppWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appResourceAppFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appResourceDatabaseWire struct { InstanceName *string `json:"instance_name,omitempty"` DatabaseName *string `json:"database_name,omitempty"` @@ -1113,6 +1508,30 @@ func appResourceDatabaseFromWire(w *appResourceDatabaseWire) (*AppResourceDataba }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppResourceDatabase) MarshalJSON() ([]byte, error) { + w, err := appResourceDatabaseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppResourceDatabase) UnmarshalJSON(data []byte) error { + var w appResourceDatabaseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appResourceDatabaseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appResourceExperimentWire struct { ExperimentId *string `json:"experiment_id,omitempty"` Permission AppResourceExperiment_ExperimentPermission `json:"permission,omitempty"` @@ -1138,6 +1557,30 @@ func appResourceExperimentFromWire(w *appResourceExperimentWire) (*AppResourceEx }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppResourceExperiment) MarshalJSON() ([]byte, error) { + w, err := appResourceExperimentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppResourceExperiment) UnmarshalJSON(data []byte) error { + var w appResourceExperimentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appResourceExperimentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appResourceGenieSpaceWire struct { Name *string `json:"name,omitempty"` SpaceId *string `json:"space_id,omitempty"` @@ -1166,6 +1609,30 @@ func appResourceGenieSpaceFromWire(w *appResourceGenieSpaceWire) (*AppResourceGe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppResourceGenieSpace) MarshalJSON() ([]byte, error) { + w, err := appResourceGenieSpaceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppResourceGenieSpace) UnmarshalJSON(data []byte) error { + var w appResourceGenieSpaceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appResourceGenieSpaceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appResourceJobWire struct { Id *string `json:"id,omitempty"` Permission AppResourceJob_JobPermission `json:"permission,omitempty"` @@ -1191,6 +1658,30 @@ func appResourceJobFromWire(w *appResourceJobWire) (*AppResourceJob, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppResourceJob) MarshalJSON() ([]byte, error) { + w, err := appResourceJobToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppResourceJob) UnmarshalJSON(data []byte) error { + var w appResourceJobWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appResourceJobFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appResourcePostgresWire struct { Branch *string `json:"branch,omitempty"` Database *string `json:"database,omitempty"` @@ -1219,6 +1710,30 @@ func appResourcePostgresFromWire(w *appResourcePostgresWire) (*AppResourcePostgr }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppResourcePostgres) MarshalJSON() ([]byte, error) { + w, err := appResourcePostgresToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppResourcePostgres) UnmarshalJSON(data []byte) error { + var w appResourcePostgresWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appResourcePostgresFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appResourceSecretWire struct { Scope *string `json:"scope,omitempty"` Key *string `json:"key,omitempty"` @@ -1247,6 +1762,30 @@ func appResourceSecretFromWire(w *appResourceSecretWire) (*AppResourceSecret, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppResourceSecret) MarshalJSON() ([]byte, error) { + w, err := appResourceSecretToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppResourceSecret) UnmarshalJSON(data []byte) error { + var w appResourceSecretWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appResourceSecretFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appResourceServingEndpointWire struct { Name *string `json:"name,omitempty"` Permission AppResourceServingEndpoint_ServingEndpointPermission `json:"permission,omitempty"` @@ -1272,6 +1811,30 @@ func appResourceServingEndpointFromWire(w *appResourceServingEndpointWire) (*App }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppResourceServingEndpoint) MarshalJSON() ([]byte, error) { + w, err := appResourceServingEndpointToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppResourceServingEndpoint) UnmarshalJSON(data []byte) error { + var w appResourceServingEndpointWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appResourceServingEndpointFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appResourceSqlWarehouseWire struct { Id *string `json:"id,omitempty"` Permission AppResourceSqlWarehouse_SqlWarehousePermission `json:"permission,omitempty"` @@ -1297,6 +1860,30 @@ func appResourceSqlWarehouseFromWire(w *appResourceSqlWarehouseWire) (*AppResour }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppResourceSqlWarehouse) MarshalJSON() ([]byte, error) { + w, err := appResourceSqlWarehouseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppResourceSqlWarehouse) UnmarshalJSON(data []byte) error { + var w appResourceSqlWarehouseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appResourceSqlWarehouseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appResourceUcSecurableWire struct { SecurableFullName *string `json:"securable_full_name,omitempty"` SecurableType AppResourceUcSecurable_UcSecurableType `json:"securable_type,omitempty"` @@ -1328,6 +1915,30 @@ func appResourceUcSecurableFromWire(w *appResourceUcSecurableWire) (*AppResource }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppResourceUcSecurable) MarshalJSON() ([]byte, error) { + w, err := appResourceUcSecurableToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppResourceUcSecurable) UnmarshalJSON(data []byte) error { + var w appResourceUcSecurableWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appResourceUcSecurableFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appThumbnailWire struct { Thumbnail []byte `json:"thumbnail,omitempty"` } @@ -1350,6 +1961,30 @@ func appThumbnailFromWire(w *appThumbnailWire) (*AppThumbnail, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppThumbnail) MarshalJSON() ([]byte, error) { + w, err := appThumbnailToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppThumbnail) UnmarshalJSON(data []byte) error { + var w appThumbnailWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appThumbnailFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appUpdateWire struct { Status *appUpdate_UpdateStatusWire `json:"status,omitempty"` Description *string `json:"description,omitempty"` @@ -1437,6 +2072,30 @@ func appUpdateFromWire(w *appUpdateWire) (*AppUpdate, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppUpdate) MarshalJSON() ([]byte, error) { + w, err := appUpdateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppUpdate) UnmarshalJSON(data []byte) error { + var w appUpdateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appUpdateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type appUpdate_UpdateStatusWire struct { State AppUpdate_UpdateStatus_UpdateState `json:"state,omitempty"` Message *string `json:"message,omitempty"` @@ -1462,6 +2121,30 @@ func appUpdate_UpdateStatusFromWire(w *appUpdate_UpdateStatusWire) (*AppUpdate_U }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AppUpdate_UpdateStatus) MarshalJSON() ([]byte, error) { + w, err := appUpdate_UpdateStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AppUpdate_UpdateStatus) UnmarshalJSON(data []byte) error { + var w appUpdate_UpdateStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appUpdate_UpdateStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type applicationStatusWire struct { State ApplicationStatus_ApplicationState `json:"state,omitempty"` Message *string `json:"message,omitempty"` @@ -1490,6 +2173,30 @@ func applicationStatusFromWire(w *applicationStatusWire) (*ApplicationStatus, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApplicationStatus) MarshalJSON() ([]byte, error) { + w, err := applicationStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApplicationStatus) UnmarshalJSON(data []byte) error { + var w applicationStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := applicationStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type asyncUpdateAppRequestWire struct { App *appWire `json:"app,omitempty"` UpdateMask *types.FieldMask[App] `json:"update_mask,omitempty"` @@ -1526,6 +2233,30 @@ func asyncUpdateAppRequestFromWire(w *asyncUpdateAppRequestWire) (*AsyncUpdateAp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AsyncUpdateAppRequest) MarshalJSON() ([]byte, error) { + w, err := asyncUpdateAppRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AsyncUpdateAppRequest) UnmarshalJSON(data []byte) error { + var w asyncUpdateAppRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := asyncUpdateAppRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type computeStatusWire struct { State ComputeStatus_ComputeState `json:"state,omitempty"` Message *string `json:"message,omitempty"` @@ -1554,6 +2285,30 @@ func computeStatusFromWire(w *computeStatusWire) (*ComputeStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ComputeStatus) MarshalJSON() ([]byte, error) { + w, err := computeStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ComputeStatus) UnmarshalJSON(data []byte) error { + var w computeStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := computeStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAppDeploymentRequestWire struct { AppName *string `json:"app_name,omitempty"` AppDeployment *appDeploymentWire `json:"app_deployment,omitempty"` @@ -1587,6 +2342,30 @@ func createAppDeploymentRequestFromWire(w *createAppDeploymentRequestWire) (*Cre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAppDeploymentRequest) MarshalJSON() ([]byte, error) { + w, err := createAppDeploymentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAppDeploymentRequest) UnmarshalJSON(data []byte) error { + var w createAppDeploymentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAppDeploymentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAppRequestWire struct { App *appWire `json:"app,omitempty"` NoCompute *bool `json:"no_compute,omitempty"` @@ -1620,6 +2399,30 @@ func createAppRequestFromWire(w *createAppRequestWire) (*CreateAppRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAppRequest) MarshalJSON() ([]byte, error) { + w, err := createAppRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAppRequest) UnmarshalJSON(data []byte) error { + var w createAppRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAppRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCustomTemplateRequestWire struct { Template *customTemplateWire `json:"template,omitempty"` } @@ -1650,6 +2453,30 @@ func createCustomTemplateRequestFromWire(w *createCustomTemplateRequestWire) (*C }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCustomTemplateRequest) MarshalJSON() ([]byte, error) { + w, err := createCustomTemplateRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCustomTemplateRequest) UnmarshalJSON(data []byte) error { + var w createCustomTemplateRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCustomTemplateRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createSpaceRequestWire struct { Space *spaceWire `json:"space,omitempty"` } @@ -1680,6 +2507,30 @@ func createSpaceRequestFromWire(w *createSpaceRequestWire) (*CreateSpaceRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateSpaceRequest) MarshalJSON() ([]byte, error) { + w, err := createSpaceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateSpaceRequest) UnmarshalJSON(data []byte) error { + var w createSpaceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createSpaceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type customTemplateWire struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` @@ -1728,6 +2579,30 @@ func customTemplateFromWire(w *customTemplateWire) (*CustomTemplate, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CustomTemplate) MarshalJSON() ([]byte, error) { + w, err := customTemplateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CustomTemplate) UnmarshalJSON(data []byte) error { + var w customTemplateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := customTemplateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteAppRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1750,6 +2625,30 @@ func deleteAppRequestFromWire(w *deleteAppRequestWire) (*DeleteAppRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteAppRequest) MarshalJSON() ([]byte, error) { + w, err := deleteAppRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteAppRequest) UnmarshalJSON(data []byte) error { + var w deleteAppRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteAppRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteAppThumbnailRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1772,6 +2671,30 @@ func deleteAppThumbnailRequestFromWire(w *deleteAppThumbnailRequestWire) (*Delet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteAppThumbnailRequest) MarshalJSON() ([]byte, error) { + w, err := deleteAppThumbnailRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteAppThumbnailRequest) UnmarshalJSON(data []byte) error { + var w deleteAppThumbnailRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteAppThumbnailRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCustomTemplateRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1794,6 +2717,30 @@ func deleteCustomTemplateRequestFromWire(w *deleteCustomTemplateRequestWire) (*D }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCustomTemplateRequest) MarshalJSON() ([]byte, error) { + w, err := deleteCustomTemplateRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCustomTemplateRequest) UnmarshalJSON(data []byte) error { + var w deleteCustomTemplateRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCustomTemplateRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteSpaceRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1816,6 +2763,30 @@ func deleteSpaceRequestFromWire(w *deleteSpaceRequestWire) (*DeleteSpaceRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteSpaceRequest) MarshalJSON() ([]byte, error) { + w, err := deleteSpaceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteSpaceRequest) UnmarshalJSON(data []byte) error { + var w deleteSpaceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteSpaceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type envVarWire struct { Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` @@ -1875,6 +2846,30 @@ func envVarFromWire(w *envVarWire) (*EnvVar, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EnvVar) MarshalJSON() ([]byte, error) { + w, err := envVarToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EnvVar) UnmarshalJSON(data []byte) error { + var w envVarWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := envVarFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAppDeploymentRequestWire struct { AppName *string `json:"app_name,omitempty"` DeploymentId *string `json:"deployment_id,omitempty"` @@ -1900,6 +2895,30 @@ func getAppDeploymentRequestFromWire(w *getAppDeploymentRequestWire) (*GetAppDep }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAppDeploymentRequest) MarshalJSON() ([]byte, error) { + w, err := getAppDeploymentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAppDeploymentRequest) UnmarshalJSON(data []byte) error { + var w getAppDeploymentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAppDeploymentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAppRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1922,6 +2941,30 @@ func getAppRequestFromWire(w *getAppRequestWire) (*GetAppRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAppRequest) MarshalJSON() ([]byte, error) { + w, err := getAppRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAppRequest) UnmarshalJSON(data []byte) error { + var w getAppRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAppRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAppUpdateRequestWire struct { AppName *string `json:"app_name,omitempty"` } @@ -1944,6 +2987,30 @@ func getAppUpdateRequestFromWire(w *getAppUpdateRequestWire) (*GetAppUpdateReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAppUpdateRequest) MarshalJSON() ([]byte, error) { + w, err := getAppUpdateRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAppUpdateRequest) UnmarshalJSON(data []byte) error { + var w getAppUpdateRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAppUpdateRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCustomTemplateRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1966,6 +3033,30 @@ func getCustomTemplateRequestFromWire(w *getCustomTemplateRequestWire) (*GetCust }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCustomTemplateRequest) MarshalJSON() ([]byte, error) { + w, err := getCustomTemplateRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCustomTemplateRequest) UnmarshalJSON(data []byte) error { + var w getCustomTemplateRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCustomTemplateRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getOperationRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1988,6 +3079,30 @@ func getOperationRequestFromWire(w *getOperationRequestWire) (*GetOperationReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetOperationRequest) MarshalJSON() ([]byte, error) { + w, err := getOperationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetOperationRequest) UnmarshalJSON(data []byte) error { + var w getOperationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getOperationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSpaceRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2010,6 +3125,30 @@ func getSpaceRequestFromWire(w *getSpaceRequestWire) (*GetSpaceRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSpaceRequest) MarshalJSON() ([]byte, error) { + w, err := getSpaceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSpaceRequest) UnmarshalJSON(data []byte) error { + var w getSpaceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSpaceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gitRepositoryWire struct { Url *string `json:"url,omitempty"` Provider *string `json:"provider,omitempty"` @@ -2049,6 +3188,30 @@ func gitRepositoryFromWire(w *gitRepositoryWire) (*GitRepository, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GitRepository) MarshalJSON() ([]byte, error) { + w, err := gitRepositoryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GitRepository) UnmarshalJSON(data []byte) error { + var w gitRepositoryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gitRepositoryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gitSourceWire struct { GitRepository *gitRepositoryWire `json:"git_repository,omitempty"` Branch *string `json:"branch,omitempty"` @@ -2134,6 +3297,30 @@ func gitSourceFromWire(w *gitSourceWire) (*GitSource, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GitSource) MarshalJSON() ([]byte, error) { + w, err := gitSourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GitSource) UnmarshalJSON(data []byte) error { + var w gitSourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gitSourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAppDeploymentsRequestWire struct { AppName *string `json:"app_name,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -2162,6 +3349,30 @@ func listAppDeploymentsRequestFromWire(w *listAppDeploymentsRequestWire) (*ListA }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAppDeploymentsRequest) MarshalJSON() ([]byte, error) { + w, err := listAppDeploymentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAppDeploymentsRequest) UnmarshalJSON(data []byte) error { + var w listAppDeploymentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAppDeploymentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAppDeploymentsResponseWire struct { AppDeployments []appDeploymentWire `json:"app_deployments,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2195,6 +3406,30 @@ func listAppDeploymentsResponseFromWire(w *listAppDeploymentsResponseWire) (*Lis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAppDeploymentsResponse) MarshalJSON() ([]byte, error) { + w, err := listAppDeploymentsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAppDeploymentsResponse) UnmarshalJSON(data []byte) error { + var w listAppDeploymentsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAppDeploymentsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAppsRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -2223,6 +3458,30 @@ func listAppsRequestFromWire(w *listAppsRequestWire) (*ListAppsRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAppsRequest) MarshalJSON() ([]byte, error) { + w, err := listAppsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAppsRequest) UnmarshalJSON(data []byte) error { + var w listAppsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAppsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAppsResponseWire struct { Apps []appWire `json:"apps,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2256,6 +3515,30 @@ func listAppsResponseFromWire(w *listAppsResponseWire) (*ListAppsResponse, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAppsResponse) MarshalJSON() ([]byte, error) { + w, err := listAppsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAppsResponse) UnmarshalJSON(data []byte) error { + var w listAppsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAppsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCustomTemplatesRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -2281,6 +3564,30 @@ func listCustomTemplatesRequestFromWire(w *listCustomTemplatesRequestWire) (*Lis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCustomTemplatesRequest) MarshalJSON() ([]byte, error) { + w, err := listCustomTemplatesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCustomTemplatesRequest) UnmarshalJSON(data []byte) error { + var w listCustomTemplatesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCustomTemplatesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCustomTemplatesResponseWire struct { Templates []customTemplateWire `json:"templates,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2314,6 +3621,30 @@ func listCustomTemplatesResponseFromWire(w *listCustomTemplatesResponseWire) (*L }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCustomTemplatesResponse) MarshalJSON() ([]byte, error) { + w, err := listCustomTemplatesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCustomTemplatesResponse) UnmarshalJSON(data []byte) error { + var w listCustomTemplatesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCustomTemplatesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSpacesRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -2339,6 +3670,30 @@ func listSpacesRequestFromWire(w *listSpacesRequestWire) (*ListSpacesRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSpacesRequest) MarshalJSON() ([]byte, error) { + w, err := listSpacesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSpacesRequest) UnmarshalJSON(data []byte) error { + var w listSpacesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSpacesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSpacesResponseWire struct { Spaces []spaceWire `json:"spaces,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2372,6 +3727,30 @@ func listSpacesResponseFromWire(w *listSpacesResponseWire) (*ListSpacesResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSpacesResponse) MarshalJSON() ([]byte, error) { + w, err := listSpacesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSpacesResponse) UnmarshalJSON(data []byte) error { + var w listSpacesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSpacesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type operationWire struct { Name *string `json:"name,omitempty"` Metadata json.RawMessage `json:"metadata,omitempty"` @@ -2445,6 +3824,30 @@ func operationFromWire(w *operationWire) (*Operation, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Operation) MarshalJSON() ([]byte, error) { + w, err := operationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Operation) UnmarshalJSON(data []byte) error { + var w operationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := operationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type spaceWire struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` @@ -2539,6 +3942,30 @@ func spaceFromWire(w *spaceWire) (*Space, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Space) MarshalJSON() ([]byte, error) { + w, err := spaceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Space) UnmarshalJSON(data []byte) error { + var w spaceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := spaceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type spaceStatusWire struct { State SpaceStatus_SpaceState `json:"state,omitempty"` Message *string `json:"message,omitempty"` @@ -2564,6 +3991,30 @@ func spaceStatusFromWire(w *spaceStatusWire) (*SpaceStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SpaceStatus) MarshalJSON() ([]byte, error) { + w, err := spaceStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SpaceStatus) UnmarshalJSON(data []byte) error { + var w spaceStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := spaceStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type spaceUpdateWire struct { Status *spaceUpdateStatusWire `json:"status,omitempty"` Description *string `json:"description,omitempty"` @@ -2614,6 +4065,30 @@ func spaceUpdateFromWire(w *spaceUpdateWire) (*SpaceUpdate, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SpaceUpdate) MarshalJSON() ([]byte, error) { + w, err := spaceUpdateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SpaceUpdate) UnmarshalJSON(data []byte) error { + var w spaceUpdateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := spaceUpdateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type spaceUpdateStatusWire struct { State SpaceUpdateState `json:"state,omitempty"` Message *string `json:"message,omitempty"` @@ -2639,6 +4114,30 @@ func spaceUpdateStatusFromWire(w *spaceUpdateStatusWire) (*SpaceUpdateStatus, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SpaceUpdateStatus) MarshalJSON() ([]byte, error) { + w, err := spaceUpdateStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SpaceUpdateStatus) UnmarshalJSON(data []byte) error { + var w spaceUpdateStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := spaceUpdateStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type startAppRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2661,6 +4160,30 @@ func startAppRequestFromWire(w *startAppRequestWire) (*StartAppRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StartAppRequest) MarshalJSON() ([]byte, error) { + w, err := startAppRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StartAppRequest) UnmarshalJSON(data []byte) error { + var w startAppRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := startAppRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type stopAppRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2683,6 +4206,30 @@ func stopAppRequestFromWire(w *stopAppRequestWire) (*StopAppRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StopAppRequest) MarshalJSON() ([]byte, error) { + w, err := stopAppRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StopAppRequest) UnmarshalJSON(data []byte) error { + var w stopAppRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := stopAppRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type telemetryExportDestinationWire struct { UnityCatalog *unityCatalogWire `json:"unity_catalog,omitempty"` } @@ -2735,6 +4282,30 @@ func telemetryExportDestinationFromWire(w *telemetryExportDestinationWire) (*Tel }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TelemetryExportDestination) MarshalJSON() ([]byte, error) { + w, err := telemetryExportDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TelemetryExportDestination) UnmarshalJSON(data []byte) error { + var w telemetryExportDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := telemetryExportDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type unityCatalogWire struct { LogsTable *string `json:"logs_table,omitempty"` MetricsTable *string `json:"metrics_table,omitempty"` @@ -2763,6 +4334,30 @@ func unityCatalogFromWire(w *unityCatalogWire) (*UnityCatalog, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UnityCatalog) MarshalJSON() ([]byte, error) { + w, err := unityCatalogToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UnityCatalog) UnmarshalJSON(data []byte) error { + var w unityCatalogWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := unityCatalogFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateAppRequestWire struct { App *appWire `json:"app,omitempty"` } @@ -2793,6 +4388,30 @@ func updateAppRequestFromWire(w *updateAppRequestWire) (*UpdateAppRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateAppRequest) MarshalJSON() ([]byte, error) { + w, err := updateAppRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateAppRequest) UnmarshalJSON(data []byte) error { + var w updateAppRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateAppRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateAppThumbnailRequestWire struct { Name *string `json:"name,omitempty"` AppThumbnail *appThumbnailWire `json:"app_thumbnail,omitempty"` @@ -2826,6 +4445,30 @@ func updateAppThumbnailRequestFromWire(w *updateAppThumbnailRequestWire) (*Updat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateAppThumbnailRequest) MarshalJSON() ([]byte, error) { + w, err := updateAppThumbnailRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateAppThumbnailRequest) UnmarshalJSON(data []byte) error { + var w updateAppThumbnailRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateAppThumbnailRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCustomTemplateRequestWire struct { Template *customTemplateWire `json:"template,omitempty"` } @@ -2856,6 +4499,30 @@ func updateCustomTemplateRequestFromWire(w *updateCustomTemplateRequestWire) (*U }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCustomTemplateRequest) MarshalJSON() ([]byte, error) { + w, err := updateCustomTemplateRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCustomTemplateRequest) UnmarshalJSON(data []byte) error { + var w updateCustomTemplateRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCustomTemplateRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateSpaceRequestWire struct { Space *spaceWire `json:"space,omitempty"` UpdateMask *types.FieldMask[Space] `json:"update_mask,omitempty"` @@ -2889,6 +4556,30 @@ func updateSpaceRequestFromWire(w *updateSpaceRequestWire) (*UpdateSpaceRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateSpaceRequest) MarshalJSON() ([]byte, error) { + w, err := updateSpaceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateSpaceRequest) UnmarshalJSON(data []byte) error { + var w updateSpaceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateSpaceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/authentication/CHANGELOG.md b/authentication/CHANGELOG.md index eea06760..6e1d0dc4 100644 --- a/authentication/CHANGELOG.md +++ b/authentication/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/authentication/internal/version.go b/authentication/internal/version.go index 71a474e4..181ee2a9 100644 --- a/authentication/internal/version.go +++ b/authentication/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-authentication" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/authentication/v1/wire.go b/authentication/v1/wire.go index 525603f4..37f6c968 100644 --- a/authentication/v1/wire.go +++ b/authentication/v1/wire.go @@ -101,6 +101,30 @@ func createAccountFederationPolicyRequestFromWire(w *createAccountFederationPoli }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAccountFederationPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := createAccountFederationPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAccountFederationPolicyRequest) UnmarshalJSON(data []byte) error { + var w createAccountFederationPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAccountFederationPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createServicePrincipalFederationPolicyRequestWire struct { AccountId *string `json:"account_id,omitempty"` ServicePrincipalId *wireInt64 `json:"service_principal_id,omitempty"` @@ -148,6 +172,30 @@ func createServicePrincipalFederationPolicyRequestFromWire(w *createServicePrinc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateServicePrincipalFederationPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := createServicePrincipalFederationPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateServicePrincipalFederationPolicyRequest) UnmarshalJSON(data []byte) error { + var w createServicePrincipalFederationPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createServicePrincipalFederationPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createServicePrincipalSecretRequestWire struct { AccountId *string `json:"account_id,omitempty"` ServicePrincipal *string `json:"service_principal,omitempty"` @@ -179,6 +227,30 @@ func createServicePrincipalSecretRequestFromWire(w *createServicePrincipalSecret }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateServicePrincipalSecretRequest) MarshalJSON() ([]byte, error) { + w, err := createServicePrincipalSecretRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateServicePrincipalSecretRequest) UnmarshalJSON(data []byte) error { + var w createServicePrincipalSecretRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createServicePrincipalSecretRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createServicePrincipalSecretResponseWire struct { Id *string `json:"id,omitempty"` Secret *string `json:"secret,omitempty"` @@ -222,6 +294,30 @@ func createServicePrincipalSecretResponseFromWire(w *createServicePrincipalSecre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateServicePrincipalSecretResponse) MarshalJSON() ([]byte, error) { + w, err := createServicePrincipalSecretResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateServicePrincipalSecretResponse) UnmarshalJSON(data []byte) error { + var w createServicePrincipalSecretResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createServicePrincipalSecretResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteAccountFederationPolicyRequestWire struct { AccountId *string `json:"account_id,omitempty"` ServicePrincipalId *wireInt64 `json:"service_principal_id,omitempty"` @@ -258,6 +354,30 @@ func deleteAccountFederationPolicyRequestFromWire(w *deleteAccountFederationPoli }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteAccountFederationPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := deleteAccountFederationPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteAccountFederationPolicyRequest) UnmarshalJSON(data []byte) error { + var w deleteAccountFederationPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteAccountFederationPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteServicePrincipalFederationPolicyRequestWire struct { AccountId *string `json:"account_id,omitempty"` ServicePrincipalId *wireInt64 `json:"service_principal_id,omitempty"` @@ -294,6 +414,30 @@ func deleteServicePrincipalFederationPolicyRequestFromWire(w *deleteServicePrinc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteServicePrincipalFederationPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := deleteServicePrincipalFederationPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteServicePrincipalFederationPolicyRequest) UnmarshalJSON(data []byte) error { + var w deleteServicePrincipalFederationPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteServicePrincipalFederationPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteServicePrincipalSecretRequestWire struct { AccountId *string `json:"account_id,omitempty"` ServicePrincipal *string `json:"service_principal,omitempty"` @@ -322,6 +466,30 @@ func deleteServicePrincipalSecretRequestFromWire(w *deleteServicePrincipalSecret }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteServicePrincipalSecretRequest) MarshalJSON() ([]byte, error) { + w, err := deleteServicePrincipalSecretRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteServicePrincipalSecretRequest) UnmarshalJSON(data []byte) error { + var w deleteServicePrincipalSecretRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteServicePrincipalSecretRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteServicePrincipalSecretResponseWire struct { } @@ -339,6 +507,30 @@ func deleteServicePrincipalSecretResponseFromWire(w *deleteServicePrincipalSecre return &DeleteServicePrincipalSecretResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteServicePrincipalSecretResponse) MarshalJSON() ([]byte, error) { + w, err := deleteServicePrincipalSecretResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteServicePrincipalSecretResponse) UnmarshalJSON(data []byte) error { + var w deleteServicePrincipalSecretResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteServicePrincipalSecretResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type federationPolicyWire struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` @@ -420,6 +612,30 @@ func federationPolicyFromWire(w *federationPolicyWire) (*FederationPolicy, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FederationPolicy) MarshalJSON() ([]byte, error) { + w, err := federationPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FederationPolicy) UnmarshalJSON(data []byte) error { + var w federationPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := federationPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAccountFederationPolicyRequestWire struct { AccountId *string `json:"account_id,omitempty"` ServicePrincipalId *wireInt64 `json:"service_principal_id,omitempty"` @@ -456,6 +672,30 @@ func getAccountFederationPolicyRequestFromWire(w *getAccountFederationPolicyRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAccountFederationPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := getAccountFederationPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAccountFederationPolicyRequest) UnmarshalJSON(data []byte) error { + var w getAccountFederationPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAccountFederationPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getServicePrincipalFederationPolicyRequestWire struct { AccountId *string `json:"account_id,omitempty"` ServicePrincipalId *wireInt64 `json:"service_principal_id,omitempty"` @@ -492,6 +732,30 @@ func getServicePrincipalFederationPolicyRequestFromWire(w *getServicePrincipalFe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetServicePrincipalFederationPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := getServicePrincipalFederationPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetServicePrincipalFederationPolicyRequest) UnmarshalJSON(data []byte) error { + var w getServicePrincipalFederationPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getServicePrincipalFederationPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAccountFederationPoliciesRequestWire struct { AccountId *string `json:"account_id,omitempty"` ServicePrincipalId *wireInt64 `json:"service_principal_id,omitempty"` @@ -531,6 +795,30 @@ func listAccountFederationPoliciesRequestFromWire(w *listAccountFederationPolici }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAccountFederationPoliciesRequest) MarshalJSON() ([]byte, error) { + w, err := listAccountFederationPoliciesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAccountFederationPoliciesRequest) UnmarshalJSON(data []byte) error { + var w listAccountFederationPoliciesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAccountFederationPoliciesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listFederationPoliciesResponseWire struct { Policies []federationPolicyWire `json:"policies,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -564,6 +852,30 @@ func listFederationPoliciesResponseFromWire(w *listFederationPoliciesResponseWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListFederationPoliciesResponse) MarshalJSON() ([]byte, error) { + w, err := listFederationPoliciesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListFederationPoliciesResponse) UnmarshalJSON(data []byte) error { + var w listFederationPoliciesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listFederationPoliciesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listServicePrincipalFederationPoliciesRequestWire struct { AccountId *string `json:"account_id,omitempty"` ServicePrincipalId *wireInt64 `json:"service_principal_id,omitempty"` @@ -603,6 +915,30 @@ func listServicePrincipalFederationPoliciesRequestFromWire(w *listServicePrincip }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListServicePrincipalFederationPoliciesRequest) MarshalJSON() ([]byte, error) { + w, err := listServicePrincipalFederationPoliciesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListServicePrincipalFederationPoliciesRequest) UnmarshalJSON(data []byte) error { + var w listServicePrincipalFederationPoliciesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listServicePrincipalFederationPoliciesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listServicePrincipalSecretsRequestWire struct { AccountId *string `json:"account_id,omitempty"` ServicePrincipal *string `json:"service_principal,omitempty"` @@ -634,6 +970,30 @@ func listServicePrincipalSecretsRequestFromWire(w *listServicePrincipalSecretsRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListServicePrincipalSecretsRequest) MarshalJSON() ([]byte, error) { + w, err := listServicePrincipalSecretsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListServicePrincipalSecretsRequest) UnmarshalJSON(data []byte) error { + var w listServicePrincipalSecretsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listServicePrincipalSecretsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listServicePrincipalSecretsResponseWire struct { Secrets []servicePrincipalSecretWire `json:"secrets,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -667,6 +1027,30 @@ func listServicePrincipalSecretsResponseFromWire(w *listServicePrincipalSecretsR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListServicePrincipalSecretsResponse) MarshalJSON() ([]byte, error) { + w, err := listServicePrincipalSecretsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListServicePrincipalSecretsResponse) UnmarshalJSON(data []byte) error { + var w listServicePrincipalSecretsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listServicePrincipalSecretsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type oidcFederationPolicyWire struct { Issuer *string `json:"issuer,omitempty"` Subject *string `json:"subject,omitempty"` @@ -704,6 +1088,30 @@ func oidcFederationPolicyFromWire(w *oidcFederationPolicyWire) (*OidcFederationP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OidcFederationPolicy) MarshalJSON() ([]byte, error) { + w, err := oidcFederationPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OidcFederationPolicy) UnmarshalJSON(data []byte) error { + var w oidcFederationPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := oidcFederationPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type servicePrincipalSecretWire struct { Id *string `json:"id,omitempty"` Secret *string `json:"secret,omitempty"` @@ -747,6 +1155,30 @@ func servicePrincipalSecretFromWire(w *servicePrincipalSecretWire) (*ServicePrin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ServicePrincipalSecret) MarshalJSON() ([]byte, error) { + w, err := servicePrincipalSecretToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ServicePrincipalSecret) UnmarshalJSON(data []byte) error { + var w servicePrincipalSecretWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := servicePrincipalSecretFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateAccountFederationPolicyRequestWire struct { AccountId *string `json:"account_id,omitempty"` ServicePrincipalId *wireInt64 `json:"service_principal_id,omitempty"` @@ -797,6 +1229,30 @@ func updateAccountFederationPolicyRequestFromWire(w *updateAccountFederationPoli }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateAccountFederationPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := updateAccountFederationPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateAccountFederationPolicyRequest) UnmarshalJSON(data []byte) error { + var w updateAccountFederationPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateAccountFederationPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateServicePrincipalFederationPolicyRequestWire struct { AccountId *string `json:"account_id,omitempty"` ServicePrincipalId *wireInt64 `json:"service_principal_id,omitempty"` @@ -847,6 +1303,30 @@ func updateServicePrincipalFederationPolicyRequestFromWire(w *updateServicePrinc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateServicePrincipalFederationPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := updateServicePrincipalFederationPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateServicePrincipalFederationPolicyRequest) UnmarshalJSON(data []byte) error { + var w updateServicePrincipalFederationPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateServicePrincipalFederationPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/budgetpolicy/CHANGELOG.md b/budgetpolicy/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/budgetpolicy/CHANGELOG.md +++ b/budgetpolicy/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/budgetpolicy/internal/version.go b/budgetpolicy/internal/version.go index 4cde713c..543f0f96 100644 --- a/budgetpolicy/internal/version.go +++ b/budgetpolicy/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-budgetpolicy" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/budgetpolicy/v1/wire.go b/budgetpolicy/v1/wire.go index c872953c..a6d1f23a 100644 --- a/budgetpolicy/v1/wire.go +++ b/budgetpolicy/v1/wire.go @@ -99,6 +99,30 @@ func budgetPolicyFromWire(w *budgetPolicyWire) (*BudgetPolicy, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BudgetPolicy) MarshalJSON() ([]byte, error) { + w, err := budgetPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BudgetPolicy) UnmarshalJSON(data []byte) error { + var w budgetPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := budgetPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createBudgetPolicyRequestWire struct { RequestId *string `json:"request_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -135,6 +159,30 @@ func createBudgetPolicyRequestFromWire(w *createBudgetPolicyRequestWire) (*Creat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateBudgetPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := createBudgetPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateBudgetPolicyRequest) UnmarshalJSON(data []byte) error { + var w createBudgetPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createBudgetPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type customPolicyTagWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -160,6 +208,30 @@ func customPolicyTagFromWire(w *customPolicyTagWire) (*CustomPolicyTag, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CustomPolicyTag) MarshalJSON() ([]byte, error) { + w, err := customPolicyTagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CustomPolicyTag) UnmarshalJSON(data []byte) error { + var w customPolicyTagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := customPolicyTagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteBudgetPolicyRequestWire struct { PolicyId *string `json:"policy_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -185,6 +257,30 @@ func deleteBudgetPolicyRequestFromWire(w *deleteBudgetPolicyRequestWire) (*Delet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteBudgetPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := deleteBudgetPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteBudgetPolicyRequest) UnmarshalJSON(data []byte) error { + var w deleteBudgetPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteBudgetPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type filterWire struct { PolicyName *string `json:"policy_name,omitempty"` CreatorUserId *wireInt64 `json:"creator_user_id,omitempty"` @@ -221,6 +317,30 @@ func filterFromWire(w *filterWire) (*Filter, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Filter) MarshalJSON() ([]byte, error) { + w, err := filterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Filter) UnmarshalJSON(data []byte) error { + var w filterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := filterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getBudgetPolicyRequestWire struct { PolicyId *string `json:"policy_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -246,6 +366,30 @@ func getBudgetPolicyRequestFromWire(w *getBudgetPolicyRequestWire) (*GetBudgetPo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetBudgetPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := getBudgetPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetBudgetPolicyRequest) UnmarshalJSON(data []byte) error { + var w getBudgetPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getBudgetPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type limitConfigWire struct { } @@ -263,6 +407,30 @@ func limitConfigFromWire(w *limitConfigWire) (*LimitConfig, error) { return &LimitConfig{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LimitConfig) MarshalJSON() ([]byte, error) { + w, err := limitConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LimitConfig) UnmarshalJSON(data []byte) error { + var w limitConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := limitConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listBudgetPoliciesRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -313,6 +481,30 @@ func listBudgetPoliciesRequestFromWire(w *listBudgetPoliciesRequestWire) (*ListB }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListBudgetPoliciesRequest) MarshalJSON() ([]byte, error) { + w, err := listBudgetPoliciesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListBudgetPoliciesRequest) UnmarshalJSON(data []byte) error { + var w listBudgetPoliciesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listBudgetPoliciesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listBudgetPoliciesResponseWire struct { Policies []budgetPolicyWire `json:"policies,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -349,6 +541,30 @@ func listBudgetPoliciesResponseFromWire(w *listBudgetPoliciesResponseWire) (*Lis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListBudgetPoliciesResponse) MarshalJSON() ([]byte, error) { + w, err := listBudgetPoliciesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListBudgetPoliciesResponse) UnmarshalJSON(data []byte) error { + var w listBudgetPoliciesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listBudgetPoliciesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sortSpecWire struct { Field SortSpec_Field `json:"field,omitempty"` Descending *bool `json:"descending,omitempty"` @@ -374,6 +590,30 @@ func sortSpecFromWire(w *sortSpecWire) (*SortSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SortSpec) MarshalJSON() ([]byte, error) { + w, err := sortSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SortSpec) UnmarshalJSON(data []byte) error { + var w sortSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sortSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateBudgetPolicyRequestWire struct { Policy *budgetPolicyWire `json:"policy,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -418,6 +658,30 @@ func updateBudgetPolicyRequestFromWire(w *updateBudgetPolicyRequestWire) (*Updat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateBudgetPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := updateBudgetPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateBudgetPolicyRequest) UnmarshalJSON(data []byte) error { + var w updateBudgetPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateBudgetPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/budgets/CHANGELOG.md b/budgets/CHANGELOG.md index c9a5548d..caed3e9b 100644 --- a/budgets/CHANGELOG.md +++ b/budgets/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.10.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.9.0 (2026-11-11) ## Release v0.8.0 (2026-11-10) diff --git a/budgets/internal/version.go b/budgets/internal/version.go index e16eab1f..1b55991b 100644 --- a/budgets/internal/version.go +++ b/budgets/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-budgets" -const Version = "0.9.0" +const Version = "0.10.0" diff --git a/budgets/v1/wire.go b/budgets/v1/wire.go index e965726a..808c19eb 100644 --- a/budgets/v1/wire.go +++ b/budgets/v1/wire.go @@ -80,6 +80,30 @@ func actionConfigurationFromWire(w *actionConfigurationWire) (*ActionConfigurati }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ActionConfiguration) MarshalJSON() ([]byte, error) { + w, err := actionConfigurationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ActionConfiguration) UnmarshalJSON(data []byte) error { + var w actionConfigurationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := actionConfigurationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertConfigurationWire struct { AlertConfigurationId *string `json:"alert_configuration_id,omitempty"` TimePeriod AlertConfigurationTimePeriod `json:"time_period,omitempty"` @@ -139,6 +163,30 @@ func alertConfigurationFromWire(w *alertConfigurationWire) (*AlertConfiguration, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertConfiguration) MarshalJSON() ([]byte, error) { + w, err := alertConfigurationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertConfiguration) UnmarshalJSON(data []byte) error { + var w alertConfigurationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertConfigurationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertSpendStatusWire struct { ScopeType AlertConfigurationScopeType `json:"scope_type,omitempty"` TimePeriod AlertConfigurationTimePeriod `json:"time_period,omitempty"` @@ -173,6 +221,30 @@ func alertSpendStatusFromWire(w *alertSpendStatusWire) (*AlertSpendStatus, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertSpendStatus) MarshalJSON() ([]byte, error) { + w, err := alertSpendStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertSpendStatus) UnmarshalJSON(data []byte) error { + var w alertSpendStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertSpendStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type budgetConfigurationWire struct { BudgetConfigurationId *string `json:"budget_configuration_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -251,6 +323,30 @@ func budgetConfigurationFromWire(w *budgetConfigurationWire) (*BudgetConfigurati }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BudgetConfiguration) MarshalJSON() ([]byte, error) { + w, err := budgetConfigurationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BudgetConfiguration) UnmarshalJSON(data []byte) error { + var w budgetConfigurationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := budgetConfigurationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type budgetConfigurationFilterWire struct { WorkspaceId *budgetConfigurationFilter_WorkspaceIdClauseWire `json:"workspace_id,omitempty"` Tags []budgetConfigurationFilter_TagClauseWire `json:"tags,omitempty"` @@ -292,6 +388,30 @@ func budgetConfigurationFilterFromWire(w *budgetConfigurationFilterWire) (*Budge }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BudgetConfigurationFilter) MarshalJSON() ([]byte, error) { + w, err := budgetConfigurationFilterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BudgetConfigurationFilter) UnmarshalJSON(data []byte) error { + var w budgetConfigurationFilterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := budgetConfigurationFilterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type budgetConfigurationFilter_ClauseWire struct { Operator BudgetConfigurationFilter_Operator `json:"operator,omitempty"` Values []string `json:"values,omitempty"` @@ -317,6 +437,30 @@ func budgetConfigurationFilter_ClauseFromWire(w *budgetConfigurationFilter_Claus }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BudgetConfigurationFilter_Clause) MarshalJSON() ([]byte, error) { + w, err := budgetConfigurationFilter_ClauseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BudgetConfigurationFilter_Clause) UnmarshalJSON(data []byte) error { + var w budgetConfigurationFilter_ClauseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := budgetConfigurationFilter_ClauseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type budgetConfigurationFilter_TagClauseWire struct { Key *string `json:"key,omitempty"` Value *budgetConfigurationFilter_ClauseWire `json:"value,omitempty"` @@ -350,6 +494,30 @@ func budgetConfigurationFilter_TagClauseFromWire(w *budgetConfigurationFilter_Ta }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BudgetConfigurationFilter_TagClause) MarshalJSON() ([]byte, error) { + w, err := budgetConfigurationFilter_TagClauseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BudgetConfigurationFilter_TagClause) UnmarshalJSON(data []byte) error { + var w budgetConfigurationFilter_TagClauseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := budgetConfigurationFilter_TagClauseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type budgetConfigurationFilter_WorkspaceIdClauseWire struct { Operator BudgetConfigurationFilter_Operator `json:"operator,omitempty"` Values []wireInt64 `json:"values,omitempty"` @@ -383,6 +551,30 @@ func budgetConfigurationFilter_WorkspaceIdClauseFromWire(w *budgetConfigurationF }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BudgetConfigurationFilter_WorkspaceIdClause) MarshalJSON() ([]byte, error) { + w, err := budgetConfigurationFilter_WorkspaceIdClauseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BudgetConfigurationFilter_WorkspaceIdClause) UnmarshalJSON(data []byte) error { + var w budgetConfigurationFilter_WorkspaceIdClauseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := budgetConfigurationFilter_WorkspaceIdClauseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type budgetSpendStatusWire struct { Name *string `json:"name,omitempty"` AlertSpendStatuses []alertSpendStatusWire `json:"alert_spend_statuses,omitempty"` @@ -416,6 +608,30 @@ func budgetSpendStatusFromWire(w *budgetSpendStatusWire) (*BudgetSpendStatus, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BudgetSpendStatus) MarshalJSON() ([]byte, error) { + w, err := budgetSpendStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BudgetSpendStatus) UnmarshalJSON(data []byte) error { + var w budgetSpendStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := budgetSpendStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createBudgetConfigurationBudgetWire struct { AccountId *string `json:"account_id,omitempty"` AlertConfigurations []createBudgetConfigurationBudgetAlertConfigurationsWire `json:"alert_configurations,omitempty"` @@ -469,6 +685,30 @@ func createBudgetConfigurationBudgetFromWire(w *createBudgetConfigurationBudgetW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateBudgetConfigurationBudget) MarshalJSON() ([]byte, error) { + w, err := createBudgetConfigurationBudgetToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateBudgetConfigurationBudget) UnmarshalJSON(data []byte) error { + var w createBudgetConfigurationBudgetWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createBudgetConfigurationBudgetFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createBudgetConfigurationBudgetActionConfigurationsWire struct { ActionType ActionConfigurationType `json:"action_type,omitempty"` Target *string `json:"target,omitempty"` @@ -494,6 +734,30 @@ func createBudgetConfigurationBudgetActionConfigurationsFromWire(w *createBudget }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateBudgetConfigurationBudgetActionConfigurations) MarshalJSON() ([]byte, error) { + w, err := createBudgetConfigurationBudgetActionConfigurationsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateBudgetConfigurationBudgetActionConfigurations) UnmarshalJSON(data []byte) error { + var w createBudgetConfigurationBudgetActionConfigurationsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createBudgetConfigurationBudgetActionConfigurationsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createBudgetConfigurationBudgetAlertConfigurationsWire struct { TimePeriod AlertConfigurationTimePeriod `json:"time_period,omitempty"` TriggerType AlertConfigurationTriggerType `json:"trigger_type,omitempty"` @@ -550,6 +814,30 @@ func createBudgetConfigurationBudgetAlertConfigurationsFromWire(w *createBudgetC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateBudgetConfigurationBudgetAlertConfigurations) MarshalJSON() ([]byte, error) { + w, err := createBudgetConfigurationBudgetAlertConfigurationsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateBudgetConfigurationBudgetAlertConfigurations) UnmarshalJSON(data []byte) error { + var w createBudgetConfigurationBudgetAlertConfigurationsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createBudgetConfigurationBudgetAlertConfigurationsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createBudgetConfigurationRequestWire struct { Budget *createBudgetConfigurationBudgetWire `json:"budget,omitempty"` } @@ -580,6 +868,30 @@ func createBudgetConfigurationRequestFromWire(w *createBudgetConfigurationReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateBudgetConfigurationRequest) MarshalJSON() ([]byte, error) { + w, err := createBudgetConfigurationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateBudgetConfigurationRequest) UnmarshalJSON(data []byte) error { + var w createBudgetConfigurationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createBudgetConfigurationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createBudgetConfigurationResponseWire struct { Budget *budgetConfigurationWire `json:"budget,omitempty"` } @@ -610,6 +922,30 @@ func createBudgetConfigurationResponseFromWire(w *createBudgetConfigurationRespo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateBudgetConfigurationResponse) MarshalJSON() ([]byte, error) { + w, err := createBudgetConfigurationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateBudgetConfigurationResponse) UnmarshalJSON(data []byte) error { + var w createBudgetConfigurationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createBudgetConfigurationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteBudgetConfigurationRequestWire struct { BudgetId *string `json:"budget_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -635,6 +971,30 @@ func deleteBudgetConfigurationRequestFromWire(w *deleteBudgetConfigurationReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteBudgetConfigurationRequest) MarshalJSON() ([]byte, error) { + w, err := deleteBudgetConfigurationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteBudgetConfigurationRequest) UnmarshalJSON(data []byte) error { + var w deleteBudgetConfigurationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteBudgetConfigurationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteBudgetConfigurationResponseWire struct { } @@ -652,6 +1012,30 @@ func deleteBudgetConfigurationResponseFromWire(w *deleteBudgetConfigurationRespo return &DeleteBudgetConfigurationResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteBudgetConfigurationResponse) MarshalJSON() ([]byte, error) { + w, err := deleteBudgetConfigurationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteBudgetConfigurationResponse) UnmarshalJSON(data []byte) error { + var w deleteBudgetConfigurationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteBudgetConfigurationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getBudgetConfigurationRequestWire struct { BudgetId *string `json:"budget_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -677,6 +1061,30 @@ func getBudgetConfigurationRequestFromWire(w *getBudgetConfigurationRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetBudgetConfigurationRequest) MarshalJSON() ([]byte, error) { + w, err := getBudgetConfigurationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetBudgetConfigurationRequest) UnmarshalJSON(data []byte) error { + var w getBudgetConfigurationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getBudgetConfigurationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getBudgetConfigurationResponseWire struct { Budget *budgetConfigurationWire `json:"budget,omitempty"` } @@ -707,6 +1115,30 @@ func getBudgetConfigurationResponseFromWire(w *getBudgetConfigurationResponseWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetBudgetConfigurationResponse) MarshalJSON() ([]byte, error) { + w, err := getBudgetConfigurationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetBudgetConfigurationResponse) UnmarshalJSON(data []byte) error { + var w getBudgetConfigurationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getBudgetConfigurationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getBudgetSpendStatusRequestWire struct { Name *string `json:"name,omitempty"` } @@ -729,6 +1161,30 @@ func getBudgetSpendStatusRequestFromWire(w *getBudgetSpendStatusRequestWire) (*G }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetBudgetSpendStatusRequest) MarshalJSON() ([]byte, error) { + w, err := getBudgetSpendStatusRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetBudgetSpendStatusRequest) UnmarshalJSON(data []byte) error { + var w getBudgetSpendStatusRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getBudgetSpendStatusRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listBudgetConfigurationsRequestWire struct { AccountId *string `json:"account_id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -754,6 +1210,30 @@ func listBudgetConfigurationsRequestFromWire(w *listBudgetConfigurationsRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListBudgetConfigurationsRequest) MarshalJSON() ([]byte, error) { + w, err := listBudgetConfigurationsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListBudgetConfigurationsRequest) UnmarshalJSON(data []byte) error { + var w listBudgetConfigurationsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listBudgetConfigurationsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listBudgetConfigurationsResponseWire struct { Budgets []budgetConfigurationWire `json:"budgets,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -787,6 +1267,30 @@ func listBudgetConfigurationsResponseFromWire(w *listBudgetConfigurationsRespons }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListBudgetConfigurationsResponse) MarshalJSON() ([]byte, error) { + w, err := listBudgetConfigurationsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListBudgetConfigurationsResponse) UnmarshalJSON(data []byte) error { + var w listBudgetConfigurationsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listBudgetConfigurationsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listBudgetSpendStatusesRequestWire struct { Parent *string `json:"parent,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -818,6 +1322,30 @@ func listBudgetSpendStatusesRequestFromWire(w *listBudgetSpendStatusesRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListBudgetSpendStatusesRequest) MarshalJSON() ([]byte, error) { + w, err := listBudgetSpendStatusesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListBudgetSpendStatusesRequest) UnmarshalJSON(data []byte) error { + var w listBudgetSpendStatusesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listBudgetSpendStatusesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listBudgetSpendStatusesResponseWire struct { BudgetSpendStatuses []budgetSpendStatusWire `json:"budget_spend_statuses,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -851,6 +1379,30 @@ func listBudgetSpendStatusesResponseFromWire(w *listBudgetSpendStatusesResponseW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListBudgetSpendStatusesResponse) MarshalJSON() ([]byte, error) { + w, err := listBudgetSpendStatusesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListBudgetSpendStatusesResponse) UnmarshalJSON(data []byte) error { + var w listBudgetSpendStatusesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listBudgetSpendStatusesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type principalOverrideWire struct { PrincipalId *wireInt64 `json:"principal_id,omitempty"` OverrideThreshold *string `json:"override_threshold,omitempty"` @@ -884,6 +1436,30 @@ func principalOverrideFromWire(w *principalOverrideWire) (*PrincipalOverride, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PrincipalOverride) MarshalJSON() ([]byte, error) { + w, err := principalOverrideToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PrincipalOverride) UnmarshalJSON(data []byte) error { + var w principalOverrideWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := principalOverrideFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateBudgetConfigurationBudgetWire struct { BudgetConfigurationId *string `json:"budget_configuration_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -940,6 +1516,30 @@ func updateBudgetConfigurationBudgetFromWire(w *updateBudgetConfigurationBudgetW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateBudgetConfigurationBudget) MarshalJSON() ([]byte, error) { + w, err := updateBudgetConfigurationBudgetToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateBudgetConfigurationBudget) UnmarshalJSON(data []byte) error { + var w updateBudgetConfigurationBudgetWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateBudgetConfigurationBudgetFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateBudgetConfigurationRequestWire struct { BudgetId *string `json:"budget_id,omitempty"` Budget *updateBudgetConfigurationBudgetWire `json:"budget,omitempty"` @@ -973,6 +1573,30 @@ func updateBudgetConfigurationRequestFromWire(w *updateBudgetConfigurationReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateBudgetConfigurationRequest) MarshalJSON() ([]byte, error) { + w, err := updateBudgetConfigurationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateBudgetConfigurationRequest) UnmarshalJSON(data []byte) error { + var w updateBudgetConfigurationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateBudgetConfigurationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateBudgetConfigurationResponseWire struct { Budget *budgetConfigurationWire `json:"budget,omitempty"` } @@ -1003,6 +1627,30 @@ func updateBudgetConfigurationResponseFromWire(w *updateBudgetConfigurationRespo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateBudgetConfigurationResponse) MarshalJSON() ([]byte, error) { + w, err := updateBudgetConfigurationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateBudgetConfigurationResponse) UnmarshalJSON(data []byte) error { + var w updateBudgetConfigurationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateBudgetConfigurationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/cleanrooms/CHANGELOG.md b/cleanrooms/CHANGELOG.md index 4fe51ecc..f9c81d37 100644 --- a/cleanrooms/CHANGELOG.md +++ b/cleanrooms/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/cleanrooms/internal/version.go b/cleanrooms/internal/version.go index 1c18522e..25adf621 100644 --- a/cleanrooms/internal/version.go +++ b/cleanrooms/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-cleanrooms" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/cleanrooms/v1/wire.go b/cleanrooms/v1/wire.go index ce7bc2bf..d5312c42 100644 --- a/cleanrooms/v1/wire.go +++ b/cleanrooms/v1/wire.go @@ -136,6 +136,30 @@ func cleanRoomFromWire(w *cleanRoomWire) (*CleanRoom, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoom) MarshalJSON() ([]byte, error) { + w, err := cleanRoomToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoom) UnmarshalJSON(data []byte) error { + var w cleanRoomWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoom_StatusWire struct { } @@ -153,6 +177,30 @@ func cleanRoom_StatusFromWire(w *cleanRoom_StatusWire) (*CleanRoom_Status, error return &CleanRoom_Status{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoom_Status) MarshalJSON() ([]byte, error) { + w, err := cleanRoom_StatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoom_Status) UnmarshalJSON(data []byte) error { + var w cleanRoom_StatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoom_StatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomAssetWire struct { CleanRoomName *string `json:"clean_room_name,omitempty"` Name *string `json:"name,omitempty"` @@ -404,6 +452,30 @@ func cleanRoomAssetFromWire(w *cleanRoomAssetWire) (*CleanRoomAsset, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomAsset) MarshalJSON() ([]byte, error) { + w, err := cleanRoomAssetToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomAsset) UnmarshalJSON(data []byte) error { + var w cleanRoomAssetWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomAssetFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomAsset_ForeignTableWire struct { Columns []columnInfoWire `json:"columns,omitempty"` } @@ -434,6 +506,30 @@ func cleanRoomAsset_ForeignTableFromWire(w *cleanRoomAsset_ForeignTableWire) (*C }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomAsset_ForeignTable) MarshalJSON() ([]byte, error) { + w, err := cleanRoomAsset_ForeignTableToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomAsset_ForeignTable) UnmarshalJSON(data []byte) error { + var w cleanRoomAsset_ForeignTableWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomAsset_ForeignTableFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomAsset_ForeignTableLocalDetailsWire struct { LocalName *string `json:"local_name,omitempty"` } @@ -456,6 +552,30 @@ func cleanRoomAsset_ForeignTableLocalDetailsFromWire(w *cleanRoomAsset_ForeignTa }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomAsset_ForeignTableLocalDetails) MarshalJSON() ([]byte, error) { + w, err := cleanRoomAsset_ForeignTableLocalDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomAsset_ForeignTableLocalDetails) UnmarshalJSON(data []byte) error { + var w cleanRoomAsset_ForeignTableLocalDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomAsset_ForeignTableLocalDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomAsset_JarAnalysisWire struct { Etag *string `json:"etag,omitempty"` Description *string `json:"description,omitempty"` @@ -507,6 +627,30 @@ func cleanRoomAsset_JarAnalysisFromWire(w *cleanRoomAsset_JarAnalysisWire) (*Cle }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomAsset_JarAnalysis) MarshalJSON() ([]byte, error) { + w, err := cleanRoomAsset_JarAnalysisToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomAsset_JarAnalysis) UnmarshalJSON(data []byte) error { + var w cleanRoomAsset_JarAnalysisWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomAsset_JarAnalysisFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomAsset_NotebookWire struct { NotebookContent *string `json:"notebook_content,omitempty"` Etag *string `json:"etag,omitempty"` @@ -555,6 +699,30 @@ func cleanRoomAsset_NotebookFromWire(w *cleanRoomAsset_NotebookWire) (*CleanRoom }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomAsset_Notebook) MarshalJSON() ([]byte, error) { + w, err := cleanRoomAsset_NotebookToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomAsset_Notebook) UnmarshalJSON(data []byte) error { + var w cleanRoomAsset_NotebookWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomAsset_NotebookFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomAsset_StatusWire struct { } @@ -572,6 +740,30 @@ func cleanRoomAsset_StatusFromWire(w *cleanRoomAsset_StatusWire) (*CleanRoomAsse return &CleanRoomAsset_Status{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomAsset_Status) MarshalJSON() ([]byte, error) { + w, err := cleanRoomAsset_StatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomAsset_Status) UnmarshalJSON(data []byte) error { + var w cleanRoomAsset_StatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomAsset_StatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomAsset_TableWire struct { Columns []columnInfoWire `json:"columns,omitempty"` } @@ -602,6 +794,30 @@ func cleanRoomAsset_TableFromWire(w *cleanRoomAsset_TableWire) (*CleanRoomAsset_ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomAsset_Table) MarshalJSON() ([]byte, error) { + w, err := cleanRoomAsset_TableToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomAsset_Table) UnmarshalJSON(data []byte) error { + var w cleanRoomAsset_TableWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomAsset_TableFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomAsset_TableLocalDetailsWire struct { LocalName *string `json:"local_name,omitempty"` Partitions []partitionSpecification_PartitionWire `json:"partitions,omitempty"` @@ -635,6 +851,30 @@ func cleanRoomAsset_TableLocalDetailsFromWire(w *cleanRoomAsset_TableLocalDetail }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomAsset_TableLocalDetails) MarshalJSON() ([]byte, error) { + w, err := cleanRoomAsset_TableLocalDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomAsset_TableLocalDetails) UnmarshalJSON(data []byte) error { + var w cleanRoomAsset_TableLocalDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomAsset_TableLocalDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomAsset_ViewWire struct { Columns []columnInfoWire `json:"columns,omitempty"` } @@ -665,6 +905,30 @@ func cleanRoomAsset_ViewFromWire(w *cleanRoomAsset_ViewWire) (*CleanRoomAsset_Vi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomAsset_View) MarshalJSON() ([]byte, error) { + w, err := cleanRoomAsset_ViewToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomAsset_View) UnmarshalJSON(data []byte) error { + var w cleanRoomAsset_ViewWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomAsset_ViewFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomAsset_ViewLocalDetailsWire struct { LocalName *string `json:"local_name,omitempty"` } @@ -687,6 +951,30 @@ func cleanRoomAsset_ViewLocalDetailsFromWire(w *cleanRoomAsset_ViewLocalDetailsW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomAsset_ViewLocalDetails) MarshalJSON() ([]byte, error) { + w, err := cleanRoomAsset_ViewLocalDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomAsset_ViewLocalDetails) UnmarshalJSON(data []byte) error { + var w cleanRoomAsset_ViewLocalDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomAsset_ViewLocalDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomAsset_VolumeLocalDetailsWire struct { LocalName *string `json:"local_name,omitempty"` } @@ -709,6 +997,30 @@ func cleanRoomAsset_VolumeLocalDetailsFromWire(w *cleanRoomAsset_VolumeLocalDeta }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomAsset_VolumeLocalDetails) MarshalJSON() ([]byte, error) { + w, err := cleanRoomAsset_VolumeLocalDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomAsset_VolumeLocalDetails) UnmarshalJSON(data []byte) error { + var w cleanRoomAsset_VolumeLocalDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomAsset_VolumeLocalDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomAutoApprovalRuleWire struct { CleanRoomName *string `json:"clean_room_name,omitempty"` RuleId *string `json:"rule_id,omitempty"` @@ -810,6 +1122,30 @@ func cleanRoomAutoApprovalRuleFromWire(w *cleanRoomAutoApprovalRuleWire) (*Clean }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomAutoApprovalRule) MarshalJSON() ([]byte, error) { + w, err := cleanRoomAutoApprovalRuleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomAutoApprovalRule) UnmarshalJSON(data []byte) error { + var w cleanRoomAutoApprovalRuleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomAutoApprovalRuleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomCollaboratorWire struct { GlobalMetastoreId *string `json:"global_metastore_id,omitempty"` OrganizationName *string `json:"organization_name,omitempty"` @@ -855,6 +1191,30 @@ func cleanRoomCollaboratorFromWire(w *cleanRoomCollaboratorWire) (*CleanRoomColl }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomCollaborator) MarshalJSON() ([]byte, error) { + w, err := cleanRoomCollaboratorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomCollaborator) UnmarshalJSON(data []byte) error { + var w cleanRoomCollaboratorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomCollaboratorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomJarAnalysisReviewWire struct { ReviewerCollaboratorAlias *string `json:"reviewer_collaborator_alias,omitempty"` CreatedAtMillis *wireInt64 `json:"created_at_millis,omitempty"` @@ -897,6 +1257,30 @@ func cleanRoomJarAnalysisReviewFromWire(w *cleanRoomJarAnalysisReviewWire) (*Cle }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomJarAnalysisReview) MarshalJSON() ([]byte, error) { + w, err := cleanRoomJarAnalysisReviewToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomJarAnalysisReview) UnmarshalJSON(data []byte) error { + var w cleanRoomJarAnalysisReviewWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomJarAnalysisReviewFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomNotebookReviewWire struct { ReviewerCollaboratorAlias *string `json:"reviewer_collaborator_alias,omitempty"` CreatedAtMillis *wireInt64 `json:"created_at_millis,omitempty"` @@ -939,6 +1323,30 @@ func cleanRoomNotebookReviewFromWire(w *cleanRoomNotebookReviewWire) (*CleanRoom }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomNotebookReview) MarshalJSON() ([]byte, error) { + w, err := cleanRoomNotebookReviewToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomNotebookReview) UnmarshalJSON(data []byte) error { + var w cleanRoomNotebookReviewWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomNotebookReviewFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomNotebookTaskRunWire struct { NotebookName *string `json:"notebook_name,omitempty"` StartTime *wireInt64 `json:"start_time,omitempty"` @@ -1047,6 +1455,30 @@ func cleanRoomNotebookTaskRunFromWire(w *cleanRoomNotebookTaskRunWire) (*CleanRo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomNotebookTaskRun) MarshalJSON() ([]byte, error) { + w, err := cleanRoomNotebookTaskRunToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomNotebookTaskRun) UnmarshalJSON(data []byte) error { + var w cleanRoomNotebookTaskRunWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomNotebookTaskRunFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomOutputCatalogWire struct { Status CleanRoomOutputCatalog_OutputCatalogStatus `json:"status,omitempty"` CatalogName *string `json:"catalog_name,omitempty"` @@ -1072,6 +1504,30 @@ func cleanRoomOutputCatalogFromWire(w *cleanRoomOutputCatalogWire) (*CleanRoomOu }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomOutputCatalog) MarshalJSON() ([]byte, error) { + w, err := cleanRoomOutputCatalogToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomOutputCatalog) UnmarshalJSON(data []byte) error { + var w cleanRoomOutputCatalogWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomOutputCatalogFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomRemoteDetailWire struct { CentralCleanRoomId *string `json:"central_clean_room_id,omitempty"` CloudVendor *string `json:"cloud_vendor,omitempty"` @@ -1150,6 +1606,30 @@ func cleanRoomRemoteDetailFromWire(w *cleanRoomRemoteDetailWire) (*CleanRoomRemo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomRemoteDetail) MarshalJSON() ([]byte, error) { + w, err := cleanRoomRemoteDetailToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomRemoteDetail) UnmarshalJSON(data []byte) error { + var w cleanRoomRemoteDetailWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomRemoteDetailFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomTaskRunWire struct { Name *string `json:"name,omitempty"` TaskType CleanRoomTaskType `json:"task_type,omitempty"` @@ -1252,6 +1732,30 @@ func cleanRoomTaskRunFromWire(w *cleanRoomTaskRunWire) (*CleanRoomTaskRun, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomTaskRun) MarshalJSON() ([]byte, error) { + w, err := cleanRoomTaskRunToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomTaskRun) UnmarshalJSON(data []byte) error { + var w cleanRoomTaskRunWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomTaskRunFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomTaskRun_CleanRoomTaskAnalysisDetailsWire struct { Etag *string `json:"etag,omitempty"` UpdatedAt *wireInt64 `json:"updated_at,omitempty"` @@ -1285,10 +1789,34 @@ func cleanRoomTaskRun_CleanRoomTaskAnalysisDetailsFromWire(w *cleanRoomTaskRun_C }, nil } -type cleanRoomTaskRun_OutputInfoWire struct { - OutputSchemaName *string `json:"output_schema_name,omitempty"` - OutputSchemaExpirationTime *wireInt64 `json:"output_schema_expiration_time,omitempty"` -} +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomTaskRun_CleanRoomTaskAnalysisDetails) MarshalJSON() ([]byte, error) { + w, err := cleanRoomTaskRun_CleanRoomTaskAnalysisDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomTaskRun_CleanRoomTaskAnalysisDetails) UnmarshalJSON(data []byte) error { + var w cleanRoomTaskRun_CleanRoomTaskAnalysisDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomTaskRun_CleanRoomTaskAnalysisDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type cleanRoomTaskRun_OutputInfoWire struct { + OutputSchemaName *string `json:"output_schema_name,omitempty"` + OutputSchemaExpirationTime *wireInt64 `json:"output_schema_expiration_time,omitempty"` +} func cleanRoomTaskRun_OutputInfoToWire(v *CleanRoomTaskRun_OutputInfo) (*cleanRoomTaskRun_OutputInfoWire, error) { if v == nil { @@ -1318,6 +1846,30 @@ func cleanRoomTaskRun_OutputInfoFromWire(w *cleanRoomTaskRun_OutputInfoWire) (*C }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomTaskRun_OutputInfo) MarshalJSON() ([]byte, error) { + w, err := cleanRoomTaskRun_OutputInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomTaskRun_OutputInfo) UnmarshalJSON(data []byte) error { + var w cleanRoomTaskRun_OutputInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomTaskRun_OutputInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomTaskRunStateWire struct { LifeCycleState CleanRoomTaskRunLifeCycleState `json:"life_cycle_state,omitempty"` ResultState CleanRoomTaskRunResultState `json:"result_state,omitempty"` @@ -1343,6 +1895,30 @@ func cleanRoomTaskRunStateFromWire(w *cleanRoomTaskRunStateWire) (*CleanRoomTask }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomTaskRunState) MarshalJSON() ([]byte, error) { + w, err := cleanRoomTaskRunStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomTaskRunState) UnmarshalJSON(data []byte) error { + var w cleanRoomTaskRunStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomTaskRunStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type collaboratorJobRunInfoWire struct { CollaboratorJobId *wireInt64 `json:"collaborator_job_id,omitempty"` CollaboratorJobRunId *wireInt64 `json:"collaborator_job_run_id,omitempty"` @@ -1409,6 +1985,30 @@ func collaboratorJobRunInfoFromWire(w *collaboratorJobRunInfoWire) (*Collaborato }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CollaboratorJobRunInfo) MarshalJSON() ([]byte, error) { + w, err := collaboratorJobRunInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CollaboratorJobRunInfo) UnmarshalJSON(data []byte) error { + var w collaboratorJobRunInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := collaboratorJobRunInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type columnInfoWire struct { Name *string `json:"name,omitempty"` TypeText *string `json:"type_text,omitempty"` @@ -1472,6 +2072,30 @@ func columnInfoFromWire(w *columnInfoWire) (*ColumnInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ColumnInfo) MarshalJSON() ([]byte, error) { + w, err := columnInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ColumnInfo) UnmarshalJSON(data []byte) error { + var w columnInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := columnInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type columnMaskWire struct { FunctionName *string `json:"function_name,omitempty"` UsingColumnNames []string `json:"using_column_names,omitempty"` @@ -1508,6 +2132,30 @@ func columnMaskFromWire(w *columnMaskWire) (*ColumnMask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ColumnMask) MarshalJSON() ([]byte, error) { + w, err := columnMaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ColumnMask) UnmarshalJSON(data []byte) error { + var w columnMaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := columnMaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type complianceSecurityProfileWire struct { IsEnabled *bool `json:"is_enabled,omitempty"` ComplianceStandards []ComplianceStandard `json:"compliance_standards,omitempty"` @@ -1533,6 +2181,30 @@ func complianceSecurityProfileFromWire(w *complianceSecurityProfileWire) (*Compl }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ComplianceSecurityProfile) MarshalJSON() ([]byte, error) { + w, err := complianceSecurityProfileToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ComplianceSecurityProfile) UnmarshalJSON(data []byte) error { + var w complianceSecurityProfileWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := complianceSecurityProfileFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCleanRoomAssetRequestWire struct { Asset *cleanRoomAssetWire `json:"asset,omitempty"` } @@ -1563,6 +2235,30 @@ func createCleanRoomAssetRequestFromWire(w *createCleanRoomAssetRequestWire) (*C }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCleanRoomAssetRequest) MarshalJSON() ([]byte, error) { + w, err := createCleanRoomAssetRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCleanRoomAssetRequest) UnmarshalJSON(data []byte) error { + var w createCleanRoomAssetRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCleanRoomAssetRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCleanRoomAssetReviewRequestWire struct { CleanRoomName *string `json:"clean_room_name,omitempty"` Name *string `json:"name,omitempty"` @@ -1644,6 +2340,30 @@ func createCleanRoomAssetReviewRequestFromWire(w *createCleanRoomAssetReviewRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCleanRoomAssetReviewRequest) MarshalJSON() ([]byte, error) { + w, err := createCleanRoomAssetReviewRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCleanRoomAssetReviewRequest) UnmarshalJSON(data []byte) error { + var w createCleanRoomAssetReviewRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCleanRoomAssetReviewRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCleanRoomAssetReviewResponseWire struct { NotebookReviews []cleanRoomNotebookReviewWire `json:"notebook_reviews,omitempty"` JarAnalysisReviews []cleanRoomJarAnalysisReviewWire `json:"jar_analysis_reviews,omitempty"` @@ -1722,6 +2442,30 @@ func createCleanRoomAssetReviewResponseFromWire(w *createCleanRoomAssetReviewRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCleanRoomAssetReviewResponse) MarshalJSON() ([]byte, error) { + w, err := createCleanRoomAssetReviewResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCleanRoomAssetReviewResponse) UnmarshalJSON(data []byte) error { + var w createCleanRoomAssetReviewResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCleanRoomAssetReviewResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCleanRoomAutoApprovalRuleRequestWire struct { AutoApprovalRule *cleanRoomAutoApprovalRuleWire `json:"auto_approval_rule,omitempty"` } @@ -1752,6 +2496,30 @@ func createCleanRoomAutoApprovalRuleRequestFromWire(w *createCleanRoomAutoApprov }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCleanRoomAutoApprovalRuleRequest) MarshalJSON() ([]byte, error) { + w, err := createCleanRoomAutoApprovalRuleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCleanRoomAutoApprovalRuleRequest) UnmarshalJSON(data []byte) error { + var w createCleanRoomAutoApprovalRuleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCleanRoomAutoApprovalRuleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCleanRoomOutputCatalogRequestWire struct { CleanRoomName *string `json:"clean_room_name,omitempty"` OutputCatalog *cleanRoomOutputCatalogWire `json:"output_catalog,omitempty"` @@ -1785,6 +2553,30 @@ func createCleanRoomOutputCatalogRequestFromWire(w *createCleanRoomOutputCatalog }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCleanRoomOutputCatalogRequest) MarshalJSON() ([]byte, error) { + w, err := createCleanRoomOutputCatalogRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCleanRoomOutputCatalogRequest) UnmarshalJSON(data []byte) error { + var w createCleanRoomOutputCatalogRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCleanRoomOutputCatalogRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCleanRoomOutputCatalogResponseWire struct { OutputCatalog *cleanRoomOutputCatalogWire `json:"output_catalog,omitempty"` } @@ -1815,6 +2607,30 @@ func createCleanRoomOutputCatalogResponseFromWire(w *createCleanRoomOutputCatalo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCleanRoomOutputCatalogResponse) MarshalJSON() ([]byte, error) { + w, err := createCleanRoomOutputCatalogResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCleanRoomOutputCatalogResponse) UnmarshalJSON(data []byte) error { + var w createCleanRoomOutputCatalogResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCleanRoomOutputCatalogResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCleanRoomRequestWire struct { CleanRoom *cleanRoomWire `json:"clean_room,omitempty"` } @@ -1845,6 +2661,30 @@ func createCleanRoomRequestFromWire(w *createCleanRoomRequestWire) (*CreateClean }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCleanRoomRequest) MarshalJSON() ([]byte, error) { + w, err := createCleanRoomRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCleanRoomRequest) UnmarshalJSON(data []byte) error { + var w createCleanRoomRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCleanRoomRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCleanRoomAssetRequestWire struct { CleanRoomName *string `json:"clean_room_name,omitempty"` AssetType CleanRoomAsset_AssetType `json:"asset_type,omitempty"` @@ -1873,6 +2713,30 @@ func deleteCleanRoomAssetRequestFromWire(w *deleteCleanRoomAssetRequestWire) (*D }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCleanRoomAssetRequest) MarshalJSON() ([]byte, error) { + w, err := deleteCleanRoomAssetRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCleanRoomAssetRequest) UnmarshalJSON(data []byte) error { + var w deleteCleanRoomAssetRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCleanRoomAssetRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCleanRoomAssetResponseWire struct { } @@ -1890,6 +2754,30 @@ func deleteCleanRoomAssetResponseFromWire(w *deleteCleanRoomAssetResponseWire) ( return &DeleteCleanRoomAssetResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCleanRoomAssetResponse) MarshalJSON() ([]byte, error) { + w, err := deleteCleanRoomAssetResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCleanRoomAssetResponse) UnmarshalJSON(data []byte) error { + var w deleteCleanRoomAssetResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCleanRoomAssetResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCleanRoomAutoApprovalRuleRequestWire struct { CleanRoomName *string `json:"clean_room_name,omitempty"` RuleId *string `json:"rule_id,omitempty"` @@ -1915,6 +2803,30 @@ func deleteCleanRoomAutoApprovalRuleRequestFromWire(w *deleteCleanRoomAutoApprov }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCleanRoomAutoApprovalRuleRequest) MarshalJSON() ([]byte, error) { + w, err := deleteCleanRoomAutoApprovalRuleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCleanRoomAutoApprovalRuleRequest) UnmarshalJSON(data []byte) error { + var w deleteCleanRoomAutoApprovalRuleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCleanRoomAutoApprovalRuleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCleanRoomRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1937,6 +2849,30 @@ func deleteCleanRoomRequestFromWire(w *deleteCleanRoomRequestWire) (*DeleteClean }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCleanRoomRequest) MarshalJSON() ([]byte, error) { + w, err := deleteCleanRoomRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCleanRoomRequest) UnmarshalJSON(data []byte) error { + var w deleteCleanRoomRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCleanRoomRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type egressNetworkPolicyWire struct { InternetAccess *egressNetworkPolicy_InternetAccessPolicyWire `json:"internet_access,omitempty"` } @@ -1967,6 +2903,30 @@ func egressNetworkPolicyFromWire(w *egressNetworkPolicyWire) (*EgressNetworkPoli }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EgressNetworkPolicy) MarshalJSON() ([]byte, error) { + w, err := egressNetworkPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EgressNetworkPolicy) UnmarshalJSON(data []byte) error { + var w egressNetworkPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := egressNetworkPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type egressNetworkPolicy_InternetAccessPolicyWire struct { RestrictionMode EgressNetworkPolicy_InternetAccessPolicy_RestrictionMode `json:"restriction_mode,omitempty"` AllowedInternetDestinations []egressNetworkPolicy_InternetAccessPolicy_InternetDestinationWire `json:"allowed_internet_destinations,omitempty"` @@ -2022,6 +2982,30 @@ func egressNetworkPolicy_InternetAccessPolicyFromWire(w *egressNetworkPolicy_Int }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EgressNetworkPolicy_InternetAccessPolicy) MarshalJSON() ([]byte, error) { + w, err := egressNetworkPolicy_InternetAccessPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EgressNetworkPolicy_InternetAccessPolicy) UnmarshalJSON(data []byte) error { + var w egressNetworkPolicy_InternetAccessPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := egressNetworkPolicy_InternetAccessPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type egressNetworkPolicy_InternetAccessPolicy_InternetDestinationWire struct { Destination *string `json:"destination,omitempty"` Type EgressNetworkPolicy_InternetAccessPolicy_InternetDestination_InternetDestinationType `json:"type,omitempty"` @@ -2050,6 +3034,30 @@ func egressNetworkPolicy_InternetAccessPolicy_InternetDestinationFromWire(w *egr }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EgressNetworkPolicy_InternetAccessPolicy_InternetDestination) MarshalJSON() ([]byte, error) { + w, err := egressNetworkPolicy_InternetAccessPolicy_InternetDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EgressNetworkPolicy_InternetAccessPolicy_InternetDestination) UnmarshalJSON(data []byte) error { + var w egressNetworkPolicy_InternetAccessPolicy_InternetDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := egressNetworkPolicy_InternetAccessPolicy_InternetDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type egressNetworkPolicy_InternetAccessPolicy_LogOnlyModeWire struct { LogOnlyModeType EgressNetworkPolicy_InternetAccessPolicy_LogOnlyMode_LogOnlyModeType `json:"log_only_mode_type,omitempty"` Workloads []EgressNetworkPolicy_InternetAccessPolicy_LogOnlyMode_WorkloadType `json:"workloads,omitempty"` @@ -2075,6 +3083,30 @@ func egressNetworkPolicy_InternetAccessPolicy_LogOnlyModeFromWire(w *egressNetwo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EgressNetworkPolicy_InternetAccessPolicy_LogOnlyMode) MarshalJSON() ([]byte, error) { + w, err := egressNetworkPolicy_InternetAccessPolicy_LogOnlyModeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EgressNetworkPolicy_InternetAccessPolicy_LogOnlyMode) UnmarshalJSON(data []byte) error { + var w egressNetworkPolicy_InternetAccessPolicy_LogOnlyModeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := egressNetworkPolicy_InternetAccessPolicy_LogOnlyModeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type egressNetworkPolicy_InternetAccessPolicy_StorageDestinationWire struct { BucketName *string `json:"bucket_name,omitempty"` Region *string `json:"region,omitempty"` @@ -2118,6 +3150,30 @@ func egressNetworkPolicy_InternetAccessPolicy_StorageDestinationFromWire(w *egre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EgressNetworkPolicy_InternetAccessPolicy_StorageDestination) MarshalJSON() ([]byte, error) { + w, err := egressNetworkPolicy_InternetAccessPolicy_StorageDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EgressNetworkPolicy_InternetAccessPolicy_StorageDestination) UnmarshalJSON(data []byte) error { + var w egressNetworkPolicy_InternetAccessPolicy_StorageDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := egressNetworkPolicy_InternetAccessPolicy_StorageDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCleanRoomAssetRequestWire struct { CleanRoomName *string `json:"clean_room_name,omitempty"` AssetType CleanRoomAsset_AssetType `json:"asset_type,omitempty"` @@ -2146,6 +3202,30 @@ func getCleanRoomAssetRequestFromWire(w *getCleanRoomAssetRequestWire) (*GetClea }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCleanRoomAssetRequest) MarshalJSON() ([]byte, error) { + w, err := getCleanRoomAssetRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCleanRoomAssetRequest) UnmarshalJSON(data []byte) error { + var w getCleanRoomAssetRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCleanRoomAssetRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCleanRoomAssetRevisionRequestWire struct { CleanRoomName *string `json:"clean_room_name,omitempty"` Name *string `json:"name,omitempty"` @@ -2177,6 +3257,30 @@ func getCleanRoomAssetRevisionRequestFromWire(w *getCleanRoomAssetRevisionReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCleanRoomAssetRevisionRequest) MarshalJSON() ([]byte, error) { + w, err := getCleanRoomAssetRevisionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCleanRoomAssetRevisionRequest) UnmarshalJSON(data []byte) error { + var w getCleanRoomAssetRevisionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCleanRoomAssetRevisionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCleanRoomAutoApprovalRuleRequestWire struct { CleanRoomName *string `json:"clean_room_name,omitempty"` RuleId *string `json:"rule_id,omitempty"` @@ -2202,6 +3306,30 @@ func getCleanRoomAutoApprovalRuleRequestFromWire(w *getCleanRoomAutoApprovalRule }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCleanRoomAutoApprovalRuleRequest) MarshalJSON() ([]byte, error) { + w, err := getCleanRoomAutoApprovalRuleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCleanRoomAutoApprovalRuleRequest) UnmarshalJSON(data []byte) error { + var w getCleanRoomAutoApprovalRuleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCleanRoomAutoApprovalRuleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCleanRoomRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2224,6 +3352,30 @@ func getCleanRoomRequestFromWire(w *getCleanRoomRequestWire) (*GetCleanRoomReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCleanRoomRequest) MarshalJSON() ([]byte, error) { + w, err := getCleanRoomRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCleanRoomRequest) UnmarshalJSON(data []byte) error { + var w getCleanRoomRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCleanRoomRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jarAnalysisVersionReviewWire struct { Etag *string `json:"etag,omitempty"` ReviewState CleanRoomJarAnalysisReview_JarAnalysisReviewState `json:"review_state,omitempty"` @@ -2252,6 +3404,30 @@ func jarAnalysisVersionReviewFromWire(w *jarAnalysisVersionReviewWire) (*JarAnal }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JarAnalysisVersionReview) MarshalJSON() ([]byte, error) { + w, err := jarAnalysisVersionReviewToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JarAnalysisVersionReview) UnmarshalJSON(data []byte) error { + var w jarAnalysisVersionReviewWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jarAnalysisVersionReviewFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCleanRoomAssetRevisionsRequestWire struct { CleanRoomName *string `json:"clean_room_name,omitempty"` Name *string `json:"name,omitempty"` @@ -2286,6 +3462,30 @@ func listCleanRoomAssetRevisionsRequestFromWire(w *listCleanRoomAssetRevisionsRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCleanRoomAssetRevisionsRequest) MarshalJSON() ([]byte, error) { + w, err := listCleanRoomAssetRevisionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCleanRoomAssetRevisionsRequest) UnmarshalJSON(data []byte) error { + var w listCleanRoomAssetRevisionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCleanRoomAssetRevisionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCleanRoomAssetRevisionsResponseWire struct { Revisions []cleanRoomAssetWire `json:"revisions,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2319,6 +3519,30 @@ func listCleanRoomAssetRevisionsResponseFromWire(w *listCleanRoomAssetRevisionsR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCleanRoomAssetRevisionsResponse) MarshalJSON() ([]byte, error) { + w, err := listCleanRoomAssetRevisionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCleanRoomAssetRevisionsResponse) UnmarshalJSON(data []byte) error { + var w listCleanRoomAssetRevisionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCleanRoomAssetRevisionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCleanRoomAssetsRequestWire struct { CleanRoomName *string `json:"clean_room_name,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -2344,6 +3568,30 @@ func listCleanRoomAssetsRequestFromWire(w *listCleanRoomAssetsRequestWire) (*Lis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCleanRoomAssetsRequest) MarshalJSON() ([]byte, error) { + w, err := listCleanRoomAssetsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCleanRoomAssetsRequest) UnmarshalJSON(data []byte) error { + var w listCleanRoomAssetsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCleanRoomAssetsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCleanRoomAssetsResponseWire struct { Assets []cleanRoomAssetWire `json:"assets,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2377,6 +3625,30 @@ func listCleanRoomAssetsResponseFromWire(w *listCleanRoomAssetsResponseWire) (*L }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCleanRoomAssetsResponse) MarshalJSON() ([]byte, error) { + w, err := listCleanRoomAssetsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCleanRoomAssetsResponse) UnmarshalJSON(data []byte) error { + var w listCleanRoomAssetsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCleanRoomAssetsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCleanRoomAutoApprovalRulesRequestWire struct { CleanRoomName *string `json:"clean_room_name,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -2405,6 +3677,30 @@ func listCleanRoomAutoApprovalRulesRequestFromWire(w *listCleanRoomAutoApprovalR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCleanRoomAutoApprovalRulesRequest) MarshalJSON() ([]byte, error) { + w, err := listCleanRoomAutoApprovalRulesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCleanRoomAutoApprovalRulesRequest) UnmarshalJSON(data []byte) error { + var w listCleanRoomAutoApprovalRulesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCleanRoomAutoApprovalRulesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCleanRoomAutoApprovalRulesResponseWire struct { Rules []cleanRoomAutoApprovalRuleWire `json:"rules,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2438,6 +3734,30 @@ func listCleanRoomAutoApprovalRulesResponseFromWire(w *listCleanRoomAutoApproval }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCleanRoomAutoApprovalRulesResponse) MarshalJSON() ([]byte, error) { + w, err := listCleanRoomAutoApprovalRulesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCleanRoomAutoApprovalRulesResponse) UnmarshalJSON(data []byte) error { + var w listCleanRoomAutoApprovalRulesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCleanRoomAutoApprovalRulesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCleanRoomNotebookTaskRunsRequestWire struct { CleanRoomName *string `json:"clean_room_name,omitempty"` NotebookName *string `json:"notebook_name,omitempty"` @@ -2469,6 +3789,30 @@ func listCleanRoomNotebookTaskRunsRequestFromWire(w *listCleanRoomNotebookTaskRu }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCleanRoomNotebookTaskRunsRequest) MarshalJSON() ([]byte, error) { + w, err := listCleanRoomNotebookTaskRunsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCleanRoomNotebookTaskRunsRequest) UnmarshalJSON(data []byte) error { + var w listCleanRoomNotebookTaskRunsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCleanRoomNotebookTaskRunsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCleanRoomNotebookTaskRunsResponseWire struct { Runs []cleanRoomNotebookTaskRunWire `json:"runs,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2502,6 +3846,30 @@ func listCleanRoomNotebookTaskRunsResponseFromWire(w *listCleanRoomNotebookTaskR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCleanRoomNotebookTaskRunsResponse) MarshalJSON() ([]byte, error) { + w, err := listCleanRoomNotebookTaskRunsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCleanRoomNotebookTaskRunsResponse) UnmarshalJSON(data []byte) error { + var w listCleanRoomNotebookTaskRunsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCleanRoomNotebookTaskRunsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCleanRoomTaskRunsRequestWire struct { CleanRoomName *string `json:"clean_room_name,omitempty"` Name *string `json:"name,omitempty"` @@ -2536,6 +3904,30 @@ func listCleanRoomTaskRunsRequestFromWire(w *listCleanRoomTaskRunsRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCleanRoomTaskRunsRequest) MarshalJSON() ([]byte, error) { + w, err := listCleanRoomTaskRunsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCleanRoomTaskRunsRequest) UnmarshalJSON(data []byte) error { + var w listCleanRoomTaskRunsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCleanRoomTaskRunsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCleanRoomTaskRunsResponseWire struct { Runs []cleanRoomTaskRunWire `json:"runs,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2569,6 +3961,30 @@ func listCleanRoomTaskRunsResponseFromWire(w *listCleanRoomTaskRunsResponseWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCleanRoomTaskRunsResponse) MarshalJSON() ([]byte, error) { + w, err := listCleanRoomTaskRunsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCleanRoomTaskRunsResponse) UnmarshalJSON(data []byte) error { + var w listCleanRoomTaskRunsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCleanRoomTaskRunsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCleanRoomsRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -2594,6 +4010,30 @@ func listCleanRoomsRequestFromWire(w *listCleanRoomsRequestWire) (*ListCleanRoom }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCleanRoomsRequest) MarshalJSON() ([]byte, error) { + w, err := listCleanRoomsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCleanRoomsRequest) UnmarshalJSON(data []byte) error { + var w listCleanRoomsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCleanRoomsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCleanRoomsResponseWire struct { CleanRooms []cleanRoomWire `json:"clean_rooms,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2627,6 +4067,30 @@ func listCleanRoomsResponseFromWire(w *listCleanRoomsResponseWire) (*ListCleanRo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCleanRoomsResponse) MarshalJSON() ([]byte, error) { + w, err := listCleanRoomsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCleanRoomsResponse) UnmarshalJSON(data []byte) error { + var w listCleanRoomsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCleanRoomsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type notebookVersionReviewWire struct { Etag *string `json:"etag,omitempty"` ReviewState CleanRoomNotebookReview_NotebookReviewState `json:"review_state,omitempty"` @@ -2655,6 +4119,30 @@ func notebookVersionReviewFromWire(w *notebookVersionReviewWire) (*NotebookVersi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NotebookVersionReview) MarshalJSON() ([]byte, error) { + w, err := notebookVersionReviewToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NotebookVersionReview) UnmarshalJSON(data []byte) error { + var w notebookVersionReviewWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := notebookVersionReviewFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type partitionSpecificationWire struct { } @@ -2672,6 +4160,30 @@ func partitionSpecificationFromWire(w *partitionSpecificationWire) (*PartitionSp return &PartitionSpecification{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PartitionSpecification) MarshalJSON() ([]byte, error) { + w, err := partitionSpecificationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PartitionSpecification) UnmarshalJSON(data []byte) error { + var w partitionSpecificationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := partitionSpecificationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type partitionSpecification_PartitionWire struct { Values []partitionSpecification_Partition_PartitionValueWire `json:"values,omitempty"` } @@ -2702,6 +4214,30 @@ func partitionSpecification_PartitionFromWire(w *partitionSpecification_Partitio }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PartitionSpecification_Partition) MarshalJSON() ([]byte, error) { + w, err := partitionSpecification_PartitionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PartitionSpecification_Partition) UnmarshalJSON(data []byte) error { + var w partitionSpecification_PartitionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := partitionSpecification_PartitionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type partitionSpecification_Partition_PartitionValueWire struct { Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` @@ -2733,6 +4269,30 @@ func partitionSpecification_Partition_PartitionValueFromWire(w *partitionSpecifi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PartitionSpecification_Partition_PartitionValue) MarshalJSON() ([]byte, error) { + w, err := partitionSpecification_Partition_PartitionValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PartitionSpecification_Partition_PartitionValue) UnmarshalJSON(data []byte) error { + var w partitionSpecification_Partition_PartitionValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := partitionSpecification_Partition_PartitionValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type policyFunctionArgumentWire struct { Column *string `json:"column,omitempty"` Constant *string `json:"constant,omitempty"` @@ -2789,6 +4349,30 @@ func policyFunctionArgumentFromWire(w *policyFunctionArgumentWire) (*PolicyFunct }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PolicyFunctionArgument) MarshalJSON() ([]byte, error) { + w, err := policyFunctionArgumentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PolicyFunctionArgument) UnmarshalJSON(data []byte) error { + var w policyFunctionArgumentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := policyFunctionArgumentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCleanRoomAssetRequestWire struct { CleanRoomName *string `json:"clean_room_name,omitempty"` Asset *cleanRoomAssetWire `json:"asset,omitempty"` @@ -2822,6 +4406,30 @@ func updateCleanRoomAssetRequestFromWire(w *updateCleanRoomAssetRequestWire) (*U }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCleanRoomAssetRequest) MarshalJSON() ([]byte, error) { + w, err := updateCleanRoomAssetRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCleanRoomAssetRequest) UnmarshalJSON(data []byte) error { + var w updateCleanRoomAssetRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCleanRoomAssetRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCleanRoomAutoApprovalRuleRequestWire struct { AutoApprovalRule *cleanRoomAutoApprovalRuleWire `json:"auto_approval_rule,omitempty"` } @@ -2852,6 +4460,30 @@ func updateCleanRoomAutoApprovalRuleRequestFromWire(w *updateCleanRoomAutoApprov }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCleanRoomAutoApprovalRuleRequest) MarshalJSON() ([]byte, error) { + w, err := updateCleanRoomAutoApprovalRuleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCleanRoomAutoApprovalRuleRequest) UnmarshalJSON(data []byte) error { + var w updateCleanRoomAutoApprovalRuleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCleanRoomAutoApprovalRuleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCleanRoomRequestWire struct { Name *string `json:"name,omitempty"` CleanRoom *cleanRoomWire `json:"clean_room,omitempty"` @@ -2885,6 +4517,30 @@ func updateCleanRoomRequestFromWire(w *updateCleanRoomRequestWire) (*UpdateClean }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCleanRoomRequest) MarshalJSON() ([]byte, error) { + w, err := updateCleanRoomRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCleanRoomRequest) UnmarshalJSON(data []byte) error { + var w updateCleanRoomRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCleanRoomRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/clusterlibraries/CHANGELOG.md b/clusterlibraries/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/clusterlibraries/CHANGELOG.md +++ b/clusterlibraries/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/clusterlibraries/internal/version.go b/clusterlibraries/internal/version.go index c94727b2..f617f7cb 100644 --- a/clusterlibraries/internal/version.go +++ b/clusterlibraries/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-clusterlibraries" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/clusterlibraries/v2/wire.go b/clusterlibraries/v2/wire.go index d46e2193..942b4cef 100644 --- a/clusterlibraries/v2/wire.go +++ b/clusterlibraries/v2/wire.go @@ -3,6 +3,7 @@ package clusterlibraries import ( + "encoding/json" "fmt" ) @@ -39,6 +40,30 @@ func clusterLibraryStatusesFromWire(w *clusterLibraryStatusesWire) (*ClusterLibr }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterLibraryStatuses) MarshalJSON() ([]byte, error) { + w, err := clusterLibraryStatusesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterLibraryStatuses) UnmarshalJSON(data []byte) error { + var w clusterLibraryStatusesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterLibraryStatusesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterStatusRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` } @@ -61,6 +86,30 @@ func clusterStatusRequestFromWire(w *clusterStatusRequestWire) (*ClusterStatusRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterStatusRequest) MarshalJSON() ([]byte, error) { + w, err := clusterStatusRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterStatusRequest) UnmarshalJSON(data []byte) error { + var w clusterStatusRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterStatusRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type installLibrariesRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` Libraries []libraryWire `json:"libraries,omitempty"` @@ -94,6 +143,30 @@ func installLibrariesRequestFromWire(w *installLibrariesRequestWire) (*InstallLi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InstallLibrariesRequest) MarshalJSON() ([]byte, error) { + w, err := installLibrariesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InstallLibrariesRequest) UnmarshalJSON(data []byte) error { + var w installLibrariesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := installLibrariesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type installLibrariesResponseWire struct { } @@ -111,6 +184,30 @@ func installLibrariesResponseFromWire(w *installLibrariesResponseWire) (*Install return &InstallLibrariesResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InstallLibrariesResponse) MarshalJSON() ([]byte, error) { + w, err := installLibrariesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InstallLibrariesResponse) UnmarshalJSON(data []byte) error { + var w installLibrariesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := installLibrariesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type libraryWire struct { Jar *string `json:"jar,omitempty"` Egg *string `json:"egg,omitempty"` @@ -251,6 +348,30 @@ func libraryFromWire(w *libraryWire) (*Library, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Library) MarshalJSON() ([]byte, error) { + w, err := libraryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Library) UnmarshalJSON(data []byte) error { + var w libraryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := libraryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type libraryFullStatusWire struct { Library *libraryWire `json:"library,omitempty"` Status LibraryInstallStatus `json:"status,omitempty"` @@ -290,6 +411,30 @@ func libraryFullStatusFromWire(w *libraryFullStatusWire) (*LibraryFullStatus, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LibraryFullStatus) MarshalJSON() ([]byte, error) { + w, err := libraryFullStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LibraryFullStatus) UnmarshalJSON(data []byte) error { + var w libraryFullStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := libraryFullStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAllClusterLibraryStatusesRequestWire struct { } @@ -307,6 +452,30 @@ func listAllClusterLibraryStatusesRequestFromWire(w *listAllClusterLibraryStatus return &ListAllClusterLibraryStatusesRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAllClusterLibraryStatusesRequest) MarshalJSON() ([]byte, error) { + w, err := listAllClusterLibraryStatusesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAllClusterLibraryStatusesRequest) UnmarshalJSON(data []byte) error { + var w listAllClusterLibraryStatusesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAllClusterLibraryStatusesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAllClusterLibraryStatusesResponseWire struct { Statuses []clusterLibraryStatusesWire `json:"statuses,omitempty"` } @@ -337,6 +506,30 @@ func listAllClusterLibraryStatusesResponseFromWire(w *listAllClusterLibraryStatu }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAllClusterLibraryStatusesResponse) MarshalJSON() ([]byte, error) { + w, err := listAllClusterLibraryStatusesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAllClusterLibraryStatusesResponse) UnmarshalJSON(data []byte) error { + var w listAllClusterLibraryStatusesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAllClusterLibraryStatusesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type mavenLibraryWire struct { Coordinates *string `json:"coordinates,omitempty"` Repo *string `json:"repo,omitempty"` @@ -365,6 +558,30 @@ func mavenLibraryFromWire(w *mavenLibraryWire) (*MavenLibrary, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MavenLibrary) MarshalJSON() ([]byte, error) { + w, err := mavenLibraryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MavenLibrary) UnmarshalJSON(data []byte) error { + var w mavenLibraryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := mavenLibraryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pythonPyPiLibraryWire struct { Package *string `json:"package,omitempty"` Repo *string `json:"repo,omitempty"` @@ -390,6 +607,30 @@ func pythonPyPiLibraryFromWire(w *pythonPyPiLibraryWire) (*PythonPyPiLibrary, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PythonPyPiLibrary) MarshalJSON() ([]byte, error) { + w, err := pythonPyPiLibraryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PythonPyPiLibrary) UnmarshalJSON(data []byte) error { + var w pythonPyPiLibraryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pythonPyPiLibraryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rCranLibraryWire struct { Package *string `json:"package,omitempty"` Repo *string `json:"repo,omitempty"` @@ -415,6 +656,30 @@ func rCranLibraryFromWire(w *rCranLibraryWire) (*RCranLibrary, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RCranLibrary) MarshalJSON() ([]byte, error) { + w, err := rCranLibraryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RCranLibrary) UnmarshalJSON(data []byte) error { + var w rCranLibraryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rCranLibraryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type uninstallLibrariesRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` Libraries []libraryWire `json:"libraries,omitempty"` @@ -448,6 +713,30 @@ func uninstallLibrariesRequestFromWire(w *uninstallLibrariesRequestWire) (*Unins }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UninstallLibrariesRequest) MarshalJSON() ([]byte, error) { + w, err := uninstallLibrariesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UninstallLibrariesRequest) UnmarshalJSON(data []byte) error { + var w uninstallLibrariesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := uninstallLibrariesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type uninstallLibrariesResponseWire struct { } @@ -465,6 +754,30 @@ func uninstallLibrariesResponseFromWire(w *uninstallLibrariesResponseWire) (*Uni return &UninstallLibrariesResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UninstallLibrariesResponse) MarshalJSON() ([]byte, error) { + w, err := uninstallLibrariesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UninstallLibrariesResponse) UnmarshalJSON(data []byte) error { + var w uninstallLibrariesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := uninstallLibrariesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/clusterpolicies/CHANGELOG.md b/clusterpolicies/CHANGELOG.md index 0e9d3eb4..219b3123 100644 --- a/clusterpolicies/CHANGELOG.md +++ b/clusterpolicies/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/clusterpolicies/internal/version.go b/clusterpolicies/internal/version.go index d2d06442..4f05f53d 100644 --- a/clusterpolicies/internal/version.go +++ b/clusterpolicies/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-clusterpolicies" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/clusterpolicies/v2/wire.go b/clusterpolicies/v2/wire.go index 09f7ef08..adf4a73a 100644 --- a/clusterpolicies/v2/wire.go +++ b/clusterpolicies/v2/wire.go @@ -95,6 +95,30 @@ func allowedComputeProductsFromWire(w *allowedComputeProductsWire) (*AllowedComp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AllowedComputeProducts) MarshalJSON() ([]byte, error) { + w, err := allowedComputeProductsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AllowedComputeProducts) UnmarshalJSON(data []byte) error { + var w allowedComputeProductsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := allowedComputeProductsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type automatedConstraintsWire struct { PerWorkloadMax *rateLimitConfigWire `json:"per_workload_max,omitempty"` } @@ -125,6 +149,30 @@ func automatedConstraintsFromWire(w *automatedConstraintsWire) (*AutomatedConstr }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AutomatedConstraints) MarshalJSON() ([]byte, error) { + w, err := automatedConstraintsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AutomatedConstraints) UnmarshalJSON(data []byte) error { + var w automatedConstraintsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := automatedConstraintsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type computePolicyWire struct { ComputePolicyId *string `json:"compute_policy_id,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -176,6 +224,30 @@ func computePolicyFromWire(w *computePolicyWire) (*ComputePolicy, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ComputePolicy) MarshalJSON() ([]byte, error) { + w, err := computePolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ComputePolicy) UnmarshalJSON(data []byte) error { + var w computePolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := computePolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createPolicyRequestWire struct { Name *string `json:"name,omitempty"` Definition *string `json:"definition,omitempty"` @@ -232,6 +304,30 @@ func createPolicyRequestFromWire(w *createPolicyRequestWire) (*CreatePolicyReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreatePolicyRequest) MarshalJSON() ([]byte, error) { + w, err := createPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreatePolicyRequest) UnmarshalJSON(data []byte) error { + var w createPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createPolicyResponseWire struct { PolicyId *string `json:"policy_id,omitempty"` } @@ -254,6 +350,30 @@ func createPolicyResponseFromWire(w *createPolicyResponseWire) (*CreatePolicyRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreatePolicyResponse) MarshalJSON() ([]byte, error) { + w, err := createPolicyResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreatePolicyResponse) UnmarshalJSON(data []byte) error { + var w createPolicyResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createPolicyResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deletePolicyRequestWire struct { PolicyId *string `json:"policy_id,omitempty"` } @@ -276,6 +396,30 @@ func deletePolicyRequestFromWire(w *deletePolicyRequestWire) (*DeletePolicyReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeletePolicyRequest) MarshalJSON() ([]byte, error) { + w, err := deletePolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeletePolicyRequest) UnmarshalJSON(data []byte) error { + var w deletePolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deletePolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deletePolicyResponseWire struct { } @@ -293,6 +437,30 @@ func deletePolicyResponseFromWire(w *deletePolicyResponseWire) (*DeletePolicyRes return &DeletePolicyResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeletePolicyResponse) MarshalJSON() ([]byte, error) { + w, err := deletePolicyResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeletePolicyResponse) UnmarshalJSON(data []byte) error { + var w deletePolicyResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deletePolicyResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type editPolicyRequestWire struct { PolicyId *string `json:"policy_id,omitempty"` Name *string `json:"name,omitempty"` @@ -352,6 +520,30 @@ func editPolicyRequestFromWire(w *editPolicyRequestWire) (*EditPolicyRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EditPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := editPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EditPolicyRequest) UnmarshalJSON(data []byte) error { + var w editPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := editPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type editPolicyResponseWire struct { } @@ -369,6 +561,30 @@ func editPolicyResponseFromWire(w *editPolicyResponseWire) (*EditPolicyResponse, return &EditPolicyResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EditPolicyResponse) MarshalJSON() ([]byte, error) { + w, err := editPolicyResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EditPolicyResponse) UnmarshalJSON(data []byte) error { + var w editPolicyResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := editPolicyResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPolicyRequestWire struct { PolicyId *string `json:"policy_id,omitempty"` } @@ -391,6 +607,30 @@ func getPolicyRequestFromWire(w *getPolicyRequestWire) (*GetPolicyRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := getPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPolicyRequest) UnmarshalJSON(data []byte) error { + var w getPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type lakebaseConstraintsWire struct { MaxCapacityUnitsPerInstance *wireInt64 `json:"max_capacity_units_per_instance,omitempty"` MaxIdleMinutesBeforeScaleToZero *wireInt64 `json:"max_idle_minutes_before_scale_to_zero,omitempty"` @@ -432,6 +672,30 @@ func lakebaseConstraintsFromWire(w *lakebaseConstraintsWire) (*LakebaseConstrain }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LakebaseConstraints) MarshalJSON() ([]byte, error) { + w, err := lakebaseConstraintsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LakebaseConstraints) UnmarshalJSON(data []byte) error { + var w lakebaseConstraintsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := lakebaseConstraintsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type libraryWire struct { Jar *string `json:"jar,omitempty"` Egg *string `json:"egg,omitempty"` @@ -572,6 +836,30 @@ func libraryFromWire(w *libraryWire) (*Library, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Library) MarshalJSON() ([]byte, error) { + w, err := libraryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Library) UnmarshalJSON(data []byte) error { + var w libraryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := libraryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listComputePoliciesRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -597,6 +885,30 @@ func listComputePoliciesRequestFromWire(w *listComputePoliciesRequestWire) (*Lis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListComputePoliciesRequest) MarshalJSON() ([]byte, error) { + w, err := listComputePoliciesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListComputePoliciesRequest) UnmarshalJSON(data []byte) error { + var w listComputePoliciesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listComputePoliciesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listComputePoliciesResponseWire struct { ComputePolicies []computePolicyWire `json:"compute_policies,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -630,6 +942,30 @@ func listComputePoliciesResponseFromWire(w *listComputePoliciesResponseWire) (*L }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListComputePoliciesResponse) MarshalJSON() ([]byte, error) { + w, err := listComputePoliciesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListComputePoliciesResponse) UnmarshalJSON(data []byte) error { + var w listComputePoliciesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listComputePoliciesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPoliciesRequestWire struct { SortOrder ListOrder `json:"sort_order,omitempty"` SortColumn PolicySortColumn `json:"sort_column,omitempty"` @@ -655,6 +991,30 @@ func listPoliciesRequestFromWire(w *listPoliciesRequestWire) (*ListPoliciesReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPoliciesRequest) MarshalJSON() ([]byte, error) { + w, err := listPoliciesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPoliciesRequest) UnmarshalJSON(data []byte) error { + var w listPoliciesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPoliciesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPoliciesResponseWire struct { Policies []policyWire `json:"policies,omitempty"` } @@ -685,6 +1045,30 @@ func listPoliciesResponseFromWire(w *listPoliciesResponseWire) (*ListPoliciesRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPoliciesResponse) MarshalJSON() ([]byte, error) { + w, err := listPoliciesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPoliciesResponse) UnmarshalJSON(data []byte) error { + var w listPoliciesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPoliciesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listServerlessComputesRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -710,6 +1094,30 @@ func listServerlessComputesRequestFromWire(w *listServerlessComputesRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListServerlessComputesRequest) MarshalJSON() ([]byte, error) { + w, err := listServerlessComputesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListServerlessComputesRequest) UnmarshalJSON(data []byte) error { + var w listServerlessComputesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listServerlessComputesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listServerlessComputesResponseWire struct { ServerlessComputes []serverlessComputeWire `json:"serverless_computes,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -743,6 +1151,30 @@ func listServerlessComputesResponseFromWire(w *listServerlessComputesResponseWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListServerlessComputesResponse) MarshalJSON() ([]byte, error) { + w, err := listServerlessComputesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListServerlessComputesResponse) UnmarshalJSON(data []byte) error { + var w listServerlessComputesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listServerlessComputesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type mavenLibraryWire struct { Coordinates *string `json:"coordinates,omitempty"` Repo *string `json:"repo,omitempty"` @@ -771,6 +1203,30 @@ func mavenLibraryFromWire(w *mavenLibraryWire) (*MavenLibrary, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MavenLibrary) MarshalJSON() ([]byte, error) { + w, err := mavenLibraryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MavenLibrary) UnmarshalJSON(data []byte) error { + var w mavenLibraryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := mavenLibraryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type policyWire struct { PolicyId *string `json:"policy_id,omitempty"` CreatorUserName *string `json:"creator_user_name,omitempty"` @@ -847,6 +1303,30 @@ func policyFromWire(w *policyWire) (*Policy, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Policy) MarshalJSON() ([]byte, error) { + w, err := policyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Policy) UnmarshalJSON(data []byte) error { + var w policyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := policyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pythonPyPiLibraryWire struct { Package *string `json:"package,omitempty"` Repo *string `json:"repo,omitempty"` @@ -872,6 +1352,30 @@ func pythonPyPiLibraryFromWire(w *pythonPyPiLibraryWire) (*PythonPyPiLibrary, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PythonPyPiLibrary) MarshalJSON() ([]byte, error) { + w, err := pythonPyPiLibraryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PythonPyPiLibrary) UnmarshalJSON(data []byte) error { + var w pythonPyPiLibraryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pythonPyPiLibraryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rCranLibraryWire struct { Package *string `json:"package,omitempty"` Repo *string `json:"repo,omitempty"` @@ -897,6 +1401,30 @@ func rCranLibraryFromWire(w *rCranLibraryWire) (*RCranLibrary, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RCranLibrary) MarshalJSON() ([]byte, error) { + w, err := rCranLibraryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RCranLibrary) UnmarshalJSON(data []byte) error { + var w rCranLibraryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rCranLibraryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rateLimitConfigWire struct { TShirtSize TshirtSize `json:"t_shirt_size,omitempty"` TShirtSizeName *string `json:"t_shirt_size_name,omitempty"` @@ -922,6 +1450,30 @@ func rateLimitConfigFromWire(w *rateLimitConfigWire) (*RateLimitConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RateLimitConfig) MarshalJSON() ([]byte, error) { + w, err := rateLimitConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RateLimitConfig) UnmarshalJSON(data []byte) error { + var w rateLimitConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rateLimitConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type serverlessComputeWire struct { ServerlessComputeId *string `json:"serverless_compute_id,omitempty"` Name *string `json:"name,omitempty"` @@ -959,6 +1511,30 @@ func serverlessComputeFromWire(w *serverlessComputeWire) (*ServerlessCompute, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ServerlessCompute) MarshalJSON() ([]byte, error) { + w, err := serverlessComputeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ServerlessCompute) UnmarshalJSON(data []byte) error { + var w serverlessComputeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := serverlessComputeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/clusters/CHANGELOG.md b/clusters/CHANGELOG.md index 5d759d42..f3d3d44e 100644 --- a/clusters/CHANGELOG.md +++ b/clusters/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/clusters/internal/version.go b/clusters/internal/version.go index ed6d5b27..dfc35384 100644 --- a/clusters/internal/version.go +++ b/clusters/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-clusters" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/clusters/v2/wire.go b/clusters/v2/wire.go index 818eac56..37d1de83 100644 --- a/clusters/v2/wire.go +++ b/clusters/v2/wire.go @@ -76,6 +76,30 @@ func adlsgen2InfoFromWire(w *adlsgen2InfoWire) (*Adlsgen2Info, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Adlsgen2Info) MarshalJSON() ([]byte, error) { + w, err := adlsgen2InfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Adlsgen2Info) UnmarshalJSON(data []byte) error { + var w adlsgen2InfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := adlsgen2InfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type autoScaleWire struct { MinWorkers *int `json:"min_workers,omitempty"` MaxWorkers *int `json:"max_workers,omitempty"` @@ -101,6 +125,30 @@ func autoScaleFromWire(w *autoScaleWire) (*AutoScale, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AutoScale) MarshalJSON() ([]byte, error) { + w, err := autoScaleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AutoScale) UnmarshalJSON(data []byte) error { + var w autoScaleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := autoScaleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type awsAttributesWire struct { FirstOnDemand *int `json:"first_on_demand,omitempty"` Availability AwsAvailability `json:"availability,omitempty"` @@ -150,6 +198,30 @@ func awsAttributesFromWire(w *awsAttributesWire) (*AwsAttributes, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AwsAttributes) MarshalJSON() ([]byte, error) { + w, err := awsAttributesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AwsAttributes) UnmarshalJSON(data []byte) error { + var w awsAttributesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := awsAttributesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type azureAttributesWire struct { LogAnalyticsInfo *logAnalyticsInfoWire `json:"log_analytics_info,omitempty"` FirstOnDemand *int `json:"first_on_demand,omitempty"` @@ -192,6 +264,30 @@ func azureAttributesFromWire(w *azureAttributesWire) (*AzureAttributes, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AzureAttributes) MarshalJSON() ([]byte, error) { + w, err := azureAttributesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AzureAttributes) UnmarshalJSON(data []byte) error { + var w azureAttributesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := azureAttributesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cancelPendingClusterEnforcementRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` AllowMissing *bool `json:"allow_missing,omitempty"` @@ -217,6 +313,30 @@ func cancelPendingClusterEnforcementRequestFromWire(w *cancelPendingClusterEnfor }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelPendingClusterEnforcementRequest) MarshalJSON() ([]byte, error) { + w, err := cancelPendingClusterEnforcementRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelPendingClusterEnforcementRequest) UnmarshalJSON(data []byte) error { + var w cancelPendingClusterEnforcementRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelPendingClusterEnforcementRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cancelPendingClusterEnforcementResponseWire struct { } @@ -234,6 +354,30 @@ func cancelPendingClusterEnforcementResponseFromWire(w *cancelPendingClusterEnfo return &CancelPendingClusterEnforcementResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelPendingClusterEnforcementResponse) MarshalJSON() ([]byte, error) { + w, err := cancelPendingClusterEnforcementResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelPendingClusterEnforcementResponse) UnmarshalJSON(data []byte) error { + var w cancelPendingClusterEnforcementResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelPendingClusterEnforcementResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type changeClusterOwnerRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` OwnerUsername *string `json:"owner_username,omitempty"` @@ -259,6 +403,30 @@ func changeClusterOwnerRequestFromWire(w *changeClusterOwnerRequestWire) (*Chang }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ChangeClusterOwnerRequest) MarshalJSON() ([]byte, error) { + w, err := changeClusterOwnerRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ChangeClusterOwnerRequest) UnmarshalJSON(data []byte) error { + var w changeClusterOwnerRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := changeClusterOwnerRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type changeClusterOwnerResponseWire struct { } @@ -276,6 +444,30 @@ func changeClusterOwnerResponseFromWire(w *changeClusterOwnerResponseWire) (*Cha return &ChangeClusterOwnerResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ChangeClusterOwnerResponse) MarshalJSON() ([]byte, error) { + w, err := changeClusterOwnerResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ChangeClusterOwnerResponse) UnmarshalJSON(data []byte) error { + var w changeClusterOwnerResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := changeClusterOwnerResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cloneClusterWire struct { SourceClusterId *string `json:"source_cluster_id,omitempty"` } @@ -298,6 +490,30 @@ func cloneClusterFromWire(w *cloneClusterWire) (*CloneCluster, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CloneCluster) MarshalJSON() ([]byte, error) { + w, err := cloneClusterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CloneCluster) UnmarshalJSON(data []byte) error { + var w cloneClusterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cloneClusterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cloudProviderNodeInfoWire struct { Status []CloudProviderNodeStatus `json:"status,omitempty"` } @@ -320,6 +536,30 @@ func cloudProviderNodeInfoFromWire(w *cloudProviderNodeInfoWire) (*CloudProvider }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CloudProviderNodeInfo) MarshalJSON() ([]byte, error) { + w, err := cloudProviderNodeInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CloudProviderNodeInfo) UnmarshalJSON(data []byte) error { + var w cloudProviderNodeInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cloudProviderNodeInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterAttributesWire struct { ClusterName *string `json:"cluster_name,omitempty"` SparkVersion *string `json:"spark_version,omitempty"` @@ -507,6 +747,30 @@ func clusterAttributesFromWire(w *clusterAttributesWire) (*ClusterAttributes, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterAttributes) MarshalJSON() ([]byte, error) { + w, err := clusterAttributesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterAttributes) UnmarshalJSON(data []byte) error { + var w clusterAttributesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterAttributesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterComplianceWire struct { ClusterId *string `json:"cluster_id,omitempty"` IsCompliant *bool `json:"is_compliant,omitempty"` @@ -546,6 +810,30 @@ func clusterComplianceFromWire(w *clusterComplianceWire) (*ClusterCompliance, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterCompliance) MarshalJSON() ([]byte, error) { + w, err := clusterComplianceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterCompliance) UnmarshalJSON(data []byte) error { + var w clusterComplianceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterComplianceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterEventWire struct { ClusterId *string `json:"cluster_id,omitempty"` Timestamp *wireInt64 `json:"timestamp,omitempty"` @@ -604,6 +892,30 @@ func clusterEventFromWire(w *clusterEventWire) (*ClusterEvent, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterEvent) MarshalJSON() ([]byte, error) { + w, err := clusterEventToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterEvent) UnmarshalJSON(data []byte) error { + var w clusterEventWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterEventFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterEventTypeWire struct { } @@ -621,6 +933,30 @@ func clusterEventTypeFromWire(w *clusterEventTypeWire) (*ClusterEventType, error return &ClusterEventType{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterEventType) MarshalJSON() ([]byte, error) { + w, err := clusterEventTypeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterEventType) UnmarshalJSON(data []byte) error { + var w clusterEventTypeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterEventTypeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterInfoWire struct { ClusterId *string `json:"cluster_id,omitempty"` CreatorUserName *string `json:"creator_user_name,omitempty"` @@ -995,6 +1331,30 @@ func clusterInfoFromWire(w *clusterInfoWire) (*ClusterInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterInfo) MarshalJSON() ([]byte, error) { + w, err := clusterInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterInfo) UnmarshalJSON(data []byte) error { + var w clusterInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterInfo_ComputeSpecWire struct { ApplyPolicyDefaultValues *bool `json:"apply_policy_default_values,omitempty"` ClusterName *string `json:"cluster_name,omitempty"` @@ -1230,6 +1590,30 @@ func clusterInfo_ComputeSpecFromWire(w *clusterInfo_ComputeSpecWire) (*ClusterIn }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterInfo_ComputeSpec) MarshalJSON() ([]byte, error) { + w, err := clusterInfo_ComputeSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterInfo_ComputeSpec) UnmarshalJSON(data []byte) error { + var w clusterInfo_ComputeSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterInfo_ComputeSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterLogConfWire struct { Dbfs *dbfsStorageInfoWire `json:"dbfs,omitempty"` S3 *s3StorageInfoWire `json:"s3,omitempty"` @@ -1322,6 +1706,30 @@ func clusterLogConfFromWire(w *clusterLogConfWire) (*ClusterLogConf, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterLogConf) MarshalJSON() ([]byte, error) { + w, err := clusterLogConfToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterLogConf) UnmarshalJSON(data []byte) error { + var w clusterLogConfWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterLogConfFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterSizeWire struct { NumWorkers *int `json:"num_workers,omitempty"` Autoscale *autoScaleWire `json:"autoscale,omitempty"` @@ -1386,6 +1794,30 @@ func clusterSizeFromWire(w *clusterSizeWire) (*ClusterSize, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterSize) MarshalJSON() ([]byte, error) { + w, err := clusterSizeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterSize) UnmarshalJSON(data []byte) error { + var w clusterSizeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterSizeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterStateWire struct { } @@ -1403,6 +1835,30 @@ func clusterStateFromWire(w *clusterStateWire) (*ClusterState, error) { return &ClusterState{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterState) MarshalJSON() ([]byte, error) { + w, err := clusterStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterState) UnmarshalJSON(data []byte) error { + var w clusterStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createClusterRequestWire struct { ApplyPolicyDefaultValues *bool `json:"apply_policy_default_values,omitempty"` CloneFrom *cloneClusterWire `json:"clone_from,omitempty"` @@ -1649,6 +2105,30 @@ func createClusterRequestFromWire(w *createClusterRequestWire) (*CreateClusterRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateClusterRequest) MarshalJSON() ([]byte, error) { + w, err := createClusterRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateClusterRequest) UnmarshalJSON(data []byte) error { + var w createClusterRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createClusterRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createClusterResponseWire struct { ClusterId *string `json:"cluster_id,omitempty"` } @@ -1671,6 +2151,30 @@ func createClusterResponseFromWire(w *createClusterResponseWire) (*CreateCluster }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateClusterResponse) MarshalJSON() ([]byte, error) { + w, err := createClusterResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateClusterResponse) UnmarshalJSON(data []byte) error { + var w createClusterResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createClusterResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dataPlaneEventDetailsWire struct { EventType DataPlaneClusterEventType `json:"event_type,omitempty"` Timestamp *wireInt64 `json:"timestamp,omitempty"` @@ -1710,8 +2214,32 @@ func dataPlaneEventDetailsFromWire(w *dataPlaneEventDetailsWire) (*DataPlaneEven }, nil } -type dbfsStorageInfoWire struct { - Destination *string `json:"destination,omitempty"` +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DataPlaneEventDetails) MarshalJSON() ([]byte, error) { + w, err := dataPlaneEventDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DataPlaneEventDetails) UnmarshalJSON(data []byte) error { + var w dataPlaneEventDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dataPlaneEventDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type dbfsStorageInfoWire struct { + Destination *string `json:"destination,omitempty"` } func dbfsStorageInfoToWire(v *DbfsStorageInfo) (*dbfsStorageInfoWire, error) { @@ -1732,6 +2260,30 @@ func dbfsStorageInfoFromWire(w *dbfsStorageInfoWire) (*DbfsStorageInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DbfsStorageInfo) MarshalJSON() ([]byte, error) { + w, err := dbfsStorageInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DbfsStorageInfo) UnmarshalJSON(data []byte) error { + var w dbfsStorageInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dbfsStorageInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteClusterRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` } @@ -1754,6 +2306,30 @@ func deleteClusterRequestFromWire(w *deleteClusterRequestWire) (*DeleteClusterRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteClusterRequest) MarshalJSON() ([]byte, error) { + w, err := deleteClusterRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteClusterRequest) UnmarshalJSON(data []byte) error { + var w deleteClusterRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteClusterRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteClusterResponseWire struct { } @@ -1771,6 +2347,30 @@ func deleteClusterResponseFromWire(w *deleteClusterResponseWire) (*DeleteCluster return &DeleteClusterResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteClusterResponse) MarshalJSON() ([]byte, error) { + w, err := deleteClusterResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteClusterResponse) UnmarshalJSON(data []byte) error { + var w deleteClusterResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteClusterResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dockerBasicAuthWire struct { Username *string `json:"username,omitempty"` Password *string `json:"password,omitempty"` @@ -1796,6 +2396,30 @@ func dockerBasicAuthFromWire(w *dockerBasicAuthWire) (*DockerBasicAuth, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DockerBasicAuth) MarshalJSON() ([]byte, error) { + w, err := dockerBasicAuthToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DockerBasicAuth) UnmarshalJSON(data []byte) error { + var w dockerBasicAuthWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dockerBasicAuthFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dockerImageWire struct { Url *string `json:"url,omitempty"` BasicAuth *dockerBasicAuthWire `json:"basic_auth,omitempty"` @@ -1851,6 +2475,30 @@ func dockerImageFromWire(w *dockerImageWire) (*DockerImage, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DockerImage) MarshalJSON() ([]byte, error) { + w, err := dockerImageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DockerImage) UnmarshalJSON(data []byte) error { + var w dockerImageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dockerImageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type editClusterRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` ApplyPolicyDefaultValues *bool `json:"apply_policy_default_values,omitempty"` @@ -2089,6 +2737,30 @@ func editClusterRequestFromWire(w *editClusterRequestWire) (*EditClusterRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EditClusterRequest) MarshalJSON() ([]byte, error) { + w, err := editClusterRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EditClusterRequest) UnmarshalJSON(data []byte) error { + var w editClusterRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := editClusterRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type editClusterResponseWire struct { } @@ -2106,6 +2778,30 @@ func editClusterResponseFromWire(w *editClusterResponseWire) (*EditClusterRespon return &EditClusterResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EditClusterResponse) MarshalJSON() ([]byte, error) { + w, err := editClusterResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EditClusterResponse) UnmarshalJSON(data []byte) error { + var w editClusterResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := editClusterResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type enforcePolicyComplianceForClusterRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` ValidateOnly *bool `json:"validate_only,omitempty"` @@ -2134,6 +2830,30 @@ func enforcePolicyComplianceForClusterRequestFromWire(w *enforcePolicyCompliance }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EnforcePolicyComplianceForClusterRequest) MarshalJSON() ([]byte, error) { + w, err := enforcePolicyComplianceForClusterRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EnforcePolicyComplianceForClusterRequest) UnmarshalJSON(data []byte) error { + var w enforcePolicyComplianceForClusterRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := enforcePolicyComplianceForClusterRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type enforcePolicyComplianceForClusterResponseWire struct { HasChanges *bool `json:"has_changes,omitempty"` Changes []enforcePolicyComplianceForClusterResponse_ClusterSettingsChangeWire `json:"changes,omitempty"` @@ -2170,6 +2890,30 @@ func enforcePolicyComplianceForClusterResponseFromWire(w *enforcePolicyComplianc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EnforcePolicyComplianceForClusterResponse) MarshalJSON() ([]byte, error) { + w, err := enforcePolicyComplianceForClusterResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EnforcePolicyComplianceForClusterResponse) UnmarshalJSON(data []byte) error { + var w enforcePolicyComplianceForClusterResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := enforcePolicyComplianceForClusterResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type enforcePolicyComplianceForClusterResponse_ClusterSettingsWire struct { ClusterName *string `json:"cluster_name,omitempty"` SparkVersion *string `json:"spark_version,omitempty"` @@ -2402,6 +3146,30 @@ func enforcePolicyComplianceForClusterResponse_ClusterSettingsFromWire(w *enforc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EnforcePolicyComplianceForClusterResponse_ClusterSettings) MarshalJSON() ([]byte, error) { + w, err := enforcePolicyComplianceForClusterResponse_ClusterSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EnforcePolicyComplianceForClusterResponse_ClusterSettings) UnmarshalJSON(data []byte) error { + var w enforcePolicyComplianceForClusterResponse_ClusterSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := enforcePolicyComplianceForClusterResponse_ClusterSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type enforcePolicyComplianceForClusterResponse_ClusterSettingsChangeWire struct { Field *string `json:"field,omitempty"` PreviousValue *string `json:"previous_value,omitempty"` @@ -2430,6 +3198,30 @@ func enforcePolicyComplianceForClusterResponse_ClusterSettingsChangeFromWire(w * }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EnforcePolicyComplianceForClusterResponse_ClusterSettingsChange) MarshalJSON() ([]byte, error) { + w, err := enforcePolicyComplianceForClusterResponse_ClusterSettingsChangeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EnforcePolicyComplianceForClusterResponse_ClusterSettingsChange) UnmarshalJSON(data []byte) error { + var w enforcePolicyComplianceForClusterResponse_ClusterSettingsChangeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := enforcePolicyComplianceForClusterResponse_ClusterSettingsChangeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type eventDetailsWire struct { CurrentNumWorkers *int `json:"current_num_workers,omitempty"` TargetNumWorkers *int `json:"target_num_workers,omitempty"` @@ -2581,6 +3373,30 @@ func eventDetailsFromWire(w *eventDetailsWire) (*EventDetails, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EventDetails) MarshalJSON() ([]byte, error) { + w, err := eventDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EventDetails) UnmarshalJSON(data []byte) error { + var w eventDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := eventDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gcpAttributesWire struct { UsePreemptibleExecutors *bool `json:"use_preemptible_executors,omitempty"` GoogleServiceAccount *string `json:"google_service_account,omitempty"` @@ -2624,6 +3440,30 @@ func gcpAttributesFromWire(w *gcpAttributesWire) (*GcpAttributes, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GcpAttributes) MarshalJSON() ([]byte, error) { + w, err := gcpAttributesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GcpAttributes) UnmarshalJSON(data []byte) error { + var w gcpAttributesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gcpAttributesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gcsStorageInfoWire struct { Destination *string `json:"destination,omitempty"` } @@ -2646,6 +3486,30 @@ func gcsStorageInfoFromWire(w *gcsStorageInfoWire) (*GcsStorageInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GcsStorageInfo) MarshalJSON() ([]byte, error) { + w, err := gcsStorageInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GcsStorageInfo) UnmarshalJSON(data []byte) error { + var w gcsStorageInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gcsStorageInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getClusterRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` } @@ -2668,6 +3532,30 @@ func getClusterRequestFromWire(w *getClusterRequestWire) (*GetClusterRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetClusterRequest) MarshalJSON() ([]byte, error) { + w, err := getClusterRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetClusterRequest) UnmarshalJSON(data []byte) error { + var w getClusterRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getClusterRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getEventsResponseWire struct { Events []clusterEventWire `json:"events,omitempty"` NextPage *listEventsRequestWire `json:"next_page,omitempty"` @@ -2726,6 +3614,30 @@ func getEventsResponseFromWire(w *getEventsResponseWire) (*GetEventsResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetEventsResponse) MarshalJSON() ([]byte, error) { + w, err := getEventsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetEventsResponse) UnmarshalJSON(data []byte) error { + var w getEventsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getEventsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPolicyComplianceForClusterRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` } @@ -2748,6 +3660,30 @@ func getPolicyComplianceForClusterRequestFromWire(w *getPolicyComplianceForClust }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPolicyComplianceForClusterRequest) MarshalJSON() ([]byte, error) { + w, err := getPolicyComplianceForClusterRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPolicyComplianceForClusterRequest) UnmarshalJSON(data []byte) error { + var w getPolicyComplianceForClusterRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPolicyComplianceForClusterRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPolicyComplianceForClusterResponseWire struct { IsCompliant *bool `json:"is_compliant,omitempty"` Violations map[string]string `json:"violations,omitempty"` @@ -2784,6 +3720,30 @@ func getPolicyComplianceForClusterResponseFromWire(w *getPolicyComplianceForClus }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPolicyComplianceForClusterResponse) MarshalJSON() ([]byte, error) { + w, err := getPolicyComplianceForClusterResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPolicyComplianceForClusterResponse) UnmarshalJSON(data []byte) error { + var w getPolicyComplianceForClusterResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPolicyComplianceForClusterResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSparkVersionsRequestWire struct { } @@ -2801,6 +3761,30 @@ func getSparkVersionsRequestFromWire(w *getSparkVersionsRequestWire) (*GetSparkV return &GetSparkVersionsRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSparkVersionsRequest) MarshalJSON() ([]byte, error) { + w, err := getSparkVersionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSparkVersionsRequest) UnmarshalJSON(data []byte) error { + var w getSparkVersionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSparkVersionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSparkVersionsResponseWire struct { Versions []sparkVersionWire `json:"versions,omitempty"` } @@ -2831,6 +3815,30 @@ func getSparkVersionsResponseFromWire(w *getSparkVersionsResponseWire) (*GetSpar }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSparkVersionsResponse) MarshalJSON() ([]byte, error) { + w, err := getSparkVersionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSparkVersionsResponse) UnmarshalJSON(data []byte) error { + var w getSparkVersionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSparkVersionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type initScriptEventDetailsWire struct { ReportedForNode *string `json:"reported_for_node,omitempty"` Global []initScriptEventDetails_InitScriptInfoAndExecutionDetailsWire `json:"global,omitempty"` @@ -2875,10 +3883,34 @@ func initScriptEventDetailsFromWire(w *initScriptEventDetailsWire) (*InitScriptE }, nil } -type initScriptEventDetails_InitScriptInfoAndExecutionDetailsWire struct { - Dbfs *dbfsStorageInfoWire `json:"dbfs,omitempty"` - S3 *s3StorageInfoWire `json:"s3,omitempty"` - File *localFileInfoWire `json:"file,omitempty"` +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InitScriptEventDetails) MarshalJSON() ([]byte, error) { + w, err := initScriptEventDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InitScriptEventDetails) UnmarshalJSON(data []byte) error { + var w initScriptEventDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := initScriptEventDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type initScriptEventDetails_InitScriptInfoAndExecutionDetailsWire struct { + Dbfs *dbfsStorageInfoWire `json:"dbfs,omitempty"` + S3 *s3StorageInfoWire `json:"s3,omitempty"` + File *localFileInfoWire `json:"file,omitempty"` Gcs *gcsStorageInfoWire `json:"gcs,omitempty"` Abfss *adlsgen2InfoWire `json:"abfss,omitempty"` Workspace *workspaceStorageInfoWire `json:"workspace,omitempty"` @@ -3059,6 +4091,30 @@ func initScriptEventDetails_InitScriptInfoAndExecutionDetailsFromWire(w *initScr }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InitScriptEventDetails_InitScriptInfoAndExecutionDetails) MarshalJSON() ([]byte, error) { + w, err := initScriptEventDetails_InitScriptInfoAndExecutionDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InitScriptEventDetails_InitScriptInfoAndExecutionDetails) UnmarshalJSON(data []byte) error { + var w initScriptEventDetails_InitScriptInfoAndExecutionDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := initScriptEventDetails_InitScriptInfoAndExecutionDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type initScriptExecutionDetailsWire struct { } @@ -3076,6 +4132,30 @@ func initScriptExecutionDetailsFromWire(w *initScriptExecutionDetailsWire) (*Ini return &InitScriptExecutionDetails{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InitScriptExecutionDetails) MarshalJSON() ([]byte, error) { + w, err := initScriptExecutionDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InitScriptExecutionDetails) UnmarshalJSON(data []byte) error { + var w initScriptExecutionDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := initScriptExecutionDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type initScriptInfoWire struct { Dbfs *dbfsStorageInfoWire `json:"dbfs,omitempty"` S3 *s3StorageInfoWire `json:"s3,omitempty"` @@ -3248,6 +4328,30 @@ func initScriptInfoFromWire(w *initScriptInfoWire) (*InitScriptInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InitScriptInfo) MarshalJSON() ([]byte, error) { + w, err := initScriptInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InitScriptInfo) UnmarshalJSON(data []byte) error { + var w initScriptInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := initScriptInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAvailableZonesRequestWire struct { } @@ -3265,6 +4369,30 @@ func listAvailableZonesRequestFromWire(w *listAvailableZonesRequestWire) (*ListA return &ListAvailableZonesRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAvailableZonesRequest) MarshalJSON() ([]byte, error) { + w, err := listAvailableZonesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAvailableZonesRequest) UnmarshalJSON(data []byte) error { + var w listAvailableZonesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAvailableZonesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAvailableZonesResponseWire struct { Zones []string `json:"zones,omitempty"` DefaultZone *string `json:"default_zone,omitempty"` @@ -3290,6 +4418,30 @@ func listAvailableZonesResponseFromWire(w *listAvailableZonesResponseWire) (*Lis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAvailableZonesResponse) MarshalJSON() ([]byte, error) { + w, err := listAvailableZonesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAvailableZonesResponse) UnmarshalJSON(data []byte) error { + var w listAvailableZonesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAvailableZonesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listClusterComplianceForPolicyRequestWire struct { PolicyId *string `json:"policy_id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -3318,6 +4470,30 @@ func listClusterComplianceForPolicyRequestFromWire(w *listClusterComplianceForPo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListClusterComplianceForPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := listClusterComplianceForPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListClusterComplianceForPolicyRequest) UnmarshalJSON(data []byte) error { + var w listClusterComplianceForPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listClusterComplianceForPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listClusterComplianceForPolicyResponseWire struct { Clusters []clusterComplianceWire `json:"clusters,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3354,6 +4530,30 @@ func listClusterComplianceForPolicyResponseFromWire(w *listClusterComplianceForP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListClusterComplianceForPolicyResponse) MarshalJSON() ([]byte, error) { + w, err := listClusterComplianceForPolicyResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListClusterComplianceForPolicyResponse) UnmarshalJSON(data []byte) error { + var w listClusterComplianceForPolicyResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listClusterComplianceForPolicyResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listClustersRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -3379,6 +4579,30 @@ func listClustersRequestFromWire(w *listClustersRequestWire) (*ListClustersReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListClustersRequest) MarshalJSON() ([]byte, error) { + w, err := listClustersRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListClustersRequest) UnmarshalJSON(data []byte) error { + var w listClustersRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listClustersRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listClustersResponseWire struct { Clusters []clusterInfoWire `json:"clusters,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3415,6 +4639,30 @@ func listClustersResponseFromWire(w *listClustersResponseWire) (*ListClustersRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListClustersResponse) MarshalJSON() ([]byte, error) { + w, err := listClustersResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListClustersResponse) UnmarshalJSON(data []byte) error { + var w listClustersResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listClustersResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listEventsRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` StartTime *wireInt64 `json:"start_time,omitempty"` @@ -3493,6 +4741,30 @@ func listEventsRequestFromWire(w *listEventsRequestWire) (*ListEventsRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListEventsRequest) MarshalJSON() ([]byte, error) { + w, err := listEventsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListEventsRequest) UnmarshalJSON(data []byte) error { + var w listEventsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listEventsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listNodeTypesRequestWire struct { } @@ -3510,6 +4782,30 @@ func listNodeTypesRequestFromWire(w *listNodeTypesRequestWire) (*ListNodeTypesRe return &ListNodeTypesRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListNodeTypesRequest) MarshalJSON() ([]byte, error) { + w, err := listNodeTypesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListNodeTypesRequest) UnmarshalJSON(data []byte) error { + var w listNodeTypesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listNodeTypesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listNodeTypesResponseWire struct { NodeTypes []nodeTypeWire `json:"node_types,omitempty"` } @@ -3540,6 +4836,30 @@ func listNodeTypesResponseFromWire(w *listNodeTypesResponseWire) (*ListNodeTypes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListNodeTypesResponse) MarshalJSON() ([]byte, error) { + w, err := listNodeTypesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListNodeTypesResponse) UnmarshalJSON(data []byte) error { + var w listNodeTypesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listNodeTypesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type localFileInfoWire struct { Destination *string `json:"destination,omitempty"` } @@ -3562,6 +4882,30 @@ func localFileInfoFromWire(w *localFileInfoWire) (*LocalFileInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LocalFileInfo) MarshalJSON() ([]byte, error) { + w, err := localFileInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LocalFileInfo) UnmarshalJSON(data []byte) error { + var w localFileInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := localFileInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logAnalyticsInfoWire struct { LogAnalyticsWorkspaceId *string `json:"log_analytics_workspace_id,omitempty"` LogAnalyticsPrimaryKey *string `json:"log_analytics_primary_key,omitempty"` @@ -3587,6 +4931,30 @@ func logAnalyticsInfoFromWire(w *logAnalyticsInfoWire) (*LogAnalyticsInfo, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogAnalyticsInfo) MarshalJSON() ([]byte, error) { + w, err := logAnalyticsInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogAnalyticsInfo) UnmarshalJSON(data []byte) error { + var w logAnalyticsInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logAnalyticsInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logSyncStatusWire struct { LastAttempted *wireInt64 `json:"last_attempted,omitempty"` LastException *string `json:"last_exception,omitempty"` @@ -3620,6 +4988,30 @@ func logSyncStatusFromWire(w *logSyncStatusWire) (*LogSyncStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogSyncStatus) MarshalJSON() ([]byte, error) { + w, err := logSyncStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogSyncStatus) UnmarshalJSON(data []byte) error { + var w logSyncStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logSyncStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type nodeInstanceTypeWire struct { InstanceTypeId *string `json:"instance_type_id,omitempty"` LocalDisks *int `json:"local_disks,omitempty"` @@ -3654,6 +5046,30 @@ func nodeInstanceTypeFromWire(w *nodeInstanceTypeWire) (*NodeInstanceType, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NodeInstanceType) MarshalJSON() ([]byte, error) { + w, err := nodeInstanceTypeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NodeInstanceType) UnmarshalJSON(data []byte) error { + var w nodeInstanceTypeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := nodeInstanceTypeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type nodeTypeWire struct { NodeTypeId *string `json:"node_type_id,omitempty"` MemoryMb *int `json:"memory_mb,omitempty"` @@ -3749,6 +5165,30 @@ func nodeTypeFromWire(w *nodeTypeWire) (*NodeType, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NodeType) MarshalJSON() ([]byte, error) { + w, err := nodeTypeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NodeType) UnmarshalJSON(data []byte) error { + var w nodeTypeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := nodeTypeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type nodeTypeFlexibilityWire struct { AlternateNodeTypeIds []string `json:"alternate_node_type_ids,omitempty"` AwsContextId *string `json:"aws_context_id,omitempty"` @@ -3774,6 +5214,30 @@ func nodeTypeFlexibilityFromWire(w *nodeTypeFlexibilityWire) (*NodeTypeFlexibili }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NodeTypeFlexibility) MarshalJSON() ([]byte, error) { + w, err := nodeTypeFlexibilityToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NodeTypeFlexibility) UnmarshalJSON(data []byte) error { + var w nodeTypeFlexibilityWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := nodeTypeFlexibilityFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pendingEnforcementWire struct { TargetSpec *enforcePolicyComplianceForClusterResponse_ClusterSettingsWire `json:"target_spec,omitempty"` InitiateTime *types.Time `json:"initiate_time,omitempty"` @@ -3824,6 +5288,30 @@ func pendingEnforcementFromWire(w *pendingEnforcementWire) (*PendingEnforcement, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PendingEnforcement) MarshalJSON() ([]byte, error) { + w, err := pendingEnforcementToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PendingEnforcement) UnmarshalJSON(data []byte) error { + var w pendingEnforcementWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pendingEnforcementFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type permanentDeleteClusterRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` } @@ -3846,6 +5334,30 @@ func permanentDeleteClusterRequestFromWire(w *permanentDeleteClusterRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PermanentDeleteClusterRequest) MarshalJSON() ([]byte, error) { + w, err := permanentDeleteClusterRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PermanentDeleteClusterRequest) UnmarshalJSON(data []byte) error { + var w permanentDeleteClusterRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := permanentDeleteClusterRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type permanentDeleteClusterResponseWire struct { } @@ -3863,6 +5375,30 @@ func permanentDeleteClusterResponseFromWire(w *permanentDeleteClusterResponseWir return &PermanentDeleteClusterResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PermanentDeleteClusterResponse) MarshalJSON() ([]byte, error) { + w, err := permanentDeleteClusterResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PermanentDeleteClusterResponse) UnmarshalJSON(data []byte) error { + var w permanentDeleteClusterResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := permanentDeleteClusterResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pinClusterRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` } @@ -3885,6 +5421,30 @@ func pinClusterRequestFromWire(w *pinClusterRequestWire) (*PinClusterRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PinClusterRequest) MarshalJSON() ([]byte, error) { + w, err := pinClusterRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PinClusterRequest) UnmarshalJSON(data []byte) error { + var w pinClusterRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pinClusterRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pinClusterResponseWire struct { } @@ -3902,6 +5462,30 @@ func pinClusterResponseFromWire(w *pinClusterResponseWire) (*PinClusterResponse, return &PinClusterResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PinClusterResponse) MarshalJSON() ([]byte, error) { + w, err := pinClusterResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PinClusterResponse) UnmarshalJSON(data []byte) error { + var w pinClusterResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pinClusterResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resizeCauseWire struct { } @@ -3919,6 +5503,30 @@ func resizeCauseFromWire(w *resizeCauseWire) (*ResizeCause, error) { return &ResizeCause{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResizeCause) MarshalJSON() ([]byte, error) { + w, err := resizeCauseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResizeCause) UnmarshalJSON(data []byte) error { + var w resizeCauseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resizeCauseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resizeClusterRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` NumWorkers *int `json:"num_workers,omitempty"` @@ -3986,6 +5594,30 @@ func resizeClusterRequestFromWire(w *resizeClusterRequestWire) (*ResizeClusterRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResizeClusterRequest) MarshalJSON() ([]byte, error) { + w, err := resizeClusterRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResizeClusterRequest) UnmarshalJSON(data []byte) error { + var w resizeClusterRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resizeClusterRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resizeClusterResponseWire struct { } @@ -4003,6 +5635,30 @@ func resizeClusterResponseFromWire(w *resizeClusterResponseWire) (*ResizeCluster return &ResizeClusterResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResizeClusterResponse) MarshalJSON() ([]byte, error) { + w, err := resizeClusterResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResizeClusterResponse) UnmarshalJSON(data []byte) error { + var w resizeClusterResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resizeClusterResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type restartClusterRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` RestartUser *string `json:"restart_user,omitempty"` @@ -4028,6 +5684,30 @@ func restartClusterRequestFromWire(w *restartClusterRequestWire) (*RestartCluste }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RestartClusterRequest) MarshalJSON() ([]byte, error) { + w, err := restartClusterRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RestartClusterRequest) UnmarshalJSON(data []byte) error { + var w restartClusterRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := restartClusterRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type restartClusterResponseWire struct { } @@ -4045,6 +5725,30 @@ func restartClusterResponseFromWire(w *restartClusterResponseWire) (*RestartClus return &RestartClusterResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RestartClusterResponse) MarshalJSON() ([]byte, error) { + w, err := restartClusterResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RestartClusterResponse) UnmarshalJSON(data []byte) error { + var w restartClusterResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := restartClusterResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type s3StorageInfoWire struct { Destination *string `json:"destination,omitempty"` Region *string `json:"region,omitempty"` @@ -4085,6 +5789,30 @@ func s3StorageInfoFromWire(w *s3StorageInfoWire) (*S3StorageInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v S3StorageInfo) MarshalJSON() ([]byte, error) { + w, err := s3StorageInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *S3StorageInfo) UnmarshalJSON(data []byte) error { + var w s3StorageInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := s3StorageInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sparkInfoWire struct { } @@ -4102,6 +5830,30 @@ func sparkInfoFromWire(w *sparkInfoWire) (*SparkInfo, error) { return &SparkInfo{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SparkInfo) MarshalJSON() ([]byte, error) { + w, err := sparkInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SparkInfo) UnmarshalJSON(data []byte) error { + var w sparkInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sparkInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sparkInfo_SparkNodeWire struct { PrivateIp *string `json:"private_ip,omitempty"` PublicDns *string `json:"public_dns,omitempty"` @@ -4158,6 +5910,30 @@ func sparkInfo_SparkNodeFromWire(w *sparkInfo_SparkNodeWire) (*SparkInfo_SparkNo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SparkInfo_SparkNode) MarshalJSON() ([]byte, error) { + w, err := sparkInfo_SparkNodeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SparkInfo_SparkNode) UnmarshalJSON(data []byte) error { + var w sparkInfo_SparkNodeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sparkInfo_SparkNodeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sparkInfo_SparkNode_SparkNodeAwsAttributesWire struct { IsSpot *bool `json:"is_spot,omitempty"` } @@ -4180,6 +5956,30 @@ func sparkInfo_SparkNode_SparkNodeAwsAttributesFromWire(w *sparkInfo_SparkNode_S }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SparkInfo_SparkNode_SparkNodeAwsAttributes) MarshalJSON() ([]byte, error) { + w, err := sparkInfo_SparkNode_SparkNodeAwsAttributesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SparkInfo_SparkNode_SparkNodeAwsAttributes) UnmarshalJSON(data []byte) error { + var w sparkInfo_SparkNode_SparkNodeAwsAttributesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sparkInfo_SparkNode_SparkNodeAwsAttributesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sparkVersionWire struct { Key *string `json:"key,omitempty"` Name *string `json:"name,omitempty"` @@ -4205,6 +6005,30 @@ func sparkVersionFromWire(w *sparkVersionWire) (*SparkVersion, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SparkVersion) MarshalJSON() ([]byte, error) { + w, err := sparkVersionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SparkVersion) UnmarshalJSON(data []byte) error { + var w sparkVersionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sparkVersionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type startClusterRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` } @@ -4227,6 +6051,30 @@ func startClusterRequestFromWire(w *startClusterRequestWire) (*StartClusterReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StartClusterRequest) MarshalJSON() ([]byte, error) { + w, err := startClusterRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StartClusterRequest) UnmarshalJSON(data []byte) error { + var w startClusterRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := startClusterRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type startClusterResponseWire struct { } @@ -4244,6 +6092,30 @@ func startClusterResponseFromWire(w *startClusterResponseWire) (*StartClusterRes return &StartClusterResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StartClusterResponse) MarshalJSON() ([]byte, error) { + w, err := startClusterResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StartClusterResponse) UnmarshalJSON(data []byte) error { + var w startClusterResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := startClusterResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type terminationReasonWire struct { Code TerminationCode `json:"code,omitempty"` Type TerminationType `json:"type,omitempty"` @@ -4272,6 +6144,30 @@ func terminationReasonFromWire(w *terminationReasonWire) (*TerminationReason, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TerminationReason) MarshalJSON() ([]byte, error) { + w, err := terminationReasonToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TerminationReason) UnmarshalJSON(data []byte) error { + var w terminationReasonWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := terminationReasonFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type unpinClusterRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` } @@ -4294,6 +6190,30 @@ func unpinClusterRequestFromWire(w *unpinClusterRequestWire) (*UnpinClusterReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UnpinClusterRequest) MarshalJSON() ([]byte, error) { + w, err := unpinClusterRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UnpinClusterRequest) UnmarshalJSON(data []byte) error { + var w unpinClusterRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := unpinClusterRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type unpinClusterResponseWire struct { } @@ -4311,6 +6231,30 @@ func unpinClusterResponseFromWire(w *unpinClusterResponseWire) (*UnpinClusterRes return &UnpinClusterResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UnpinClusterResponse) MarshalJSON() ([]byte, error) { + w, err := unpinClusterResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UnpinClusterResponse) UnmarshalJSON(data []byte) error { + var w unpinClusterResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := unpinClusterResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateClusterRequestWire struct { ClusterId *string `json:"cluster_id,omitempty"` Cluster *updateClusterRequest_UpdateClusterResourceWire `json:"cluster,omitempty"` @@ -4347,6 +6291,30 @@ func updateClusterRequestFromWire(w *updateClusterRequestWire) (*UpdateClusterRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateClusterRequest) MarshalJSON() ([]byte, error) { + w, err := updateClusterRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateClusterRequest) UnmarshalJSON(data []byte) error { + var w updateClusterRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateClusterRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateClusterRequest_UpdateClusterResourceWire struct { NumWorkers *int `json:"num_workers,omitempty"` Autoscale *autoScaleWire `json:"autoscale,omitempty"` @@ -4579,6 +6547,30 @@ func updateClusterRequest_UpdateClusterResourceFromWire(w *updateClusterRequest_ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateClusterRequest_UpdateClusterResource) MarshalJSON() ([]byte, error) { + w, err := updateClusterRequest_UpdateClusterResourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateClusterRequest_UpdateClusterResource) UnmarshalJSON(data []byte) error { + var w updateClusterRequest_UpdateClusterResourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateClusterRequest_UpdateClusterResourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateClusterResponseWire struct { } @@ -4596,6 +6588,30 @@ func updateClusterResponseFromWire(w *updateClusterResponseWire) (*UpdateCluster return &UpdateClusterResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateClusterResponse) MarshalJSON() ([]byte, error) { + w, err := updateClusterResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateClusterResponse) UnmarshalJSON(data []byte) error { + var w updateClusterResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateClusterResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type volumesStorageInfoWire struct { Destination *string `json:"destination,omitempty"` } @@ -4618,6 +6634,30 @@ func volumesStorageInfoFromWire(w *volumesStorageInfoWire) (*VolumesStorageInfo, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v VolumesStorageInfo) MarshalJSON() ([]byte, error) { + w, err := volumesStorageInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *VolumesStorageInfo) UnmarshalJSON(data []byte) error { + var w volumesStorageInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := volumesStorageInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type workloadTypeWire struct { Clients *workloadType_ClientsTypesWire `json:"clients,omitempty"` } @@ -4648,6 +6688,30 @@ func workloadTypeFromWire(w *workloadTypeWire) (*WorkloadType, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WorkloadType) MarshalJSON() ([]byte, error) { + w, err := workloadTypeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WorkloadType) UnmarshalJSON(data []byte) error { + var w workloadTypeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := workloadTypeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type workloadType_ClientsTypesWire struct { Notebooks *bool `json:"notebooks,omitempty"` Jobs *bool `json:"jobs,omitempty"` @@ -4673,6 +6737,30 @@ func workloadType_ClientsTypesFromWire(w *workloadType_ClientsTypesWire) (*Workl }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WorkloadType_ClientsTypes) MarshalJSON() ([]byte, error) { + w, err := workloadType_ClientsTypesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WorkloadType_ClientsTypes) UnmarshalJSON(data []byte) error { + var w workloadType_ClientsTypesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := workloadType_ClientsTypesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type workspaceStorageInfoWire struct { Destination *string `json:"destination,omitempty"` } @@ -4695,6 +6783,30 @@ func workspaceStorageInfoFromWire(w *workspaceStorageInfoWire) (*WorkspaceStorag }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WorkspaceStorageInfo) MarshalJSON() ([]byte, error) { + w, err := workspaceStorageInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WorkspaceStorageInfo) UnmarshalJSON(data []byte) error { + var w workspaceStorageInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := workspaceStorageInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/commandexecution/CHANGELOG.md b/commandexecution/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/commandexecution/CHANGELOG.md +++ b/commandexecution/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/commandexecution/internal/version.go b/commandexecution/internal/version.go index 31d3ab1d..1f5ef450 100644 --- a/commandexecution/internal/version.go +++ b/commandexecution/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-commandexecution" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/commandexecution/v2/wire.go b/commandexecution/v2/wire.go index 60685004..cd43a552 100644 --- a/commandexecution/v2/wire.go +++ b/commandexecution/v2/wire.go @@ -35,6 +35,30 @@ func cancelCommandRequestFromWire(w *cancelCommandRequestWire) (*CancelCommandRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelCommandRequest) MarshalJSON() ([]byte, error) { + w, err := cancelCommandRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelCommandRequest) UnmarshalJSON(data []byte) error { + var w cancelCommandRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelCommandRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cancelResponseWire struct { } @@ -52,6 +76,30 @@ func cancelResponseFromWire(w *cancelResponseWire) (*CancelResponse, error) { return &CancelResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelResponse) MarshalJSON() ([]byte, error) { + w, err := cancelResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelResponse) UnmarshalJSON(data []byte) error { + var w cancelResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createContextRequestWire struct { ClusterId *string `json:"clusterId,omitempty"` Language Language `json:"language,omitempty"` @@ -77,6 +125,30 @@ func createContextRequestFromWire(w *createContextRequestWire) (*CreateContextRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateContextRequest) MarshalJSON() ([]byte, error) { + w, err := createContextRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateContextRequest) UnmarshalJSON(data []byte) error { + var w createContextRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createContextRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createResponseWire struct { Id *string `json:"id,omitempty"` } @@ -99,6 +171,30 @@ func createResponseFromWire(w *createResponseWire) (*CreateResponse, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateResponse) MarshalJSON() ([]byte, error) { + w, err := createResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateResponse) UnmarshalJSON(data []byte) error { + var w createResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type destroyContextRequestWire struct { ClusterId *string `json:"clusterId,omitempty"` ContextId *string `json:"contextId,omitempty"` @@ -124,6 +220,30 @@ func destroyContextRequestFromWire(w *destroyContextRequestWire) (*DestroyContex }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DestroyContextRequest) MarshalJSON() ([]byte, error) { + w, err := destroyContextRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DestroyContextRequest) UnmarshalJSON(data []byte) error { + var w destroyContextRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := destroyContextRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type destroyResponseWire struct { } @@ -141,6 +261,30 @@ func destroyResponseFromWire(w *destroyResponseWire) (*DestroyResponse, error) { return &DestroyResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DestroyResponse) MarshalJSON() ([]byte, error) { + w, err := destroyResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DestroyResponse) UnmarshalJSON(data []byte) error { + var w destroyResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := destroyResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type executeCommandRequestWire struct { ClusterId *string `json:"clusterId,omitempty"` ContextId *string `json:"contextId,omitempty"` @@ -172,6 +316,30 @@ func executeCommandRequestFromWire(w *executeCommandRequestWire) (*ExecuteComman }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExecuteCommandRequest) MarshalJSON() ([]byte, error) { + w, err := executeCommandRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExecuteCommandRequest) UnmarshalJSON(data []byte) error { + var w executeCommandRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := executeCommandRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCommandStatusRequestWire struct { ClusterId *string `json:"clusterId,omitempty"` ContextId *string `json:"contextId,omitempty"` @@ -200,6 +368,30 @@ func getCommandStatusRequestFromWire(w *getCommandStatusRequestWire) (*GetComman }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCommandStatusRequest) MarshalJSON() ([]byte, error) { + w, err := getCommandStatusRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCommandStatusRequest) UnmarshalJSON(data []byte) error { + var w getCommandStatusRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCommandStatusRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCommandStatusResponseWire struct { Id *string `json:"id,omitempty"` Status CommandStatus `json:"status,omitempty"` @@ -236,6 +428,30 @@ func getCommandStatusResponseFromWire(w *getCommandStatusResponseWire) (*GetComm }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCommandStatusResponse) MarshalJSON() ([]byte, error) { + w, err := getCommandStatusResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCommandStatusResponse) UnmarshalJSON(data []byte) error { + var w getCommandStatusResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCommandStatusResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getContextStatusRequestWire struct { ClusterId *string `json:"clusterId,omitempty"` ContextId *string `json:"contextId,omitempty"` @@ -261,6 +477,30 @@ func getContextStatusRequestFromWire(w *getContextStatusRequestWire) (*GetContex }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetContextStatusRequest) MarshalJSON() ([]byte, error) { + w, err := getContextStatusRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetContextStatusRequest) UnmarshalJSON(data []byte) error { + var w getContextStatusRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getContextStatusRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getContextStatusResponseWire struct { Id *string `json:"id,omitempty"` Status ContextStatus `json:"status,omitempty"` @@ -286,6 +526,30 @@ func getContextStatusResponseFromWire(w *getContextStatusResponseWire) (*GetCont }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetContextStatusResponse) MarshalJSON() ([]byte, error) { + w, err := getContextStatusResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetContextStatusResponse) UnmarshalJSON(data []byte) error { + var w getContextStatusResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getContextStatusResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resultsWire struct { Cause *string `json:"cause,omitempty"` Data json.RawMessage `json:"data,omitempty"` @@ -334,3 +598,27 @@ func resultsFromWire(w *resultsWire) (*Results, error) { Truncated: w.Truncated, }, nil } + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Results) MarshalJSON() ([]byte, error) { + w, err := resultsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Results) UnmarshalJSON(data []byte) error { + var w resultsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resultsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} diff --git a/computemigrations/CHANGELOG.md b/computemigrations/CHANGELOG.md index 62219f84..82349e77 100644 --- a/computemigrations/CHANGELOG.md +++ b/computemigrations/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.4.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.3.0 (2026-11-11) ## Release v0.2.0 (2026-11-10) diff --git a/computemigrations/internal/version.go b/computemigrations/internal/version.go index b0d7d640..b64fa0be 100644 --- a/computemigrations/internal/version.go +++ b/computemigrations/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-computemigrations" -const Version = "0.3.0" +const Version = "0.4.0" diff --git a/computemigrations/v1/wire.go b/computemigrations/v1/wire.go index 3cac3c32..dfe5edbd 100644 --- a/computemigrations/v1/wire.go +++ b/computemigrations/v1/wire.go @@ -82,6 +82,30 @@ func approveMigrationExecutionRequestFromWire(w *approveMigrationExecutionReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApproveMigrationExecutionRequest) MarshalJSON() ([]byte, error) { + w, err := approveMigrationExecutionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApproveMigrationExecutionRequest) UnmarshalJSON(data []byte) error { + var w approveMigrationExecutionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := approveMigrationExecutionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type approveMigrationTranslationRequestWire struct { MigrationId *string `json:"migration_id,omitempty"` Etag *string `json:"etag,omitempty"` @@ -110,6 +134,30 @@ func approveMigrationTranslationRequestFromWire(w *approveMigrationTranslationRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApproveMigrationTranslationRequest) MarshalJSON() ([]byte, error) { + w, err := approveMigrationTranslationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApproveMigrationTranslationRequest) UnmarshalJSON(data []byte) error { + var w approveMigrationTranslationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := approveMigrationTranslationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type bakingConfigWire struct { RunCount *int `json:"run_count,omitempty"` TimeWindowHours *int `json:"time_window_hours,omitempty"` @@ -135,6 +183,30 @@ func bakingConfigFromWire(w *bakingConfigWire) (*BakingConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BakingConfig) MarshalJSON() ([]byte, error) { + w, err := bakingConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BakingConfig) UnmarshalJSON(data []byte) error { + var w bakingConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := bakingConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type bakingReportWire struct { TotalRuns *int `json:"total_runs,omitempty"` SuccessfulRuns *int `json:"successful_runs,omitempty"` @@ -160,6 +232,30 @@ func bakingReportFromWire(w *bakingReportWire) (*BakingReport, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BakingReport) MarshalJSON() ([]byte, error) { + w, err := bakingReportToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BakingReport) UnmarshalJSON(data []byte) error { + var w bakingReportWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := bakingReportFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cancelMigrationRequestWire struct { MigrationId *string `json:"migration_id,omitempty"` Etag *string `json:"etag,omitempty"` @@ -188,6 +284,30 @@ func cancelMigrationRequestFromWire(w *cancelMigrationRequestWire) (*CancelMigra }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelMigrationRequest) MarshalJSON() ([]byte, error) { + w, err := cancelMigrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelMigrationRequest) UnmarshalJSON(data []byte) error { + var w cancelMigrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelMigrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createMigrationRequestWire struct { Migration *migrationWire `json:"migration,omitempty"` RequestId *string `json:"request_id,omitempty"` @@ -221,6 +341,30 @@ func createMigrationRequestFromWire(w *createMigrationRequestWire) (*CreateMigra }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateMigrationRequest) MarshalJSON() ([]byte, error) { + w, err := createMigrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateMigrationRequest) UnmarshalJSON(data []byte) error { + var w createMigrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createMigrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteMigrationRequestWire struct { MigrationId *string `json:"migration_id,omitempty"` Etag *string `json:"etag,omitempty"` @@ -246,6 +390,30 @@ func deleteMigrationRequestFromWire(w *deleteMigrationRequestWire) (*DeleteMigra }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteMigrationRequest) MarshalJSON() ([]byte, error) { + w, err := deleteMigrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteMigrationRequest) UnmarshalJSON(data []byte) error { + var w deleteMigrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteMigrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getMigrationRequestWire struct { MigrationId *string `json:"migration_id,omitempty"` } @@ -268,6 +436,30 @@ func getMigrationRequestFromWire(w *getMigrationRequestWire) (*GetMigrationReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetMigrationRequest) MarshalJSON() ([]byte, error) { + w, err := getMigrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetMigrationRequest) UnmarshalJSON(data []byte) error { + var w getMigrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getMigrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listMigrationsRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -299,6 +491,30 @@ func listMigrationsRequestFromWire(w *listMigrationsRequestWire) (*ListMigration }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListMigrationsRequest) MarshalJSON() ([]byte, error) { + w, err := listMigrationsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListMigrationsRequest) UnmarshalJSON(data []byte) error { + var w listMigrationsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listMigrationsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listMigrationsResponseWire struct { Migrations []migrationWire `json:"migrations,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -332,6 +548,30 @@ func listMigrationsResponseFromWire(w *listMigrationsResponseWire) (*ListMigrati }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListMigrationsResponse) MarshalJSON() ([]byte, error) { + w, err := listMigrationsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListMigrationsResponse) UnmarshalJSON(data []byte) error { + var w listMigrationsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listMigrationsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type migrationWire struct { MigrationId *string `json:"migration_id,omitempty"` AssetType Migration_AssetType `json:"asset_type,omitempty"` @@ -441,6 +681,30 @@ func migrationFromWire(w *migrationWire) (*Migration, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Migration) MarshalJSON() ([]byte, error) { + w, err := migrationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Migration) UnmarshalJSON(data []byte) error { + var w migrationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := migrationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type migration_InitiatorWire struct { Role Migration_Initiator_Role `json:"role,omitempty"` UserId *wireInt64 `json:"user_id,omitempty"` @@ -474,6 +738,30 @@ func migration_InitiatorFromWire(w *migration_InitiatorWire) (*Migration_Initiat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Migration_Initiator) MarshalJSON() ([]byte, error) { + w, err := migration_InitiatorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Migration_Initiator) UnmarshalJSON(data []byte) error { + var w migration_InitiatorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := migration_InitiatorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type migration_StateTransitionWire struct { State Migration_State `json:"state,omitempty"` TransitionTime *types.Time `json:"transition_time,omitempty"` @@ -505,6 +793,30 @@ func migration_StateTransitionFromWire(w *migration_StateTransitionWire) (*Migra }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Migration_StateTransition) MarshalJSON() ([]byte, error) { + w, err := migration_StateTransitionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Migration_StateTransition) UnmarshalJSON(data []byte) error { + var w migration_StateTransitionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := migration_StateTransitionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type migrationAssetWire struct { AssetType Migration_AssetType `json:"asset_type,omitempty"` Uri *string `json:"uri,omitempty"` @@ -533,6 +845,30 @@ func migrationAssetFromWire(w *migrationAssetWire) (*MigrationAsset, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MigrationAsset) MarshalJSON() ([]byte, error) { + w, err := migrationAssetToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MigrationAsset) UnmarshalJSON(data []byte) error { + var w migrationAssetWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := migrationAssetFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type migrationReportWire struct { PrimaryAsset *migrationAssetWire `json:"primary_asset,omitempty"` SecondaryAssets []migrationAssetWire `json:"secondary_assets,omitempty"` @@ -574,6 +910,30 @@ func migrationReportFromWire(w *migrationReportWire) (*MigrationReport, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MigrationReport) MarshalJSON() ([]byte, error) { + w, err := migrationReportToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MigrationReport) UnmarshalJSON(data []byte) error { + var w migrationReportWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := migrationReportFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rejectMigrationExecutionRequestWire struct { MigrationId *string `json:"migration_id,omitempty"` Etag *string `json:"etag,omitempty"` @@ -602,6 +962,30 @@ func rejectMigrationExecutionRequestFromWire(w *rejectMigrationExecutionRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RejectMigrationExecutionRequest) MarshalJSON() ([]byte, error) { + w, err := rejectMigrationExecutionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RejectMigrationExecutionRequest) UnmarshalJSON(data []byte) error { + var w rejectMigrationExecutionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rejectMigrationExecutionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rejectMigrationTranslationRequestWire struct { MigrationId *string `json:"migration_id,omitempty"` Etag *string `json:"etag,omitempty"` @@ -630,6 +1014,30 @@ func rejectMigrationTranslationRequestFromWire(w *rejectMigrationTranslationRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RejectMigrationTranslationRequest) MarshalJSON() ([]byte, error) { + w, err := rejectMigrationTranslationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RejectMigrationTranslationRequest) UnmarshalJSON(data []byte) error { + var w rejectMigrationTranslationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rejectMigrationTranslationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type validationReportWire struct { Passed *bool `json:"passed,omitempty"` DurationMs *wireInt64 `json:"duration_ms,omitempty"` @@ -672,6 +1080,30 @@ func validationReportFromWire(w *validationReportWire) (*ValidationReport, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ValidationReport) MarshalJSON() ([]byte, error) { + w, err := validationReportToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ValidationReport) UnmarshalJSON(data []byte) error { + var w validationReportWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := validationReportFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/customllms/CHANGELOG.md b/customllms/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/customllms/CHANGELOG.md +++ b/customllms/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/customllms/internal/version.go b/customllms/internal/version.go index 09d543e2..59769d8c 100644 --- a/customllms/internal/version.go +++ b/customllms/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-customllms" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/customllms/v1/wire.go b/customllms/v1/wire.go index 51492c0b..29f1b9d0 100644 --- a/customllms/v1/wire.go +++ b/customllms/v1/wire.go @@ -3,6 +3,7 @@ package customllms import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -30,6 +31,30 @@ func cancelCustomLlmOptimizationRunRequestFromWire(w *cancelCustomLlmOptimizatio }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelCustomLlmOptimizationRunRequest) MarshalJSON() ([]byte, error) { + w, err := cancelCustomLlmOptimizationRunRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelCustomLlmOptimizationRunRequest) UnmarshalJSON(data []byte) error { + var w cancelCustomLlmOptimizationRunRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelCustomLlmOptimizationRunRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCustomLlmRequestWire struct { Name *string `json:"name,omitempty"` Instructions *string `json:"instructions,omitempty"` @@ -72,6 +97,30 @@ func createCustomLlmRequestFromWire(w *createCustomLlmRequestWire) (*CreateCusto }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCustomLlmRequest) MarshalJSON() ([]byte, error) { + w, err := createCustomLlmRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCustomLlmRequest) UnmarshalJSON(data []byte) error { + var w createCustomLlmRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCustomLlmRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type customLlmWire struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -129,6 +178,30 @@ func customLlmFromWire(w *customLlmWire) (*CustomLlm, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CustomLlm) MarshalJSON() ([]byte, error) { + w, err := customLlmToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CustomLlm) UnmarshalJSON(data []byte) error { + var w customLlmWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := customLlmFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type datasetWire struct { Table *tableWire `json:"table,omitempty"` } @@ -159,6 +232,30 @@ func datasetFromWire(w *datasetWire) (*Dataset, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Dataset) MarshalJSON() ([]byte, error) { + w, err := datasetToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Dataset) UnmarshalJSON(data []byte) error { + var w datasetWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := datasetFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCustomLlmRequestWire struct { Id *string `json:"id,omitempty"` } @@ -181,6 +278,30 @@ func deleteCustomLlmRequestFromWire(w *deleteCustomLlmRequestWire) (*DeleteCusto }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCustomLlmRequest) MarshalJSON() ([]byte, error) { + w, err := deleteCustomLlmRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCustomLlmRequest) UnmarshalJSON(data []byte) error { + var w deleteCustomLlmRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCustomLlmRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCustomLlmRequestWire struct { Id *string `json:"id,omitempty"` } @@ -203,6 +324,30 @@ func getCustomLlmRequestFromWire(w *getCustomLlmRequestWire) (*GetCustomLlmReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCustomLlmRequest) MarshalJSON() ([]byte, error) { + w, err := getCustomLlmRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCustomLlmRequest) UnmarshalJSON(data []byte) error { + var w getCustomLlmRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCustomLlmRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type startCustomLlmOptimizationRunRequestWire struct { Id *string `json:"id,omitempty"` } @@ -225,6 +370,30 @@ func startCustomLlmOptimizationRunRequestFromWire(w *startCustomLlmOptimizationR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StartCustomLlmOptimizationRunRequest) MarshalJSON() ([]byte, error) { + w, err := startCustomLlmOptimizationRunRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StartCustomLlmOptimizationRunRequest) UnmarshalJSON(data []byte) error { + var w startCustomLlmOptimizationRunRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := startCustomLlmOptimizationRunRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tableWire struct { TablePath *string `json:"table_path,omitempty"` RequestCol *string `json:"request_col,omitempty"` @@ -253,6 +422,30 @@ func tableFromWire(w *tableWire) (*Table, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Table) MarshalJSON() ([]byte, error) { + w, err := tableToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Table) UnmarshalJSON(data []byte) error { + var w tableWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tableFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCustomLlmRequestWire struct { Id *string `json:"id,omitempty"` CustomLlm *customLlmWire `json:"custom_llm,omitempty"` @@ -289,6 +482,30 @@ func updateCustomLlmRequestFromWire(w *updateCustomLlmRequestWire) (*UpdateCusto }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCustomLlmRequest) MarshalJSON() ([]byte, error) { + w, err := updateCustomLlmRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCustomLlmRequest) UnmarshalJSON(data []byte) error { + var w updateCustomLlmRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCustomLlmRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/database/CHANGELOG.md b/database/CHANGELOG.md index cf26bda6..fbc95ae7 100644 --- a/database/CHANGELOG.md +++ b/database/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/database/internal/version.go b/database/internal/version.go index 4dd680d3..69c1f251 100644 --- a/database/internal/version.go +++ b/database/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-database" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/database/v1/wire.go b/database/v1/wire.go index f87dafb2..91bc8afc 100644 --- a/database/v1/wire.go +++ b/database/v1/wire.go @@ -84,6 +84,30 @@ func createDatabaseCatalogRequestFromWire(w *createDatabaseCatalogRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateDatabaseCatalogRequest) MarshalJSON() ([]byte, error) { + w, err := createDatabaseCatalogRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateDatabaseCatalogRequest) UnmarshalJSON(data []byte) error { + var w createDatabaseCatalogRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createDatabaseCatalogRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createDatabaseInstanceRequestWire struct { DatabaseInstance *databaseInstanceWire `json:"database_instance,omitempty"` } @@ -114,6 +138,30 @@ func createDatabaseInstanceRequestFromWire(w *createDatabaseInstanceRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateDatabaseInstanceRequest) MarshalJSON() ([]byte, error) { + w, err := createDatabaseInstanceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateDatabaseInstanceRequest) UnmarshalJSON(data []byte) error { + var w createDatabaseInstanceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createDatabaseInstanceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createDatabaseInstanceRoleRequestWire struct { InstanceName *string `json:"instance_name,omitempty"` DatabaseInstanceRole *databaseInstanceRoleWire `json:"database_instance_role,omitempty"` @@ -150,6 +198,30 @@ func createDatabaseInstanceRoleRequestFromWire(w *createDatabaseInstanceRoleRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateDatabaseInstanceRoleRequest) MarshalJSON() ([]byte, error) { + w, err := createDatabaseInstanceRoleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateDatabaseInstanceRoleRequest) UnmarshalJSON(data []byte) error { + var w createDatabaseInstanceRoleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createDatabaseInstanceRoleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createDatabaseTableRequestWire struct { Table *databaseTableWire `json:"table,omitempty"` } @@ -180,6 +252,30 @@ func createDatabaseTableRequestFromWire(w *createDatabaseTableRequestWire) (*Cre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateDatabaseTableRequest) MarshalJSON() ([]byte, error) { + w, err := createDatabaseTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateDatabaseTableRequest) UnmarshalJSON(data []byte) error { + var w createDatabaseTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createDatabaseTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createSyncedDatabaseTableRequestWire struct { SyncedTable *syncedDatabaseTableWire `json:"synced_table,omitempty"` } @@ -210,6 +306,30 @@ func createSyncedDatabaseTableRequestFromWire(w *createSyncedDatabaseTableReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateSyncedDatabaseTableRequest) MarshalJSON() ([]byte, error) { + w, err := createSyncedDatabaseTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateSyncedDatabaseTableRequest) UnmarshalJSON(data []byte) error { + var w createSyncedDatabaseTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createSyncedDatabaseTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type customTagWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -235,6 +355,30 @@ func customTagFromWire(w *customTagWire) (*CustomTag, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CustomTag) MarshalJSON() ([]byte, error) { + w, err := customTagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CustomTag) UnmarshalJSON(data []byte) error { + var w customTagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := customTagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databaseCatalogWire struct { Name *string `json:"name,omitempty"` DatabaseInstanceName *string `json:"database_instance_name,omitempty"` @@ -269,6 +413,30 @@ func databaseCatalogFromWire(w *databaseCatalogWire) (*DatabaseCatalog, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatabaseCatalog) MarshalJSON() ([]byte, error) { + w, err := databaseCatalogToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatabaseCatalog) UnmarshalJSON(data []byte) error { + var w databaseCatalogWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databaseCatalogFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databaseCredentialWire struct { Token *string `json:"token,omitempty"` ExpirationTime *types.Time `json:"expiration_time,omitempty"` @@ -294,6 +462,30 @@ func databaseCredentialFromWire(w *databaseCredentialWire) (*DatabaseCredential, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatabaseCredential) MarshalJSON() ([]byte, error) { + w, err := databaseCredentialToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatabaseCredential) UnmarshalJSON(data []byte) error { + var w databaseCredentialWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databaseCredentialFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databaseInstanceWire struct { Uid *string `json:"uid,omitempty"` Name *string `json:"name,omitempty"` @@ -423,6 +615,30 @@ func databaseInstanceFromWire(w *databaseInstanceWire) (*DatabaseInstance, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatabaseInstance) MarshalJSON() ([]byte, error) { + w, err := databaseInstanceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatabaseInstance) UnmarshalJSON(data []byte) error { + var w databaseInstanceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databaseInstanceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databaseInstanceRefWire struct { Uid *string `json:"uid,omitempty"` Name *string `json:"name,omitempty"` @@ -457,6 +673,30 @@ func databaseInstanceRefFromWire(w *databaseInstanceRefWire) (*DatabaseInstanceR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatabaseInstanceRef) MarshalJSON() ([]byte, error) { + w, err := databaseInstanceRefToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatabaseInstanceRef) UnmarshalJSON(data []byte) error { + var w databaseInstanceRefWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databaseInstanceRefFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databaseInstanceRoleWire struct { Name *string `json:"name,omitempty"` IdentityType DatabaseInstanceRole_IdentityType `json:"identity_type,omitempty"` @@ -510,6 +750,30 @@ func databaseInstanceRoleFromWire(w *databaseInstanceRoleWire) (*DatabaseInstanc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatabaseInstanceRole) MarshalJSON() ([]byte, error) { + w, err := databaseInstanceRoleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatabaseInstanceRole) UnmarshalJSON(data []byte) error { + var w databaseInstanceRoleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databaseInstanceRoleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databaseInstanceRole_AttributesWire struct { Createdb *bool `json:"createdb,omitempty"` Createrole *bool `json:"createrole,omitempty"` @@ -538,6 +802,30 @@ func databaseInstanceRole_AttributesFromWire(w *databaseInstanceRole_AttributesW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatabaseInstanceRole_Attributes) MarshalJSON() ([]byte, error) { + w, err := databaseInstanceRole_AttributesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatabaseInstanceRole_Attributes) UnmarshalJSON(data []byte) error { + var w databaseInstanceRole_AttributesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databaseInstanceRole_AttributesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databaseTableWire struct { Name *string `json:"name,omitempty"` DatabaseInstanceName *string `json:"database_instance_name,omitempty"` @@ -566,6 +854,30 @@ func databaseTableFromWire(w *databaseTableWire) (*DatabaseTable, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatabaseTable) MarshalJSON() ([]byte, error) { + w, err := databaseTableToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatabaseTable) UnmarshalJSON(data []byte) error { + var w databaseTableWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databaseTableFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteDatabaseCatalogRequestWire struct { Name *string `json:"name,omitempty"` } @@ -588,6 +900,30 @@ func deleteDatabaseCatalogRequestFromWire(w *deleteDatabaseCatalogRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteDatabaseCatalogRequest) MarshalJSON() ([]byte, error) { + w, err := deleteDatabaseCatalogRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteDatabaseCatalogRequest) UnmarshalJSON(data []byte) error { + var w deleteDatabaseCatalogRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteDatabaseCatalogRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteDatabaseInstanceRequestWire struct { Name *string `json:"name,omitempty"` Force *bool `json:"force,omitempty"` @@ -616,6 +952,30 @@ func deleteDatabaseInstanceRequestFromWire(w *deleteDatabaseInstanceRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteDatabaseInstanceRequest) MarshalJSON() ([]byte, error) { + w, err := deleteDatabaseInstanceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteDatabaseInstanceRequest) UnmarshalJSON(data []byte) error { + var w deleteDatabaseInstanceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteDatabaseInstanceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteDatabaseInstanceRoleRequestWire struct { InstanceName *string `json:"instance_name,omitempty"` Name *string `json:"name,omitempty"` @@ -647,6 +1007,30 @@ func deleteDatabaseInstanceRoleRequestFromWire(w *deleteDatabaseInstanceRoleRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteDatabaseInstanceRoleRequest) MarshalJSON() ([]byte, error) { + w, err := deleteDatabaseInstanceRoleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteDatabaseInstanceRoleRequest) UnmarshalJSON(data []byte) error { + var w deleteDatabaseInstanceRoleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteDatabaseInstanceRoleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteDatabaseTableRequestWire struct { Name *string `json:"name,omitempty"` } @@ -669,6 +1053,30 @@ func deleteDatabaseTableRequestFromWire(w *deleteDatabaseTableRequestWire) (*Del }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteDatabaseTableRequest) MarshalJSON() ([]byte, error) { + w, err := deleteDatabaseTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteDatabaseTableRequest) UnmarshalJSON(data []byte) error { + var w deleteDatabaseTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteDatabaseTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteSyncedDatabaseTableRequestWire struct { Name *string `json:"name,omitempty"` PurgeData *bool `json:"purge_data,omitempty"` @@ -694,6 +1102,30 @@ func deleteSyncedDatabaseTableRequestFromWire(w *deleteSyncedDatabaseTableReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteSyncedDatabaseTableRequest) MarshalJSON() ([]byte, error) { + w, err := deleteSyncedDatabaseTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteSyncedDatabaseTableRequest) UnmarshalJSON(data []byte) error { + var w deleteSyncedDatabaseTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteSyncedDatabaseTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deltaTableSyncInfoWire struct { DeltaCommitVersion *wireInt64 `json:"delta_commit_version,omitempty"` DeltaCommitTimestamp *types.Time `json:"delta_commit_timestamp,omitempty"` @@ -727,6 +1159,30 @@ func deltaTableSyncInfoFromWire(w *deltaTableSyncInfoWire) (*DeltaTableSyncInfo, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeltaTableSyncInfo) MarshalJSON() ([]byte, error) { + w, err := deltaTableSyncInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeltaTableSyncInfo) UnmarshalJSON(data []byte) error { + var w deltaTableSyncInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deltaTableSyncInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type findDatabaseInstanceByUidRequestWire struct { Uid *string `json:"uid,omitempty"` } @@ -749,6 +1205,30 @@ func findDatabaseInstanceByUidRequestFromWire(w *findDatabaseInstanceByUidReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FindDatabaseInstanceByUidRequest) MarshalJSON() ([]byte, error) { + w, err := findDatabaseInstanceByUidRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FindDatabaseInstanceByUidRequest) UnmarshalJSON(data []byte) error { + var w findDatabaseInstanceByUidRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := findDatabaseInstanceByUidRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type generateDatabaseCredentialRequestWire struct { RequestId *string `json:"request_id,omitempty"` InstanceNames []string `json:"instance_names,omitempty"` @@ -785,6 +1265,30 @@ func generateDatabaseCredentialRequestFromWire(w *generateDatabaseCredentialRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenerateDatabaseCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := generateDatabaseCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenerateDatabaseCredentialRequest) UnmarshalJSON(data []byte) error { + var w generateDatabaseCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := generateDatabaseCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getDatabaseCatalogRequestWire struct { Name *string `json:"name,omitempty"` } @@ -807,6 +1311,30 @@ func getDatabaseCatalogRequestFromWire(w *getDatabaseCatalogRequestWire) (*GetDa }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetDatabaseCatalogRequest) MarshalJSON() ([]byte, error) { + w, err := getDatabaseCatalogRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetDatabaseCatalogRequest) UnmarshalJSON(data []byte) error { + var w getDatabaseCatalogRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getDatabaseCatalogRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getDatabaseInstanceRequestWire struct { Name *string `json:"name,omitempty"` } @@ -829,6 +1357,30 @@ func getDatabaseInstanceRequestFromWire(w *getDatabaseInstanceRequestWire) (*Get }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetDatabaseInstanceRequest) MarshalJSON() ([]byte, error) { + w, err := getDatabaseInstanceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetDatabaseInstanceRequest) UnmarshalJSON(data []byte) error { + var w getDatabaseInstanceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getDatabaseInstanceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getDatabaseInstanceRoleRequestWire struct { InstanceName *string `json:"instance_name,omitempty"` Name *string `json:"name,omitempty"` @@ -854,6 +1406,30 @@ func getDatabaseInstanceRoleRequestFromWire(w *getDatabaseInstanceRoleRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetDatabaseInstanceRoleRequest) MarshalJSON() ([]byte, error) { + w, err := getDatabaseInstanceRoleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetDatabaseInstanceRoleRequest) UnmarshalJSON(data []byte) error { + var w getDatabaseInstanceRoleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getDatabaseInstanceRoleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getDatabaseTableRequestWire struct { Name *string `json:"name,omitempty"` } @@ -876,6 +1452,30 @@ func getDatabaseTableRequestFromWire(w *getDatabaseTableRequestWire) (*GetDataba }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetDatabaseTableRequest) MarshalJSON() ([]byte, error) { + w, err := getDatabaseTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetDatabaseTableRequest) UnmarshalJSON(data []byte) error { + var w getDatabaseTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getDatabaseTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSyncedDatabaseTableRequestWire struct { Name *string `json:"name,omitempty"` } @@ -898,6 +1498,30 @@ func getSyncedDatabaseTableRequestFromWire(w *getSyncedDatabaseTableRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSyncedDatabaseTableRequest) MarshalJSON() ([]byte, error) { + w, err := getSyncedDatabaseTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSyncedDatabaseTableRequest) UnmarshalJSON(data []byte) error { + var w getSyncedDatabaseTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSyncedDatabaseTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDatabaseCatalogsRequestWire struct { InstanceName *string `json:"instance_name,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -926,6 +1550,30 @@ func listDatabaseCatalogsRequestFromWire(w *listDatabaseCatalogsRequestWire) (*L }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDatabaseCatalogsRequest) MarshalJSON() ([]byte, error) { + w, err := listDatabaseCatalogsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDatabaseCatalogsRequest) UnmarshalJSON(data []byte) error { + var w listDatabaseCatalogsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDatabaseCatalogsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDatabaseCatalogsResponseWire struct { DatabaseCatalogs []databaseCatalogWire `json:"database_catalogs,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -959,6 +1607,30 @@ func listDatabaseCatalogsResponseFromWire(w *listDatabaseCatalogsResponseWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDatabaseCatalogsResponse) MarshalJSON() ([]byte, error) { + w, err := listDatabaseCatalogsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDatabaseCatalogsResponse) UnmarshalJSON(data []byte) error { + var w listDatabaseCatalogsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDatabaseCatalogsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDatabaseInstanceRolesRequestWire struct { InstanceName *string `json:"instance_name,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -987,6 +1659,30 @@ func listDatabaseInstanceRolesRequestFromWire(w *listDatabaseInstanceRolesReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDatabaseInstanceRolesRequest) MarshalJSON() ([]byte, error) { + w, err := listDatabaseInstanceRolesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDatabaseInstanceRolesRequest) UnmarshalJSON(data []byte) error { + var w listDatabaseInstanceRolesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDatabaseInstanceRolesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDatabaseInstanceRolesResponseWire struct { DatabaseInstanceRoles []databaseInstanceRoleWire `json:"database_instance_roles,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1020,6 +1716,30 @@ func listDatabaseInstanceRolesResponseFromWire(w *listDatabaseInstanceRolesRespo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDatabaseInstanceRolesResponse) MarshalJSON() ([]byte, error) { + w, err := listDatabaseInstanceRolesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDatabaseInstanceRolesResponse) UnmarshalJSON(data []byte) error { + var w listDatabaseInstanceRolesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDatabaseInstanceRolesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDatabaseInstancesRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -1045,6 +1765,30 @@ func listDatabaseInstancesRequestFromWire(w *listDatabaseInstancesRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDatabaseInstancesRequest) MarshalJSON() ([]byte, error) { + w, err := listDatabaseInstancesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDatabaseInstancesRequest) UnmarshalJSON(data []byte) error { + var w listDatabaseInstancesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDatabaseInstancesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDatabaseInstancesResponseWire struct { DatabaseInstances []databaseInstanceWire `json:"database_instances,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1078,6 +1822,30 @@ func listDatabaseInstancesResponseFromWire(w *listDatabaseInstancesResponseWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDatabaseInstancesResponse) MarshalJSON() ([]byte, error) { + w, err := listDatabaseInstancesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDatabaseInstancesResponse) UnmarshalJSON(data []byte) error { + var w listDatabaseInstancesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDatabaseInstancesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSyncedDatabaseTablesRequestWire struct { InstanceName *string `json:"instance_name,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -1106,6 +1874,30 @@ func listSyncedDatabaseTablesRequestFromWire(w *listSyncedDatabaseTablesRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSyncedDatabaseTablesRequest) MarshalJSON() ([]byte, error) { + w, err := listSyncedDatabaseTablesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSyncedDatabaseTablesRequest) UnmarshalJSON(data []byte) error { + var w listSyncedDatabaseTablesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSyncedDatabaseTablesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSyncedDatabaseTablesResponseWire struct { SyncedTables []syncedDatabaseTableWire `json:"synced_tables,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1139,6 +1931,30 @@ func listSyncedDatabaseTablesResponseFromWire(w *listSyncedDatabaseTablesRespons }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSyncedDatabaseTablesResponse) MarshalJSON() ([]byte, error) { + w, err := listSyncedDatabaseTablesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSyncedDatabaseTablesResponse) UnmarshalJSON(data []byte) error { + var w listSyncedDatabaseTablesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSyncedDatabaseTablesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type newPipelineSpecWire struct { StorageCatalog *string `json:"storage_catalog,omitempty"` StorageSchema *string `json:"storage_schema,omitempty"` @@ -1167,6 +1983,30 @@ func newPipelineSpecFromWire(w *newPipelineSpecWire) (*NewPipelineSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NewPipelineSpec) MarshalJSON() ([]byte, error) { + w, err := newPipelineSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NewPipelineSpec) UnmarshalJSON(data []byte) error { + var w newPipelineSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := newPipelineSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type provisioningInfoWire struct { } @@ -1184,6 +2024,30 @@ func provisioningInfoFromWire(w *provisioningInfoWire) (*ProvisioningInfo, error return &ProvisioningInfo{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProvisioningInfo) MarshalJSON() ([]byte, error) { + w, err := provisioningInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProvisioningInfo) UnmarshalJSON(data []byte) error { + var w provisioningInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := provisioningInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type requestedClaimsWire struct { PermissionSet RequestedClaims_PermissionSet `json:"permission_set,omitempty"` Resources []requestedResourceWire `json:"resources,omitempty"` @@ -1217,6 +2081,30 @@ func requestedClaimsFromWire(w *requestedClaimsWire) (*RequestedClaims, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RequestedClaims) MarshalJSON() ([]byte, error) { + w, err := requestedClaimsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RequestedClaims) UnmarshalJSON(data []byte) error { + var w requestedClaimsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := requestedClaimsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type requestedResourceWire struct { UnspecifiedResourceName *string `json:"unspecified_resource_name,omitempty"` TableName *string `json:"table_name,omitempty"` @@ -1273,6 +2161,30 @@ func requestedResourceFromWire(w *requestedResourceWire) (*RequestedResource, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RequestedResource) MarshalJSON() ([]byte, error) { + w, err := requestedResourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RequestedResource) UnmarshalJSON(data []byte) error { + var w requestedResourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := requestedResourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedDatabaseTableWire struct { Name *string `json:"name,omitempty"` DatabaseInstanceName *string `json:"database_instance_name,omitempty"` @@ -1332,6 +2244,30 @@ func syncedDatabaseTableFromWire(w *syncedDatabaseTableWire) (*SyncedDatabaseTab }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedDatabaseTable) MarshalJSON() ([]byte, error) { + w, err := syncedDatabaseTableToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedDatabaseTable) UnmarshalJSON(data []byte) error { + var w syncedDatabaseTableWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedDatabaseTableFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedTableContinuousUpdateStatusWire struct { LastProcessedCommitVersion *wireInt64 `json:"last_processed_commit_version,omitempty"` Timestamp *types.Time `json:"timestamp,omitempty"` @@ -1376,6 +2312,30 @@ func syncedTableContinuousUpdateStatusFromWire(w *syncedTableContinuousUpdateSta }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTableContinuousUpdateStatus) MarshalJSON() ([]byte, error) { + w, err := syncedTableContinuousUpdateStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTableContinuousUpdateStatus) UnmarshalJSON(data []byte) error { + var w syncedTableContinuousUpdateStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTableContinuousUpdateStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedTableFailedStatusWire struct { LastProcessedCommitVersion *wireInt64 `json:"last_processed_commit_version,omitempty"` Timestamp *types.Time `json:"timestamp,omitempty"` @@ -1409,6 +2369,30 @@ func syncedTableFailedStatusFromWire(w *syncedTableFailedStatusWire) (*SyncedTab }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTableFailedStatus) MarshalJSON() ([]byte, error) { + w, err := syncedTableFailedStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTableFailedStatus) UnmarshalJSON(data []byte) error { + var w syncedTableFailedStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTableFailedStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedTablePipelineProgressWire struct { LatestVersionCurrentlyProcessing *wireInt64 `json:"latest_version_currently_processing,omitempty"` SyncedRowCount *wireInt64 `json:"synced_row_count,omitempty"` @@ -1470,6 +2454,30 @@ func syncedTablePipelineProgressFromWire(w *syncedTablePipelineProgressWire) (*S }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTablePipelineProgress) MarshalJSON() ([]byte, error) { + w, err := syncedTablePipelineProgressToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTablePipelineProgress) UnmarshalJSON(data []byte) error { + var w syncedTablePipelineProgressWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTablePipelineProgressFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedTablePositionWire struct { SyncStartTimestamp *types.Time `json:"sync_start_timestamp,omitempty"` SyncEndTimestamp *types.Time `json:"sync_end_timestamp,omitempty"` @@ -1528,6 +2536,30 @@ func syncedTablePositionFromWire(w *syncedTablePositionWire) (*SyncedTablePositi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTablePosition) MarshalJSON() ([]byte, error) { + w, err := syncedTablePositionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTablePosition) UnmarshalJSON(data []byte) error { + var w syncedTablePositionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTablePositionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedTableProvisioningStatusWire struct { InitialPipelineSyncProgress *syncedTablePipelineProgressWire `json:"initial_pipeline_sync_progress,omitempty"` } @@ -1558,6 +2590,30 @@ func syncedTableProvisioningStatusFromWire(w *syncedTableProvisioningStatusWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTableProvisioningStatus) MarshalJSON() ([]byte, error) { + w, err := syncedTableProvisioningStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTableProvisioningStatus) UnmarshalJSON(data []byte) error { + var w syncedTableProvisioningStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTableProvisioningStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedTableSpecWire struct { SchedulingPolicy SyncedTableSchedulingPolicy `json:"scheduling_policy,omitempty"` SourceTableFullName *string `json:"source_table_full_name,omitempty"` @@ -1620,6 +2676,30 @@ func syncedTableSpecFromWire(w *syncedTableSpecWire) (*SyncedTableSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTableSpec) MarshalJSON() ([]byte, error) { + w, err := syncedTableSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTableSpec) UnmarshalJSON(data []byte) error { + var w syncedTableSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTableSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedTableSpec_TypeOverrideWire struct { ColumnName *string `json:"column_name,omitempty"` PgType SyncedTableSpec_PgSpecificType `json:"pg_type,omitempty"` @@ -1648,6 +2728,30 @@ func syncedTableSpec_TypeOverrideFromWire(w *syncedTableSpec_TypeOverrideWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTableSpec_TypeOverride) MarshalJSON() ([]byte, error) { + w, err := syncedTableSpec_TypeOverrideToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTableSpec_TypeOverride) UnmarshalJSON(data []byte) error { + var w syncedTableSpec_TypeOverrideWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTableSpec_TypeOverrideFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedTableStatusWire struct { DetailedState SyncedTableState `json:"detailed_state,omitempty"` Message *string `json:"message,omitempty"` @@ -1780,6 +2884,30 @@ func syncedTableStatusFromWire(w *syncedTableStatusWire) (*SyncedTableStatus, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTableStatus) MarshalJSON() ([]byte, error) { + w, err := syncedTableStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTableStatus) UnmarshalJSON(data []byte) error { + var w syncedTableStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTableStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedTableTriggeredUpdateStatusWire struct { LastProcessedCommitVersion *wireInt64 `json:"last_processed_commit_version,omitempty"` Timestamp *types.Time `json:"timestamp,omitempty"` @@ -1824,6 +2952,30 @@ func syncedTableTriggeredUpdateStatusFromWire(w *syncedTableTriggeredUpdateStatu }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTableTriggeredUpdateStatus) MarshalJSON() ([]byte, error) { + w, err := syncedTableTriggeredUpdateStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTableTriggeredUpdateStatus) UnmarshalJSON(data []byte) error { + var w syncedTableTriggeredUpdateStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTableTriggeredUpdateStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateDatabaseCatalogRequestWire struct { DatabaseCatalog *databaseCatalogWire `json:"database_catalog,omitempty"` UpdateMask *types.FieldMask[DatabaseCatalog] `json:"update_mask,omitempty"` @@ -1857,6 +3009,30 @@ func updateDatabaseCatalogRequestFromWire(w *updateDatabaseCatalogRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateDatabaseCatalogRequest) MarshalJSON() ([]byte, error) { + w, err := updateDatabaseCatalogRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateDatabaseCatalogRequest) UnmarshalJSON(data []byte) error { + var w updateDatabaseCatalogRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateDatabaseCatalogRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateDatabaseInstanceRequestWire struct { DatabaseInstance *databaseInstanceWire `json:"database_instance,omitempty"` UpdateMask *types.FieldMask[DatabaseInstance] `json:"update_mask,omitempty"` @@ -1890,6 +3066,30 @@ func updateDatabaseInstanceRequestFromWire(w *updateDatabaseInstanceRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateDatabaseInstanceRequest) MarshalJSON() ([]byte, error) { + w, err := updateDatabaseInstanceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateDatabaseInstanceRequest) UnmarshalJSON(data []byte) error { + var w updateDatabaseInstanceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateDatabaseInstanceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateSyncedDatabaseTableRequestWire struct { SyncedTable *syncedDatabaseTableWire `json:"synced_table,omitempty"` UpdateMask *types.FieldMask[SyncedDatabaseTable] `json:"update_mask,omitempty"` @@ -1923,6 +3123,30 @@ func updateSyncedDatabaseTableRequestFromWire(w *updateSyncedDatabaseTableReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateSyncedDatabaseTableRequest) MarshalJSON() ([]byte, error) { + w, err := updateSyncedDatabaseTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateSyncedDatabaseTableRequest) UnmarshalJSON(data []byte) error { + var w updateSyncedDatabaseTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateSyncedDatabaseTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/dataclassification/CHANGELOG.md b/dataclassification/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/dataclassification/CHANGELOG.md +++ b/dataclassification/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/dataclassification/internal/version.go b/dataclassification/internal/version.go index 90aed364..2d5b1c76 100644 --- a/dataclassification/internal/version.go +++ b/dataclassification/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-dataclassification" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/dataclassification/v1/wire.go b/dataclassification/v1/wire.go index fdfb0cbc..001bfafb 100644 --- a/dataclassification/v1/wire.go +++ b/dataclassification/v1/wire.go @@ -3,6 +3,7 @@ package dataclassification import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -33,6 +34,30 @@ func autoTaggingConfigFromWire(w *autoTaggingConfigWire) (*AutoTaggingConfig, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AutoTaggingConfig) MarshalJSON() ([]byte, error) { + w, err := autoTaggingConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AutoTaggingConfig) UnmarshalJSON(data []byte) error { + var w autoTaggingConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := autoTaggingConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type catalogConfigWire struct { Name *string `json:"name,omitempty"` IncludedSchemas *catalogConfig_SchemaNamesWire `json:"included_schemas,omitempty"` @@ -119,6 +144,30 @@ func catalogConfigFromWire(w *catalogConfigWire) (*CatalogConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CatalogConfig) MarshalJSON() ([]byte, error) { + w, err := catalogConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CatalogConfig) UnmarshalJSON(data []byte) error { + var w catalogConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := catalogConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type catalogConfig_SchemaNamesWire struct { Names []string `json:"names,omitempty"` } @@ -141,6 +190,30 @@ func catalogConfig_SchemaNamesFromWire(w *catalogConfig_SchemaNamesWire) (*Catal }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CatalogConfig_SchemaNames) MarshalJSON() ([]byte, error) { + w, err := catalogConfig_SchemaNamesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CatalogConfig_SchemaNames) UnmarshalJSON(data []byte) error { + var w catalogConfig_SchemaNamesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := catalogConfig_SchemaNamesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCatalogConfigRequestWire struct { Parent *string `json:"parent,omitempty"` CatalogConfig *catalogConfigWire `json:"catalog_config,omitempty"` @@ -174,6 +247,30 @@ func createCatalogConfigRequestFromWire(w *createCatalogConfigRequestWire) (*Cre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCatalogConfigRequest) MarshalJSON() ([]byte, error) { + w, err := createCatalogConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCatalogConfigRequest) UnmarshalJSON(data []byte) error { + var w createCatalogConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCatalogConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCatalogConfigRequestWire struct { Name *string `json:"name,omitempty"` } @@ -196,6 +293,30 @@ func deleteCatalogConfigRequestFromWire(w *deleteCatalogConfigRequestWire) (*Del }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCatalogConfigRequest) MarshalJSON() ([]byte, error) { + w, err := deleteCatalogConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCatalogConfigRequest) UnmarshalJSON(data []byte) error { + var w deleteCatalogConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCatalogConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCatalogConfigRequestWire struct { Name *string `json:"name,omitempty"` } @@ -218,6 +339,30 @@ func getCatalogConfigRequestFromWire(w *getCatalogConfigRequestWire) (*GetCatalo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCatalogConfigRequest) MarshalJSON() ([]byte, error) { + w, err := getCatalogConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCatalogConfigRequest) UnmarshalJSON(data []byte) error { + var w getCatalogConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCatalogConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCatalogConfigRequestWire struct { CatalogConfig *catalogConfigWire `json:"catalog_config,omitempty"` UpdateMask *types.FieldMask[CatalogConfig] `json:"update_mask,omitempty"` @@ -251,6 +396,30 @@ func updateCatalogConfigRequestFromWire(w *updateCatalogConfigRequestWire) (*Upd }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCatalogConfigRequest) MarshalJSON() ([]byte, error) { + w, err := updateCatalogConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCatalogConfigRequest) UnmarshalJSON(data []byte) error { + var w updateCatalogConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCatalogConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/dataquality/CHANGELOG.md b/dataquality/CHANGELOG.md index ca02e4be..6568eb64 100644 --- a/dataquality/CHANGELOG.md +++ b/dataquality/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.8.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.7.0 (2026-11-11) ## Release v0.6.0 (2026-11-10) diff --git a/dataquality/internal/version.go b/dataquality/internal/version.go index cdc932e1..4ab11846 100644 --- a/dataquality/internal/version.go +++ b/dataquality/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-dataquality" -const Version = "0.7.0" +const Version = "0.8.0" diff --git a/dataquality/v1/wire.go b/dataquality/v1/wire.go index 2c8d1372..855491c8 100644 --- a/dataquality/v1/wire.go +++ b/dataquality/v1/wire.go @@ -87,6 +87,30 @@ func anomalyDetectionConfigFromWire(w *anomalyDetectionConfigWire) (*AnomalyDete }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AnomalyDetectionConfig) MarshalJSON() ([]byte, error) { + w, err := anomalyDetectionConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AnomalyDetectionConfig) UnmarshalJSON(data []byte) error { + var w anomalyDetectionConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := anomalyDetectionConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cancelRefreshRequestWire struct { ObjectType *string `json:"object_type,omitempty"` ObjectId *string `json:"object_id,omitempty"` @@ -123,6 +147,30 @@ func cancelRefreshRequestFromWire(w *cancelRefreshRequestWire) (*CancelRefreshRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelRefreshRequest) MarshalJSON() ([]byte, error) { + w, err := cancelRefreshRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelRefreshRequest) UnmarshalJSON(data []byte) error { + var w cancelRefreshRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelRefreshRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cancelRefreshResponseWire struct { Refresh *refreshWire `json:"refresh,omitempty"` } @@ -153,6 +201,30 @@ func cancelRefreshResponseFromWire(w *cancelRefreshResponseWire) (*CancelRefresh }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelRefreshResponse) MarshalJSON() ([]byte, error) { + w, err := cancelRefreshResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelRefreshResponse) UnmarshalJSON(data []byte) error { + var w cancelRefreshResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelRefreshResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createMonitorRequestWire struct { Monitor *monitorWire `json:"monitor,omitempty"` } @@ -183,6 +255,30 @@ func createMonitorRequestFromWire(w *createMonitorRequestWire) (*CreateMonitorRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateMonitorRequest) MarshalJSON() ([]byte, error) { + w, err := createMonitorRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateMonitorRequest) UnmarshalJSON(data []byte) error { + var w createMonitorRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createMonitorRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createRefreshRequestWire struct { Refresh *refreshWire `json:"refresh,omitempty"` } @@ -213,6 +309,30 @@ func createRefreshRequestFromWire(w *createRefreshRequestWire) (*CreateRefreshRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateRefreshRequest) MarshalJSON() ([]byte, error) { + w, err := createRefreshRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateRefreshRequest) UnmarshalJSON(data []byte) error { + var w createRefreshRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createRefreshRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cronScheduleWire struct { QuartzCronExpression *string `json:"quartz_cron_expression,omitempty"` TimezoneId *string `json:"timezone_id,omitempty"` @@ -241,6 +361,30 @@ func cronScheduleFromWire(w *cronScheduleWire) (*CronSchedule, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CronSchedule) MarshalJSON() ([]byte, error) { + w, err := cronScheduleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CronSchedule) UnmarshalJSON(data []byte) error { + var w cronScheduleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cronScheduleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dataProfilingConfigWire struct { OutputSchemaId *string `json:"output_schema_id,omitempty"` AssetsDir *string `json:"assets_dir,omitempty"` @@ -416,6 +560,30 @@ func dataProfilingConfigFromWire(w *dataProfilingConfigWire) (*DataProfilingConf }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DataProfilingConfig) MarshalJSON() ([]byte, error) { + w, err := dataProfilingConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DataProfilingConfig) UnmarshalJSON(data []byte) error { + var w dataProfilingConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dataProfilingConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dataProfilingCustomMetricWire struct { Name *string `json:"name,omitempty"` Definition *string `json:"definition,omitempty"` @@ -450,6 +618,30 @@ func dataProfilingCustomMetricFromWire(w *dataProfilingCustomMetricWire) (*DataP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DataProfilingCustomMetric) MarshalJSON() ([]byte, error) { + w, err := dataProfilingCustomMetricToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DataProfilingCustomMetric) UnmarshalJSON(data []byte) error { + var w dataProfilingCustomMetricWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dataProfilingCustomMetricFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteMonitorRequestWire struct { ObjectType *string `json:"object_type,omitempty"` ObjectId *string `json:"object_id,omitempty"` @@ -475,6 +667,30 @@ func deleteMonitorRequestFromWire(w *deleteMonitorRequestWire) (*DeleteMonitorRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteMonitorRequest) MarshalJSON() ([]byte, error) { + w, err := deleteMonitorRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteMonitorRequest) UnmarshalJSON(data []byte) error { + var w deleteMonitorRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteMonitorRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRefreshRequestWire struct { ObjectType *string `json:"object_type,omitempty"` ObjectId *string `json:"object_id,omitempty"` @@ -511,6 +727,30 @@ func deleteRefreshRequestFromWire(w *deleteRefreshRequestWire) (*DeleteRefreshRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRefreshRequest) MarshalJSON() ([]byte, error) { + w, err := deleteRefreshRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRefreshRequest) UnmarshalJSON(data []byte) error { + var w deleteRefreshRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRefreshRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getMonitorRequestWire struct { ObjectType *string `json:"object_type,omitempty"` ObjectId *string `json:"object_id,omitempty"` @@ -536,6 +776,30 @@ func getMonitorRequestFromWire(w *getMonitorRequestWire) (*GetMonitorRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetMonitorRequest) MarshalJSON() ([]byte, error) { + w, err := getMonitorRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetMonitorRequest) UnmarshalJSON(data []byte) error { + var w getMonitorRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getMonitorRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRefreshRequestWire struct { ObjectType *string `json:"object_type,omitempty"` ObjectId *string `json:"object_id,omitempty"` @@ -572,6 +836,30 @@ func getRefreshRequestFromWire(w *getRefreshRequestWire) (*GetRefreshRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRefreshRequest) MarshalJSON() ([]byte, error) { + w, err := getRefreshRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRefreshRequest) UnmarshalJSON(data []byte) error { + var w getRefreshRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRefreshRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type inferenceLogConfigWire struct { ProblemType InferenceProblemType `json:"problem_type,omitempty"` TimestampColumn *string `json:"timestamp_column,omitempty"` @@ -609,6 +897,30 @@ func inferenceLogConfigFromWire(w *inferenceLogConfigWire) (*InferenceLogConfig, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InferenceLogConfig) MarshalJSON() ([]byte, error) { + w, err := inferenceLogConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InferenceLogConfig) UnmarshalJSON(data []byte) error { + var w inferenceLogConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := inferenceLogConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listMonitorRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -634,6 +946,30 @@ func listMonitorRequestFromWire(w *listMonitorRequestWire) (*ListMonitorRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListMonitorRequest) MarshalJSON() ([]byte, error) { + w, err := listMonitorRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListMonitorRequest) UnmarshalJSON(data []byte) error { + var w listMonitorRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listMonitorRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listMonitorResponseWire struct { Monitors []monitorWire `json:"monitors,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -667,6 +1003,30 @@ func listMonitorResponseFromWire(w *listMonitorResponseWire) (*ListMonitorRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListMonitorResponse) MarshalJSON() ([]byte, error) { + w, err := listMonitorResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListMonitorResponse) UnmarshalJSON(data []byte) error { + var w listMonitorResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listMonitorResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRefreshRequestWire struct { ObjectType *string `json:"object_type,omitempty"` ObjectId *string `json:"object_id,omitempty"` @@ -698,6 +1058,30 @@ func listRefreshRequestFromWire(w *listRefreshRequestWire) (*ListRefreshRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRefreshRequest) MarshalJSON() ([]byte, error) { + w, err := listRefreshRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRefreshRequest) UnmarshalJSON(data []byte) error { + var w listRefreshRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRefreshRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRefreshResponseWire struct { Refreshes []refreshWire `json:"refreshes,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -731,6 +1115,30 @@ func listRefreshResponseFromWire(w *listRefreshResponseWire) (*ListRefreshRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRefreshResponse) MarshalJSON() ([]byte, error) { + w, err := listRefreshResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRefreshResponse) UnmarshalJSON(data []byte) error { + var w listRefreshResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRefreshResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type monitorWire struct { ObjectType *string `json:"object_type,omitempty"` ObjectId *string `json:"object_id,omitempty"` @@ -778,6 +1186,30 @@ func monitorFromWire(w *monitorWire) (*Monitor, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Monitor) MarshalJSON() ([]byte, error) { + w, err := monitorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Monitor) UnmarshalJSON(data []byte) error { + var w monitorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := monitorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type notificationDestinationWire struct { EmailAddresses []string `json:"email_addresses,omitempty"` DestinationIds []string `json:"destination_ids,omitempty"` @@ -814,6 +1246,30 @@ func notificationDestinationFromWire(w *notificationDestinationWire) (*Notificat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NotificationDestination) MarshalJSON() ([]byte, error) { + w, err := notificationDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NotificationDestination) UnmarshalJSON(data []byte) error { + var w notificationDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := notificationDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type notificationSettingsWire struct { OnFailure *notificationDestinationWire `json:"on_failure,omitempty"` OnUnhealthyTable *notificationDestinationWire `json:"on_unhealthy_table,omitempty"` @@ -855,6 +1311,30 @@ func notificationSettingsFromWire(w *notificationSettingsWire) (*NotificationSet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NotificationSettings) MarshalJSON() ([]byte, error) { + w, err := notificationSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NotificationSettings) UnmarshalJSON(data []byte) error { + var w notificationSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := notificationSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type refreshWire struct { ObjectType *string `json:"object_type,omitempty"` ObjectId *string `json:"object_id,omitempty"` @@ -922,6 +1402,30 @@ func refreshFromWire(w *refreshWire) (*Refresh, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Refresh) MarshalJSON() ([]byte, error) { + w, err := refreshToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Refresh) UnmarshalJSON(data []byte) error { + var w refreshWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := refreshFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type snapshotConfigWire struct { } @@ -939,6 +1443,30 @@ func snapshotConfigFromWire(w *snapshotConfigWire) (*SnapshotConfig, error) { return &SnapshotConfig{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SnapshotConfig) MarshalJSON() ([]byte, error) { + w, err := snapshotConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SnapshotConfig) UnmarshalJSON(data []byte) error { + var w snapshotConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := snapshotConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type timeSeriesConfigWire struct { TimestampColumn *string `json:"timestamp_column,omitempty"` Granularities []AggregationGranularity `json:"granularities,omitempty"` @@ -964,6 +1492,30 @@ func timeSeriesConfigFromWire(w *timeSeriesConfigWire) (*TimeSeriesConfig, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TimeSeriesConfig) MarshalJSON() ([]byte, error) { + w, err := timeSeriesConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TimeSeriesConfig) UnmarshalJSON(data []byte) error { + var w timeSeriesConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := timeSeriesConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateMonitorRequestWire struct { ObjectType *string `json:"object_type,omitempty"` ObjectId *string `json:"object_id,omitempty"` @@ -1003,6 +1555,30 @@ func updateMonitorRequestFromWire(w *updateMonitorRequestWire) (*UpdateMonitorRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateMonitorRequest) MarshalJSON() ([]byte, error) { + w, err := updateMonitorRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateMonitorRequest) UnmarshalJSON(data []byte) error { + var w updateMonitorRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateMonitorRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateRefreshRequestWire struct { ObjectType *string `json:"object_type,omitempty"` ObjectId *string `json:"object_id,omitempty"` @@ -1053,6 +1629,30 @@ func updateRefreshRequestFromWire(w *updateRefreshRequestWire) (*UpdateRefreshRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateRefreshRequest) MarshalJSON() ([]byte, error) { + w, err := updateRefreshRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateRefreshRequest) UnmarshalJSON(data []byte) error { + var w updateRefreshRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateRefreshRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/disasterrecovery/CHANGELOG.md b/disasterrecovery/CHANGELOG.md index 5d759d42..f3d3d44e 100644 --- a/disasterrecovery/CHANGELOG.md +++ b/disasterrecovery/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/disasterrecovery/internal/version.go b/disasterrecovery/internal/version.go index ab7f8de7..f745aff8 100644 --- a/disasterrecovery/internal/version.go +++ b/disasterrecovery/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-disasterrecovery" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/disasterrecovery/v1/wire.go b/disasterrecovery/v1/wire.go index aabe01a7..012201c3 100644 --- a/disasterrecovery/v1/wire.go +++ b/disasterrecovery/v1/wire.go @@ -3,6 +3,7 @@ package disasterrecovery import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -47,6 +48,30 @@ func createFailoverGroupRequestFromWire(w *createFailoverGroupRequestWire) (*Cre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateFailoverGroupRequest) MarshalJSON() ([]byte, error) { + w, err := createFailoverGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateFailoverGroupRequest) UnmarshalJSON(data []byte) error { + var w createFailoverGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createFailoverGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createStableUrlRequestWire struct { Parent *string `json:"parent,omitempty"` StableUrl *stableUrlWire `json:"stable_url,omitempty"` @@ -86,6 +111,30 @@ func createStableUrlRequestFromWire(w *createStableUrlRequestWire) (*CreateStabl }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateStableUrlRequest) MarshalJSON() ([]byte, error) { + w, err := createStableUrlRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateStableUrlRequest) UnmarshalJSON(data []byte) error { + var w createStableUrlRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createStableUrlRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteFailoverGroupRequestWire struct { Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` @@ -111,6 +160,30 @@ func deleteFailoverGroupRequestFromWire(w *deleteFailoverGroupRequestWire) (*Del }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteFailoverGroupRequest) MarshalJSON() ([]byte, error) { + w, err := deleteFailoverGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteFailoverGroupRequest) UnmarshalJSON(data []byte) error { + var w deleteFailoverGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteFailoverGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteStableUrlRequestWire struct { Name *string `json:"name,omitempty"` } @@ -133,6 +206,30 @@ func deleteStableUrlRequestFromWire(w *deleteStableUrlRequestWire) (*DeleteStabl }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteStableUrlRequest) MarshalJSON() ([]byte, error) { + w, err := deleteStableUrlRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteStableUrlRequest) UnmarshalJSON(data []byte) error { + var w deleteStableUrlRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteStableUrlRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type failoverFailoverGroupRequestWire struct { Name *string `json:"name,omitempty"` TargetPrimaryRegion *string `json:"target_primary_region,omitempty"` @@ -164,6 +261,30 @@ func failoverFailoverGroupRequestFromWire(w *failoverFailoverGroupRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FailoverFailoverGroupRequest) MarshalJSON() ([]byte, error) { + w, err := failoverFailoverGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FailoverFailoverGroupRequest) UnmarshalJSON(data []byte) error { + var w failoverFailoverGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := failoverFailoverGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type failoverGroupWire struct { Name *string `json:"name,omitempty"` EffectivePrimaryRegion *string `json:"effective_primary_region,omitempty"` @@ -246,6 +367,30 @@ func failoverGroupFromWire(w *failoverGroupWire) (*FailoverGroup, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FailoverGroup) MarshalJSON() ([]byte, error) { + w, err := failoverGroupToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FailoverGroup) UnmarshalJSON(data []byte) error { + var w failoverGroupWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := failoverGroupFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getFailoverGroupRequestWire struct { Name *string `json:"name,omitempty"` } @@ -268,6 +413,30 @@ func getFailoverGroupRequestFromWire(w *getFailoverGroupRequestWire) (*GetFailov }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetFailoverGroupRequest) MarshalJSON() ([]byte, error) { + w, err := getFailoverGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetFailoverGroupRequest) UnmarshalJSON(data []byte) error { + var w getFailoverGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getFailoverGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getStableUrlRequestWire struct { Name *string `json:"name,omitempty"` } @@ -290,6 +459,30 @@ func getStableUrlRequestFromWire(w *getStableUrlRequestWire) (*GetStableUrlReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetStableUrlRequest) MarshalJSON() ([]byte, error) { + w, err := getStableUrlRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetStableUrlRequest) UnmarshalJSON(data []byte) error { + var w getStableUrlRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getStableUrlRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type initialReplicationProgressWire struct { Completed *int `json:"completed,omitempty"` } @@ -312,6 +505,30 @@ func initialReplicationProgressFromWire(w *initialReplicationProgressWire) (*Ini }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InitialReplicationProgress) MarshalJSON() ([]byte, error) { + w, err := initialReplicationProgressToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InitialReplicationProgress) UnmarshalJSON(data []byte) error { + var w initialReplicationProgressWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := initialReplicationProgressFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listFailoverGroupsRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -340,6 +557,30 @@ func listFailoverGroupsRequestFromWire(w *listFailoverGroupsRequestWire) (*ListF }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListFailoverGroupsRequest) MarshalJSON() ([]byte, error) { + w, err := listFailoverGroupsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListFailoverGroupsRequest) UnmarshalJSON(data []byte) error { + var w listFailoverGroupsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listFailoverGroupsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listFailoverGroupsResponseWire struct { FailoverGroups []failoverGroupWire `json:"failover_groups,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -373,6 +614,30 @@ func listFailoverGroupsResponseFromWire(w *listFailoverGroupsResponseWire) (*Lis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListFailoverGroupsResponse) MarshalJSON() ([]byte, error) { + w, err := listFailoverGroupsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListFailoverGroupsResponse) UnmarshalJSON(data []byte) error { + var w listFailoverGroupsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listFailoverGroupsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listStableUrlsRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -401,6 +666,30 @@ func listStableUrlsRequestFromWire(w *listStableUrlsRequestWire) (*ListStableUrl }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListStableUrlsRequest) MarshalJSON() ([]byte, error) { + w, err := listStableUrlsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListStableUrlsRequest) UnmarshalJSON(data []byte) error { + var w listStableUrlsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listStableUrlsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listStableUrlsResponseWire struct { StableUrls []stableUrlWire `json:"stable_urls,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -434,6 +723,30 @@ func listStableUrlsResponseFromWire(w *listStableUrlsResponseWire) (*ListStableU }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListStableUrlsResponse) MarshalJSON() ([]byte, error) { + w, err := listStableUrlsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListStableUrlsResponse) UnmarshalJSON(data []byte) error { + var w listStableUrlsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listStableUrlsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type locationMappingWire struct { Name *string `json:"name,omitempty"` UriByRegion []locationMappingEntryWire `json:"uri_by_region,omitempty"` @@ -467,6 +780,30 @@ func locationMappingFromWire(w *locationMappingWire) (*LocationMapping, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LocationMapping) MarshalJSON() ([]byte, error) { + w, err := locationMappingToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LocationMapping) UnmarshalJSON(data []byte) error { + var w locationMappingWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := locationMappingFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type locationMappingEntryWire struct { Region *string `json:"region,omitempty"` Uri *string `json:"uri,omitempty"` @@ -492,6 +829,30 @@ func locationMappingEntryFromWire(w *locationMappingEntryWire) (*LocationMapping }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LocationMappingEntry) MarshalJSON() ([]byte, error) { + w, err := locationMappingEntryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LocationMappingEntry) UnmarshalJSON(data []byte) error { + var w locationMappingEntryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := locationMappingEntryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type stableUrlWire struct { Name *string `json:"name,omitempty"` Url *string `json:"url,omitempty"` @@ -529,6 +890,30 @@ func stableUrlFromWire(w *stableUrlWire) (*StableUrl, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StableUrl) MarshalJSON() ([]byte, error) { + w, err := stableUrlToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StableUrl) UnmarshalJSON(data []byte) error { + var w stableUrlWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := stableUrlFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ucCatalogWire struct { Name *string `json:"name,omitempty"` } @@ -551,6 +936,30 @@ func ucCatalogFromWire(w *ucCatalogWire) (*UcCatalog, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UcCatalog) MarshalJSON() ([]byte, error) { + w, err := ucCatalogToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UcCatalog) UnmarshalJSON(data []byte) error { + var w ucCatalogWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ucCatalogFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ucReplicationConfigWire struct { LocationMappings []locationMappingWire `json:"location_mappings,omitempty"` Catalogs []ucCatalogWire `json:"catalogs,omitempty"` @@ -595,6 +1004,30 @@ func ucReplicationConfigFromWire(w *ucReplicationConfigWire) (*UcReplicationConf }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UcReplicationConfig) MarshalJSON() ([]byte, error) { + w, err := ucReplicationConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UcReplicationConfig) UnmarshalJSON(data []byte) error { + var w ucReplicationConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ucReplicationConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateFailoverGroupRequestWire struct { FailoverGroup *failoverGroupWire `json:"failover_group,omitempty"` UpdateMask *types.FieldMask[FailoverGroup] `json:"update_mask,omitempty"` @@ -631,6 +1064,30 @@ func updateFailoverGroupRequestFromWire(w *updateFailoverGroupRequestWire) (*Upd }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateFailoverGroupRequest) MarshalJSON() ([]byte, error) { + w, err := updateFailoverGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateFailoverGroupRequest) UnmarshalJSON(data []byte) error { + var w updateFailoverGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateFailoverGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type workspaceSetWire struct { Name *string `json:"name,omitempty"` WorkspaceIds []string `json:"workspace_ids,omitempty"` @@ -662,6 +1119,30 @@ func workspaceSetFromWire(w *workspaceSetWire) (*WorkspaceSet, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WorkspaceSet) MarshalJSON() ([]byte, error) { + w, err := workspaceSetToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WorkspaceSet) UnmarshalJSON(data []byte) error { + var w workspaceSetWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := workspaceSetFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/domains/CHANGELOG.md b/domains/CHANGELOG.md index 8374aa60..b66e09a6 100644 --- a/domains/CHANGELOG.md +++ b/domains/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/domains/internal/version.go b/domains/internal/version.go index f2436126..77bb864f 100644 --- a/domains/internal/version.go +++ b/domains/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-domains" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/domains/v1/wire.go b/domains/v1/wire.go index 26570d6c..ae580048 100644 --- a/domains/v1/wire.go +++ b/domains/v1/wire.go @@ -87,6 +87,30 @@ func createDomainRequestFromWire(w *createDomainRequestWire) (*CreateDomainReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateDomainRequest) MarshalJSON() ([]byte, error) { + w, err := createDomainRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateDomainRequest) UnmarshalJSON(data []byte) error { + var w createDomainRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createDomainRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteDomainRequestWire struct { Name *string `json:"name,omitempty"` Force *bool `json:"force,omitempty"` @@ -112,6 +136,30 @@ func deleteDomainRequestFromWire(w *deleteDomainRequestWire) (*DeleteDomainReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteDomainRequest) MarshalJSON() ([]byte, error) { + w, err := deleteDomainRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteDomainRequest) UnmarshalJSON(data []byte) error { + var w deleteDomainRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteDomainRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type domainWire struct { DomainId *string `json:"domain_id,omitempty"` TagKey *string `json:"tag_key,omitempty"` @@ -194,6 +242,30 @@ func domainFromWire(w *domainWire) (*Domain, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Domain) MarshalJSON() ([]byte, error) { + w, err := domainToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Domain) UnmarshalJSON(data []byte) error { + var w domainWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := domainFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type domainIconWire struct { Name DomainIcon_Name `json:"name,omitempty"` Color *string `json:"color,omitempty"` @@ -219,6 +291,30 @@ func domainIconFromWire(w *domainIconWire) (*DomainIcon, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DomainIcon) MarshalJSON() ([]byte, error) { + w, err := domainIconToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DomainIcon) UnmarshalJSON(data []byte) error { + var w domainIconWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := domainIconFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getDomainRequestWire struct { Name *string `json:"name,omitempty"` } @@ -241,6 +337,30 @@ func getDomainRequestFromWire(w *getDomainRequestWire) (*GetDomainRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetDomainRequest) MarshalJSON() ([]byte, error) { + w, err := getDomainRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetDomainRequest) UnmarshalJSON(data []byte) error { + var w getDomainRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getDomainRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDomainsRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -269,6 +389,30 @@ func listDomainsRequestFromWire(w *listDomainsRequestWire) (*ListDomainsRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDomainsRequest) MarshalJSON() ([]byte, error) { + w, err := listDomainsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDomainsRequest) UnmarshalJSON(data []byte) error { + var w listDomainsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDomainsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDomainsResponseWire struct { Domains []domainWire `json:"domains,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -302,6 +446,30 @@ func listDomainsResponseFromWire(w *listDomainsResponseWire) (*ListDomainsRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDomainsResponse) MarshalJSON() ([]byte, error) { + w, err := listDomainsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDomainsResponse) UnmarshalJSON(data []byte) error { + var w listDomainsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDomainsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateDomainRequestWire struct { Domain *domainWire `json:"domain,omitempty"` UpdateMask *types.FieldMask[Domain] `json:"update_mask,omitempty"` @@ -335,6 +503,30 @@ func updateDomainRequestFromWire(w *updateDomainRequestWire) (*UpdateDomainReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateDomainRequest) MarshalJSON() ([]byte, error) { + w, err := updateDomainRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateDomainRequest) UnmarshalJSON(data []byte) error { + var w updateDomainRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateDomainRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/environments/CHANGELOG.md b/environments/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/environments/CHANGELOG.md +++ b/environments/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/environments/internal/version.go b/environments/internal/version.go index a77eadc1..66649fe3 100644 --- a/environments/internal/version.go +++ b/environments/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-environments" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/environments/v1/wire.go b/environments/v1/wire.go index 1372d738..3f780050 100644 --- a/environments/v1/wire.go +++ b/environments/v1/wire.go @@ -40,6 +40,30 @@ func apiErrorFromWire(w *apiErrorWire) (*ApiError, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApiError) MarshalJSON() ([]byte, error) { + w, err := apiErrorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApiError) UnmarshalJSON(data []byte) error { + var w apiErrorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := apiErrorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createWorkspaceBaseEnvironmentRequestWire struct { WorkspaceBaseEnvironment *workspaceBaseEnvironmentWire `json:"workspace_base_environment,omitempty"` WorkspaceBaseEnvironmentId *string `json:"workspace_base_environment_id,omitempty"` @@ -76,6 +100,30 @@ func createWorkspaceBaseEnvironmentRequestFromWire(w *createWorkspaceBaseEnviron }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateWorkspaceBaseEnvironmentRequest) MarshalJSON() ([]byte, error) { + w, err := createWorkspaceBaseEnvironmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateWorkspaceBaseEnvironmentRequest) UnmarshalJSON(data []byte) error { + var w createWorkspaceBaseEnvironmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createWorkspaceBaseEnvironmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type defaultWorkspaceBaseEnvironmentWire struct { Name *string `json:"name,omitempty"` CpuWorkspaceBaseEnvironment *string `json:"cpu_workspace_base_environment,omitempty"` @@ -104,6 +152,30 @@ func defaultWorkspaceBaseEnvironmentFromWire(w *defaultWorkspaceBaseEnvironmentW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DefaultWorkspaceBaseEnvironment) MarshalJSON() ([]byte, error) { + w, err := defaultWorkspaceBaseEnvironmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DefaultWorkspaceBaseEnvironment) UnmarshalJSON(data []byte) error { + var w defaultWorkspaceBaseEnvironmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := defaultWorkspaceBaseEnvironmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteWorkspaceBaseEnvironmentRequestWire struct { Name *string `json:"name,omitempty"` } @@ -126,6 +198,30 @@ func deleteWorkspaceBaseEnvironmentRequestFromWire(w *deleteWorkspaceBaseEnviron }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteWorkspaceBaseEnvironmentRequest) MarshalJSON() ([]byte, error) { + w, err := deleteWorkspaceBaseEnvironmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteWorkspaceBaseEnvironmentRequest) UnmarshalJSON(data []byte) error { + var w deleteWorkspaceBaseEnvironmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteWorkspaceBaseEnvironmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type environmentSpecWire struct { Dependencies []string `json:"dependencies,omitempty"` EnvironmentVersion *string `json:"environment_version,omitempty"` @@ -151,6 +247,30 @@ func environmentSpecFromWire(w *environmentSpecWire) (*EnvironmentSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EnvironmentSpec) MarshalJSON() ([]byte, error) { + w, err := environmentSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EnvironmentSpec) UnmarshalJSON(data []byte) error { + var w environmentSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := environmentSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getDefaultWorkspaceBaseEnvironmentRequestWire struct { Name *string `json:"name,omitempty"` } @@ -173,6 +293,30 @@ func getDefaultWorkspaceBaseEnvironmentRequestFromWire(w *getDefaultWorkspaceBas }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetDefaultWorkspaceBaseEnvironmentRequest) MarshalJSON() ([]byte, error) { + w, err := getDefaultWorkspaceBaseEnvironmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetDefaultWorkspaceBaseEnvironmentRequest) UnmarshalJSON(data []byte) error { + var w getDefaultWorkspaceBaseEnvironmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getDefaultWorkspaceBaseEnvironmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getOperationRequestWire struct { Name *string `json:"name,omitempty"` } @@ -195,6 +339,30 @@ func getOperationRequestFromWire(w *getOperationRequestWire) (*GetOperationReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetOperationRequest) MarshalJSON() ([]byte, error) { + w, err := getOperationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetOperationRequest) UnmarshalJSON(data []byte) error { + var w getOperationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getOperationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getWorkspaceBaseEnvironmentRequestWire struct { Name *string `json:"name,omitempty"` } @@ -217,6 +385,30 @@ func getWorkspaceBaseEnvironmentRequestFromWire(w *getWorkspaceBaseEnvironmentRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetWorkspaceBaseEnvironmentRequest) MarshalJSON() ([]byte, error) { + w, err := getWorkspaceBaseEnvironmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetWorkspaceBaseEnvironmentRequest) UnmarshalJSON(data []byte) error { + var w getWorkspaceBaseEnvironmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getWorkspaceBaseEnvironmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listWorkspaceBaseEnvironmentsRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -242,6 +434,30 @@ func listWorkspaceBaseEnvironmentsRequestFromWire(w *listWorkspaceBaseEnvironmen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListWorkspaceBaseEnvironmentsRequest) MarshalJSON() ([]byte, error) { + w, err := listWorkspaceBaseEnvironmentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListWorkspaceBaseEnvironmentsRequest) UnmarshalJSON(data []byte) error { + var w listWorkspaceBaseEnvironmentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listWorkspaceBaseEnvironmentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listWorkspaceBaseEnvironmentsResponseWire struct { WorkspaceBaseEnvironments []workspaceBaseEnvironmentWire `json:"workspace_base_environments,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -275,6 +491,30 @@ func listWorkspaceBaseEnvironmentsResponseFromWire(w *listWorkspaceBaseEnvironme }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListWorkspaceBaseEnvironmentsResponse) MarshalJSON() ([]byte, error) { + w, err := listWorkspaceBaseEnvironmentsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListWorkspaceBaseEnvironmentsResponse) UnmarshalJSON(data []byte) error { + var w listWorkspaceBaseEnvironmentsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listWorkspaceBaseEnvironmentsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type operationWire struct { Name *string `json:"name,omitempty"` Metadata json.RawMessage `json:"metadata,omitempty"` @@ -348,6 +588,30 @@ func operationFromWire(w *operationWire) (*Operation, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Operation) MarshalJSON() ([]byte, error) { + w, err := operationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Operation) UnmarshalJSON(data []byte) error { + var w operationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := operationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type refreshWorkspaceBaseEnvironmentRequestWire struct { Name *string `json:"name,omitempty"` } @@ -370,6 +634,30 @@ func refreshWorkspaceBaseEnvironmentRequestFromWire(w *refreshWorkspaceBaseEnvir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RefreshWorkspaceBaseEnvironmentRequest) MarshalJSON() ([]byte, error) { + w, err := refreshWorkspaceBaseEnvironmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RefreshWorkspaceBaseEnvironmentRequest) UnmarshalJSON(data []byte) error { + var w refreshWorkspaceBaseEnvironmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := refreshWorkspaceBaseEnvironmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateDefaultWorkspaceBaseEnvironmentRequestWire struct { DefaultWorkspaceBaseEnvironment *defaultWorkspaceBaseEnvironmentWire `json:"default_workspace_base_environment,omitempty"` UpdateMask *types.FieldMask[DefaultWorkspaceBaseEnvironment] `json:"update_mask,omitempty"` @@ -403,6 +691,30 @@ func updateDefaultWorkspaceBaseEnvironmentRequestFromWire(w *updateDefaultWorksp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateDefaultWorkspaceBaseEnvironmentRequest) MarshalJSON() ([]byte, error) { + w, err := updateDefaultWorkspaceBaseEnvironmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateDefaultWorkspaceBaseEnvironmentRequest) UnmarshalJSON(data []byte) error { + var w updateDefaultWorkspaceBaseEnvironmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateDefaultWorkspaceBaseEnvironmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateWorkspaceBaseEnvironmentRequestWire struct { Name *string `json:"name,omitempty"` WorkspaceBaseEnvironment *workspaceBaseEnvironmentWire `json:"workspace_base_environment,omitempty"` @@ -436,6 +748,30 @@ func updateWorkspaceBaseEnvironmentRequestFromWire(w *updateWorkspaceBaseEnviron }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateWorkspaceBaseEnvironmentRequest) MarshalJSON() ([]byte, error) { + w, err := updateWorkspaceBaseEnvironmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateWorkspaceBaseEnvironmentRequest) UnmarshalJSON(data []byte) error { + var w updateWorkspaceBaseEnvironmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateWorkspaceBaseEnvironmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type workspaceBaseEnvironmentWire struct { Name *string `json:"name,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -499,6 +835,30 @@ func workspaceBaseEnvironmentFromWire(w *workspaceBaseEnvironmentWire) (*Workspa }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WorkspaceBaseEnvironment) MarshalJSON() ([]byte, error) { + w, err := workspaceBaseEnvironmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WorkspaceBaseEnvironment) UnmarshalJSON(data []byte) error { + var w workspaceBaseEnvironmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := workspaceBaseEnvironmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type workspaceBaseEnvironmentCacheWire struct { } @@ -516,6 +876,30 @@ func workspaceBaseEnvironmentCacheFromWire(w *workspaceBaseEnvironmentCacheWire) return &WorkspaceBaseEnvironmentCache{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WorkspaceBaseEnvironmentCache) MarshalJSON() ([]byte, error) { + w, err := workspaceBaseEnvironmentCacheToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WorkspaceBaseEnvironmentCache) UnmarshalJSON(data []byte) error { + var w workspaceBaseEnvironmentCacheWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := workspaceBaseEnvironmentCacheFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type workspaceBaseEnvironmentOperationMetadataWire struct { } @@ -533,6 +917,30 @@ func workspaceBaseEnvironmentOperationMetadataFromWire(w *workspaceBaseEnvironme return &WorkspaceBaseEnvironmentOperationMetadata{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WorkspaceBaseEnvironmentOperationMetadata) MarshalJSON() ([]byte, error) { + w, err := workspaceBaseEnvironmentOperationMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WorkspaceBaseEnvironmentOperationMetadata) UnmarshalJSON(data []byte) error { + var w workspaceBaseEnvironmentOperationMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := workspaceBaseEnvironmentOperationMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/experiments/CHANGELOG.md b/experiments/CHANGELOG.md index cf26bda6..fbc95ae7 100644 --- a/experiments/CHANGELOG.md +++ b/experiments/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/experiments/internal/version.go b/experiments/internal/version.go index a7d1bda6..966988e8 100644 --- a/experiments/internal/version.go +++ b/experiments/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-experiments" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/experiments/v1/wire.go b/experiments/v1/wire.go index b49e1942..b7bd4c29 100644 --- a/experiments/v1/wire.go +++ b/experiments/v1/wire.go @@ -101,6 +101,30 @@ func createExperimentRequestFromWire(w *createExperimentRequestWire) (*CreateExp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateExperimentRequest) MarshalJSON() ([]byte, error) { + w, err := createExperimentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateExperimentRequest) UnmarshalJSON(data []byte) error { + var w createExperimentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createExperimentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createExperimentResponseWire struct { ExperimentId *string `json:"experiment_id,omitempty"` } @@ -123,6 +147,30 @@ func createExperimentResponseFromWire(w *createExperimentResponseWire) (*CreateE }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateExperimentResponse) MarshalJSON() ([]byte, error) { + w, err := createExperimentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateExperimentResponse) UnmarshalJSON(data []byte) error { + var w createExperimentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createExperimentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createIssueRequestWire struct { Parent *string `json:"parent,omitempty"` Issue *issueWire `json:"issue,omitempty"` @@ -159,6 +207,30 @@ func createIssueRequestFromWire(w *createIssueRequestWire) (*CreateIssueRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateIssueRequest) MarshalJSON() ([]byte, error) { + w, err := createIssueRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateIssueRequest) UnmarshalJSON(data []byte) error { + var w createIssueRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createIssueRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createLoggedModelRequestWire struct { ExperimentId *string `json:"experiment_id,omitempty"` Name *string `json:"name,omitempty"` @@ -212,6 +284,30 @@ func createLoggedModelRequestFromWire(w *createLoggedModelRequestWire) (*CreateL }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateLoggedModelRequest) MarshalJSON() ([]byte, error) { + w, err := createLoggedModelRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateLoggedModelRequest) UnmarshalJSON(data []byte) error { + var w createLoggedModelRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createLoggedModelRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createLoggedModelResponseWire struct { Model *loggedModelWire `json:"model,omitempty"` } @@ -242,6 +338,30 @@ func createLoggedModelResponseFromWire(w *createLoggedModelResponseWire) (*Creat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateLoggedModelResponse) MarshalJSON() ([]byte, error) { + w, err := createLoggedModelResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateLoggedModelResponse) UnmarshalJSON(data []byte) error { + var w createLoggedModelResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createLoggedModelResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createRunRequestWire struct { ExperimentId *string `json:"experiment_id,omitempty"` UserId *string `json:"user_id,omitempty"` @@ -292,6 +412,30 @@ func createRunRequestFromWire(w *createRunRequestWire) (*CreateRunRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateRunRequest) MarshalJSON() ([]byte, error) { + w, err := createRunRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateRunRequest) UnmarshalJSON(data []byte) error { + var w createRunRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createRunRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createRunResponseWire struct { Run *runWire `json:"run,omitempty"` } @@ -322,6 +466,30 @@ func createRunResponseFromWire(w *createRunResponseWire) (*CreateRunResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateRunResponse) MarshalJSON() ([]byte, error) { + w, err := createRunResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateRunResponse) UnmarshalJSON(data []byte) error { + var w createRunResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createRunResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type datasetWire struct { Name *string `json:"name,omitempty"` Digest *string `json:"digest,omitempty"` @@ -359,6 +527,30 @@ func datasetFromWire(w *datasetWire) (*Dataset, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Dataset) MarshalJSON() ([]byte, error) { + w, err := datasetToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Dataset) UnmarshalJSON(data []byte) error { + var w datasetWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := datasetFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type datasetInputWire struct { Tags []inputTagWire `json:"tags,omitempty"` Dataset *datasetWire `json:"dataset,omitempty"` @@ -400,6 +592,30 @@ func datasetInputFromWire(w *datasetInputWire) (*DatasetInput, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatasetInput) MarshalJSON() ([]byte, error) { + w, err := datasetInputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatasetInput) UnmarshalJSON(data []byte) error { + var w datasetInputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := datasetInputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteExperimentRequestWire struct { ExperimentId *string `json:"experiment_id,omitempty"` } @@ -422,6 +638,30 @@ func deleteExperimentRequestFromWire(w *deleteExperimentRequestWire) (*DeleteExp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteExperimentRequest) MarshalJSON() ([]byte, error) { + w, err := deleteExperimentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteExperimentRequest) UnmarshalJSON(data []byte) error { + var w deleteExperimentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteExperimentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteExperimentResponseWire struct { } @@ -439,6 +679,30 @@ func deleteExperimentResponseFromWire(w *deleteExperimentResponseWire) (*DeleteE return &DeleteExperimentResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteExperimentResponse) MarshalJSON() ([]byte, error) { + w, err := deleteExperimentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteExperimentResponse) UnmarshalJSON(data []byte) error { + var w deleteExperimentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteExperimentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteLoggedModelRequestWire struct { ModelId *string `json:"model_id,omitempty"` } @@ -461,6 +725,30 @@ func deleteLoggedModelRequestFromWire(w *deleteLoggedModelRequestWire) (*DeleteL }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteLoggedModelRequest) MarshalJSON() ([]byte, error) { + w, err := deleteLoggedModelRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteLoggedModelRequest) UnmarshalJSON(data []byte) error { + var w deleteLoggedModelRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteLoggedModelRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteLoggedModelResponseWire struct { } @@ -478,6 +766,30 @@ func deleteLoggedModelResponseFromWire(w *deleteLoggedModelResponseWire) (*Delet return &DeleteLoggedModelResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteLoggedModelResponse) MarshalJSON() ([]byte, error) { + w, err := deleteLoggedModelResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteLoggedModelResponse) UnmarshalJSON(data []byte) error { + var w deleteLoggedModelResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteLoggedModelResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteLoggedModelTagRequestWire struct { ModelId *string `json:"model_id,omitempty"` TagKey *string `json:"tag_key,omitempty"` @@ -503,6 +815,30 @@ func deleteLoggedModelTagRequestFromWire(w *deleteLoggedModelTagRequestWire) (*D }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteLoggedModelTagRequest) MarshalJSON() ([]byte, error) { + w, err := deleteLoggedModelTagRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteLoggedModelTagRequest) UnmarshalJSON(data []byte) error { + var w deleteLoggedModelTagRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteLoggedModelTagRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteLoggedModelTagResponseWire struct { } @@ -520,6 +856,30 @@ func deleteLoggedModelTagResponseFromWire(w *deleteLoggedModelTagResponseWire) ( return &DeleteLoggedModelTagResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteLoggedModelTagResponse) MarshalJSON() ([]byte, error) { + w, err := deleteLoggedModelTagResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteLoggedModelTagResponse) UnmarshalJSON(data []byte) error { + var w deleteLoggedModelTagResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteLoggedModelTagResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRunRequestWire struct { RunId *string `json:"run_id,omitempty"` } @@ -542,6 +902,30 @@ func deleteRunRequestFromWire(w *deleteRunRequestWire) (*DeleteRunRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRunRequest) MarshalJSON() ([]byte, error) { + w, err := deleteRunRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRunRequest) UnmarshalJSON(data []byte) error { + var w deleteRunRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRunRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRunResponseWire struct { } @@ -559,6 +943,30 @@ func deleteRunResponseFromWire(w *deleteRunResponseWire) (*DeleteRunResponse, er return &DeleteRunResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRunResponse) MarshalJSON() ([]byte, error) { + w, err := deleteRunResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRunResponse) UnmarshalJSON(data []byte) error { + var w deleteRunResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRunResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRunsRequestWire struct { ExperimentId *string `json:"experiment_id,omitempty"` MaxTimestampMillis *wireInt64 `json:"max_timestamp_millis,omitempty"` @@ -595,6 +1003,30 @@ func deleteRunsRequestFromWire(w *deleteRunsRequestWire) (*DeleteRunsRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRunsRequest) MarshalJSON() ([]byte, error) { + w, err := deleteRunsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRunsRequest) UnmarshalJSON(data []byte) error { + var w deleteRunsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRunsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRunsResponseWire struct { RunsDeleted *int `json:"runs_deleted,omitempty"` } @@ -617,6 +1049,30 @@ func deleteRunsResponseFromWire(w *deleteRunsResponseWire) (*DeleteRunsResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRunsResponse) MarshalJSON() ([]byte, error) { + w, err := deleteRunsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRunsResponse) UnmarshalJSON(data []byte) error { + var w deleteRunsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRunsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteTagRequestWire struct { RunId *string `json:"run_id,omitempty"` Key *string `json:"key,omitempty"` @@ -642,6 +1098,30 @@ func deleteTagRequestFromWire(w *deleteTagRequestWire) (*DeleteTagRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteTagRequest) MarshalJSON() ([]byte, error) { + w, err := deleteTagRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteTagRequest) UnmarshalJSON(data []byte) error { + var w deleteTagRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteTagRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteTagResponseWire struct { } @@ -659,6 +1139,30 @@ func deleteTagResponseFromWire(w *deleteTagResponseWire) (*DeleteTagResponse, er return &DeleteTagResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteTagResponse) MarshalJSON() ([]byte, error) { + w, err := deleteTagResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteTagResponse) UnmarshalJSON(data []byte) error { + var w deleteTagResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteTagResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type experimentWire struct { ExperimentId *string `json:"experiment_id,omitempty"` Name *string `json:"name,omitempty"` @@ -734,6 +1238,30 @@ func experimentFromWire(w *experimentWire) (*Experiment, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Experiment) MarshalJSON() ([]byte, error) { + w, err := experimentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Experiment) UnmarshalJSON(data []byte) error { + var w experimentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := experimentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type experimentTagWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -759,6 +1287,30 @@ func experimentTagFromWire(w *experimentTagWire) (*ExperimentTag, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExperimentTag) MarshalJSON() ([]byte, error) { + w, err := experimentTagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExperimentTag) UnmarshalJSON(data []byte) error { + var w experimentTagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := experimentTagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type experimentTraceLocationWire struct { UcTraceLocation *ucTraceLocationWire `json:"uc_trace_location,omitempty"` } @@ -811,6 +1363,30 @@ func experimentTraceLocationFromWire(w *experimentTraceLocationWire) (*Experimen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExperimentTraceLocation) MarshalJSON() ([]byte, error) { + w, err := experimentTraceLocationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExperimentTraceLocation) UnmarshalJSON(data []byte) error { + var w experimentTraceLocationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := experimentTraceLocationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type fileInfoWire struct { Path *string `json:"path,omitempty"` IsDir *bool `json:"is_dir,omitempty"` @@ -847,6 +1423,30 @@ func fileInfoFromWire(w *fileInfoWire) (*FileInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FileInfo) MarshalJSON() ([]byte, error) { + w, err := fileInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FileInfo) UnmarshalJSON(data []byte) error { + var w fileInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := fileInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type finalizeLoggedModelRequestWire struct { ModelId *string `json:"model_id,omitempty"` Status LoggedModelStatus `json:"status,omitempty"` @@ -872,6 +1472,30 @@ func finalizeLoggedModelRequestFromWire(w *finalizeLoggedModelRequestWire) (*Fin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FinalizeLoggedModelRequest) MarshalJSON() ([]byte, error) { + w, err := finalizeLoggedModelRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FinalizeLoggedModelRequest) UnmarshalJSON(data []byte) error { + var w finalizeLoggedModelRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := finalizeLoggedModelRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type finalizeLoggedModelResponseWire struct { Model *loggedModelWire `json:"model,omitempty"` } @@ -902,6 +1526,30 @@ func finalizeLoggedModelResponseFromWire(w *finalizeLoggedModelResponseWire) (*F }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FinalizeLoggedModelResponse) MarshalJSON() ([]byte, error) { + w, err := finalizeLoggedModelResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FinalizeLoggedModelResponse) UnmarshalJSON(data []byte) error { + var w finalizeLoggedModelResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := finalizeLoggedModelResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getExperimentByNameRequestWire struct { ExperimentName *string `json:"experiment_name,omitempty"` } @@ -924,6 +1572,30 @@ func getExperimentByNameRequestFromWire(w *getExperimentByNameRequestWire) (*Get }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetExperimentByNameRequest) MarshalJSON() ([]byte, error) { + w, err := getExperimentByNameRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetExperimentByNameRequest) UnmarshalJSON(data []byte) error { + var w getExperimentByNameRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getExperimentByNameRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getExperimentByNameResponseWire struct { Experiment *experimentWire `json:"experiment,omitempty"` } @@ -954,6 +1626,30 @@ func getExperimentByNameResponseFromWire(w *getExperimentByNameResponseWire) (*G }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetExperimentByNameResponse) MarshalJSON() ([]byte, error) { + w, err := getExperimentByNameResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetExperimentByNameResponse) UnmarshalJSON(data []byte) error { + var w getExperimentByNameResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getExperimentByNameResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getExperimentRequestWire struct { ExperimentId *string `json:"experiment_id,omitempty"` } @@ -976,6 +1672,30 @@ func getExperimentRequestFromWire(w *getExperimentRequestWire) (*GetExperimentRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetExperimentRequest) MarshalJSON() ([]byte, error) { + w, err := getExperimentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetExperimentRequest) UnmarshalJSON(data []byte) error { + var w getExperimentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getExperimentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getExperimentResponseWire struct { Experiment *experimentWire `json:"experiment,omitempty"` Runs []runInfoWire `json:"runs,omitempty"` @@ -1017,6 +1737,30 @@ func getExperimentResponseFromWire(w *getExperimentResponseWire) (*GetExperiment }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetExperimentResponse) MarshalJSON() ([]byte, error) { + w, err := getExperimentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetExperimentResponse) UnmarshalJSON(data []byte) error { + var w getExperimentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getExperimentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getIssueRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1039,6 +1783,30 @@ func getIssueRequestFromWire(w *getIssueRequestWire) (*GetIssueRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetIssueRequest) MarshalJSON() ([]byte, error) { + w, err := getIssueRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetIssueRequest) UnmarshalJSON(data []byte) error { + var w getIssueRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getIssueRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getLoggedModelRequestWire struct { ModelId *string `json:"model_id,omitempty"` } @@ -1061,6 +1829,30 @@ func getLoggedModelRequestFromWire(w *getLoggedModelRequestWire) (*GetLoggedMode }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetLoggedModelRequest) MarshalJSON() ([]byte, error) { + w, err := getLoggedModelRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetLoggedModelRequest) UnmarshalJSON(data []byte) error { + var w getLoggedModelRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getLoggedModelRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getLoggedModelResponseWire struct { Model *loggedModelWire `json:"model,omitempty"` } @@ -1091,6 +1883,30 @@ func getLoggedModelResponseFromWire(w *getLoggedModelResponseWire) (*GetLoggedMo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetLoggedModelResponse) MarshalJSON() ([]byte, error) { + w, err := getLoggedModelResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetLoggedModelResponse) UnmarshalJSON(data []byte) error { + var w getLoggedModelResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getLoggedModelResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getMetricHistoryResponseWire struct { Metrics []metricWire `json:"metrics,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1124,6 +1940,30 @@ func getMetricHistoryResponseFromWire(w *getMetricHistoryResponseWire) (*GetMetr }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetMetricHistoryResponse) MarshalJSON() ([]byte, error) { + w, err := getMetricHistoryResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetMetricHistoryResponse) UnmarshalJSON(data []byte) error { + var w getMetricHistoryResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getMetricHistoryResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRunRequestWire struct { RunId *string `json:"run_id,omitempty"` RunUuid *string `json:"run_uuid,omitempty"` @@ -1149,6 +1989,30 @@ func getRunRequestFromWire(w *getRunRequestWire) (*GetRunRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRunRequest) MarshalJSON() ([]byte, error) { + w, err := getRunRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRunRequest) UnmarshalJSON(data []byte) error { + var w getRunRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRunRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRunResponseWire struct { Run *runWire `json:"run,omitempty"` } @@ -1179,6 +2043,30 @@ func getRunResponseFromWire(w *getRunResponseWire) (*GetRunResponse, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRunResponse) MarshalJSON() ([]byte, error) { + w, err := getRunResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRunResponse) UnmarshalJSON(data []byte) error { + var w getRunResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRunResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type inputTagWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -1198,10 +2086,34 @@ func inputTagFromWire(w *inputTagWire) (*InputTag, error) { if w == nil { return nil, nil } - return &InputTag{ - Key: w.Key, - Value: w.Value, - }, nil + return &InputTag{ + Key: w.Key, + Value: w.Value, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InputTag) MarshalJSON() ([]byte, error) { + w, err := inputTagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InputTag) UnmarshalJSON(data []byte) error { + var w inputTagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := inputTagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil } type issueWire struct { @@ -1271,6 +2183,30 @@ func issueFromWire(w *issueWire) (*Issue, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Issue) MarshalJSON() ([]byte, error) { + w, err := issueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Issue) UnmarshalJSON(data []byte) error { + var w issueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := issueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type issueTagFilterWire struct { Key *string `json:"key,omitempty"` Values []string `json:"values,omitempty"` @@ -1296,6 +2232,30 @@ func issueTagFilterFromWire(w *issueTagFilterWire) (*IssueTagFilter, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IssueTagFilter) MarshalJSON() ([]byte, error) { + w, err := issueTagFilterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IssueTagFilter) UnmarshalJSON(data []byte) error { + var w issueTagFilterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := issueTagFilterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listArtifactsRequestWire struct { RunId *string `json:"run_id,omitempty"` RunUuid *string `json:"run_uuid,omitempty"` @@ -1327,6 +2287,30 @@ func listArtifactsRequestFromWire(w *listArtifactsRequestWire) (*ListArtifactsRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListArtifactsRequest) MarshalJSON() ([]byte, error) { + w, err := listArtifactsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListArtifactsRequest) UnmarshalJSON(data []byte) error { + var w listArtifactsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listArtifactsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listArtifactsResponseWire struct { RootUri *string `json:"root_uri,omitempty"` Files []fileInfoWire `json:"files,omitempty"` @@ -1363,6 +2347,30 @@ func listArtifactsResponseFromWire(w *listArtifactsResponseWire) (*ListArtifacts }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListArtifactsResponse) MarshalJSON() ([]byte, error) { + w, err := listArtifactsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListArtifactsResponse) UnmarshalJSON(data []byte) error { + var w listArtifactsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listArtifactsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExperimentsRequestWire struct { ViewType ViewType `json:"view_type,omitempty"` MaxResults *wireInt64 `json:"max_results,omitempty"` @@ -1399,6 +2407,30 @@ func listExperimentsRequestFromWire(w *listExperimentsRequestWire) (*ListExperim }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExperimentsRequest) MarshalJSON() ([]byte, error) { + w, err := listExperimentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExperimentsRequest) UnmarshalJSON(data []byte) error { + var w listExperimentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExperimentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExperimentsResponseWire struct { Experiments []experimentWire `json:"experiments,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1432,6 +2464,30 @@ func listExperimentsResponseFromWire(w *listExperimentsResponseWire) (*ListExper }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExperimentsResponse) MarshalJSON() ([]byte, error) { + w, err := listExperimentsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExperimentsResponse) UnmarshalJSON(data []byte) error { + var w listExperimentsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExperimentsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listMetricHistoryRequestWire struct { RunId *string `json:"run_id,omitempty"` RunUuid *string `json:"run_uuid,omitempty"` @@ -1466,6 +2522,30 @@ func listMetricHistoryRequestFromWire(w *listMetricHistoryRequestWire) (*ListMet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListMetricHistoryRequest) MarshalJSON() ([]byte, error) { + w, err := listMetricHistoryRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListMetricHistoryRequest) UnmarshalJSON(data []byte) error { + var w listMetricHistoryRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listMetricHistoryRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logBatchRequestWire struct { RunId *string `json:"run_id,omitempty"` Metrics []metricWire `json:"metrics,omitempty"` @@ -1521,6 +2601,30 @@ func logBatchRequestFromWire(w *logBatchRequestWire) (*LogBatchRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogBatchRequest) MarshalJSON() ([]byte, error) { + w, err := logBatchRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogBatchRequest) UnmarshalJSON(data []byte) error { + var w logBatchRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logBatchRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logBatchResponseWire struct { } @@ -1538,6 +2642,30 @@ func logBatchResponseFromWire(w *logBatchResponseWire) (*LogBatchResponse, error return &LogBatchResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogBatchResponse) MarshalJSON() ([]byte, error) { + w, err := logBatchResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogBatchResponse) UnmarshalJSON(data []byte) error { + var w logBatchResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logBatchResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logInputsRequestWire struct { RunId *string `json:"run_id,omitempty"` Datasets []datasetInputWire `json:"datasets,omitempty"` @@ -1582,6 +2710,30 @@ func logInputsRequestFromWire(w *logInputsRequestWire) (*LogInputsRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogInputsRequest) MarshalJSON() ([]byte, error) { + w, err := logInputsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogInputsRequest) UnmarshalJSON(data []byte) error { + var w logInputsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logInputsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logInputsResponseWire struct { } @@ -1599,6 +2751,30 @@ func logInputsResponseFromWire(w *logInputsResponseWire) (*LogInputsResponse, er return &LogInputsResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogInputsResponse) MarshalJSON() ([]byte, error) { + w, err := logInputsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogInputsResponse) UnmarshalJSON(data []byte) error { + var w logInputsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logInputsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logLoggedModelParamsRequestWire struct { ModelId *string `json:"model_id,omitempty"` Params []loggedModelParameterWire `json:"params,omitempty"` @@ -1632,6 +2808,30 @@ func logLoggedModelParamsRequestFromWire(w *logLoggedModelParamsRequestWire) (*L }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogLoggedModelParamsRequest) MarshalJSON() ([]byte, error) { + w, err := logLoggedModelParamsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogLoggedModelParamsRequest) UnmarshalJSON(data []byte) error { + var w logLoggedModelParamsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logLoggedModelParamsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logLoggedModelParamsResponseWire struct { } @@ -1649,6 +2849,30 @@ func logLoggedModelParamsResponseFromWire(w *logLoggedModelParamsResponseWire) ( return &LogLoggedModelParamsResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogLoggedModelParamsResponse) MarshalJSON() ([]byte, error) { + w, err := logLoggedModelParamsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogLoggedModelParamsResponse) UnmarshalJSON(data []byte) error { + var w logLoggedModelParamsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logLoggedModelParamsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logMetricRequestWire struct { RunId *string `json:"run_id,omitempty"` RunUuid *string `json:"run_uuid,omitempty"` @@ -1711,6 +2935,30 @@ func logMetricRequestFromWire(w *logMetricRequestWire) (*LogMetricRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogMetricRequest) MarshalJSON() ([]byte, error) { + w, err := logMetricRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogMetricRequest) UnmarshalJSON(data []byte) error { + var w logMetricRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logMetricRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logMetricResponseWire struct { } @@ -1728,6 +2976,30 @@ func logMetricResponseFromWire(w *logMetricResponseWire) (*LogMetricResponse, er return &LogMetricResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogMetricResponse) MarshalJSON() ([]byte, error) { + w, err := logMetricResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogMetricResponse) UnmarshalJSON(data []byte) error { + var w logMetricResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logMetricResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logModelRequestWire struct { RunId *string `json:"run_id,omitempty"` ModelJson *string `json:"model_json,omitempty"` @@ -1753,6 +3025,30 @@ func logModelRequestFromWire(w *logModelRequestWire) (*LogModelRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogModelRequest) MarshalJSON() ([]byte, error) { + w, err := logModelRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogModelRequest) UnmarshalJSON(data []byte) error { + var w logModelRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logModelRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logModelResponseWire struct { } @@ -1770,6 +3066,30 @@ func logModelResponseFromWire(w *logModelResponseWire) (*LogModelResponse, error return &LogModelResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogModelResponse) MarshalJSON() ([]byte, error) { + w, err := logModelResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogModelResponse) UnmarshalJSON(data []byte) error { + var w logModelResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logModelResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logOutputsRequestWire struct { RunId *string `json:"run_id,omitempty"` Models []modelOutputWire `json:"models,omitempty"` @@ -1803,6 +3123,30 @@ func logOutputsRequestFromWire(w *logOutputsRequestWire) (*LogOutputsRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogOutputsRequest) MarshalJSON() ([]byte, error) { + w, err := logOutputsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogOutputsRequest) UnmarshalJSON(data []byte) error { + var w logOutputsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logOutputsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logOutputsResponseWire struct { } @@ -1820,6 +3164,30 @@ func logOutputsResponseFromWire(w *logOutputsResponseWire) (*LogOutputsResponse, return &LogOutputsResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogOutputsResponse) MarshalJSON() ([]byte, error) { + w, err := logOutputsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogOutputsResponse) UnmarshalJSON(data []byte) error { + var w logOutputsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logOutputsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logParamRequestWire struct { RunId *string `json:"run_id,omitempty"` RunUuid *string `json:"run_uuid,omitempty"` @@ -1851,6 +3219,30 @@ func logParamRequestFromWire(w *logParamRequestWire) (*LogParamRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogParamRequest) MarshalJSON() ([]byte, error) { + w, err := logParamRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogParamRequest) UnmarshalJSON(data []byte) error { + var w logParamRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logParamRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logParamResponseWire struct { } @@ -1865,7 +3257,31 @@ func logParamResponseFromWire(w *logParamResponseWire) (*LogParamResponse, error if w == nil { return nil, nil } - return &LogParamResponse{}, nil + return &LogParamResponse{}, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogParamResponse) MarshalJSON() ([]byte, error) { + w, err := logParamResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogParamResponse) UnmarshalJSON(data []byte) error { + var w logParamResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logParamResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil } type loggedModelWire struct { @@ -1909,6 +3325,30 @@ func loggedModelFromWire(w *loggedModelWire) (*LoggedModel, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LoggedModel) MarshalJSON() ([]byte, error) { + w, err := loggedModelToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LoggedModel) UnmarshalJSON(data []byte) error { + var w loggedModelWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := loggedModelFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type loggedModelDataWire struct { Params []loggedModelParameterWire `json:"params,omitempty"` Metrics []metricWire `json:"metrics,omitempty"` @@ -1950,6 +3390,30 @@ func loggedModelDataFromWire(w *loggedModelDataWire) (*LoggedModelData, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LoggedModelData) MarshalJSON() ([]byte, error) { + w, err := loggedModelDataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LoggedModelData) UnmarshalJSON(data []byte) error { + var w loggedModelDataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := loggedModelDataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type loggedModelInfoWire struct { ModelId *string `json:"model_id,omitempty"` ExperimentId *string `json:"experiment_id,omitempty"` @@ -2037,6 +3501,30 @@ func loggedModelInfoFromWire(w *loggedModelInfoWire) (*LoggedModelInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LoggedModelInfo) MarshalJSON() ([]byte, error) { + w, err := loggedModelInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LoggedModelInfo) UnmarshalJSON(data []byte) error { + var w loggedModelInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := loggedModelInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type loggedModelParameterWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -2062,6 +3550,30 @@ func loggedModelParameterFromWire(w *loggedModelParameterWire) (*LoggedModelPara }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LoggedModelParameter) MarshalJSON() ([]byte, error) { + w, err := loggedModelParameterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LoggedModelParameter) UnmarshalJSON(data []byte) error { + var w loggedModelParameterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := loggedModelParameterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type loggedModelTagWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -2087,6 +3599,30 @@ func loggedModelTagFromWire(w *loggedModelTagWire) (*LoggedModelTag, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LoggedModelTag) MarshalJSON() ([]byte, error) { + w, err := loggedModelTagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LoggedModelTag) UnmarshalJSON(data []byte) error { + var w loggedModelTagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := loggedModelTagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type metricWire struct { Key *string `json:"key,omitempty"` Value *float64 `json:"value,omitempty"` @@ -2146,6 +3682,30 @@ func metricFromWire(w *metricWire) (*Metric, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Metric) MarshalJSON() ([]byte, error) { + w, err := metricToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Metric) UnmarshalJSON(data []byte) error { + var w metricWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := metricFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelInputWire struct { ModelId *string `json:"model_id,omitempty"` } @@ -2168,6 +3728,30 @@ func modelInputFromWire(w *modelInputWire) (*ModelInput, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelInput) MarshalJSON() ([]byte, error) { + w, err := modelInputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelInput) UnmarshalJSON(data []byte) error { + var w modelInputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelInputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelOutputWire struct { ModelId *string `json:"model_id,omitempty"` Step *wireInt64 `json:"step,omitempty"` @@ -2201,6 +3785,30 @@ func modelOutputFromWire(w *modelOutputWire) (*ModelOutput, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelOutput) MarshalJSON() ([]byte, error) { + w, err := modelOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelOutput) UnmarshalJSON(data []byte) error { + var w modelOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type paramWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -2226,6 +3834,30 @@ func paramFromWire(w *paramWire) (*Param, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Param) MarshalJSON() ([]byte, error) { + w, err := paramToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Param) UnmarshalJSON(data []byte) error { + var w paramWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := paramFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type restoreExperimentRequestWire struct { ExperimentId *string `json:"experiment_id,omitempty"` } @@ -2248,6 +3880,30 @@ func restoreExperimentRequestFromWire(w *restoreExperimentRequestWire) (*Restore }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RestoreExperimentRequest) MarshalJSON() ([]byte, error) { + w, err := restoreExperimentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RestoreExperimentRequest) UnmarshalJSON(data []byte) error { + var w restoreExperimentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := restoreExperimentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type restoreExperimentResponseWire struct { } @@ -2265,6 +3921,30 @@ func restoreExperimentResponseFromWire(w *restoreExperimentResponseWire) (*Resto return &RestoreExperimentResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RestoreExperimentResponse) MarshalJSON() ([]byte, error) { + w, err := restoreExperimentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RestoreExperimentResponse) UnmarshalJSON(data []byte) error { + var w restoreExperimentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := restoreExperimentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type restoreRunRequestWire struct { RunId *string `json:"run_id,omitempty"` } @@ -2287,6 +3967,30 @@ func restoreRunRequestFromWire(w *restoreRunRequestWire) (*RestoreRunRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RestoreRunRequest) MarshalJSON() ([]byte, error) { + w, err := restoreRunRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RestoreRunRequest) UnmarshalJSON(data []byte) error { + var w restoreRunRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := restoreRunRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type restoreRunResponseWire struct { } @@ -2304,6 +4008,30 @@ func restoreRunResponseFromWire(w *restoreRunResponseWire) (*RestoreRunResponse, return &RestoreRunResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RestoreRunResponse) MarshalJSON() ([]byte, error) { + w, err := restoreRunResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RestoreRunResponse) UnmarshalJSON(data []byte) error { + var w restoreRunResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := restoreRunResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type restoreRunsRequestWire struct { ExperimentId *string `json:"experiment_id,omitempty"` MinTimestampMillis *wireInt64 `json:"min_timestamp_millis,omitempty"` @@ -2340,6 +4068,30 @@ func restoreRunsRequestFromWire(w *restoreRunsRequestWire) (*RestoreRunsRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RestoreRunsRequest) MarshalJSON() ([]byte, error) { + w, err := restoreRunsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RestoreRunsRequest) UnmarshalJSON(data []byte) error { + var w restoreRunsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := restoreRunsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type restoreRunsResponseWire struct { RunsRestored *int `json:"runs_restored,omitempty"` } @@ -2362,6 +4114,30 @@ func restoreRunsResponseFromWire(w *restoreRunsResponseWire) (*RestoreRunsRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RestoreRunsResponse) MarshalJSON() ([]byte, error) { + w, err := restoreRunsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RestoreRunsResponse) UnmarshalJSON(data []byte) error { + var w restoreRunsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := restoreRunsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runWire struct { Info *runInfoWire `json:"info,omitempty"` Data *runDataWire `json:"data,omitempty"` @@ -2414,6 +4190,30 @@ func runFromWire(w *runWire) (*Run, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Run) MarshalJSON() ([]byte, error) { + w, err := runToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Run) UnmarshalJSON(data []byte) error { + var w runWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runDataWire struct { Metrics []metricWire `json:"metrics,omitempty"` Params []paramWire `json:"params,omitempty"` @@ -2466,6 +4266,30 @@ func runDataFromWire(w *runDataWire) (*RunData, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunData) MarshalJSON() ([]byte, error) { + w, err := runDataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunData) UnmarshalJSON(data []byte) error { + var w runDataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runDataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runInfoWire struct { RunId *string `json:"run_id,omitempty"` RunUuid *string `json:"run_uuid,omitempty"` @@ -2531,6 +4355,30 @@ func runInfoFromWire(w *runInfoWire) (*RunInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunInfo) MarshalJSON() ([]byte, error) { + w, err := runInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunInfo) UnmarshalJSON(data []byte) error { + var w runInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runInputsWire struct { DatasetInputs []datasetInputWire `json:"dataset_inputs,omitempty"` ModelInputs []modelInputWire `json:"model_inputs,omitempty"` @@ -2572,6 +4420,30 @@ func runInputsFromWire(w *runInputsWire) (*RunInputs, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunInputs) MarshalJSON() ([]byte, error) { + w, err := runInputsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunInputs) UnmarshalJSON(data []byte) error { + var w runInputsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runInputsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runTagWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -2597,6 +4469,30 @@ func runTagFromWire(w *runTagWire) (*RunTag, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunTag) MarshalJSON() ([]byte, error) { + w, err := runTagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunTag) UnmarshalJSON(data []byte) error { + var w runTagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runTagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchExperimentsRequestWire struct { MaxResults *wireInt64 `json:"max_results,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -2639,6 +4535,30 @@ func searchExperimentsRequestFromWire(w *searchExperimentsRequestWire) (*SearchE }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchExperimentsRequest) MarshalJSON() ([]byte, error) { + w, err := searchExperimentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchExperimentsRequest) UnmarshalJSON(data []byte) error { + var w searchExperimentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchExperimentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchExperimentsResponseWire struct { Experiments []experimentWire `json:"experiments,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2672,6 +4592,30 @@ func searchExperimentsResponseFromWire(w *searchExperimentsResponseWire) (*Searc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchExperimentsResponse) MarshalJSON() ([]byte, error) { + w, err := searchExperimentsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchExperimentsResponse) UnmarshalJSON(data []byte) error { + var w searchExperimentsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchExperimentsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchIssuesRequestWire struct { Parent *string `json:"parent,omitempty"` Query *string `json:"query,omitempty"` @@ -2732,6 +4676,30 @@ func searchIssuesRequestFromWire(w *searchIssuesRequestWire) (*SearchIssuesReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchIssuesRequest) MarshalJSON() ([]byte, error) { + w, err := searchIssuesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchIssuesRequest) UnmarshalJSON(data []byte) error { + var w searchIssuesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchIssuesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchIssuesResponseWire struct { Issues []issueWire `json:"issues,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2768,6 +4736,30 @@ func searchIssuesResponseFromWire(w *searchIssuesResponseWire) (*SearchIssuesRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchIssuesResponse) MarshalJSON() ([]byte, error) { + w, err := searchIssuesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchIssuesResponse) UnmarshalJSON(data []byte) error { + var w searchIssuesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchIssuesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchLoggedModelsRequestWire struct { ExperimentIds []string `json:"experiment_ids,omitempty"` Filter *string `json:"filter,omitempty"` @@ -2821,6 +4813,30 @@ func searchLoggedModelsRequestFromWire(w *searchLoggedModelsRequestWire) (*Searc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchLoggedModelsRequest) MarshalJSON() ([]byte, error) { + w, err := searchLoggedModelsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchLoggedModelsRequest) UnmarshalJSON(data []byte) error { + var w searchLoggedModelsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchLoggedModelsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchLoggedModelsRequest_DatasetWire struct { DatasetName *string `json:"dataset_name,omitempty"` DatasetDigest *string `json:"dataset_digest,omitempty"` @@ -2846,6 +4862,30 @@ func searchLoggedModelsRequest_DatasetFromWire(w *searchLoggedModelsRequest_Data }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchLoggedModelsRequest_Dataset) MarshalJSON() ([]byte, error) { + w, err := searchLoggedModelsRequest_DatasetToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchLoggedModelsRequest_Dataset) UnmarshalJSON(data []byte) error { + var w searchLoggedModelsRequest_DatasetWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchLoggedModelsRequest_DatasetFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchLoggedModelsRequest_OrderByWire struct { FieldName *string `json:"field_name,omitempty"` Ascending *bool `json:"ascending,omitempty"` @@ -2877,6 +4917,30 @@ func searchLoggedModelsRequest_OrderByFromWire(w *searchLoggedModelsRequest_Orde }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchLoggedModelsRequest_OrderBy) MarshalJSON() ([]byte, error) { + w, err := searchLoggedModelsRequest_OrderByToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchLoggedModelsRequest_OrderBy) UnmarshalJSON(data []byte) error { + var w searchLoggedModelsRequest_OrderByWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchLoggedModelsRequest_OrderByFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchLoggedModelsResponseWire struct { Models []loggedModelWire `json:"models,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2910,6 +4974,30 @@ func searchLoggedModelsResponseFromWire(w *searchLoggedModelsResponseWire) (*Sea }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchLoggedModelsResponse) MarshalJSON() ([]byte, error) { + w, err := searchLoggedModelsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchLoggedModelsResponse) UnmarshalJSON(data []byte) error { + var w searchLoggedModelsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchLoggedModelsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchRunsRequestWire struct { ExperimentIds []string `json:"experiment_ids,omitempty"` Filter *string `json:"filter,omitempty"` @@ -2947,6 +5035,30 @@ func searchRunsRequestFromWire(w *searchRunsRequestWire) (*SearchRunsRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchRunsRequest) MarshalJSON() ([]byte, error) { + w, err := searchRunsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchRunsRequest) UnmarshalJSON(data []byte) error { + var w searchRunsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchRunsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchRunsResponseWire struct { Runs []runWire `json:"runs,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2980,6 +5092,30 @@ func searchRunsResponseFromWire(w *searchRunsResponseWire) (*SearchRunsResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchRunsResponse) MarshalJSON() ([]byte, error) { + w, err := searchRunsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchRunsResponse) UnmarshalJSON(data []byte) error { + var w searchRunsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchRunsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type setExperimentTagRequestWire struct { ExperimentId *string `json:"experiment_id,omitempty"` Key *string `json:"key,omitempty"` @@ -3008,6 +5144,30 @@ func setExperimentTagRequestFromWire(w *setExperimentTagRequestWire) (*SetExperi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SetExperimentTagRequest) MarshalJSON() ([]byte, error) { + w, err := setExperimentTagRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SetExperimentTagRequest) UnmarshalJSON(data []byte) error { + var w setExperimentTagRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := setExperimentTagRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type setExperimentTagResponseWire struct { } @@ -3025,6 +5185,30 @@ func setExperimentTagResponseFromWire(w *setExperimentTagResponseWire) (*SetExpe return &SetExperimentTagResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SetExperimentTagResponse) MarshalJSON() ([]byte, error) { + w, err := setExperimentTagResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SetExperimentTagResponse) UnmarshalJSON(data []byte) error { + var w setExperimentTagResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := setExperimentTagResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type setLoggedModelTagsRequestWire struct { ModelId *string `json:"model_id,omitempty"` Tags []loggedModelTagWire `json:"tags,omitempty"` @@ -3058,6 +5242,30 @@ func setLoggedModelTagsRequestFromWire(w *setLoggedModelTagsRequestWire) (*SetLo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SetLoggedModelTagsRequest) MarshalJSON() ([]byte, error) { + w, err := setLoggedModelTagsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SetLoggedModelTagsRequest) UnmarshalJSON(data []byte) error { + var w setLoggedModelTagsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := setLoggedModelTagsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type setLoggedModelTagsResponseWire struct { } @@ -3075,6 +5283,30 @@ func setLoggedModelTagsResponseFromWire(w *setLoggedModelTagsResponseWire) (*Set return &SetLoggedModelTagsResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SetLoggedModelTagsResponse) MarshalJSON() ([]byte, error) { + w, err := setLoggedModelTagsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SetLoggedModelTagsResponse) UnmarshalJSON(data []byte) error { + var w setLoggedModelTagsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := setLoggedModelTagsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type setTagRequestWire struct { RunId *string `json:"run_id,omitempty"` RunUuid *string `json:"run_uuid,omitempty"` @@ -3106,6 +5338,30 @@ func setTagRequestFromWire(w *setTagRequestWire) (*SetTagRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SetTagRequest) MarshalJSON() ([]byte, error) { + w, err := setTagRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SetTagRequest) UnmarshalJSON(data []byte) error { + var w setTagRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := setTagRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type setTagResponseWire struct { } @@ -3123,6 +5379,30 @@ func setTagResponseFromWire(w *setTagResponseWire) (*SetTagResponse, error) { return &SetTagResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SetTagResponse) MarshalJSON() ([]byte, error) { + w, err := setTagResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SetTagResponse) UnmarshalJSON(data []byte) error { + var w setTagResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := setTagResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ucTraceLocationWire struct { Catalog *string `json:"catalog,omitempty"` Schema *string `json:"schema,omitempty"` @@ -3154,6 +5434,30 @@ func ucTraceLocationFromWire(w *ucTraceLocationWire) (*UcTraceLocation, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UcTraceLocation) MarshalJSON() ([]byte, error) { + w, err := ucTraceLocationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UcTraceLocation) UnmarshalJSON(data []byte) error { + var w ucTraceLocationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ucTraceLocationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateExperimentRequestWire struct { ExperimentId *string `json:"experiment_id,omitempty"` NewName *string `json:"new_name,omitempty"` @@ -3179,6 +5483,30 @@ func updateExperimentRequestFromWire(w *updateExperimentRequestWire) (*UpdateExp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateExperimentRequest) MarshalJSON() ([]byte, error) { + w, err := updateExperimentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateExperimentRequest) UnmarshalJSON(data []byte) error { + var w updateExperimentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateExperimentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateExperimentResponseWire struct { } @@ -3196,6 +5524,30 @@ func updateExperimentResponseFromWire(w *updateExperimentResponseWire) (*UpdateE return &UpdateExperimentResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateExperimentResponse) MarshalJSON() ([]byte, error) { + w, err := updateExperimentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateExperimentResponse) UnmarshalJSON(data []byte) error { + var w updateExperimentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateExperimentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateIssueRequestWire struct { Issue *issueWire `json:"issue,omitempty"` UpdateMask *types.FieldMask[Issue] `json:"update_mask,omitempty"` @@ -3229,6 +5581,30 @@ func updateIssueRequestFromWire(w *updateIssueRequestWire) (*UpdateIssueRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateIssueRequest) MarshalJSON() ([]byte, error) { + w, err := updateIssueRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateIssueRequest) UnmarshalJSON(data []byte) error { + var w updateIssueRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateIssueRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateRunRequestWire struct { RunId *string `json:"run_id,omitempty"` RunUuid *string `json:"run_uuid,omitempty"` @@ -3271,6 +5647,30 @@ func updateRunRequestFromWire(w *updateRunRequestWire) (*UpdateRunRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateRunRequest) MarshalJSON() ([]byte, error) { + w, err := updateRunRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateRunRequest) UnmarshalJSON(data []byte) error { + var w updateRunRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateRunRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateRunResponseWire struct { RunInfo *runInfoWire `json:"run_info,omitempty"` } @@ -3301,6 +5701,30 @@ func updateRunResponseFromWire(w *updateRunResponseWire) (*UpdateRunResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateRunResponse) MarshalJSON() ([]byte, error) { + w, err := updateRunResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateRunResponse) UnmarshalJSON(data []byte) error { + var w updateRunResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateRunResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/features/CHANGELOG.md b/features/CHANGELOG.md index 0f9f9f14..d83c37a8 100644 --- a/features/CHANGELOG.md +++ b/features/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.21.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.20.0 (2026-11-11) ## Release v0.19.0 (2026-11-10) diff --git a/features/internal/version.go b/features/internal/version.go index 27c4ff87..e8952635 100644 --- a/features/internal/version.go +++ b/features/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-features" -const Version = "0.20.0" +const Version = "0.21.0" diff --git a/features/v1/model.go b/features/v1/model.go index 9017d724..d23776f6 100644 --- a/features/v1/model.go +++ b/features/v1/model.go @@ -1072,7 +1072,7 @@ type CustomUdf struct { // Specifies the data source backing a feature. Exactly one source type must be // set.. type DataSource struct { - // (-- Next ID: 8. --) + // (-- Next ID: 9. --) DataSource isDataSource_DataSource // Completeness timing for this Feature's use of the source. This configuration // is part of the Feature definition; it does not modify the underlying table or @@ -1202,15 +1202,13 @@ type DeltaTableSource struct { FullName *string `fieldmask:"full_name"` EntityColumns []string `fieldmask:"entity_columns"` TimeseriesColumn *string `fieldmask:"timeseries_column"` - // Single WHERE clause to filter delta table before applying transformations. - // Will be row-wise evaluated, so should only include conditionals and - // projections. + // A single WHERE clause to filter the Delta table before applying + // transformations. The predicate is evaluated for each row. FilterCondition *string `fieldmask:"filter_condition"` - // A single SQL SELECT expression applied after filter_condition. Should - // contains all the columns needed (eg. "SELECT *, col_a + col_b AS col_c FROM - // x.y.z WHERE col_a > 0" would have `transformation_sql` "*, col_a + col_b AS - // col_c") If transformation_sql is not provided, all columns of the delta table - // are present in the DataSource dataframe. + // A single SQL SELECT expression applied after filter_condition. The expression + // must contain all required columns (e.g., "*, col_a + col_b AS col_c"). If + // transformation_sql is not provided, all columns of the delta table are + // present in the DataSource dataframe. TransformationSql *string `fieldmask:"transformation_sql"` // Schema of the resulting dataframe after transformations, in Spark StructType // JSON format (from df.schema.json()). Required if transformation_sql is diff --git a/features/v1/wire.go b/features/v1/wire.go index 56f2c1a9..201092c8 100644 --- a/features/v1/wire.go +++ b/features/v1/wire.go @@ -437,6 +437,30 @@ func aggregationFunctionFromWire(w *aggregationFunctionWire) (*AggregationFuncti }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AggregationFunction) MarshalJSON() ([]byte, error) { + w, err := aggregationFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AggregationFunction) UnmarshalJSON(data []byte) error { + var w aggregationFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aggregationFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type apiErrorWire struct { ErrorCode ErrorCode `json:"error_code,omitempty"` Message *string `json:"message,omitempty"` @@ -468,6 +492,30 @@ func apiErrorFromWire(w *apiErrorWire) (*ApiError, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApiError) MarshalJSON() ([]byte, error) { + w, err := apiErrorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApiError) UnmarshalJSON(data []byte) error { + var w apiErrorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := apiErrorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type approxCountDistinctFunctionWire struct { Input *string `json:"input,omitempty"` RelativeSd *float64 `json:"relative_sd,omitempty"` @@ -496,6 +544,30 @@ func approxCountDistinctFunctionFromWire(w *approxCountDistinctFunctionWire) (*A }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApproxCountDistinctFunction) MarshalJSON() ([]byte, error) { + w, err := approxCountDistinctFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApproxCountDistinctFunction) UnmarshalJSON(data []byte) error { + var w approxCountDistinctFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := approxCountDistinctFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type approxPercentileFunctionWire struct { Input *string `json:"input,omitempty"` Percentile *float64 `json:"percentile,omitempty"` @@ -535,6 +607,30 @@ func approxPercentileFunctionFromWire(w *approxPercentileFunctionWire) (*ApproxP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApproxPercentileFunction) MarshalJSON() ([]byte, error) { + w, err := approxPercentileFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApproxPercentileFunction) UnmarshalJSON(data []byte) error { + var w approxPercentileFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := approxPercentileFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type authConfigWire struct { UcServiceCredentialName *string `json:"uc_service_credential_name,omitempty"` MtlsConfig *mtlsConfigWire `json:"mtls_config,omitempty"` @@ -599,6 +695,30 @@ func authConfigFromWire(w *authConfigWire) (*AuthConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AuthConfig) MarshalJSON() ([]byte, error) { + w, err := authConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AuthConfig) UnmarshalJSON(data []byte) error { + var w authConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := authConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type avgFunctionWire struct { Input *string `json:"input,omitempty"` } @@ -621,6 +741,30 @@ func avgFunctionFromWire(w *avgFunctionWire) (*AvgFunction, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AvgFunction) MarshalJSON() ([]byte, error) { + w, err := avgFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AvgFunction) UnmarshalJSON(data []byte) error { + var w avgFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := avgFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type backfillFeaturesRequestWire struct { FeatureFullNames []string `json:"feature_full_names,omitempty"` BackfillRanges []backfillRangeWire `json:"backfill_ranges,omitempty"` @@ -663,6 +807,30 @@ func backfillFeaturesRequestFromWire(w *backfillFeaturesRequestWire) (*BackfillF }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BackfillFeaturesRequest) MarshalJSON() ([]byte, error) { + w, err := backfillFeaturesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BackfillFeaturesRequest) UnmarshalJSON(data []byte) error { + var w backfillFeaturesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := backfillFeaturesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type backfillFeaturesResponseWire struct { } @@ -680,6 +848,30 @@ func backfillFeaturesResponseFromWire(w *backfillFeaturesResponseWire) (*Backfil return &BackfillFeaturesResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BackfillFeaturesResponse) MarshalJSON() ([]byte, error) { + w, err := backfillFeaturesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BackfillFeaturesResponse) UnmarshalJSON(data []byte) error { + var w backfillFeaturesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := backfillFeaturesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type backfillOperationMetadataWire struct { FeatureFullNames []string `json:"feature_full_names,omitempty"` BackfillRanges []backfillRangeWire `json:"backfill_ranges,omitempty"` @@ -716,6 +908,30 @@ func backfillOperationMetadataFromWire(w *backfillOperationMetadataWire) (*Backf }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BackfillOperationMetadata) MarshalJSON() ([]byte, error) { + w, err := backfillOperationMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BackfillOperationMetadata) UnmarshalJSON(data []byte) error { + var w backfillOperationMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := backfillOperationMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type backfillRangeWire struct { StartTime *types.Time `json:"start_time,omitempty"` EndTime *types.Time `json:"end_time,omitempty"` @@ -741,6 +957,30 @@ func backfillRangeFromWire(w *backfillRangeWire) (*BackfillRange, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BackfillRange) MarshalJSON() ([]byte, error) { + w, err := backfillRangeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BackfillRange) UnmarshalJSON(data []byte) error { + var w backfillRangeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := backfillRangeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type backfillSourceWire struct { DeltaTableSource *deltaTableSourceWire `json:"delta_table_source,omitempty"` DeltaTableName *string `json:"delta_table_name,omitempty"` @@ -805,6 +1045,30 @@ func backfillSourceFromWire(w *backfillSourceWire) (*BackfillSource, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BackfillSource) MarshalJSON() ([]byte, error) { + w, err := backfillSourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BackfillSource) UnmarshalJSON(data []byte) error { + var w backfillSourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := backfillSourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type batchCreateMaterializedFeaturesRequestWire struct { Requests []createMaterializedFeatureRequestWire `json:"requests,omitempty"` } @@ -835,6 +1099,30 @@ func batchCreateMaterializedFeaturesRequestFromWire(w *batchCreateMaterializedFe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BatchCreateMaterializedFeaturesRequest) MarshalJSON() ([]byte, error) { + w, err := batchCreateMaterializedFeaturesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BatchCreateMaterializedFeaturesRequest) UnmarshalJSON(data []byte) error { + var w batchCreateMaterializedFeaturesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := batchCreateMaterializedFeaturesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type batchCreateMaterializedFeaturesResponseWire struct { MaterializedFeatures []materializedFeatureWire `json:"materialized_features,omitempty"` } @@ -865,6 +1153,30 @@ func batchCreateMaterializedFeaturesResponseFromWire(w *batchCreateMaterializedF }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BatchCreateMaterializedFeaturesResponse) MarshalJSON() ([]byte, error) { + w, err := batchCreateMaterializedFeaturesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BatchCreateMaterializedFeaturesResponse) UnmarshalJSON(data []byte) error { + var w batchCreateMaterializedFeaturesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := batchCreateMaterializedFeaturesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cancelOperationRequestWire struct { Name *string `json:"name,omitempty"` } @@ -887,6 +1199,30 @@ func cancelOperationRequestFromWire(w *cancelOperationRequestWire) (*CancelOpera }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelOperationRequest) MarshalJSON() ([]byte, error) { + w, err := cancelOperationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelOperationRequest) UnmarshalJSON(data []byte) error { + var w cancelOperationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelOperationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type columnIdentifierWire struct { VariantExprPath *string `json:"variant_expr_path,omitempty"` } @@ -909,6 +1245,30 @@ func columnIdentifierFromWire(w *columnIdentifierWire) (*ColumnIdentifier, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ColumnIdentifier) MarshalJSON() ([]byte, error) { + w, err := columnIdentifierToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ColumnIdentifier) UnmarshalJSON(data []byte) error { + var w columnIdentifierWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := columnIdentifierFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type columnSelectionWire struct { Column *string `json:"column,omitempty"` } @@ -931,6 +1291,30 @@ func columnSelectionFromWire(w *columnSelectionWire) (*ColumnSelection, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ColumnSelection) MarshalJSON() ([]byte, error) { + w, err := columnSelectionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ColumnSelection) UnmarshalJSON(data []byte) error { + var w columnSelectionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := columnSelectionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type continuousWindowWire struct { WindowDuration *types.Duration `json:"window_duration,omitempty"` Offset *types.Duration `json:"offset,omitempty"` @@ -956,6 +1340,30 @@ func continuousWindowFromWire(w *continuousWindowWire) (*ContinuousWindow, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ContinuousWindow) MarshalJSON() ([]byte, error) { + w, err := continuousWindowToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ContinuousWindow) UnmarshalJSON(data []byte) error { + var w continuousWindowWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := continuousWindowFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type countFunctionWire struct { Input *string `json:"input,omitempty"` } @@ -978,6 +1386,30 @@ func countFunctionFromWire(w *countFunctionWire) (*CountFunction, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CountFunction) MarshalJSON() ([]byte, error) { + w, err := countFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CountFunction) UnmarshalJSON(data []byte) error { + var w countFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := countFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createFeatureRequestWire struct { Feature *featureWire `json:"feature,omitempty"` } @@ -1008,6 +1440,30 @@ func createFeatureRequestFromWire(w *createFeatureRequestWire) (*CreateFeatureRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateFeatureRequest) MarshalJSON() ([]byte, error) { + w, err := createFeatureRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateFeatureRequest) UnmarshalJSON(data []byte) error { + var w createFeatureRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createFeatureRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createFeatureSpecRequestWire struct { FeatureSpec *featureSpecWire `json:"feature_spec,omitempty"` } @@ -1038,6 +1494,30 @@ func createFeatureSpecRequestFromWire(w *createFeatureSpecRequestWire) (*CreateF }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateFeatureSpecRequest) MarshalJSON() ([]byte, error) { + w, err := createFeatureSpecRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateFeatureSpecRequest) UnmarshalJSON(data []byte) error { + var w createFeatureSpecRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createFeatureSpecRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createKafkaConfigRequestWire struct { KafkaConfig *kafkaConfigWire `json:"kafka_config,omitempty"` } @@ -1068,6 +1548,30 @@ func createKafkaConfigRequestFromWire(w *createKafkaConfigRequestWire) (*CreateK }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateKafkaConfigRequest) MarshalJSON() ([]byte, error) { + w, err := createKafkaConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateKafkaConfigRequest) UnmarshalJSON(data []byte) error { + var w createKafkaConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createKafkaConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createMaterializationSetRequestWire struct { MaterializationSet *materializationSetWire `json:"materialization_set,omitempty"` RequestId *string `json:"request_id,omitempty"` @@ -1101,6 +1605,30 @@ func createMaterializationSetRequestFromWire(w *createMaterializationSetRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateMaterializationSetRequest) MarshalJSON() ([]byte, error) { + w, err := createMaterializationSetRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateMaterializationSetRequest) UnmarshalJSON(data []byte) error { + var w createMaterializationSetRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createMaterializationSetRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createMaterializedFeatureRequestWire struct { MaterializedFeature *materializedFeatureWire `json:"materialized_feature,omitempty"` } @@ -1131,6 +1659,30 @@ func createMaterializedFeatureRequestFromWire(w *createMaterializedFeatureReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateMaterializedFeatureRequest) MarshalJSON() ([]byte, error) { + w, err := createMaterializedFeatureRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateMaterializedFeatureRequest) UnmarshalJSON(data []byte) error { + var w createMaterializedFeatureRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createMaterializedFeatureRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createStreamRequestWire struct { Stream *streamWire `json:"stream,omitempty"` } @@ -1161,6 +1713,30 @@ func createStreamRequestFromWire(w *createStreamRequestWire) (*CreateStreamReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateStreamRequest) MarshalJSON() ([]byte, error) { + w, err := createStreamRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateStreamRequest) UnmarshalJSON(data []byte) error { + var w createStreamRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createStreamRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cronScheduleWire struct { CronExpression *string `json:"cron_expression,omitempty"` Mode CronSchedule_Mode `json:"mode,omitempty"` @@ -1192,6 +1768,30 @@ func cronScheduleFromWire(w *cronScheduleWire) (*CronSchedule, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CronSchedule) MarshalJSON() ([]byte, error) { + w, err := cronScheduleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CronSchedule) UnmarshalJSON(data []byte) error { + var w cronScheduleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cronScheduleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type customUdfWire struct { FunctionPath *string `json:"function_path,omitempty"` InputBindings []inputBindingWire `json:"input_bindings,omitempty"` @@ -1225,6 +1825,30 @@ func customUdfFromWire(w *customUdfWire) (*CustomUdf, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CustomUdf) MarshalJSON() ([]byte, error) { + w, err := customUdfToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CustomUdf) UnmarshalJSON(data []byte) error { + var w customUdfWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := customUdfFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dataSourceWire struct { DeltaTableSource *deltaTableSourceWire `json:"delta_table_source,omitempty"` KafkaSource *kafkaSourceWire `json:"kafka_source,omitempty"` @@ -1388,6 +2012,30 @@ func dataSourceFromWire(w *dataSourceWire) (*DataSource, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DataSource) MarshalJSON() ([]byte, error) { + w, err := dataSourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DataSource) UnmarshalJSON(data []byte) error { + var w dataSourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dataSourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type declarativeFeatureWire struct { Feature *string `json:"feature,omitempty"` } @@ -1410,6 +2058,30 @@ func declarativeFeatureFromWire(w *declarativeFeatureWire) (*DeclarativeFeature, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeclarativeFeature) MarshalJSON() ([]byte, error) { + w, err := declarativeFeatureToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeclarativeFeature) UnmarshalJSON(data []byte) error { + var w declarativeFeatureWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := declarativeFeatureFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type defaultValueWire struct { Feature *string `json:"feature,omitempty"` DefaultValue *string `json:"default_value,omitempty"` @@ -1435,6 +2107,30 @@ func defaultValueFromWire(w *defaultValueWire) (*DefaultValue, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DefaultValue) MarshalJSON() ([]byte, error) { + w, err := defaultValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DefaultValue) UnmarshalJSON(data []byte) error { + var w defaultValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := defaultValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteFeatureRequestWire struct { FullName *string `json:"full_name,omitempty"` } @@ -1457,6 +2153,30 @@ func deleteFeatureRequestFromWire(w *deleteFeatureRequestWire) (*DeleteFeatureRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteFeatureRequest) MarshalJSON() ([]byte, error) { + w, err := deleteFeatureRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteFeatureRequest) UnmarshalJSON(data []byte) error { + var w deleteFeatureRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteFeatureRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteFeatureSpecRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1479,6 +2199,30 @@ func deleteFeatureSpecRequestFromWire(w *deleteFeatureSpecRequestWire) (*DeleteF }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteFeatureSpecRequest) MarshalJSON() ([]byte, error) { + w, err := deleteFeatureSpecRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteFeatureSpecRequest) UnmarshalJSON(data []byte) error { + var w deleteFeatureSpecRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteFeatureSpecRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteKafkaConfigRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1501,6 +2245,30 @@ func deleteKafkaConfigRequestFromWire(w *deleteKafkaConfigRequestWire) (*DeleteK }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteKafkaConfigRequest) MarshalJSON() ([]byte, error) { + w, err := deleteKafkaConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteKafkaConfigRequest) UnmarshalJSON(data []byte) error { + var w deleteKafkaConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteKafkaConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteMaterializationSetRequestWire struct { MaterializationSetId *string `json:"materialization_set_id,omitempty"` AllowMissing *bool `json:"allow_missing,omitempty"` @@ -1529,6 +2297,30 @@ func deleteMaterializationSetRequestFromWire(w *deleteMaterializationSetRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteMaterializationSetRequest) MarshalJSON() ([]byte, error) { + w, err := deleteMaterializationSetRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteMaterializationSetRequest) UnmarshalJSON(data []byte) error { + var w deleteMaterializationSetRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteMaterializationSetRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteMaterializedFeatureRequestWire struct { MaterializedFeatureId *string `json:"materialized_feature_id,omitempty"` } @@ -1551,6 +2343,30 @@ func deleteMaterializedFeatureRequestFromWire(w *deleteMaterializedFeatureReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteMaterializedFeatureRequest) MarshalJSON() ([]byte, error) { + w, err := deleteMaterializedFeatureRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteMaterializedFeatureRequest) UnmarshalJSON(data []byte) error { + var w deleteMaterializedFeatureRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteMaterializedFeatureRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteStreamRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1573,6 +2389,30 @@ func deleteStreamRequestFromWire(w *deleteStreamRequestWire) (*DeleteStreamReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteStreamRequest) MarshalJSON() ([]byte, error) { + w, err := deleteStreamRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteStreamRequest) UnmarshalJSON(data []byte) error { + var w deleteStreamRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteStreamRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deltaTableSourceWire struct { FullName *string `json:"full_name,omitempty"` EntityColumns []string `json:"entity_columns,omitempty"` @@ -1610,6 +2450,30 @@ func deltaTableSourceFromWire(w *deltaTableSourceWire) (*DeltaTableSource, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeltaTableSource) MarshalJSON() ([]byte, error) { + w, err := deltaTableSourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeltaTableSource) UnmarshalJSON(data []byte) error { + var w deltaTableSourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deltaTableSourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type directMtlsConfigWire struct { BootstrapServers *string `json:"bootstrap_servers,omitempty"` MtlsConfig *mtlsConfigWire `json:"mtls_config,omitempty"` @@ -1643,6 +2507,30 @@ func directMtlsConfigFromWire(w *directMtlsConfigWire) (*DirectMtlsConfig, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DirectMtlsConfig) MarshalJSON() ([]byte, error) { + w, err := directMtlsConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DirectMtlsConfig) UnmarshalJSON(data []byte) error { + var w directMtlsConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := directMtlsConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type directSchemasWire struct { PayloadSchema *schemaConfigWire `json:"payload_schema,omitempty"` KeySchema *schemaConfigWire `json:"key_schema,omitempty"` @@ -1684,6 +2572,30 @@ func directSchemasFromWire(w *directSchemasWire) (*DirectSchemas, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DirectSchemas) MarshalJSON() ([]byte, error) { + w, err := directSchemasToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DirectSchemas) UnmarshalJSON(data []byte) error { + var w directSchemasWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := directSchemasFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type entityColumnWire struct { Name *string `json:"name,omitempty"` } @@ -1706,6 +2618,30 @@ func entityColumnFromWire(w *entityColumnWire) (*EntityColumn, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EntityColumn) MarshalJSON() ([]byte, error) { + w, err := entityColumnToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EntityColumn) UnmarshalJSON(data []byte) error { + var w entityColumnWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := entityColumnFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type externalTriggerWire struct { } @@ -1723,6 +2659,30 @@ func externalTriggerFromWire(w *externalTriggerWire) (*ExternalTrigger, error) { return &ExternalTrigger{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalTrigger) MarshalJSON() ([]byte, error) { + w, err := externalTriggerToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalTrigger) UnmarshalJSON(data []byte) error { + var w externalTriggerWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalTriggerFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type featureWire struct { FullName *string `json:"full_name,omitempty"` Source *dataSourceWire `json:"source,omitempty"` @@ -1860,6 +2820,30 @@ func featureFromWire(w *featureWire) (*Feature, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Feature) MarshalJSON() ([]byte, error) { + w, err := featureToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Feature) UnmarshalJSON(data []byte) error { + var w featureWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := featureFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type featureFunctionWire struct { Udf *string `json:"udf,omitempty"` InputBindings []featureFunction_InputBindingWire `json:"input_bindings,omitempty"` @@ -1896,6 +2880,30 @@ func featureFunctionFromWire(w *featureFunctionWire) (*FeatureFunction, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FeatureFunction) MarshalJSON() ([]byte, error) { + w, err := featureFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FeatureFunction) UnmarshalJSON(data []byte) error { + var w featureFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := featureFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type featureFunction_InputBindingWire struct { Parameter *string `json:"parameter,omitempty"` BoundFeature *string `json:"bound_feature,omitempty"` @@ -1921,6 +2929,30 @@ func featureFunction_InputBindingFromWire(w *featureFunction_InputBindingWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FeatureFunction_InputBinding) MarshalJSON() ([]byte, error) { + w, err := featureFunction_InputBindingToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FeatureFunction_InputBinding) UnmarshalJSON(data []byte) error { + var w featureFunction_InputBindingWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := featureFunction_InputBindingFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type featureLookupWire struct { Table *string `json:"table,omitempty"` LookupKeys []string `json:"lookup_keys,omitempty"` @@ -1977,6 +3009,30 @@ func featureLookupFromWire(w *featureLookupWire) (*FeatureLookup, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FeatureLookup) MarshalJSON() ([]byte, error) { + w, err := featureLookupToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FeatureLookup) UnmarshalJSON(data []byte) error { + var w featureLookupWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := featureLookupFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type featureReferenceWire struct { Feature *string `json:"feature,omitempty"` } @@ -1999,6 +3055,30 @@ func featureReferenceFromWire(w *featureReferenceWire) (*FeatureReference, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FeatureReference) MarshalJSON() ([]byte, error) { + w, err := featureReferenceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FeatureReference) UnmarshalJSON(data []byte) error { + var w featureReferenceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := featureReferenceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type featureSpecWire struct { Name *string `json:"name,omitempty"` Features []featuresWire `json:"features,omitempty"` @@ -2068,6 +3148,30 @@ func featureSpecFromWire(w *featureSpecWire) (*FeatureSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FeatureSpec) MarshalJSON() ([]byte, error) { + w, err := featureSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FeatureSpec) UnmarshalJSON(data []byte) error { + var w featureSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := featureSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type featureViewSourceWire struct { FeatureReferences []featureReferenceWire `json:"feature_references,omitempty"` } @@ -2098,6 +3202,30 @@ func featureViewSourceFromWire(w *featureViewSourceWire) (*FeatureViewSource, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FeatureViewSource) MarshalJSON() ([]byte, error) { + w, err := featureViewSourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FeatureViewSource) UnmarshalJSON(data []byte) error { + var w featureViewSourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := featureViewSourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type featuresWire struct { FeatureLookup *featureLookupWire `json:"feature_lookup,omitempty"` FeatureFunction *featureFunctionWire `json:"feature_function,omitempty"` @@ -2190,6 +3318,30 @@ func featuresFromWire(w *featuresWire) (*Features, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Features) MarshalJSON() ([]byte, error) { + w, err := featuresToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Features) UnmarshalJSON(data []byte) error { + var w featuresWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := featuresFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type fieldDefinitionWire struct { Name *string `json:"name,omitempty"` DataType ScalarDataType `json:"data_type,omitempty"` @@ -2215,6 +3367,30 @@ func fieldDefinitionFromWire(w *fieldDefinitionWire) (*FieldDefinition, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FieldDefinition) MarshalJSON() ([]byte, error) { + w, err := fieldDefinitionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FieldDefinition) UnmarshalJSON(data []byte) error { + var w fieldDefinitionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := fieldDefinitionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type firstDistinctFunctionWire struct { Input *string `json:"input,omitempty"` N *wireInt64 `json:"n,omitempty"` @@ -2248,6 +3424,30 @@ func firstDistinctFunctionFromWire(w *firstDistinctFunctionWire) (*FirstDistinct }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FirstDistinctFunction) MarshalJSON() ([]byte, error) { + w, err := firstDistinctFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FirstDistinctFunction) UnmarshalJSON(data []byte) error { + var w firstDistinctFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := firstDistinctFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type firstFunctionWire struct { Input *string `json:"input,omitempty"` } @@ -2270,6 +3470,30 @@ func firstFunctionFromWire(w *firstFunctionWire) (*FirstFunction, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FirstFunction) MarshalJSON() ([]byte, error) { + w, err := firstFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FirstFunction) UnmarshalJSON(data []byte) error { + var w firstFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := firstFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type firstNFunctionWire struct { Input *string `json:"input,omitempty"` N *wireInt64 `json:"n,omitempty"` @@ -2303,6 +3527,30 @@ func firstNFunctionFromWire(w *firstNFunctionWire) (*FirstNFunction, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FirstNFunction) MarshalJSON() ([]byte, error) { + w, err := firstNFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FirstNFunction) UnmarshalJSON(data []byte) error { + var w firstNFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := firstNFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type flatSchemaWire struct { Fields []fieldDefinitionWire `json:"fields,omitempty"` } @@ -2333,6 +3581,30 @@ func flatSchemaFromWire(w *flatSchemaWire) (*FlatSchema, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FlatSchema) MarshalJSON() ([]byte, error) { + w, err := flatSchemaToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FlatSchema) UnmarshalJSON(data []byte) error { + var w flatSchemaWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := flatSchemaFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type functionWire struct { FunctionType FunctionFunctionType `json:"function_type,omitempty"` ExtraParameters []functionExtraParameterWire `json:"extra_parameters,omitempty"` @@ -2439,6 +3711,30 @@ func functionFromWire(w *functionWire) (*Function, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Function) MarshalJSON() ([]byte, error) { + w, err := functionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Function) UnmarshalJSON(data []byte) error { + var w functionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := functionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type functionExtraParameterWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -2464,6 +3760,30 @@ func functionExtraParameterFromWire(w *functionExtraParameterWire) (*FunctionExt }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FunctionExtraParameter) MarshalJSON() ([]byte, error) { + w, err := functionExtraParameterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FunctionExtraParameter) UnmarshalJSON(data []byte) error { + var w functionExtraParameterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := functionExtraParameterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getFeatureRequestWire struct { FullName *string `json:"full_name,omitempty"` } @@ -2486,6 +3806,30 @@ func getFeatureRequestFromWire(w *getFeatureRequestWire) (*GetFeatureRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetFeatureRequest) MarshalJSON() ([]byte, error) { + w, err := getFeatureRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetFeatureRequest) UnmarshalJSON(data []byte) error { + var w getFeatureRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getFeatureRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getFeatureSpecRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2508,6 +3852,30 @@ func getFeatureSpecRequestFromWire(w *getFeatureSpecRequestWire) (*GetFeatureSpe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetFeatureSpecRequest) MarshalJSON() ([]byte, error) { + w, err := getFeatureSpecRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetFeatureSpecRequest) UnmarshalJSON(data []byte) error { + var w getFeatureSpecRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getFeatureSpecRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getKafkaConfigRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2530,6 +3898,30 @@ func getKafkaConfigRequestFromWire(w *getKafkaConfigRequestWire) (*GetKafkaConfi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetKafkaConfigRequest) MarshalJSON() ([]byte, error) { + w, err := getKafkaConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetKafkaConfigRequest) UnmarshalJSON(data []byte) error { + var w getKafkaConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getKafkaConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getMaterializationSetRequestWire struct { MaterializationSetId *string `json:"materialization_set_id,omitempty"` } @@ -2552,6 +3944,30 @@ func getMaterializationSetRequestFromWire(w *getMaterializationSetRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetMaterializationSetRequest) MarshalJSON() ([]byte, error) { + w, err := getMaterializationSetRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetMaterializationSetRequest) UnmarshalJSON(data []byte) error { + var w getMaterializationSetRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getMaterializationSetRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getMaterializedFeatureRequestWire struct { MaterializedFeatureId *string `json:"materialized_feature_id,omitempty"` } @@ -2574,6 +3990,30 @@ func getMaterializedFeatureRequestFromWire(w *getMaterializedFeatureRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetMaterializedFeatureRequest) MarshalJSON() ([]byte, error) { + w, err := getMaterializedFeatureRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetMaterializedFeatureRequest) UnmarshalJSON(data []byte) error { + var w getMaterializedFeatureRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getMaterializedFeatureRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getOperationRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2596,6 +4036,30 @@ func getOperationRequestFromWire(w *getOperationRequestWire) (*GetOperationReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetOperationRequest) MarshalJSON() ([]byte, error) { + w, err := getOperationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetOperationRequest) UnmarshalJSON(data []byte) error { + var w getOperationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getOperationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getStreamRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2618,6 +4082,30 @@ func getStreamRequestFromWire(w *getStreamRequestWire) (*GetStreamRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetStreamRequest) MarshalJSON() ([]byte, error) { + w, err := getStreamRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetStreamRequest) UnmarshalJSON(data []byte) error { + var w getStreamRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getStreamRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingestionConfigWire struct { IngestionDestination *ingestionDestinationWire `json:"ingestion_destination,omitempty"` BackfillSource *backfillSourceWire `json:"backfill_source,omitempty"` @@ -2693,6 +4181,30 @@ func ingestionConfigFromWire(w *ingestionConfigWire) (*IngestionConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngestionConfig) MarshalJSON() ([]byte, error) { + w, err := ingestionConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngestionConfig) UnmarshalJSON(data []byte) error { + var w ingestionConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingestionConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingestionDestinationWire struct { DeltaTableName *string `json:"delta_table_name,omitempty"` ViewName *string `json:"view_name,omitempty"` @@ -2749,6 +4261,30 @@ func ingestionDestinationFromWire(w *ingestionDestinationWire) (*IngestionDestin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngestionDestination) MarshalJSON() ([]byte, error) { + w, err := ingestionDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngestionDestination) UnmarshalJSON(data []byte) error { + var w ingestionDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingestionDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type inputBindingWire struct { Parameter *string `json:"parameter,omitempty"` Column *string `json:"column,omitempty"` @@ -2774,6 +4310,30 @@ func inputBindingFromWire(w *inputBindingWire) (*InputBinding, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InputBinding) MarshalJSON() ([]byte, error) { + w, err := inputBindingToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InputBinding) UnmarshalJSON(data []byte) error { + var w inputBindingWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := inputBindingFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobContextWire struct { JobId *wireInt64 `json:"job_id,omitempty"` JobRunId *wireInt64 `json:"job_run_id,omitempty"` @@ -2815,6 +4375,30 @@ func jobContextFromWire(w *jobContextWire) (*JobContext, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobContext) MarshalJSON() ([]byte, error) { + w, err := jobContextToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobContext) UnmarshalJSON(data []byte) error { + var w jobContextWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobContextFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type kafkaConfigWire struct { Name *string `json:"name,omitempty"` BootstrapServers *string `json:"bootstrap_servers,omitempty"` @@ -2909,6 +4493,30 @@ func kafkaConfigFromWire(w *kafkaConfigWire) (*KafkaConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v KafkaConfig) MarshalJSON() ([]byte, error) { + w, err := kafkaConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *KafkaConfig) UnmarshalJSON(data []byte) error { + var w kafkaConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := kafkaConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type kafkaSourceWire struct { Name *string `json:"name,omitempty"` EntityColumnIdentifiers []columnIdentifierWire `json:"entity_column_identifiers,omitempty"` @@ -2956,6 +4564,30 @@ func kafkaSourceFromWire(w *kafkaSourceWire) (*KafkaSource, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v KafkaSource) MarshalJSON() ([]byte, error) { + w, err := kafkaSourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *KafkaSource) UnmarshalJSON(data []byte) error { + var w kafkaSourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := kafkaSourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type kafkaStreamConfigWire struct { SubscriptionMode *kafkaSubscriptionModeWire `json:"subscription_mode,omitempty"` ExtraOptions map[string]string `json:"extra_options,omitempty"` @@ -2989,6 +4621,30 @@ func kafkaStreamConfigFromWire(w *kafkaStreamConfigWire) (*KafkaStreamConfig, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v KafkaStreamConfig) MarshalJSON() ([]byte, error) { + w, err := kafkaStreamConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *KafkaStreamConfig) UnmarshalJSON(data []byte) error { + var w kafkaStreamConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := kafkaStreamConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type kafkaSubscriptionModeWire struct { Assign *string `json:"assign,omitempty"` Subscribe *string `json:"subscribe,omitempty"` @@ -3057,6 +4713,30 @@ func kafkaSubscriptionModeFromWire(w *kafkaSubscriptionModeWire) (*KafkaSubscrip }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v KafkaSubscriptionMode) MarshalJSON() ([]byte, error) { + w, err := kafkaSubscriptionModeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *KafkaSubscriptionMode) UnmarshalJSON(data []byte) error { + var w kafkaSubscriptionModeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := kafkaSubscriptionModeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type kinesisStreamConfigWire struct { StreamNames *streamNameListWire `json:"stream_names,omitempty"` StreamArns *streamArnListWire `json:"stream_arns,omitempty"` @@ -3132,6 +4812,30 @@ func kinesisStreamConfigFromWire(w *kinesisStreamConfigWire) (*KinesisStreamConf }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v KinesisStreamConfig) MarshalJSON() ([]byte, error) { + w, err := kinesisStreamConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *KinesisStreamConfig) UnmarshalJSON(data []byte) error { + var w kinesisStreamConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := kinesisStreamConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type lastDistinctFunctionWire struct { Input *string `json:"input,omitempty"` N *wireInt64 `json:"n,omitempty"` @@ -3165,6 +4869,30 @@ func lastDistinctFunctionFromWire(w *lastDistinctFunctionWire) (*LastDistinctFun }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LastDistinctFunction) MarshalJSON() ([]byte, error) { + w, err := lastDistinctFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LastDistinctFunction) UnmarshalJSON(data []byte) error { + var w lastDistinctFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := lastDistinctFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type lastFunctionWire struct { Input *string `json:"input,omitempty"` } @@ -3187,6 +4915,30 @@ func lastFunctionFromWire(w *lastFunctionWire) (*LastFunction, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LastFunction) MarshalJSON() ([]byte, error) { + w, err := lastFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LastFunction) UnmarshalJSON(data []byte) error { + var w lastFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := lastFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type lastNFunctionWire struct { Input *string `json:"input,omitempty"` N *wireInt64 `json:"n,omitempty"` @@ -3220,6 +4972,30 @@ func lastNFunctionFromWire(w *lastNFunctionWire) (*LastNFunction, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LastNFunction) MarshalJSON() ([]byte, error) { + w, err := lastNFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LastNFunction) UnmarshalJSON(data []byte) error { + var w lastNFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := lastNFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type lineageContextWire struct { NotebookId *wireInt64 `json:"notebook_id,omitempty"` JobContext *jobContextWire `json:"job_context,omitempty"` @@ -3261,6 +5037,30 @@ func lineageContextFromWire(w *lineageContextWire) (*LineageContext, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LineageContext) MarshalJSON() ([]byte, error) { + w, err := lineageContextToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LineageContext) UnmarshalJSON(data []byte) error { + var w lineageContextWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := lineageContextFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listFeaturesRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -3292,6 +5092,30 @@ func listFeaturesRequestFromWire(w *listFeaturesRequestWire) (*ListFeaturesReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListFeaturesRequest) MarshalJSON() ([]byte, error) { + w, err := listFeaturesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListFeaturesRequest) UnmarshalJSON(data []byte) error { + var w listFeaturesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listFeaturesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listFeaturesResponseWire struct { Features []featureWire `json:"features,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3325,6 +5149,30 @@ func listFeaturesResponseFromWire(w *listFeaturesResponseWire) (*ListFeaturesRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListFeaturesResponse) MarshalJSON() ([]byte, error) { + w, err := listFeaturesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListFeaturesResponse) UnmarshalJSON(data []byte) error { + var w listFeaturesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listFeaturesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listKafkaConfigsRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -3350,6 +5198,30 @@ func listKafkaConfigsRequestFromWire(w *listKafkaConfigsRequestWire) (*ListKafka }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListKafkaConfigsRequest) MarshalJSON() ([]byte, error) { + w, err := listKafkaConfigsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListKafkaConfigsRequest) UnmarshalJSON(data []byte) error { + var w listKafkaConfigsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listKafkaConfigsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listKafkaConfigsResponseWire struct { KafkaConfigs []kafkaConfigWire `json:"kafka_configs,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3383,6 +5255,30 @@ func listKafkaConfigsResponseFromWire(w *listKafkaConfigsResponseWire) (*ListKaf }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListKafkaConfigsResponse) MarshalJSON() ([]byte, error) { + w, err := listKafkaConfigsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListKafkaConfigsResponse) UnmarshalJSON(data []byte) error { + var w listKafkaConfigsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listKafkaConfigsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listMaterializedFeaturesRequestWire struct { FeatureName *string `json:"feature_name,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -3404,11 +5300,35 @@ func listMaterializedFeaturesRequestFromWire(w *listMaterializedFeaturesRequestW if w == nil { return nil, nil } - return &ListMaterializedFeaturesRequest{ - FeatureName: w.FeatureName, - PageToken: w.PageToken, - PageSize: w.PageSize, - }, nil + return &ListMaterializedFeaturesRequest{ + FeatureName: w.FeatureName, + PageToken: w.PageToken, + PageSize: w.PageSize, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListMaterializedFeaturesRequest) MarshalJSON() ([]byte, error) { + w, err := listMaterializedFeaturesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListMaterializedFeaturesRequest) UnmarshalJSON(data []byte) error { + var w listMaterializedFeaturesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listMaterializedFeaturesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil } type listMaterializedFeaturesResponseWire struct { @@ -3444,6 +5364,30 @@ func listMaterializedFeaturesResponseFromWire(w *listMaterializedFeaturesRespons }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListMaterializedFeaturesResponse) MarshalJSON() ([]byte, error) { + w, err := listMaterializedFeaturesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListMaterializedFeaturesResponse) UnmarshalJSON(data []byte) error { + var w listMaterializedFeaturesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listMaterializedFeaturesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listStreamsRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -3472,6 +5416,30 @@ func listStreamsRequestFromWire(w *listStreamsRequestWire) (*ListStreamsRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListStreamsRequest) MarshalJSON() ([]byte, error) { + w, err := listStreamsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListStreamsRequest) UnmarshalJSON(data []byte) error { + var w listStreamsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listStreamsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listStreamsResponseWire struct { Streams []streamWire `json:"streams,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3505,6 +5473,30 @@ func listStreamsResponseFromWire(w *listStreamsResponseWire) (*ListStreamsRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListStreamsResponse) MarshalJSON() ([]byte, error) { + w, err := listStreamsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListStreamsResponse) UnmarshalJSON(data []byte) error { + var w listStreamsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listStreamsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type materializationFailureNotificationWire struct { EmailAddresses []string `json:"email_addresses,omitempty"` DestinationIds []string `json:"destination_ids,omitempty"` @@ -3533,6 +5525,30 @@ func materializationFailureNotificationFromWire(w *materializationFailureNotific }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MaterializationFailureNotification) MarshalJSON() ([]byte, error) { + w, err := materializationFailureNotificationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MaterializationFailureNotification) UnmarshalJSON(data []byte) error { + var w materializationFailureNotificationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := materializationFailureNotificationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type materializationNotificationsWire struct { OnSuccess *materializationSuccessNotificationWire `json:"on_success,omitempty"` OnFailure *materializationFailureNotificationWire `json:"on_failure,omitempty"` @@ -3574,6 +5590,30 @@ func materializationNotificationsFromWire(w *materializationNotificationsWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MaterializationNotifications) MarshalJSON() ([]byte, error) { + w, err := materializationNotificationsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MaterializationNotifications) UnmarshalJSON(data []byte) error { + var w materializationNotificationsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := materializationNotificationsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type materializationRunProgressWire struct { MaterializedFeatureIds []string `json:"materialized_feature_ids,omitempty"` State MaterializationRunProgress_State `json:"state,omitempty"` @@ -3610,6 +5650,30 @@ func materializationRunProgressFromWire(w *materializationRunProgressWire) (*Mat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MaterializationRunProgress) MarshalJSON() ([]byte, error) { + w, err := materializationRunProgressToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MaterializationRunProgress) UnmarshalJSON(data []byte) error { + var w materializationRunProgressWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := materializationRunProgressFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type materializationSetWire struct { MaterializationSetId *string `json:"materialization_set_id,omitempty"` MaterializedFeatures []materializedFeatureWire `json:"materialized_features,omitempty"` @@ -3654,6 +5718,30 @@ func materializationSetFromWire(w *materializationSetWire) (*MaterializationSet, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MaterializationSet) MarshalJSON() ([]byte, error) { + w, err := materializationSetToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MaterializationSet) UnmarshalJSON(data []byte) error { + var w materializationSetWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := materializationSetFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type materializationSetDeletionProgressWire struct { DeletedMaterializedFeatureIds []string `json:"deleted_materialized_feature_ids,omitempty"` FailedMaterializedFeatures []materializedFeatureChangeFailureWire `json:"failed_materialized_features,omitempty"` @@ -3687,6 +5775,30 @@ func materializationSetDeletionProgressFromWire(w *materializationSetDeletionPro }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MaterializationSetDeletionProgress) MarshalJSON() ([]byte, error) { + w, err := materializationSetDeletionProgressToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MaterializationSetDeletionProgress) UnmarshalJSON(data []byte) error { + var w materializationSetDeletionProgressWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := materializationSetDeletionProgressFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type materializationSetOperationMetadataWire struct { FeatureFullNames []string `json:"feature_full_names,omitempty"` State MaterializationSetOperationMetadata_State `json:"state,omitempty"` @@ -3791,6 +5903,30 @@ func materializationSetOperationMetadataFromWire(w *materializationSetOperationM }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MaterializationSetOperationMetadata) MarshalJSON() ([]byte, error) { + w, err := materializationSetOperationMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MaterializationSetOperationMetadata) UnmarshalJSON(data []byte) error { + var w materializationSetOperationMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := materializationSetOperationMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type materializationSetTriggerProgressWire struct { Runs []materializationRunProgressWire `json:"runs,omitempty"` } @@ -3821,6 +5957,30 @@ func materializationSetTriggerProgressFromWire(w *materializationSetTriggerProgr }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MaterializationSetTriggerProgress) MarshalJSON() ([]byte, error) { + w, err := materializationSetTriggerProgressToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MaterializationSetTriggerProgress) UnmarshalJSON(data []byte) error { + var w materializationSetTriggerProgressWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := materializationSetTriggerProgressFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type materializationSetUpdateProgressWire struct { UpdatedMaterializedFeatureIds []string `json:"updated_materialized_feature_ids,omitempty"` DeletedMaterializedFeatureIds []string `json:"deleted_materialized_feature_ids,omitempty"` @@ -3857,6 +6017,30 @@ func materializationSetUpdateProgressFromWire(w *materializationSetUpdateProgres }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MaterializationSetUpdateProgress) MarshalJSON() ([]byte, error) { + w, err := materializationSetUpdateProgressToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MaterializationSetUpdateProgress) UnmarshalJSON(data []byte) error { + var w materializationSetUpdateProgressWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := materializationSetUpdateProgressFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type materializationSuccessNotificationWire struct { EmailAddresses []string `json:"email_addresses,omitempty"` DestinationIds []string `json:"destination_ids,omitempty"` @@ -3882,6 +6066,30 @@ func materializationSuccessNotificationFromWire(w *materializationSuccessNotific }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MaterializationSuccessNotification) MarshalJSON() ([]byte, error) { + w, err := materializationSuccessNotificationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MaterializationSuccessNotification) UnmarshalJSON(data []byte) error { + var w materializationSuccessNotificationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := materializationSuccessNotificationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type materializedFeatureWire struct { MaterializedFeatureId *string `json:"materialized_feature_id,omitempty"` FeatureName *string `json:"feature_name,omitempty"` @@ -4105,6 +6313,30 @@ func materializedFeatureFromWire(w *materializedFeatureWire) (*MaterializedFeatu }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MaterializedFeature) MarshalJSON() ([]byte, error) { + w, err := materializedFeatureToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MaterializedFeature) UnmarshalJSON(data []byte) error { + var w materializedFeatureWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := materializedFeatureFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type materializedFeatureChangeFailureWire struct { MaterializedFeatureId *string `json:"materialized_feature_id,omitempty"` ErrorCode *string `json:"error_code,omitempty"` @@ -4133,6 +6365,30 @@ func materializedFeatureChangeFailureFromWire(w *materializedFeatureChangeFailur }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MaterializedFeatureChangeFailure) MarshalJSON() ([]byte, error) { + w, err := materializedFeatureChangeFailureToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MaterializedFeatureChangeFailure) UnmarshalJSON(data []byte) error { + var w materializedFeatureChangeFailureWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := materializedFeatureChangeFailureFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type maxFunctionWire struct { Input *string `json:"input,omitempty"` } @@ -4155,6 +6411,30 @@ func maxFunctionFromWire(w *maxFunctionWire) (*MaxFunction, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MaxFunction) MarshalJSON() ([]byte, error) { + w, err := maxFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MaxFunction) UnmarshalJSON(data []byte) error { + var w maxFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := maxFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type minFunctionWire struct { Input *string `json:"input,omitempty"` } @@ -4177,6 +6457,30 @@ func minFunctionFromWire(w *minFunctionWire) (*MinFunction, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MinFunction) MarshalJSON() ([]byte, error) { + w, err := minFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MinFunction) UnmarshalJSON(data []byte) error { + var w minFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := minFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type mtlsConfigWire struct { KeystoreLocation *string `json:"keystore_location,omitempty"` KeystorePasswordRef *secretScopeReferenceWire `json:"keystore_password_ref,omitempty"` @@ -4238,6 +6542,30 @@ func mtlsConfigFromWire(w *mtlsConfigWire) (*MtlsConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MtlsConfig) MarshalJSON() ([]byte, error) { + w, err := mtlsConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MtlsConfig) UnmarshalJSON(data []byte) error { + var w mtlsConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := mtlsConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type offlineStoreConfigWire struct { CatalogName *string `json:"catalog_name,omitempty"` SchemaName *string `json:"schema_name,omitempty"` @@ -4266,6 +6594,30 @@ func offlineStoreConfigFromWire(w *offlineStoreConfigWire) (*OfflineStoreConfig, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OfflineStoreConfig) MarshalJSON() ([]byte, error) { + w, err := offlineStoreConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OfflineStoreConfig) UnmarshalJSON(data []byte) error { + var w offlineStoreConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := offlineStoreConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type onlineStoreConfigWire struct { CatalogName *string `json:"catalog_name,omitempty"` SchemaName *string `json:"schema_name,omitempty"` @@ -4297,6 +6649,30 @@ func onlineStoreConfigFromWire(w *onlineStoreConfigWire) (*OnlineStoreConfig, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OnlineStoreConfig) MarshalJSON() ([]byte, error) { + w, err := onlineStoreConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OnlineStoreConfig) UnmarshalJSON(data []byte) error { + var w onlineStoreConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := onlineStoreConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type operationWire struct { Name *string `json:"name,omitempty"` Metadata json.RawMessage `json:"metadata,omitempty"` @@ -4370,6 +6746,30 @@ func operationFromWire(w *operationWire) (*Operation, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Operation) MarshalJSON() ([]byte, error) { + w, err := operationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Operation) UnmarshalJSON(data []byte) error { + var w operationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := operationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipRequirementsWire struct { Requirements []string `json:"requirements,omitempty"` } @@ -4392,6 +6792,30 @@ func pipRequirementsFromWire(w *pipRequirementsWire) (*PipRequirements, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipRequirements) MarshalJSON() ([]byte, error) { + w, err := pipRequirementsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipRequirements) UnmarshalJSON(data []byte) error { + var w pipRequirementsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipRequirementsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type protoSchemaSpecWire struct { SchemaText *string `json:"schema_text,omitempty"` MessageName *string `json:"message_name,omitempty"` @@ -4417,6 +6841,30 @@ func protoSchemaSpecFromWire(w *protoSchemaSpecWire) (*ProtoSchemaSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProtoSchemaSpec) MarshalJSON() ([]byte, error) { + w, err := protoSchemaSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProtoSchemaSpec) UnmarshalJSON(data []byte) error { + var w protoSchemaSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := protoSchemaSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type purgeFeatureEntitiesMetadataWire struct { Features []string `json:"features,omitempty"` EntitiesTable *string `json:"entities_table,omitempty"` @@ -4465,6 +6913,30 @@ func purgeFeatureEntitiesMetadataFromWire(w *purgeFeatureEntitiesMetadataWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PurgeFeatureEntitiesMetadata) MarshalJSON() ([]byte, error) { + w, err := purgeFeatureEntitiesMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PurgeFeatureEntitiesMetadata) UnmarshalJSON(data []byte) error { + var w purgeFeatureEntitiesMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := purgeFeatureEntitiesMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type purgeFeatureEntitiesRequestWire struct { Features []string `json:"features,omitempty"` EntitiesTable *string `json:"entities_table,omitempty"` @@ -4524,6 +6996,30 @@ func purgeFeatureEntitiesRequestFromWire(w *purgeFeatureEntitiesRequestWire) (*P }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PurgeFeatureEntitiesRequest) MarshalJSON() ([]byte, error) { + w, err := purgeFeatureEntitiesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PurgeFeatureEntitiesRequest) UnmarshalJSON(data []byte) error { + var w purgeFeatureEntitiesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := purgeFeatureEntitiesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type purgeFeatureEntitiesResponseWire struct { Metadata *purgeFeatureEntitiesMetadataWire `json:"metadata,omitempty"` Results []purgeFeatureEntitiesResultWire `json:"results,omitempty"` @@ -4579,6 +7075,30 @@ func purgeFeatureEntitiesResponseFromWire(w *purgeFeatureEntitiesResponseWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PurgeFeatureEntitiesResponse) MarshalJSON() ([]byte, error) { + w, err := purgeFeatureEntitiesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PurgeFeatureEntitiesResponse) UnmarshalJSON(data []byte) error { + var w purgeFeatureEntitiesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := purgeFeatureEntitiesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type purgeFeatureEntitiesResultWire struct { Feature *string `json:"feature,omitempty"` OfflineState PurgeFeatureEntitiesResult_State `json:"offline_state,omitempty"` @@ -4618,6 +7138,30 @@ func purgeFeatureEntitiesResultFromWire(w *purgeFeatureEntitiesResultWire) (*Pur }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PurgeFeatureEntitiesResult) MarshalJSON() ([]byte, error) { + w, err := purgeFeatureEntitiesResultToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PurgeFeatureEntitiesResult) UnmarshalJSON(data []byte) error { + var w purgeFeatureEntitiesResultWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := purgeFeatureEntitiesResultFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type renameOutputWire struct { Feature *string `json:"feature,omitempty"` Output *string `json:"output,omitempty"` @@ -4643,6 +7187,30 @@ func renameOutputFromWire(w *renameOutputWire) (*RenameOutput, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RenameOutput) MarshalJSON() ([]byte, error) { + w, err := renameOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RenameOutput) UnmarshalJSON(data []byte) error { + var w renameOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := renameOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type requestSourceWire struct { FlatSchema *flatSchemaWire `json:"flat_schema,omitempty"` DataframeSchema *string `json:"dataframe_schema,omitempty"` @@ -4707,6 +7275,30 @@ func requestSourceFromWire(w *requestSourceWire) (*RequestSource, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RequestSource) MarshalJSON() ([]byte, error) { + w, err := requestSourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RequestSource) UnmarshalJSON(data []byte) error { + var w requestSourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := requestSourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rollingWindowWire struct { WindowDuration *types.Duration `json:"window_duration,omitempty"` Delay *types.Duration `json:"delay,omitempty"` @@ -4732,6 +7324,30 @@ func rollingWindowFromWire(w *rollingWindowWire) (*RollingWindow, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RollingWindow) MarshalJSON() ([]byte, error) { + w, err := rollingWindowToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RollingWindow) UnmarshalJSON(data []byte) error { + var w rollingWindowWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rollingWindowFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sawtoothWindowWire struct { WindowDuration *types.Duration `json:"window_duration,omitempty"` Delay *types.Duration `json:"delay,omitempty"` @@ -4757,6 +7373,30 @@ func sawtoothWindowFromWire(w *sawtoothWindowWire) (*SawtoothWindow, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SawtoothWindow) MarshalJSON() ([]byte, error) { + w, err := sawtoothWindowToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SawtoothWindow) UnmarshalJSON(data []byte) error { + var w sawtoothWindowWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sawtoothWindowFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type schemaConfigWire struct { JsonSchema *string `json:"json_schema,omitempty"` AvroSchema *string `json:"avro_schema,omitempty"` @@ -4833,6 +7473,30 @@ func schemaConfigFromWire(w *schemaConfigWire) (*SchemaConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SchemaConfig) MarshalJSON() ([]byte, error) { + w, err := schemaConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SchemaConfig) UnmarshalJSON(data []byte) error { + var w schemaConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := schemaConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type schemaLocatorWire struct { ConfluentSchema *schemaLocator_ConfluentSchemaWire `json:"confluent_schema,omitempty"` Format SchemaLocator_Format `json:"format,omitempty"` @@ -4888,6 +7552,30 @@ func schemaLocatorFromWire(w *schemaLocatorWire) (*SchemaLocator, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SchemaLocator) MarshalJSON() ([]byte, error) { + w, err := schemaLocatorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SchemaLocator) UnmarshalJSON(data []byte) error { + var w schemaLocatorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := schemaLocatorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type schemaLocator_ConfluentSchemaWire struct { Subject *string `json:"subject,omitempty"` } @@ -4910,6 +7598,30 @@ func schemaLocator_ConfluentSchemaFromWire(w *schemaLocator_ConfluentSchemaWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SchemaLocator_ConfluentSchema) MarshalJSON() ([]byte, error) { + w, err := schemaLocator_ConfluentSchemaToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SchemaLocator_ConfluentSchema) UnmarshalJSON(data []byte) error { + var w schemaLocator_ConfluentSchemaWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := schemaLocator_ConfluentSchemaFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type schemaRegistryConfigWire struct { UcConnection *string `json:"uc_connection,omitempty"` ApiSecretRef *secretScopeReferenceWire `json:"api_secret_ref,omitempty"` @@ -4965,6 +7677,30 @@ func schemaRegistryConfigFromWire(w *schemaRegistryConfigWire) (*SchemaRegistryC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SchemaRegistryConfig) MarshalJSON() ([]byte, error) { + w, err := schemaRegistryConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SchemaRegistryConfig) UnmarshalJSON(data []byte) error { + var w schemaRegistryConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := schemaRegistryConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sdpSourceWire struct { PipelineId *string `json:"pipeline_id,omitempty"` OutputTable *string `json:"output_table,omitempty"` @@ -5005,6 +7741,30 @@ func sdpSourceFromWire(w *sdpSourceWire) (*SdpSource, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SdpSource) MarshalJSON() ([]byte, error) { + w, err := sdpSourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SdpSource) UnmarshalJSON(data []byte) error { + var w sdpSourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sdpSourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type secretScopeReferenceWire struct { Scope *string `json:"scope,omitempty"` Key *string `json:"key,omitempty"` @@ -5030,6 +7790,30 @@ func secretScopeReferenceFromWire(w *secretScopeReferenceWire) (*SecretScopeRefe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SecretScopeReference) MarshalJSON() ([]byte, error) { + w, err := secretScopeReferenceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SecretScopeReference) UnmarshalJSON(data []byte) error { + var w secretScopeReferenceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := secretScopeReferenceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type slidingWindowWire struct { WindowDuration *types.Duration `json:"window_duration,omitempty"` SlideDuration *types.Duration `json:"slide_duration,omitempty"` @@ -5061,6 +7845,30 @@ func slidingWindowFromWire(w *slidingWindowWire) (*SlidingWindow, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SlidingWindow) MarshalJSON() ([]byte, error) { + w, err := slidingWindowToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SlidingWindow) UnmarshalJSON(data []byte) error { + var w slidingWindowWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := slidingWindowFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sourceLatenessWire struct { SettlingDelay *types.Duration `json:"settling_delay,omitempty"` } @@ -5083,6 +7891,30 @@ func sourceLatenessFromWire(w *sourceLatenessWire) (*SourceLateness, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SourceLateness) MarshalJSON() ([]byte, error) { + w, err := sourceLatenessToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SourceLateness) UnmarshalJSON(data []byte) error { + var w sourceLatenessWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sourceLatenessFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type stddevPopFunctionWire struct { Input *string `json:"input,omitempty"` } @@ -5105,6 +7937,30 @@ func stddevPopFunctionFromWire(w *stddevPopFunctionWire) (*StddevPopFunction, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StddevPopFunction) MarshalJSON() ([]byte, error) { + w, err := stddevPopFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StddevPopFunction) UnmarshalJSON(data []byte) error { + var w stddevPopFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := stddevPopFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type stddevSampFunctionWire struct { Input *string `json:"input,omitempty"` } @@ -5127,6 +7983,30 @@ func stddevSampFunctionFromWire(w *stddevSampFunctionWire) (*StddevSampFunction, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StddevSampFunction) MarshalJSON() ([]byte, error) { + w, err := stddevSampFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StddevSampFunction) UnmarshalJSON(data []byte) error { + var w stddevSampFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := stddevSampFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type streamWire struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` @@ -5217,6 +8097,30 @@ func streamFromWire(w *streamWire) (*Stream, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Stream) MarshalJSON() ([]byte, error) { + w, err := streamToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Stream) UnmarshalJSON(data []byte) error { + var w streamWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := streamFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type streamArnListWire struct { Arns []string `json:"arns,omitempty"` } @@ -5234,9 +8138,33 @@ func streamArnListFromWire(w *streamArnListWire) (*StreamArnList, error) { if w == nil { return nil, nil } - return &StreamArnList{ - Arns: w.Arns, - }, nil + return &StreamArnList{ + Arns: w.Arns, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StreamArnList) MarshalJSON() ([]byte, error) { + w, err := streamArnListToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StreamArnList) UnmarshalJSON(data []byte) error { + var w streamArnListWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := streamArnListFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil } type streamConnectionConfigWire struct { @@ -5303,6 +8231,30 @@ func streamConnectionConfigFromWire(w *streamConnectionConfigWire) (*StreamConne }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StreamConnectionConfig) MarshalJSON() ([]byte, error) { + w, err := streamConnectionConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StreamConnectionConfig) UnmarshalJSON(data []byte) error { + var w streamConnectionConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := streamConnectionConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type streamNameListWire struct { Names []string `json:"names,omitempty"` } @@ -5325,6 +8277,30 @@ func streamNameListFromWire(w *streamNameListWire) (*StreamNameList, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StreamNameList) MarshalJSON() ([]byte, error) { + w, err := streamNameListToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StreamNameList) UnmarshalJSON(data []byte) error { + var w streamNameListWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := streamNameListFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type streamSchemaConfigWire struct { DirectSchemas *directSchemasWire `json:"direct_schemas,omitempty"` SchemaRegistryConfig *schemaRegistryConfigWire `json:"schema_registry_config,omitempty"` @@ -5397,6 +8373,30 @@ func streamSchemaConfigFromWire(w *streamSchemaConfigWire) (*StreamSchemaConfig, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StreamSchemaConfig) MarshalJSON() ([]byte, error) { + w, err := streamSchemaConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StreamSchemaConfig) UnmarshalJSON(data []byte) error { + var w streamSchemaConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := streamSchemaConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type streamSourceWire struct { FullName *string `json:"full_name,omitempty"` FilterCondition *string `json:"filter_condition,omitempty"` @@ -5428,6 +8428,30 @@ func streamSourceFromWire(w *streamSourceWire) (*StreamSource, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StreamSource) MarshalJSON() ([]byte, error) { + w, err := streamSourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StreamSource) UnmarshalJSON(data []byte) error { + var w streamSourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := streamSourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type streamSourceConfigWire struct { KafkaStreamConfig *kafkaStreamConfigWire `json:"kafka_stream_config,omitempty"` KinesisStreamConfig *kinesisStreamConfigWire `json:"kinesis_stream_config,omitempty"` @@ -5500,6 +8524,30 @@ func streamSourceConfigFromWire(w *streamSourceConfigWire) (*StreamSourceConfig, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StreamSourceConfig) MarshalJSON() ([]byte, error) { + w, err := streamSourceConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StreamSourceConfig) UnmarshalJSON(data []byte) error { + var w streamSourceConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := streamSourceConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type streamingModeWire struct { Mode StreamingMode_StreamingModeType `json:"mode,omitempty"` FreshnessTarget *string `json:"freshness_target,omitempty"` @@ -5528,6 +8576,30 @@ func streamingModeFromWire(w *streamingModeWire) (*StreamingMode, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StreamingMode) MarshalJSON() ([]byte, error) { + w, err := streamingModeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StreamingMode) UnmarshalJSON(data []byte) error { + var w streamingModeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := streamingModeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type subscriptionModeWire struct { Assign *string `json:"assign,omitempty"` Subscribe *string `json:"subscribe,omitempty"` @@ -5596,6 +8668,30 @@ func subscriptionModeFromWire(w *subscriptionModeWire) (*SubscriptionMode, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SubscriptionMode) MarshalJSON() ([]byte, error) { + w, err := subscriptionModeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SubscriptionMode) UnmarshalJSON(data []byte) error { + var w subscriptionModeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := subscriptionModeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sumFunctionWire struct { Input *string `json:"input,omitempty"` } @@ -5618,6 +8714,30 @@ func sumFunctionFromWire(w *sumFunctionWire) (*SumFunction, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SumFunction) MarshalJSON() ([]byte, error) { + w, err := sumFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SumFunction) UnmarshalJSON(data []byte) error { + var w sumFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sumFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tableTriggerWire struct { MinTimeBetweenTriggers *types.Duration `json:"min_time_between_triggers,omitempty"` WaitAfterLastChange *types.Duration `json:"wait_after_last_change,omitempty"` @@ -5649,6 +8769,30 @@ func tableTriggerFromWire(w *tableTriggerWire) (*TableTrigger, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TableTrigger) MarshalJSON() ([]byte, error) { + w, err := tableTriggerToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TableTrigger) UnmarshalJSON(data []byte) error { + var w tableTriggerWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tableTriggerFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type timeWindowWire struct { Continuous *continuousWindowWire `json:"continuous,omitempty"` Tumbling *tumblingWindowWire `json:"tumbling,omitempty"` @@ -5784,6 +8928,30 @@ func timeWindowFromWire(w *timeWindowWire) (*TimeWindow, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TimeWindow) MarshalJSON() ([]byte, error) { + w, err := timeWindowToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TimeWindow) UnmarshalJSON(data []byte) error { + var w timeWindowWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := timeWindowFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type timeseriesColumnWire struct { Name *string `json:"name,omitempty"` } @@ -5806,6 +8974,30 @@ func timeseriesColumnFromWire(w *timeseriesColumnWire) (*TimeseriesColumn, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TimeseriesColumn) MarshalJSON() ([]byte, error) { + w, err := timeseriesColumnToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TimeseriesColumn) UnmarshalJSON(data []byte) error { + var w timeseriesColumnWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := timeseriesColumnFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type triggerMaterializationSetRequestWire struct { MaterializationSetId *string `json:"materialization_set_id,omitempty"` RequestId *string `json:"request_id,omitempty"` @@ -5831,6 +9023,30 @@ func triggerMaterializationSetRequestFromWire(w *triggerMaterializationSetReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TriggerMaterializationSetRequest) MarshalJSON() ([]byte, error) { + w, err := triggerMaterializationSetRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TriggerMaterializationSetRequest) UnmarshalJSON(data []byte) error { + var w triggerMaterializationSetRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := triggerMaterializationSetRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type triggerMaterializationSetResponseWire struct { } @@ -5848,6 +9064,30 @@ func triggerMaterializationSetResponseFromWire(w *triggerMaterializationSetRespo return &TriggerMaterializationSetResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TriggerMaterializationSetResponse) MarshalJSON() ([]byte, error) { + w, err := triggerMaterializationSetResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TriggerMaterializationSetResponse) UnmarshalJSON(data []byte) error { + var w triggerMaterializationSetResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := triggerMaterializationSetResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tumblingWindowWire struct { WindowDuration *types.Duration `json:"window_duration,omitempty"` Delay *types.Duration `json:"delay,omitempty"` @@ -5876,6 +9116,30 @@ func tumblingWindowFromWire(w *tumblingWindowWire) (*TumblingWindow, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TumblingWindow) MarshalJSON() ([]byte, error) { + w, err := tumblingWindowToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TumblingWindow) UnmarshalJSON(data []byte) error { + var w tumblingWindowWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tumblingWindowFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateFeatureRequestWire struct { Feature *featureWire `json:"feature,omitempty"` UpdateMask *types.FieldMask[Feature] `json:"update_mask,omitempty"` @@ -5909,6 +9173,30 @@ func updateFeatureRequestFromWire(w *updateFeatureRequestWire) (*UpdateFeatureRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateFeatureRequest) MarshalJSON() ([]byte, error) { + w, err := updateFeatureRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateFeatureRequest) UnmarshalJSON(data []byte) error { + var w updateFeatureRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateFeatureRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateKafkaConfigRequestWire struct { KafkaConfig *kafkaConfigWire `json:"kafka_config,omitempty"` UpdateMask *types.FieldMask[KafkaConfig] `json:"update_mask,omitempty"` @@ -5942,6 +9230,30 @@ func updateKafkaConfigRequestFromWire(w *updateKafkaConfigRequestWire) (*UpdateK }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateKafkaConfigRequest) MarshalJSON() ([]byte, error) { + w, err := updateKafkaConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateKafkaConfigRequest) UnmarshalJSON(data []byte) error { + var w updateKafkaConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateKafkaConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateMaterializationSetRequestWire struct { MaterializationSet *materializationSetWire `json:"materialization_set,omitempty"` UpdateMask *types.FieldMask[MaterializationSet] `json:"update_mask,omitempty"` @@ -5978,6 +9290,30 @@ func updateMaterializationSetRequestFromWire(w *updateMaterializationSetRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateMaterializationSetRequest) MarshalJSON() ([]byte, error) { + w, err := updateMaterializationSetRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateMaterializationSetRequest) UnmarshalJSON(data []byte) error { + var w updateMaterializationSetRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateMaterializationSetRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateMaterializedFeatureRequestWire struct { MaterializedFeature *materializedFeatureWire `json:"materialized_feature,omitempty"` UpdateMask *types.FieldMask[MaterializedFeature] `json:"update_mask,omitempty"` @@ -6011,6 +9347,30 @@ func updateMaterializedFeatureRequestFromWire(w *updateMaterializedFeatureReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateMaterializedFeatureRequest) MarshalJSON() ([]byte, error) { + w, err := updateMaterializedFeatureRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateMaterializedFeatureRequest) UnmarshalJSON(data []byte) error { + var w updateMaterializedFeatureRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateMaterializedFeatureRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateStreamRequestWire struct { Stream *streamWire `json:"stream,omitempty"` UpdateMask *types.FieldMask[Stream] `json:"update_mask,omitempty"` @@ -6044,6 +9404,30 @@ func updateStreamRequestFromWire(w *updateStreamRequestWire) (*UpdateStreamReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateStreamRequest) MarshalJSON() ([]byte, error) { + w, err := updateStreamRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateStreamRequest) UnmarshalJSON(data []byte) error { + var w updateStreamRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateStreamRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type varPopFunctionWire struct { Input *string `json:"input,omitempty"` } @@ -6066,6 +9450,30 @@ func varPopFunctionFromWire(w *varPopFunctionWire) (*VarPopFunction, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v VarPopFunction) MarshalJSON() ([]byte, error) { + w, err := varPopFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *VarPopFunction) UnmarshalJSON(data []byte) error { + var w varPopFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := varPopFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type varSampFunctionWire struct { Input *string `json:"input,omitempty"` } @@ -6088,6 +9496,30 @@ func varSampFunctionFromWire(w *varSampFunctionWire) (*VarSampFunction, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v VarSampFunction) MarshalJSON() ([]byte, error) { + w, err := varSampFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *VarSampFunction) UnmarshalJSON(data []byte) error { + var w varSampFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := varSampFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/featurestore/CHANGELOG.md b/featurestore/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/featurestore/CHANGELOG.md +++ b/featurestore/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/featurestore/internal/version.go b/featurestore/internal/version.go index a054b49b..cac44bb3 100644 --- a/featurestore/internal/version.go +++ b/featurestore/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-featurestore" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/featurestore/v1/wire.go b/featurestore/v1/wire.go index 9d75d131..d751a4bf 100644 --- a/featurestore/v1/wire.go +++ b/featurestore/v1/wire.go @@ -3,6 +3,7 @@ package featurestore import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -38,6 +39,30 @@ func createOnlineStoreRequestFromWire(w *createOnlineStoreRequestWire) (*CreateO }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateOnlineStoreRequest) MarshalJSON() ([]byte, error) { + w, err := createOnlineStoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateOnlineStoreRequest) UnmarshalJSON(data []byte) error { + var w createOnlineStoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createOnlineStoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteOnlineStoreRequestWire struct { Name *string `json:"name,omitempty"` } @@ -60,6 +85,30 @@ func deleteOnlineStoreRequestFromWire(w *deleteOnlineStoreRequestWire) (*DeleteO }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteOnlineStoreRequest) MarshalJSON() ([]byte, error) { + w, err := deleteOnlineStoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteOnlineStoreRequest) UnmarshalJSON(data []byte) error { + var w deleteOnlineStoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteOnlineStoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteOnlineTableRequestWire struct { OnlineTableName *string `json:"online_table_name,omitempty"` } @@ -82,6 +131,30 @@ func deleteOnlineTableRequestFromWire(w *deleteOnlineTableRequestWire) (*DeleteO }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteOnlineTableRequest) MarshalJSON() ([]byte, error) { + w, err := deleteOnlineTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteOnlineTableRequest) UnmarshalJSON(data []byte) error { + var w deleteOnlineTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteOnlineTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getOnlineStoreRequestWire struct { Name *string `json:"name,omitempty"` } @@ -104,6 +177,30 @@ func getOnlineStoreRequestFromWire(w *getOnlineStoreRequestWire) (*GetOnlineStor }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetOnlineStoreRequest) MarshalJSON() ([]byte, error) { + w, err := getOnlineStoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetOnlineStoreRequest) UnmarshalJSON(data []byte) error { + var w getOnlineStoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getOnlineStoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listOnlineStoresRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -129,6 +226,30 @@ func listOnlineStoresRequestFromWire(w *listOnlineStoresRequestWire) (*ListOnlin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListOnlineStoresRequest) MarshalJSON() ([]byte, error) { + w, err := listOnlineStoresRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListOnlineStoresRequest) UnmarshalJSON(data []byte) error { + var w listOnlineStoresRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listOnlineStoresRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listOnlineStoresResponseWire struct { OnlineStores []onlineStoreWire `json:"online_stores,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -162,6 +283,30 @@ func listOnlineStoresResponseFromWire(w *listOnlineStoresResponseWire) (*ListOnl }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListOnlineStoresResponse) MarshalJSON() ([]byte, error) { + w, err := listOnlineStoresResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListOnlineStoresResponse) UnmarshalJSON(data []byte) error { + var w listOnlineStoresResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listOnlineStoresResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type onlineStoreWire struct { Name *string `json:"name,omitempty"` Creator *string `json:"creator,omitempty"` @@ -202,6 +347,30 @@ func onlineStoreFromWire(w *onlineStoreWire) (*OnlineStore, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OnlineStore) MarshalJSON() ([]byte, error) { + w, err := onlineStoreToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OnlineStore) UnmarshalJSON(data []byte) error { + var w onlineStoreWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := onlineStoreFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type publishSpecWire struct { OnlineStore *string `json:"online_store,omitempty"` OnlineTableName *string `json:"online_table_name,omitempty"` @@ -239,6 +408,30 @@ func publishSpecFromWire(w *publishSpecWire) (*PublishSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PublishSpec) MarshalJSON() ([]byte, error) { + w, err := publishSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PublishSpec) UnmarshalJSON(data []byte) error { + var w publishSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := publishSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type publishTableRequestWire struct { SourceTableName *string `json:"source_table_name,omitempty"` PublishSpec *publishSpecWire `json:"publish_spec,omitempty"` @@ -272,6 +465,30 @@ func publishTableRequestFromWire(w *publishTableRequestWire) (*PublishTableReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PublishTableRequest) MarshalJSON() ([]byte, error) { + w, err := publishTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PublishTableRequest) UnmarshalJSON(data []byte) error { + var w publishTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := publishTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type publishTableResponseWire struct { OnlineTableName *string `json:"online_table_name,omitempty"` PipelineId *string `json:"pipeline_id,omitempty"` @@ -297,6 +514,30 @@ func publishTableResponseFromWire(w *publishTableResponseWire) (*PublishTableRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PublishTableResponse) MarshalJSON() ([]byte, error) { + w, err := publishTableResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PublishTableResponse) UnmarshalJSON(data []byte) error { + var w publishTableResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := publishTableResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateOnlineStoreRequestWire struct { OnlineStore *onlineStoreWire `json:"online_store,omitempty"` UpdateMask *types.FieldMask[OnlineStore] `json:"update_mask,omitempty"` @@ -330,6 +571,30 @@ func updateOnlineStoreRequestFromWire(w *updateOnlineStoreRequestWire) (*UpdateO }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateOnlineStoreRequest) MarshalJSON() ([]byte, error) { + w, err := updateOnlineStoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateOnlineStoreRequest) UnmarshalJSON(data []byte) error { + var w updateOnlineStoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateOnlineStoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/files/CHANGELOG.md b/files/CHANGELOG.md index fa2a06c5..de439769 100644 --- a/files/CHANGELOG.md +++ b/files/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/files/internal/version.go b/files/internal/version.go index aae1a7cf..f4ddfedb 100644 --- a/files/internal/version.go +++ b/files/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-files" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/files/v2/wire.go b/files/v2/wire.go index 262bcec7..6a67dc91 100644 --- a/files/v2/wire.go +++ b/files/v2/wire.go @@ -85,6 +85,30 @@ func addBlockRequestFromWire(w *addBlockRequestWire) (*AddBlockRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AddBlockRequest) MarshalJSON() ([]byte, error) { + w, err := addBlockRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AddBlockRequest) UnmarshalJSON(data []byte) error { + var w addBlockRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := addBlockRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type addBlockResponseWire struct { } @@ -102,6 +126,30 @@ func addBlockResponseFromWire(w *addBlockResponseWire) (*AddBlockResponse, error return &AddBlockResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AddBlockResponse) MarshalJSON() ([]byte, error) { + w, err := addBlockResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AddBlockResponse) UnmarshalJSON(data []byte) error { + var w addBlockResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := addBlockResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type closeRequestWire struct { Handle *wireInt64 `json:"handle,omitempty"` } @@ -132,6 +180,30 @@ func closeRequestFromWire(w *closeRequestWire) (*CloseRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CloseRequest) MarshalJSON() ([]byte, error) { + w, err := closeRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CloseRequest) UnmarshalJSON(data []byte) error { + var w closeRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := closeRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type closeResponseWire struct { } @@ -149,6 +221,30 @@ func closeResponseFromWire(w *closeResponseWire) (*CloseResponse, error) { return &CloseResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CloseResponse) MarshalJSON() ([]byte, error) { + w, err := closeResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CloseResponse) UnmarshalJSON(data []byte) error { + var w closeResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := closeResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createDirectoryRequestWire struct { DirectoryPath *string `json:"directory_path,omitempty"` } @@ -171,6 +267,30 @@ func createDirectoryRequestFromWire(w *createDirectoryRequestWire) (*CreateDirec }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateDirectoryRequest) MarshalJSON() ([]byte, error) { + w, err := createDirectoryRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateDirectoryRequest) UnmarshalJSON(data []byte) error { + var w createDirectoryRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createDirectoryRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createDirectoryResponseWire struct { } @@ -188,6 +308,30 @@ func createDirectoryResponseFromWire(w *createDirectoryResponseWire) (*CreateDir return &CreateDirectoryResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateDirectoryResponse) MarshalJSON() ([]byte, error) { + w, err := createDirectoryResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateDirectoryResponse) UnmarshalJSON(data []byte) error { + var w createDirectoryResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createDirectoryResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createRequestWire struct { Path *string `json:"path,omitempty"` Overwrite *bool `json:"overwrite,omitempty"` @@ -213,6 +357,30 @@ func createRequestFromWire(w *createRequestWire) (*CreateRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateRequest) MarshalJSON() ([]byte, error) { + w, err := createRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateRequest) UnmarshalJSON(data []byte) error { + var w createRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createResponseWire struct { Handle *wireInt64 `json:"handle,omitempty"` } @@ -243,6 +411,30 @@ func createResponseFromWire(w *createResponseWire) (*CreateResponse, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateResponse) MarshalJSON() ([]byte, error) { + w, err := createResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateResponse) UnmarshalJSON(data []byte) error { + var w createResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteDirectoryRequestWire struct { DirectoryPath *string `json:"directory_path,omitempty"` } @@ -265,6 +457,30 @@ func deleteDirectoryRequestFromWire(w *deleteDirectoryRequestWire) (*DeleteDirec }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteDirectoryRequest) MarshalJSON() ([]byte, error) { + w, err := deleteDirectoryRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteDirectoryRequest) UnmarshalJSON(data []byte) error { + var w deleteDirectoryRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteDirectoryRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteDirectoryResponseWire struct { } @@ -282,6 +498,30 @@ func deleteDirectoryResponseFromWire(w *deleteDirectoryResponseWire) (*DeleteDir return &DeleteDirectoryResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteDirectoryResponse) MarshalJSON() ([]byte, error) { + w, err := deleteDirectoryResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteDirectoryResponse) UnmarshalJSON(data []byte) error { + var w deleteDirectoryResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteDirectoryResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteFileRequestWire struct { FilePath *string `json:"file_path,omitempty"` } @@ -304,6 +544,30 @@ func deleteFileRequestFromWire(w *deleteFileRequestWire) (*DeleteFileRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteFileRequest) MarshalJSON() ([]byte, error) { + w, err := deleteFileRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteFileRequest) UnmarshalJSON(data []byte) error { + var w deleteFileRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteFileRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteFileResponseWire struct { } @@ -321,6 +585,30 @@ func deleteFileResponseFromWire(w *deleteFileResponseWire) (*DeleteFileResponse, return &DeleteFileResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteFileResponse) MarshalJSON() ([]byte, error) { + w, err := deleteFileResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteFileResponse) UnmarshalJSON(data []byte) error { + var w deleteFileResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteFileResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRequestWire struct { Path *string `json:"path,omitempty"` Recursive *bool `json:"recursive,omitempty"` @@ -346,6 +634,30 @@ func deleteRequestFromWire(w *deleteRequestWire) (*DeleteRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRequest) MarshalJSON() ([]byte, error) { + w, err := deleteRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRequest) UnmarshalJSON(data []byte) error { + var w deleteRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteResponseWire struct { } @@ -363,6 +675,30 @@ func deleteResponseFromWire(w *deleteResponseWire) (*DeleteResponse, error) { return &DeleteResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteResponse) MarshalJSON() ([]byte, error) { + w, err := deleteResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteResponse) UnmarshalJSON(data []byte) error { + var w deleteResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type directoryEntryWire struct { FileSize *int `json:"file_size,omitempty"` IsDirectory *bool `json:"is_directory,omitempty"` @@ -397,6 +733,30 @@ func directoryEntryFromWire(w *directoryEntryWire) (*DirectoryEntry, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DirectoryEntry) MarshalJSON() ([]byte, error) { + w, err := directoryEntryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DirectoryEntry) UnmarshalJSON(data []byte) error { + var w directoryEntryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := directoryEntryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type downloadFileRequestWire struct { FilePath *string `json:"file_path,omitempty"` } @@ -483,6 +843,30 @@ func fileInfoFromWire(w *fileInfoWire) (*FileInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FileInfo) MarshalJSON() ([]byte, error) { + w, err := fileInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FileInfo) UnmarshalJSON(data []byte) error { + var w fileInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := fileInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getDirectoryMetadataRequestWire struct { DirectoryPath *string `json:"directory_path,omitempty"` } @@ -505,6 +889,30 @@ func getDirectoryMetadataRequestFromWire(w *getDirectoryMetadataRequestWire) (*G }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetDirectoryMetadataRequest) MarshalJSON() ([]byte, error) { + w, err := getDirectoryMetadataRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetDirectoryMetadataRequest) UnmarshalJSON(data []byte) error { + var w getDirectoryMetadataRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getDirectoryMetadataRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getDirectoryMetadataResponseWire struct { } @@ -522,6 +930,30 @@ func getDirectoryMetadataResponseFromWire(w *getDirectoryMetadataResponseWire) ( return &GetDirectoryMetadataResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetDirectoryMetadataResponse) MarshalJSON() ([]byte, error) { + w, err := getDirectoryMetadataResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetDirectoryMetadataResponse) UnmarshalJSON(data []byte) error { + var w getDirectoryMetadataResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getDirectoryMetadataResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getFileMetadataRequestWire struct { FilePath *string `json:"file_path,omitempty"` } @@ -583,6 +1015,30 @@ func getStatusRequestFromWire(w *getStatusRequestWire) (*GetStatusRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetStatusRequest) MarshalJSON() ([]byte, error) { + w, err := getStatusRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetStatusRequest) UnmarshalJSON(data []byte) error { + var w getStatusRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getStatusRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getStatusResponseWire struct { Path *string `json:"path,omitempty"` IsDir *bool `json:"is_dir,omitempty"` @@ -630,6 +1086,30 @@ func getStatusResponseFromWire(w *getStatusResponseWire) (*GetStatusResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetStatusResponse) MarshalJSON() ([]byte, error) { + w, err := getStatusResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetStatusResponse) UnmarshalJSON(data []byte) error { + var w getStatusResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getStatusResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDirectoryContentsRequestWire struct { DirectoryPath *string `json:"directory_path,omitempty"` PageSize *wireInt64 `json:"page_size,omitempty"` @@ -666,6 +1146,30 @@ func listDirectoryContentsRequestFromWire(w *listDirectoryContentsRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDirectoryContentsRequest) MarshalJSON() ([]byte, error) { + w, err := listDirectoryContentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDirectoryContentsRequest) UnmarshalJSON(data []byte) error { + var w listDirectoryContentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDirectoryContentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDirectoryResponseWire struct { Contents []directoryEntryWire `json:"contents,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -699,6 +1203,30 @@ func listDirectoryResponseFromWire(w *listDirectoryResponseWire) (*ListDirectory }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDirectoryResponse) MarshalJSON() ([]byte, error) { + w, err := listDirectoryResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDirectoryResponse) UnmarshalJSON(data []byte) error { + var w listDirectoryResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDirectoryResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listStatusRequestWire struct { Path *string `json:"path,omitempty"` } @@ -721,6 +1249,30 @@ func listStatusRequestFromWire(w *listStatusRequestWire) (*ListStatusRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListStatusRequest) MarshalJSON() ([]byte, error) { + w, err := listStatusRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListStatusRequest) UnmarshalJSON(data []byte) error { + var w listStatusRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listStatusRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listStatusResponseWire struct { Files []fileInfoWire `json:"files,omitempty"` } @@ -751,6 +1303,30 @@ func listStatusResponseFromWire(w *listStatusResponseWire) (*ListStatusResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListStatusResponse) MarshalJSON() ([]byte, error) { + w, err := listStatusResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListStatusResponse) UnmarshalJSON(data []byte) error { + var w listStatusResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listStatusResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type mkDirsRequestWire struct { Path *string `json:"path,omitempty"` } @@ -773,6 +1349,30 @@ func mkDirsRequestFromWire(w *mkDirsRequestWire) (*MkDirsRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MkDirsRequest) MarshalJSON() ([]byte, error) { + w, err := mkDirsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MkDirsRequest) UnmarshalJSON(data []byte) error { + var w mkDirsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := mkDirsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type mkDirsResponseWire struct { } @@ -790,6 +1390,30 @@ func mkDirsResponseFromWire(w *mkDirsResponseWire) (*MkDirsResponse, error) { return &MkDirsResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MkDirsResponse) MarshalJSON() ([]byte, error) { + w, err := mkDirsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MkDirsResponse) UnmarshalJSON(data []byte) error { + var w mkDirsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := mkDirsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type moveRequestWire struct { SourcePath *string `json:"source_path,omitempty"` DestinationPath *string `json:"destination_path,omitempty"` @@ -815,6 +1439,30 @@ func moveRequestFromWire(w *moveRequestWire) (*MoveRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MoveRequest) MarshalJSON() ([]byte, error) { + w, err := moveRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MoveRequest) UnmarshalJSON(data []byte) error { + var w moveRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := moveRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type moveResponseWire struct { } @@ -832,6 +1480,30 @@ func moveResponseFromWire(w *moveResponseWire) (*MoveResponse, error) { return &MoveResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MoveResponse) MarshalJSON() ([]byte, error) { + w, err := moveResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MoveResponse) UnmarshalJSON(data []byte) error { + var w moveResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := moveResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type putRequestWire struct { Path *string `json:"path,omitempty"` Contents []byte `json:"contents,omitempty"` @@ -860,6 +1532,30 @@ func putRequestFromWire(w *putRequestWire) (*PutRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PutRequest) MarshalJSON() ([]byte, error) { + w, err := putRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PutRequest) UnmarshalJSON(data []byte) error { + var w putRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := putRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type putResponseWire struct { } @@ -877,6 +1573,30 @@ func putResponseFromWire(w *putResponseWire) (*PutResponse, error) { return &PutResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PutResponse) MarshalJSON() ([]byte, error) { + w, err := putResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PutResponse) UnmarshalJSON(data []byte) error { + var w putResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := putResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type readRequestWire struct { Path *string `json:"path,omitempty"` Offset *wireInt64 `json:"offset,omitempty"` @@ -921,6 +1641,30 @@ func readRequestFromWire(w *readRequestWire) (*ReadRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ReadRequest) MarshalJSON() ([]byte, error) { + w, err := readRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ReadRequest) UnmarshalJSON(data []byte) error { + var w readRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := readRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type readResponseWire struct { BytesRead *wireInt64 `json:"bytes_read,omitempty"` Data []byte `json:"data,omitempty"` @@ -954,6 +1698,30 @@ func readResponseFromWire(w *readResponseWire) (*ReadResponse, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ReadResponse) MarshalJSON() ([]byte, error) { + w, err := readResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ReadResponse) UnmarshalJSON(data []byte) error { + var w readResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := readResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type uploadFileRequestWire struct { FilePath *string `json:"file_path,omitempty"` Overwrite *bool `json:"overwrite,omitempty"` @@ -996,6 +1764,30 @@ func uploadFileResponseFromWire(w *uploadFileResponseWire) (*UploadFileResponse, return &UploadFileResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UploadFileResponse) MarshalJSON() ([]byte, error) { + w, err := uploadFileResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UploadFileResponse) UnmarshalJSON(data []byte) error { + var w uploadFileResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := uploadFileResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/forecasting/CHANGELOG.md b/forecasting/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/forecasting/CHANGELOG.md +++ b/forecasting/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/forecasting/internal/version.go b/forecasting/internal/version.go index f8980ef8..ca3a8af9 100644 --- a/forecasting/internal/version.go +++ b/forecasting/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-forecasting" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/forecasting/v1/wire.go b/forecasting/v1/wire.go index 936cbfdb..70c97dc6 100644 --- a/forecasting/v1/wire.go +++ b/forecasting/v1/wire.go @@ -138,6 +138,30 @@ func createForecastingExperimentRequestFromWire(w *createForecastingExperimentRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateForecastingExperimentRequest) MarshalJSON() ([]byte, error) { + w, err := createForecastingExperimentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateForecastingExperimentRequest) UnmarshalJSON(data []byte) error { + var w createForecastingExperimentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createForecastingExperimentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createForecastingExperimentResponseWire struct { ExperimentId *string `json:"experiment_id,omitempty"` } @@ -160,6 +184,30 @@ func createForecastingExperimentResponseFromWire(w *createForecastingExperimentR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateForecastingExperimentResponse) MarshalJSON() ([]byte, error) { + w, err := createForecastingExperimentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateForecastingExperimentResponse) UnmarshalJSON(data []byte) error { + var w createForecastingExperimentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createForecastingExperimentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type forecastingExperimentWire struct { ExperimentId *string `json:"experiment_id,omitempty"` ExperimentPageUrl *string `json:"experiment_page_url,omitempty"` @@ -188,6 +236,30 @@ func forecastingExperimentFromWire(w *forecastingExperimentWire) (*ForecastingEx }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ForecastingExperiment) MarshalJSON() ([]byte, error) { + w, err := forecastingExperimentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ForecastingExperiment) UnmarshalJSON(data []byte) error { + var w forecastingExperimentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := forecastingExperimentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getForecastingExperimentRequestWire struct { ExperimentId *string `json:"experiment_id,omitempty"` } @@ -209,3 +281,27 @@ func getForecastingExperimentRequestFromWire(w *getForecastingExperimentRequestW ExperimentId: w.ExperimentId, }, nil } + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetForecastingExperimentRequest) MarshalJSON() ([]byte, error) { + w, err := getForecastingExperimentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetForecastingExperimentRequest) UnmarshalJSON(data []byte) error { + var w getForecastingExperimentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getForecastingExperimentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} diff --git a/genie/CHANGELOG.md b/genie/CHANGELOG.md index 2b8c52e7..af957eba 100644 --- a/genie/CHANGELOG.md +++ b/genie/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.8.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.7.0 (2026-11-11) ## Release v0.6.0 (2026-11-10) diff --git a/genie/internal/version.go b/genie/internal/version.go index 18ec12ca..393a07a3 100644 --- a/genie/internal/version.go +++ b/genie/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-genie" -const Version = "0.7.0" +const Version = "0.8.0" diff --git a/genie/v1/wire.go b/genie/v1/wire.go index 807703f1..e6a1cae4 100644 --- a/genie/v1/wire.go +++ b/genie/v1/wire.go @@ -115,6 +115,30 @@ func chunkInfoFromWire(w *chunkInfoWire) (*ChunkInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ChunkInfo) MarshalJSON() ([]byte, error) { + w, err := chunkInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ChunkInfo) UnmarshalJSON(data []byte) error { + var w chunkInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := chunkInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type columnInfoWire struct { Name *string `json:"name,omitempty"` TypeText *string `json:"type_text,omitempty"` @@ -178,6 +202,30 @@ func columnInfoFromWire(w *columnInfoWire) (*ColumnInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ColumnInfo) MarshalJSON() ([]byte, error) { + w, err := columnInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ColumnInfo) UnmarshalJSON(data []byte) error { + var w columnInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := columnInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type columnMaskWire struct { FunctionName *string `json:"function_name,omitempty"` UsingColumnNames []string `json:"using_column_names,omitempty"` @@ -214,6 +262,30 @@ func columnMaskFromWire(w *columnMaskWire) (*ColumnMask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ColumnMask) MarshalJSON() ([]byte, error) { + w, err := columnMaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ColumnMask) UnmarshalJSON(data []byte) error { + var w columnMaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := columnMaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databricksServiceExceptionProtoWire struct { ErrorCode ErrorCode `json:"error_code,omitempty"` Message *string `json:"message,omitempty"` @@ -242,6 +314,30 @@ func databricksServiceExceptionProtoFromWire(w *databricksServiceExceptionProtoW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatabricksServiceExceptionProto) MarshalJSON() ([]byte, error) { + w, err := databricksServiceExceptionProtoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatabricksServiceExceptionProto) UnmarshalJSON(data []byte) error { + var w databricksServiceExceptionProtoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databricksServiceExceptionProtoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type downloadMessageAttachmentVisualizationRequestWire struct { Name *string `json:"name,omitempty"` } @@ -264,6 +360,30 @@ func downloadMessageAttachmentVisualizationRequestFromWire(w *downloadMessageAtt }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DownloadMessageAttachmentVisualizationRequest) MarshalJSON() ([]byte, error) { + w, err := downloadMessageAttachmentVisualizationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DownloadMessageAttachmentVisualizationRequest) UnmarshalJSON(data []byte) error { + var w downloadMessageAttachmentVisualizationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := downloadMessageAttachmentVisualizationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type downloadMessageAttachmentVisualizationResponseWire struct { } @@ -351,6 +471,30 @@ func externalLinkFromWire(w *externalLinkWire) (*ExternalLink, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalLink) MarshalJSON() ([]byte, error) { + w, err := externalLinkToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalLink) UnmarshalJSON(data []byte) error { + var w externalLinkWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalLinkFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAttachmentWire struct { Text *textAttachmentWire `json:"text,omitempty"` Query *genieQueryAttachmentWire `json:"query,omitempty"` @@ -466,6 +610,30 @@ func genieAttachmentFromWire(w *genieAttachmentWire) (*GenieAttachment, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAttachment) MarshalJSON() ([]byte, error) { + w, err := genieAttachmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAttachment) UnmarshalJSON(data []byte) error { + var w genieAttachmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAttachmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieCancelResponseRequestWire struct { AgentId *string `json:"agent_id,omitempty"` ConversationId *string `json:"conversation_id,omitempty"` @@ -494,6 +662,30 @@ func genieCancelResponseRequestFromWire(w *genieCancelResponseRequestWire) (*Gen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieCancelResponseRequest) MarshalJSON() ([]byte, error) { + w, err := genieCancelResponseRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieCancelResponseRequest) UnmarshalJSON(data []byte) error { + var w genieCancelResponseRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieCancelResponseRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieConversationWire struct { Id *string `json:"id,omitempty"` SpaceId *string `json:"space_id,omitempty"` @@ -558,6 +750,30 @@ func genieConversationFromWire(w *genieConversationWire) (*GenieConversation, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieConversation) MarshalJSON() ([]byte, error) { + w, err := genieConversationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieConversation) UnmarshalJSON(data []byte) error { + var w genieConversationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieConversationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieConversationSummaryWire struct { ConversationId *string `json:"conversation_id,omitempty"` Title *string `json:"title,omitempty"` @@ -597,6 +813,30 @@ func genieConversationSummaryFromWire(w *genieConversationSummaryWire) (*GenieCo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieConversationSummary) MarshalJSON() ([]byte, error) { + w, err := genieConversationSummaryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieConversationSummary) UnmarshalJSON(data []byte) error { + var w genieConversationSummaryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieConversationSummaryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieCreateConversationMessageRequestWire struct { SpaceId *string `json:"space_id,omitempty"` ConversationId *string `json:"conversation_id,omitempty"` @@ -628,6 +868,30 @@ func genieCreateConversationMessageRequestFromWire(w *genieCreateConversationMes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieCreateConversationMessageRequest) MarshalJSON() ([]byte, error) { + w, err := genieCreateConversationMessageRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieCreateConversationMessageRequest) UnmarshalJSON(data []byte) error { + var w genieCreateConversationMessageRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieCreateConversationMessageRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieCreateEvalRunRequestWire struct { SpaceId *string `json:"space_id,omitempty"` BenchmarkQuestionIds []string `json:"benchmark_question_ids,omitempty"` @@ -653,6 +917,30 @@ func genieCreateEvalRunRequestFromWire(w *genieCreateEvalRunRequestWire) (*Genie }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieCreateEvalRunRequest) MarshalJSON() ([]byte, error) { + w, err := genieCreateEvalRunRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieCreateEvalRunRequest) UnmarshalJSON(data []byte) error { + var w genieCreateEvalRunRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieCreateEvalRunRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieCreateMessageCommentRequestWire struct { SpaceId *string `json:"space_id,omitempty"` ConversationId *string `json:"conversation_id,omitempty"` @@ -684,6 +972,30 @@ func genieCreateMessageCommentRequestFromWire(w *genieCreateMessageCommentReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieCreateMessageCommentRequest) MarshalJSON() ([]byte, error) { + w, err := genieCreateMessageCommentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieCreateMessageCommentRequest) UnmarshalJSON(data []byte) error { + var w genieCreateMessageCommentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieCreateMessageCommentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieCreateSpaceRequestWire struct { WarehouseId *string `json:"warehouse_id,omitempty"` ParentPath *string `json:"parent_path,omitempty"` @@ -718,6 +1030,30 @@ func genieCreateSpaceRequestFromWire(w *genieCreateSpaceRequestWire) (*GenieCrea }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieCreateSpaceRequest) MarshalJSON() ([]byte, error) { + w, err := genieCreateSpaceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieCreateSpaceRequest) UnmarshalJSON(data []byte) error { + var w genieCreateSpaceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieCreateSpaceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieDeleteConversationMessageRequestWire struct { SpaceId *string `json:"space_id,omitempty"` ConversationId *string `json:"conversation_id,omitempty"` @@ -746,6 +1082,30 @@ func genieDeleteConversationMessageRequestFromWire(w *genieDeleteConversationMes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieDeleteConversationMessageRequest) MarshalJSON() ([]byte, error) { + w, err := genieDeleteConversationMessageRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieDeleteConversationMessageRequest) UnmarshalJSON(data []byte) error { + var w genieDeleteConversationMessageRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieDeleteConversationMessageRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieDeleteConversationRequestWire struct { SpaceId *string `json:"space_id,omitempty"` ConversationId *string `json:"conversation_id,omitempty"` @@ -771,6 +1131,30 @@ func genieDeleteConversationRequestFromWire(w *genieDeleteConversationRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieDeleteConversationRequest) MarshalJSON() ([]byte, error) { + w, err := genieDeleteConversationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieDeleteConversationRequest) UnmarshalJSON(data []byte) error { + var w genieDeleteConversationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieDeleteConversationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieEvalResponseWire struct { Response *string `json:"response,omitempty"` SqlExecutionResult *statementResponseWire `json:"sql_execution_result,omitempty"` @@ -807,6 +1191,30 @@ func genieEvalResponseFromWire(w *genieEvalResponseWire) (*GenieEvalResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieEvalResponse) MarshalJSON() ([]byte, error) { + w, err := genieEvalResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieEvalResponse) UnmarshalJSON(data []byte) error { + var w genieEvalResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieEvalResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieEvalResultWire struct { ResultId *string `json:"result_id,omitempty"` SpaceId *string `json:"space_id,omitempty"` @@ -855,6 +1263,30 @@ func genieEvalResultFromWire(w *genieEvalResultWire) (*GenieEvalResult, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieEvalResult) MarshalJSON() ([]byte, error) { + w, err := genieEvalResultToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieEvalResult) UnmarshalJSON(data []byte) error { + var w genieEvalResultWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieEvalResultFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieEvalResultDetailsWire struct { ResultId *string `json:"result_id,omitempty"` SpaceId *string `json:"space_id,omitempty"` @@ -917,6 +1349,30 @@ func genieEvalResultDetailsFromWire(w *genieEvalResultDetailsWire) (*GenieEvalRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieEvalResultDetails) MarshalJSON() ([]byte, error) { + w, err := genieEvalResultDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieEvalResultDetails) UnmarshalJSON(data []byte) error { + var w genieEvalResultDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieEvalResultDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieEvalRunResponseWire struct { EvalRunId *string `json:"eval_run_id,omitempty"` EvalRunStatus EvaluationStatusType `json:"eval_run_status,omitempty"` @@ -1019,6 +1475,30 @@ func genieEvalRunResponseFromWire(w *genieEvalRunResponseWire) (*GenieEvalRunRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieEvalRunResponse) MarshalJSON() ([]byte, error) { + w, err := genieEvalRunResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieEvalRunResponse) UnmarshalJSON(data []byte) error { + var w genieEvalRunResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieEvalRunResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieExecuteMessageAttachmentQueryRequestWire struct { MessageId *string `json:"message_id,omitempty"` SpaceId *string `json:"space_id,omitempty"` @@ -1050,6 +1530,30 @@ func genieExecuteMessageAttachmentQueryRequestFromWire(w *genieExecuteMessageAtt }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieExecuteMessageAttachmentQueryRequest) MarshalJSON() ([]byte, error) { + w, err := genieExecuteMessageAttachmentQueryRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieExecuteMessageAttachmentQueryRequest) UnmarshalJSON(data []byte) error { + var w genieExecuteMessageAttachmentQueryRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieExecuteMessageAttachmentQueryRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieExecuteMessageQueryRequestWire struct { MessageId *string `json:"message_id,omitempty"` SpaceId *string `json:"space_id,omitempty"` @@ -1078,10 +1582,34 @@ func genieExecuteMessageQueryRequestFromWire(w *genieExecuteMessageQueryRequestW }, nil } -type genieFeedbackWire struct { - Rating GenieFeedbackRating `json:"rating,omitempty"` - Comment *string `json:"comment,omitempty"` -} +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieExecuteMessageQueryRequest) MarshalJSON() ([]byte, error) { + w, err := genieExecuteMessageQueryRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieExecuteMessageQueryRequest) UnmarshalJSON(data []byte) error { + var w genieExecuteMessageQueryRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieExecuteMessageQueryRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type genieFeedbackWire struct { + Rating GenieFeedbackRating `json:"rating,omitempty"` + Comment *string `json:"comment,omitempty"` +} func genieFeedbackToWire(v *GenieFeedback) (*genieFeedbackWire, error) { if v == nil { @@ -1103,6 +1631,30 @@ func genieFeedbackFromWire(w *genieFeedbackWire) (*GenieFeedback, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieFeedback) MarshalJSON() ([]byte, error) { + w, err := genieFeedbackToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieFeedback) UnmarshalJSON(data []byte) error { + var w genieFeedbackWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieFeedbackFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieGenerateDownloadFullQueryResultRequestWire struct { SpaceId *string `json:"space_id,omitempty"` ConversationId *string `json:"conversation_id,omitempty"` @@ -1134,6 +1686,30 @@ func genieGenerateDownloadFullQueryResultRequestFromWire(w *genieGenerateDownloa }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieGenerateDownloadFullQueryResultRequest) MarshalJSON() ([]byte, error) { + w, err := genieGenerateDownloadFullQueryResultRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieGenerateDownloadFullQueryResultRequest) UnmarshalJSON(data []byte) error { + var w genieGenerateDownloadFullQueryResultRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieGenerateDownloadFullQueryResultRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieGenerateDownloadFullQueryResultResponseWire struct { DownloadId *string `json:"download_id,omitempty"` DownloadIdSignature *string `json:"download_id_signature,omitempty"` @@ -1159,6 +1735,30 @@ func genieGenerateDownloadFullQueryResultResponseFromWire(w *genieGenerateDownlo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieGenerateDownloadFullQueryResultResponse) MarshalJSON() ([]byte, error) { + w, err := genieGenerateDownloadFullQueryResultResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieGenerateDownloadFullQueryResultResponse) UnmarshalJSON(data []byte) error { + var w genieGenerateDownloadFullQueryResultResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieGenerateDownloadFullQueryResultResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieGetConversationMessageRequestWire struct { SpaceId *string `json:"space_id,omitempty"` ConversationId *string `json:"conversation_id,omitempty"` @@ -1187,6 +1787,30 @@ func genieGetConversationMessageRequestFromWire(w *genieGetConversationMessageRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieGetConversationMessageRequest) MarshalJSON() ([]byte, error) { + w, err := genieGetConversationMessageRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieGetConversationMessageRequest) UnmarshalJSON(data []byte) error { + var w genieGetConversationMessageRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieGetConversationMessageRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieGetDownloadFullQueryResultRequestWire struct { SpaceId *string `json:"space_id,omitempty"` ConversationId *string `json:"conversation_id,omitempty"` @@ -1224,6 +1848,30 @@ func genieGetDownloadFullQueryResultRequestFromWire(w *genieGetDownloadFullQuery }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieGetDownloadFullQueryResultRequest) MarshalJSON() ([]byte, error) { + w, err := genieGetDownloadFullQueryResultRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieGetDownloadFullQueryResultRequest) UnmarshalJSON(data []byte) error { + var w genieGetDownloadFullQueryResultRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieGetDownloadFullQueryResultRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieGetDownloadFullQueryResultResponseWire struct { StatementResponse *statementResponseWire `json:"statement_response,omitempty"` } @@ -1254,6 +1902,30 @@ func genieGetDownloadFullQueryResultResponseFromWire(w *genieGetDownloadFullQuer }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieGetDownloadFullQueryResultResponse) MarshalJSON() ([]byte, error) { + w, err := genieGetDownloadFullQueryResultResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieGetDownloadFullQueryResultResponse) UnmarshalJSON(data []byte) error { + var w genieGetDownloadFullQueryResultResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieGetDownloadFullQueryResultResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieGetEvalResultDetailsRequestWire struct { SpaceId *string `json:"space_id,omitempty"` EvalRunId *string `json:"eval_run_id,omitempty"` @@ -1282,6 +1954,30 @@ func genieGetEvalResultDetailsRequestFromWire(w *genieGetEvalResultDetailsReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieGetEvalResultDetailsRequest) MarshalJSON() ([]byte, error) { + w, err := genieGetEvalResultDetailsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieGetEvalResultDetailsRequest) UnmarshalJSON(data []byte) error { + var w genieGetEvalResultDetailsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieGetEvalResultDetailsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieGetEvalRunRequestWire struct { SpaceId *string `json:"space_id,omitempty"` EvalRunId *string `json:"eval_run_id,omitempty"` @@ -1307,6 +2003,30 @@ func genieGetEvalRunRequestFromWire(w *genieGetEvalRunRequestWire) (*GenieGetEva }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieGetEvalRunRequest) MarshalJSON() ([]byte, error) { + w, err := genieGetEvalRunRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieGetEvalRunRequest) UnmarshalJSON(data []byte) error { + var w genieGetEvalRunRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieGetEvalRunRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieGetMessageAttachmentQueryResultRequestWire struct { MessageId *string `json:"message_id,omitempty"` SpaceId *string `json:"space_id,omitempty"` @@ -1338,6 +2058,30 @@ func genieGetMessageAttachmentQueryResultRequestFromWire(w *genieGetMessageAttac }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieGetMessageAttachmentQueryResultRequest) MarshalJSON() ([]byte, error) { + w, err := genieGetMessageAttachmentQueryResultRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieGetMessageAttachmentQueryResultRequest) UnmarshalJSON(data []byte) error { + var w genieGetMessageAttachmentQueryResultRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieGetMessageAttachmentQueryResultRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieGetMessageQueryResultRequestWire struct { MessageId *string `json:"message_id,omitempty"` SpaceId *string `json:"space_id,omitempty"` @@ -1366,6 +2110,30 @@ func genieGetMessageQueryResultRequestFromWire(w *genieGetMessageQueryResultRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieGetMessageQueryResultRequest) MarshalJSON() ([]byte, error) { + w, err := genieGetMessageQueryResultRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieGetMessageQueryResultRequest) UnmarshalJSON(data []byte) error { + var w genieGetMessageQueryResultRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieGetMessageQueryResultRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieGetMessageQueryResultResponseWire struct { StatementResponse *statementResponseWire `json:"statement_response,omitempty"` } @@ -1396,6 +2164,30 @@ func genieGetMessageQueryResultResponseFromWire(w *genieGetMessageQueryResultRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieGetMessageQueryResultResponse) MarshalJSON() ([]byte, error) { + w, err := genieGetMessageQueryResultResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieGetMessageQueryResultResponse) UnmarshalJSON(data []byte) error { + var w genieGetMessageQueryResultResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieGetMessageQueryResultResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieGetQueryResultByAttachmentRequestWire struct { MessageId *string `json:"message_id,omitempty"` SpaceId *string `json:"space_id,omitempty"` @@ -1427,6 +2219,30 @@ func genieGetQueryResultByAttachmentRequestFromWire(w *genieGetQueryResultByAtta }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieGetQueryResultByAttachmentRequest) MarshalJSON() ([]byte, error) { + w, err := genieGetQueryResultByAttachmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieGetQueryResultByAttachmentRequest) UnmarshalJSON(data []byte) error { + var w genieGetQueryResultByAttachmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieGetQueryResultByAttachmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieGetSpaceRequestWire struct { SpaceId *string `json:"space_id,omitempty"` IncludeSerializedSpace *bool `json:"include_serialized_space,omitempty"` @@ -1452,6 +2268,30 @@ func genieGetSpaceRequestFromWire(w *genieGetSpaceRequestWire) (*GenieGetSpaceRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieGetSpaceRequest) MarshalJSON() ([]byte, error) { + w, err := genieGetSpaceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieGetSpaceRequest) UnmarshalJSON(data []byte) error { + var w genieGetSpaceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieGetSpaceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieListConversationCommentsRequestWire struct { SpaceId *string `json:"space_id,omitempty"` ConversationId *string `json:"conversation_id,omitempty"` @@ -1483,6 +2323,30 @@ func genieListConversationCommentsRequestFromWire(w *genieListConversationCommen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieListConversationCommentsRequest) MarshalJSON() ([]byte, error) { + w, err := genieListConversationCommentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieListConversationCommentsRequest) UnmarshalJSON(data []byte) error { + var w genieListConversationCommentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieListConversationCommentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieListConversationCommentsResponseWire struct { Comments []genieMessageCommentWire `json:"comments,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1516,6 +2380,30 @@ func genieListConversationCommentsResponseFromWire(w *genieListConversationComme }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieListConversationCommentsResponse) MarshalJSON() ([]byte, error) { + w, err := genieListConversationCommentsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieListConversationCommentsResponse) UnmarshalJSON(data []byte) error { + var w genieListConversationCommentsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieListConversationCommentsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieListConversationMessagesRequestWire struct { SpaceId *string `json:"space_id,omitempty"` ConversationId *string `json:"conversation_id,omitempty"` @@ -1547,6 +2435,30 @@ func genieListConversationMessagesRequestFromWire(w *genieListConversationMessag }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieListConversationMessagesRequest) MarshalJSON() ([]byte, error) { + w, err := genieListConversationMessagesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieListConversationMessagesRequest) UnmarshalJSON(data []byte) error { + var w genieListConversationMessagesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieListConversationMessagesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieListConversationMessagesResponseWire struct { Messages []genieMessageWire `json:"messages,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1580,6 +2492,30 @@ func genieListConversationMessagesResponseFromWire(w *genieListConversationMessa }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieListConversationMessagesResponse) MarshalJSON() ([]byte, error) { + w, err := genieListConversationMessagesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieListConversationMessagesResponse) UnmarshalJSON(data []byte) error { + var w genieListConversationMessagesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieListConversationMessagesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieListConversationsRequestWire struct { SpaceId *string `json:"space_id,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -1611,6 +2547,30 @@ func genieListConversationsRequestFromWire(w *genieListConversationsRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieListConversationsRequest) MarshalJSON() ([]byte, error) { + w, err := genieListConversationsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieListConversationsRequest) UnmarshalJSON(data []byte) error { + var w genieListConversationsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieListConversationsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieListConversationsResponseWire struct { Conversations []genieConversationSummaryWire `json:"conversations,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1644,6 +2604,30 @@ func genieListConversationsResponseFromWire(w *genieListConversationsResponseWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieListConversationsResponse) MarshalJSON() ([]byte, error) { + w, err := genieListConversationsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieListConversationsResponse) UnmarshalJSON(data []byte) error { + var w genieListConversationsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieListConversationsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieListEvalResultsRequestWire struct { SpaceId *string `json:"space_id,omitempty"` EvalRunId *string `json:"eval_run_id,omitempty"` @@ -1675,6 +2659,30 @@ func genieListEvalResultsRequestFromWire(w *genieListEvalResultsRequestWire) (*G }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieListEvalResultsRequest) MarshalJSON() ([]byte, error) { + w, err := genieListEvalResultsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieListEvalResultsRequest) UnmarshalJSON(data []byte) error { + var w genieListEvalResultsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieListEvalResultsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieListEvalResultsResponseWire struct { EvalResults []genieEvalResultWire `json:"eval_results,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1708,6 +2716,30 @@ func genieListEvalResultsResponseFromWire(w *genieListEvalResultsResponseWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieListEvalResultsResponse) MarshalJSON() ([]byte, error) { + w, err := genieListEvalResultsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieListEvalResultsResponse) UnmarshalJSON(data []byte) error { + var w genieListEvalResultsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieListEvalResultsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieListEvalRunsRequestWire struct { SpaceId *string `json:"space_id,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -1736,6 +2768,30 @@ func genieListEvalRunsRequestFromWire(w *genieListEvalRunsRequestWire) (*GenieLi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieListEvalRunsRequest) MarshalJSON() ([]byte, error) { + w, err := genieListEvalRunsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieListEvalRunsRequest) UnmarshalJSON(data []byte) error { + var w genieListEvalRunsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieListEvalRunsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieListEvalRunsResponseWire struct { EvalRuns []genieEvalRunResponseWire `json:"eval_runs,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1769,6 +2825,30 @@ func genieListEvalRunsResponseFromWire(w *genieListEvalRunsResponseWire) (*Genie }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieListEvalRunsResponse) MarshalJSON() ([]byte, error) { + w, err := genieListEvalRunsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieListEvalRunsResponse) UnmarshalJSON(data []byte) error { + var w genieListEvalRunsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieListEvalRunsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieListMessageCommentsRequestWire struct { SpaceId *string `json:"space_id,omitempty"` ConversationId *string `json:"conversation_id,omitempty"` @@ -1803,6 +2883,30 @@ func genieListMessageCommentsRequestFromWire(w *genieListMessageCommentsRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieListMessageCommentsRequest) MarshalJSON() ([]byte, error) { + w, err := genieListMessageCommentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieListMessageCommentsRequest) UnmarshalJSON(data []byte) error { + var w genieListMessageCommentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieListMessageCommentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieListMessageCommentsResponseWire struct { Comments []genieMessageCommentWire `json:"comments,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1836,6 +2940,30 @@ func genieListMessageCommentsResponseFromWire(w *genieListMessageCommentsRespons }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieListMessageCommentsResponse) MarshalJSON() ([]byte, error) { + w, err := genieListMessageCommentsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieListMessageCommentsResponse) UnmarshalJSON(data []byte) error { + var w genieListMessageCommentsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieListMessageCommentsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieListSpacesRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -1861,6 +2989,30 @@ func genieListSpacesRequestFromWire(w *genieListSpacesRequestWire) (*GenieListSp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieListSpacesRequest) MarshalJSON() ([]byte, error) { + w, err := genieListSpacesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieListSpacesRequest) UnmarshalJSON(data []byte) error { + var w genieListSpacesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieListSpacesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieListSpacesResponseWire struct { Spaces []genieSpaceWire `json:"spaces,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1894,6 +3046,30 @@ func genieListSpacesResponseFromWire(w *genieListSpacesResponseWire) (*GenieList }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieListSpacesResponse) MarshalJSON() ([]byte, error) { + w, err := genieListSpacesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieListSpacesResponse) UnmarshalJSON(data []byte) error { + var w genieListSpacesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieListSpacesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieMessageWire struct { Id *string `json:"id,omitempty"` SpaceId *string `json:"space_id,omitempty"` @@ -2008,6 +3184,30 @@ func genieMessageFromWire(w *genieMessageWire) (*GenieMessage, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieMessage) MarshalJSON() ([]byte, error) { + w, err := genieMessageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieMessage) UnmarshalJSON(data []byte) error { + var w genieMessageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieMessageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieMessageCommentWire struct { SpaceId *string `json:"space_id,omitempty"` ConversationId *string `json:"conversation_id,omitempty"` @@ -2064,6 +3264,30 @@ func genieMessageCommentFromWire(w *genieMessageCommentWire) (*GenieMessageComme }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieMessageComment) MarshalJSON() ([]byte, error) { + w, err := genieMessageCommentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieMessageComment) UnmarshalJSON(data []byte) error { + var w genieMessageCommentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieMessageCommentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieQueryAttachmentWire struct { Title *string `json:"title,omitempty"` Query *string `json:"query,omitempty"` @@ -2142,6 +3366,30 @@ func genieQueryAttachmentFromWire(w *genieQueryAttachmentWire) (*GenieQueryAttac }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieQueryAttachment) MarshalJSON() ([]byte, error) { + w, err := genieQueryAttachmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieQueryAttachment) UnmarshalJSON(data []byte) error { + var w genieQueryAttachmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieQueryAttachmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieResultMetadataWire struct { RowCount *wireInt64 `json:"row_count,omitempty"` IsTruncated *bool `json:"is_truncated,omitempty"` @@ -2175,6 +3423,30 @@ func genieResultMetadataFromWire(w *genieResultMetadataWire) (*GenieResultMetada }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieResultMetadata) MarshalJSON() ([]byte, error) { + w, err := genieResultMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieResultMetadata) UnmarshalJSON(data []byte) error { + var w genieResultMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieResultMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieSendMessageFeedbackRequestWire struct { SpaceId *string `json:"space_id,omitempty"` ConversationId *string `json:"conversation_id,omitempty"` @@ -2209,6 +3481,30 @@ func genieSendMessageFeedbackRequestFromWire(w *genieSendMessageFeedbackRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieSendMessageFeedbackRequest) MarshalJSON() ([]byte, error) { + w, err := genieSendMessageFeedbackRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieSendMessageFeedbackRequest) UnmarshalJSON(data []byte) error { + var w genieSendMessageFeedbackRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieSendMessageFeedbackRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieSpaceWire struct { SpaceId *string `json:"space_id,omitempty"` Title *string `json:"title,omitempty"` @@ -2255,6 +3551,30 @@ func genieSpaceFromWire(w *genieSpaceWire) (*GenieSpace, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieSpace) MarshalJSON() ([]byte, error) { + w, err := genieSpaceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieSpace) UnmarshalJSON(data []byte) error { + var w genieSpaceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieSpaceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieStartConversationRequestWire struct { SpaceId *string `json:"space_id,omitempty"` Content *string `json:"content,omitempty"` @@ -2283,6 +3603,30 @@ func genieStartConversationRequestFromWire(w *genieStartConversationRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieStartConversationRequest) MarshalJSON() ([]byte, error) { + w, err := genieStartConversationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieStartConversationRequest) UnmarshalJSON(data []byte) error { + var w genieStartConversationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieStartConversationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieStartConversationResponseWire struct { MessageId *string `json:"message_id,omitempty"` Message *genieMessageWire `json:"message,omitempty"` @@ -2330,6 +3674,30 @@ func genieStartConversationResponseFromWire(w *genieStartConversationResponseWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieStartConversationResponse) MarshalJSON() ([]byte, error) { + w, err := genieStartConversationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieStartConversationResponse) UnmarshalJSON(data []byte) error { + var w genieStartConversationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieStartConversationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieSuggestedQuestionsAttachmentWire struct { Questions []string `json:"questions,omitempty"` } @@ -2352,6 +3720,30 @@ func genieSuggestedQuestionsAttachmentFromWire(w *genieSuggestedQuestionsAttachm }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieSuggestedQuestionsAttachment) MarshalJSON() ([]byte, error) { + w, err := genieSuggestedQuestionsAttachmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieSuggestedQuestionsAttachment) UnmarshalJSON(data []byte) error { + var w genieSuggestedQuestionsAttachmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieSuggestedQuestionsAttachmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieTrashSpaceRequestWire struct { SpaceId *string `json:"space_id,omitempty"` } @@ -2374,6 +3766,30 @@ func genieTrashSpaceRequestFromWire(w *genieTrashSpaceRequestWire) (*GenieTrashS }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieTrashSpaceRequest) MarshalJSON() ([]byte, error) { + w, err := genieTrashSpaceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieTrashSpaceRequest) UnmarshalJSON(data []byte) error { + var w genieTrashSpaceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieTrashSpaceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieUpdateSpaceRequestWire struct { SpaceId *string `json:"space_id,omitempty"` SerializedSpace *string `json:"serialized_space,omitempty"` @@ -2414,6 +3830,30 @@ func genieUpdateSpaceRequestFromWire(w *genieUpdateSpaceRequestWire) (*GenieUpda }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieUpdateSpaceRequest) MarshalJSON() ([]byte, error) { + w, err := genieUpdateSpaceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieUpdateSpaceRequest) UnmarshalJSON(data []byte) error { + var w genieUpdateSpaceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieUpdateSpaceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieVizAttachmentWire struct { Title *string `json:"title,omitempty"` QueryAttachmentId *string `json:"query_attachment_id,omitempty"` @@ -2439,6 +3879,30 @@ func genieVizAttachmentFromWire(w *genieVizAttachmentWire) (*GenieVizAttachment, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieVizAttachment) MarshalJSON() ([]byte, error) { + w, err := genieVizAttachmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieVizAttachment) UnmarshalJSON(data []byte) error { + var w genieVizAttachmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieVizAttachmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type messageErrorWire struct { Error *string `json:"error,omitempty"` Type MessageError_Type `json:"type,omitempty"` @@ -2464,6 +3928,30 @@ func messageErrorFromWire(w *messageErrorWire) (*MessageError, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MessageError) MarshalJSON() ([]byte, error) { + w, err := messageErrorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MessageError) UnmarshalJSON(data []byte) error { + var w messageErrorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := messageErrorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type messageStatusWire struct { } @@ -2481,6 +3969,30 @@ func messageStatusFromWire(w *messageStatusWire) (*MessageStatus, error) { return &MessageStatus{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MessageStatus) MarshalJSON() ([]byte, error) { + w, err := messageStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MessageStatus) UnmarshalJSON(data []byte) error { + var w messageStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := messageStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type policyFunctionArgumentWire struct { Column *string `json:"column,omitempty"` Constant *string `json:"constant,omitempty"` @@ -2537,6 +4049,30 @@ func policyFunctionArgumentFromWire(w *policyFunctionArgumentWire) (*PolicyFunct }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PolicyFunctionArgument) MarshalJSON() ([]byte, error) { + w, err := policyFunctionArgumentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PolicyFunctionArgument) UnmarshalJSON(data []byte) error { + var w policyFunctionArgumentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := policyFunctionArgumentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queryAttachmentParameterWire struct { Keyword *string `json:"keyword,omitempty"` Value *string `json:"value,omitempty"` @@ -2565,6 +4101,30 @@ func queryAttachmentParameterFromWire(w *queryAttachmentParameterWire) (*QueryAt }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueryAttachmentParameter) MarshalJSON() ([]byte, error) { + w, err := queryAttachmentParameterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueryAttachmentParameter) UnmarshalJSON(data []byte) error { + var w queryAttachmentParameterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queryAttachmentParameterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resultWire struct { StatementId *string `json:"statement_id,omitempty"` RowCount *wireInt64 `json:"row_count,omitempty"` @@ -2604,6 +4164,30 @@ func resultFromWire(w *resultWire) (*Result, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Result) MarshalJSON() ([]byte, error) { + w, err := resultToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Result) UnmarshalJSON(data []byte) error { + var w resultWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resultFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resultDataWire struct { ExternalLinks []externalLinkWire `json:"external_links,omitempty"` DataArray [][]json.RawMessage `json:"data_array,omitempty"` @@ -2679,6 +4263,30 @@ func resultDataFromWire(w *resultDataWire) (*ResultData, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResultData) MarshalJSON() ([]byte, error) { + w, err := resultDataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResultData) UnmarshalJSON(data []byte) error { + var w resultDataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resultDataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resultManifestWire struct { Format Format `json:"format,omitempty"` Schema *schemaWire `json:"schema,omitempty"` @@ -2751,6 +4359,30 @@ func resultManifestFromWire(w *resultManifestWire) (*ResultManifest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResultManifest) MarshalJSON() ([]byte, error) { + w, err := resultManifestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResultManifest) UnmarshalJSON(data []byte) error { + var w resultManifestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resultManifestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type schemaWire struct { ColumnCount *int `json:"column_count,omitempty"` Columns []columnInfoWire `json:"columns,omitempty"` @@ -2784,6 +4416,30 @@ func schemaFromWire(w *schemaWire) (*Schema, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Schema) MarshalJSON() ([]byte, error) { + w, err := schemaToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Schema) UnmarshalJSON(data []byte) error { + var w schemaWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := schemaFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type statementResponseWire struct { StatementId *string `json:"statement_id,omitempty"` Status *statementStatusWire `json:"status,omitempty"` @@ -2839,6 +4495,30 @@ func statementResponseFromWire(w *statementResponseWire) (*StatementResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StatementResponse) MarshalJSON() ([]byte, error) { + w, err := statementResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StatementResponse) UnmarshalJSON(data []byte) error { + var w statementResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := statementResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type statementStatusWire struct { State StatementStatus_State `json:"state,omitempty"` Error *databricksServiceExceptionProtoWire `json:"error,omitempty"` @@ -2875,6 +4555,30 @@ func statementStatusFromWire(w *statementStatusWire) (*StatementStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StatementStatus) MarshalJSON() ([]byte, error) { + w, err := statementStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StatementStatus) UnmarshalJSON(data []byte) error { + var w statementStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := statementStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type textAttachmentWire struct { Content *string `json:"content,omitempty"` Id *string `json:"id,omitempty"` @@ -2903,6 +4607,30 @@ func textAttachmentFromWire(w *textAttachmentWire) (*TextAttachment, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TextAttachment) MarshalJSON() ([]byte, error) { + w, err := textAttachmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TextAttachment) UnmarshalJSON(data []byte) error { + var w textAttachmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := textAttachmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type thoughtWire struct { ThoughtType ThoughtType `json:"thought_type,omitempty"` Content *string `json:"content,omitempty"` @@ -2928,6 +4656,30 @@ func thoughtFromWire(w *thoughtWire) (*Thought, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Thought) MarshalJSON() ([]byte, error) { + w, err := thoughtToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Thought) UnmarshalJSON(data []byte) error { + var w thoughtWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := thoughtFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/genieagents/CHANGELOG.md b/genieagents/CHANGELOG.md index 62219f84..82349e77 100644 --- a/genieagents/CHANGELOG.md +++ b/genieagents/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.4.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.3.0 (2026-11-11) ## Release v0.2.0 (2026-11-10) diff --git a/genieagents/internal/version.go b/genieagents/internal/version.go index 3d8e63e0..d46a3ef2 100644 --- a/genieagents/internal/version.go +++ b/genieagents/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-genieagents" -const Version = "0.3.0" +const Version = "0.4.0" diff --git a/genieagents/v1/wire.go b/genieagents/v1/wire.go index d69fc311..6a8252f9 100644 --- a/genieagents/v1/wire.go +++ b/genieagents/v1/wire.go @@ -3,6 +3,7 @@ package genieagents import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -41,6 +42,30 @@ func createGenieAgentRequestFromWire(w *createGenieAgentRequestWire) (*CreateGen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateGenieAgentRequest) MarshalJSON() ([]byte, error) { + w, err := createGenieAgentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateGenieAgentRequest) UnmarshalJSON(data []byte) error { + var w createGenieAgentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createGenieAgentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteGenieAgentRequestWire struct { Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` @@ -66,6 +91,30 @@ func deleteGenieAgentRequestFromWire(w *deleteGenieAgentRequestWire) (*DeleteGen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteGenieAgentRequest) MarshalJSON() ([]byte, error) { + w, err := deleteGenieAgentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteGenieAgentRequest) UnmarshalJSON(data []byte) error { + var w deleteGenieAgentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteGenieAgentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentWire struct { Name *string `json:"name,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -123,6 +172,30 @@ func genieAgentFromWire(w *genieAgentWire) (*GenieAgent, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgent) MarshalJSON() ([]byte, error) { + w, err := genieAgentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgent) UnmarshalJSON(data []byte) error { + var w genieAgentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentBenchmarkAnswerWire struct { Format GenieAgentBenchmarkAnswerFormat `json:"format,omitempty"` Content *string `json:"content,omitempty"` @@ -148,6 +221,30 @@ func genieAgentBenchmarkAnswerFromWire(w *genieAgentBenchmarkAnswerWire) (*Genie }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentBenchmarkAnswer) MarshalJSON() ([]byte, error) { + w, err := genieAgentBenchmarkAnswerToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentBenchmarkAnswer) UnmarshalJSON(data []byte) error { + var w genieAgentBenchmarkAnswerWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentBenchmarkAnswerFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentBenchmarkQuestionWire struct { Id *string `json:"id,omitempty"` Question *string `json:"question,omitempty"` @@ -187,6 +284,30 @@ func genieAgentBenchmarkQuestionFromWire(w *genieAgentBenchmarkQuestionWire) (*G }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentBenchmarkQuestion) MarshalJSON() ([]byte, error) { + w, err := genieAgentBenchmarkQuestionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentBenchmarkQuestion) UnmarshalJSON(data []byte) error { + var w genieAgentBenchmarkQuestionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentBenchmarkQuestionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentBenchmarksWire struct { Questions []genieAgentBenchmarkQuestionWire `json:"questions,omitempty"` } @@ -217,6 +338,30 @@ func genieAgentBenchmarksFromWire(w *genieAgentBenchmarksWire) (*GenieAgentBench }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentBenchmarks) MarshalJSON() ([]byte, error) { + w, err := genieAgentBenchmarksToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentBenchmarks) UnmarshalJSON(data []byte) error { + var w genieAgentBenchmarksWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentBenchmarksFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentColumnConfigWire struct { Column *string `json:"column,omitempty"` Description *string `json:"description,omitempty"` @@ -257,6 +402,30 @@ func genieAgentColumnConfigFromWire(w *genieAgentColumnConfigWire) (*GenieAgentC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentColumnConfig) MarshalJSON() ([]byte, error) { + w, err := genieAgentColumnConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentColumnConfig) UnmarshalJSON(data []byte) error { + var w genieAgentColumnConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentColumnConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentConfigWire struct { SampleQuestions []genieAgentSampleQuestionWire `json:"sample_questions,omitempty"` } @@ -287,6 +456,30 @@ func genieAgentConfigFromWire(w *genieAgentConfigWire) (*GenieAgentConfig, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentConfig) MarshalJSON() ([]byte, error) { + w, err := genieAgentConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentConfig) UnmarshalJSON(data []byte) error { + var w genieAgentConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentDataSourcesWire struct { Tables []genieAgentTableWire `json:"tables,omitempty"` Volumes []genieAgentVolumeWire `json:"volumes,omitempty"` @@ -339,6 +532,30 @@ func genieAgentDataSourcesFromWire(w *genieAgentDataSourcesWire) (*GenieAgentDat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentDataSources) MarshalJSON() ([]byte, error) { + w, err := genieAgentDataSourcesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentDataSources) UnmarshalJSON(data []byte) error { + var w genieAgentDataSourcesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentDataSourcesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentDefinitionWire struct { Config *genieAgentConfigWire `json:"config,omitempty"` DataSources *genieAgentDataSourcesWire `json:"data_sources,omitempty"` @@ -402,6 +619,30 @@ func genieAgentDefinitionFromWire(w *genieAgentDefinitionWire) (*GenieAgentDefin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentDefinition) MarshalJSON() ([]byte, error) { + w, err := genieAgentDefinitionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentDefinition) UnmarshalJSON(data []byte) error { + var w genieAgentDefinitionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentDefinitionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentExampleQuestionSqlWire struct { Id *string `json:"id,omitempty"` Question *string `json:"question,omitempty"` @@ -444,6 +685,30 @@ func genieAgentExampleQuestionSqlFromWire(w *genieAgentExampleQuestionSqlWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentExampleQuestionSql) MarshalJSON() ([]byte, error) { + w, err := genieAgentExampleQuestionSqlToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentExampleQuestionSql) UnmarshalJSON(data []byte) error { + var w genieAgentExampleQuestionSqlWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentExampleQuestionSqlFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentInstructionsWire struct { TextInstructions []genieAgentTextInstructionWire `json:"text_instructions,omitempty"` ExampleQuestionSqls []genieAgentExampleQuestionSqlWire `json:"example_question_sqls,omitempty"` @@ -518,6 +783,30 @@ func genieAgentInstructionsFromWire(w *genieAgentInstructionsWire) (*GenieAgentI }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentInstructions) MarshalJSON() ([]byte, error) { + w, err := genieAgentInstructionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentInstructions) UnmarshalJSON(data []byte) error { + var w genieAgentInstructionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentInstructionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentJoinSourceWire struct { Identifier *string `json:"identifier,omitempty"` Alias *string `json:"alias,omitempty"` @@ -543,6 +832,30 @@ func genieAgentJoinSourceFromWire(w *genieAgentJoinSourceWire) (*GenieAgentJoinS }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentJoinSource) MarshalJSON() ([]byte, error) { + w, err := genieAgentJoinSourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentJoinSource) UnmarshalJSON(data []byte) error { + var w genieAgentJoinSourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentJoinSourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentJoinSpecWire struct { Id *string `json:"id,omitempty"` Left *genieAgentJoinSourceWire `json:"left,omitempty"` @@ -599,6 +912,30 @@ func genieAgentJoinSpecFromWire(w *genieAgentJoinSpecWire) (*GenieAgentJoinSpec, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentJoinSpec) MarshalJSON() ([]byte, error) { + w, err := genieAgentJoinSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentJoinSpec) UnmarshalJSON(data []byte) error { + var w genieAgentJoinSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentJoinSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentMcpConnectionWire struct { McpConnection *string `json:"mcp_connection,omitempty"` } @@ -621,6 +958,30 @@ func genieAgentMcpConnectionFromWire(w *genieAgentMcpConnectionWire) (*GenieAgen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentMcpConnection) MarshalJSON() ([]byte, error) { + w, err := genieAgentMcpConnectionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentMcpConnection) UnmarshalJSON(data []byte) error { + var w genieAgentMcpConnectionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentMcpConnectionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentSampleQuestionWire struct { Id *string `json:"id,omitempty"` Question *string `json:"question,omitempty"` @@ -646,6 +1007,30 @@ func genieAgentSampleQuestionFromWire(w *genieAgentSampleQuestionWire) (*GenieAg }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentSampleQuestion) MarshalJSON() ([]byte, error) { + w, err := genieAgentSampleQuestionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentSampleQuestion) UnmarshalJSON(data []byte) error { + var w genieAgentSampleQuestionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentSampleQuestionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentSqlExpressionWire struct { Id *string `json:"id,omitempty"` Alias *string `json:"alias,omitempty"` @@ -683,6 +1068,30 @@ func genieAgentSqlExpressionFromWire(w *genieAgentSqlExpressionWire) (*GenieAgen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentSqlExpression) MarshalJSON() ([]byte, error) { + w, err := genieAgentSqlExpressionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentSqlExpression) UnmarshalJSON(data []byte) error { + var w genieAgentSqlExpressionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentSqlExpressionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentSqlFilterWire struct { Id *string `json:"id,omitempty"` Sql *string `json:"sql,omitempty"` @@ -717,6 +1126,30 @@ func genieAgentSqlFilterFromWire(w *genieAgentSqlFilterWire) (*GenieAgentSqlFilt }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentSqlFilter) MarshalJSON() ([]byte, error) { + w, err := genieAgentSqlFilterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentSqlFilter) UnmarshalJSON(data []byte) error { + var w genieAgentSqlFilterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentSqlFilterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentSqlFunctionWire struct { Id *string `json:"id,omitempty"` Identifier *string `json:"identifier,omitempty"` @@ -742,6 +1175,30 @@ func genieAgentSqlFunctionFromWire(w *genieAgentSqlFunctionWire) (*GenieAgentSql }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentSqlFunction) MarshalJSON() ([]byte, error) { + w, err := genieAgentSqlFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentSqlFunction) UnmarshalJSON(data []byte) error { + var w genieAgentSqlFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentSqlFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentSqlMeasureWire struct { Id *string `json:"id,omitempty"` Alias *string `json:"alias,omitempty"` @@ -779,6 +1236,30 @@ func genieAgentSqlMeasureFromWire(w *genieAgentSqlMeasureWire) (*GenieAgentSqlMe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentSqlMeasure) MarshalJSON() ([]byte, error) { + w, err := genieAgentSqlMeasureToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentSqlMeasure) UnmarshalJSON(data []byte) error { + var w genieAgentSqlMeasureWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentSqlMeasureFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentSqlParameterWire struct { Name *string `json:"name,omitempty"` TypeHint *string `json:"type_hint,omitempty"` @@ -818,6 +1299,30 @@ func genieAgentSqlParameterFromWire(w *genieAgentSqlParameterWire) (*GenieAgentS }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentSqlParameter) MarshalJSON() ([]byte, error) { + w, err := genieAgentSqlParameterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentSqlParameter) UnmarshalJSON(data []byte) error { + var w genieAgentSqlParameterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentSqlParameterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentSqlParameterDefaultRangeWire struct { Min *string `json:"min,omitempty"` Max *string `json:"max,omitempty"` @@ -843,6 +1348,30 @@ func genieAgentSqlParameterDefaultRangeFromWire(w *genieAgentSqlParameterDefault }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentSqlParameterDefaultRange) MarshalJSON() ([]byte, error) { + w, err := genieAgentSqlParameterDefaultRangeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentSqlParameterDefaultRange) UnmarshalJSON(data []byte) error { + var w genieAgentSqlParameterDefaultRangeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentSqlParameterDefaultRangeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentSqlParameterDefaultValueWire struct { Values []string `json:"values,omitempty"` ValueRange *genieAgentSqlParameterDefaultRangeWire `json:"value_range,omitempty"` @@ -876,6 +1405,30 @@ func genieAgentSqlParameterDefaultValueFromWire(w *genieAgentSqlParameterDefault }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentSqlParameterDefaultValue) MarshalJSON() ([]byte, error) { + w, err := genieAgentSqlParameterDefaultValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentSqlParameterDefaultValue) UnmarshalJSON(data []byte) error { + var w genieAgentSqlParameterDefaultValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentSqlParameterDefaultValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentSqlSnippetsWire struct { Filters []genieAgentSqlFilterWire `json:"filters,omitempty"` Expressions []genieAgentSqlExpressionWire `json:"expressions,omitempty"` @@ -928,6 +1481,30 @@ func genieAgentSqlSnippetsFromWire(w *genieAgentSqlSnippetsWire) (*GenieAgentSql }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentSqlSnippets) MarshalJSON() ([]byte, error) { + w, err := genieAgentSqlSnippetsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentSqlSnippets) UnmarshalJSON(data []byte) error { + var w genieAgentSqlSnippetsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentSqlSnippetsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentTableWire struct { Identifier *string `json:"identifier,omitempty"` Description *string `json:"description,omitempty"` @@ -964,6 +1541,30 @@ func genieAgentTableFromWire(w *genieAgentTableWire) (*GenieAgentTable, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentTable) MarshalJSON() ([]byte, error) { + w, err := genieAgentTableToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentTable) UnmarshalJSON(data []byte) error { + var w genieAgentTableWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentTableFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentTextInstructionWire struct { Id *string `json:"id,omitempty"` Content *string `json:"content,omitempty"` @@ -989,6 +1590,30 @@ func genieAgentTextInstructionFromWire(w *genieAgentTextInstructionWire) (*Genie }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentTextInstruction) MarshalJSON() ([]byte, error) { + w, err := genieAgentTextInstructionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentTextInstruction) UnmarshalJSON(data []byte) error { + var w genieAgentTextInstructionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentTextInstructionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieAgentVolumeWire struct { Path *string `json:"path,omitempty"` Description *string `json:"description,omitempty"` @@ -1014,6 +1639,30 @@ func genieAgentVolumeFromWire(w *genieAgentVolumeWire) (*GenieAgentVolume, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieAgentVolume) MarshalJSON() ([]byte, error) { + w, err := genieAgentVolumeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieAgentVolume) UnmarshalJSON(data []byte) error { + var w genieAgentVolumeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieAgentVolumeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getGenieAgentRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1036,6 +1685,30 @@ func getGenieAgentRequestFromWire(w *getGenieAgentRequestWire) (*GetGenieAgentRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetGenieAgentRequest) MarshalJSON() ([]byte, error) { + w, err := getGenieAgentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetGenieAgentRequest) UnmarshalJSON(data []byte) error { + var w getGenieAgentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getGenieAgentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listGenieAgentsRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -1064,6 +1737,30 @@ func listGenieAgentsRequestFromWire(w *listGenieAgentsRequestWire) (*ListGenieAg }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListGenieAgentsRequest) MarshalJSON() ([]byte, error) { + w, err := listGenieAgentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListGenieAgentsRequest) UnmarshalJSON(data []byte) error { + var w listGenieAgentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listGenieAgentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listGenieAgentsResponseWire struct { GenieAgents []genieAgentWire `json:"genie_agents,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1100,6 +1797,30 @@ func listGenieAgentsResponseFromWire(w *listGenieAgentsResponseWire) (*ListGenie }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListGenieAgentsResponse) MarshalJSON() ([]byte, error) { + w, err := listGenieAgentsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListGenieAgentsResponse) UnmarshalJSON(data []byte) error { + var w listGenieAgentsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listGenieAgentsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateGenieAgentRequestWire struct { GenieAgent *genieAgentWire `json:"genie_agent,omitempty"` UpdateMask *types.FieldMask[GenieAgent] `json:"update_mask,omitempty"` @@ -1136,6 +1857,30 @@ func updateGenieAgentRequestFromWire(w *updateGenieAgentRequestWire) (*UpdateGen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateGenieAgentRequest) MarshalJSON() ([]byte, error) { + w, err := updateGenieAgentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateGenieAgentRequest) UnmarshalJSON(data []byte) error { + var w updateGenieAgentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateGenieAgentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/gitcredentials/CHANGELOG.md b/gitcredentials/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/gitcredentials/CHANGELOG.md +++ b/gitcredentials/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/gitcredentials/internal/version.go b/gitcredentials/internal/version.go index 5c364b3b..7643befe 100644 --- a/gitcredentials/internal/version.go +++ b/gitcredentials/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-gitcredentials" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/gitcredentials/v1/wire.go b/gitcredentials/v1/wire.go index ec456a02..1ed66c7b 100644 --- a/gitcredentials/v1/wire.go +++ b/gitcredentials/v1/wire.go @@ -100,6 +100,30 @@ func createCredentialsRequestFromWire(w *createCredentialsRequestWire) (*CreateC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCredentialsRequest) MarshalJSON() ([]byte, error) { + w, err := createCredentialsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCredentialsRequest) UnmarshalJSON(data []byte) error { + var w createCredentialsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCredentialsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCredentialsResponseWire struct { CredentialId *wireInt64 `json:"credential_id,omitempty"` GitProvider *string `json:"git_provider,omitempty"` @@ -145,6 +169,30 @@ func createCredentialsResponseFromWire(w *createCredentialsResponseWire) (*Creat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCredentialsResponse) MarshalJSON() ([]byte, error) { + w, err := createCredentialsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCredentialsResponse) UnmarshalJSON(data []byte) error { + var w createCredentialsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCredentialsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type credentialWire struct { CredentialId *wireInt64 `json:"credential_id,omitempty"` GitProvider *string `json:"git_provider,omitempty"` @@ -190,6 +238,30 @@ func credentialFromWire(w *credentialWire) (*Credential, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Credential) MarshalJSON() ([]byte, error) { + w, err := credentialToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Credential) UnmarshalJSON(data []byte) error { + var w credentialWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := credentialFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCredentialsRequestWire struct { Id *wireInt64 `json:"id,omitempty"` PrincipalId *wireInt64 `json:"principal_id,omitempty"` @@ -231,6 +303,30 @@ func deleteCredentialsRequestFromWire(w *deleteCredentialsRequestWire) (*DeleteC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCredentialsRequest) MarshalJSON() ([]byte, error) { + w, err := deleteCredentialsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCredentialsRequest) UnmarshalJSON(data []byte) error { + var w deleteCredentialsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCredentialsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCredentialsResponseWire struct { } @@ -248,6 +344,30 @@ func deleteCredentialsResponseFromWire(w *deleteCredentialsResponseWire) (*Delet return &DeleteCredentialsResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCredentialsResponse) MarshalJSON() ([]byte, error) { + w, err := deleteCredentialsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCredentialsResponse) UnmarshalJSON(data []byte) error { + var w deleteCredentialsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCredentialsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCredentialsRequestWire struct { Id *wireInt64 `json:"id,omitempty"` PrincipalId *wireInt64 `json:"principal_id,omitempty"` @@ -289,6 +409,30 @@ func getCredentialsRequestFromWire(w *getCredentialsRequestWire) (*GetCredential }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCredentialsRequest) MarshalJSON() ([]byte, error) { + w, err := getCredentialsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCredentialsRequest) UnmarshalJSON(data []byte) error { + var w getCredentialsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCredentialsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCredentialsResponseWire struct { CredentialId *wireInt64 `json:"credential_id,omitempty"` GitProvider *string `json:"git_provider,omitempty"` @@ -334,6 +478,30 @@ func getCredentialsResponseFromWire(w *getCredentialsResponseWire) (*GetCredenti }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCredentialsResponse) MarshalJSON() ([]byte, error) { + w, err := getCredentialsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCredentialsResponse) UnmarshalJSON(data []byte) error { + var w getCredentialsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCredentialsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCredentialsRequestWire struct { PrincipalId *wireInt64 `json:"principal_id,omitempty"` } @@ -364,6 +532,30 @@ func listCredentialsRequestFromWire(w *listCredentialsRequestWire) (*ListCredent }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCredentialsRequest) MarshalJSON() ([]byte, error) { + w, err := listCredentialsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCredentialsRequest) UnmarshalJSON(data []byte) error { + var w listCredentialsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCredentialsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCredentialsResponseWire struct { Credentials []credentialWire `json:"credentials,omitempty"` } @@ -394,6 +586,30 @@ func listCredentialsResponseFromWire(w *listCredentialsResponseWire) (*ListCrede }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCredentialsResponse) MarshalJSON() ([]byte, error) { + w, err := listCredentialsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCredentialsResponse) UnmarshalJSON(data []byte) error { + var w listCredentialsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCredentialsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCredentialsRequestWire struct { Id *wireInt64 `json:"id,omitempty"` PersonalAccessToken *string `json:"personal_access_token,omitempty"` @@ -453,6 +669,30 @@ func updateCredentialsRequestFromWire(w *updateCredentialsRequestWire) (*UpdateC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCredentialsRequest) MarshalJSON() ([]byte, error) { + w, err := updateCredentialsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCredentialsRequest) UnmarshalJSON(data []byte) error { + var w updateCredentialsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCredentialsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCredentialsResponseWire struct { } @@ -470,6 +710,30 @@ func updateCredentialsResponseFromWire(w *updateCredentialsResponseWire) (*Updat return &UpdateCredentialsResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCredentialsResponse) MarshalJSON() ([]byte, error) { + w, err := updateCredentialsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCredentialsResponse) UnmarshalJSON(data []byte) error { + var w updateCredentialsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCredentialsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/globalinitscripts/CHANGELOG.md b/globalinitscripts/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/globalinitscripts/CHANGELOG.md +++ b/globalinitscripts/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/globalinitscripts/internal/version.go b/globalinitscripts/internal/version.go index 87819001..39e64788 100644 --- a/globalinitscripts/internal/version.go +++ b/globalinitscripts/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-globalinitscripts" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/globalinitscripts/v2/wire.go b/globalinitscripts/v2/wire.go index 3620c3cf..df9b5a12 100644 --- a/globalinitscripts/v2/wire.go +++ b/globalinitscripts/v2/wire.go @@ -83,6 +83,30 @@ func createGlobalInitScriptRequestFromWire(w *createGlobalInitScriptRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateGlobalInitScriptRequest) MarshalJSON() ([]byte, error) { + w, err := createGlobalInitScriptRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateGlobalInitScriptRequest) UnmarshalJSON(data []byte) error { + var w createGlobalInitScriptRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createGlobalInitScriptRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createGlobalInitScriptResponseWire struct { ScriptId *string `json:"script_id,omitempty"` } @@ -105,6 +129,30 @@ func createGlobalInitScriptResponseFromWire(w *createGlobalInitScriptResponseWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateGlobalInitScriptResponse) MarshalJSON() ([]byte, error) { + w, err := createGlobalInitScriptResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateGlobalInitScriptResponse) UnmarshalJSON(data []byte) error { + var w createGlobalInitScriptResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createGlobalInitScriptResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteGlobalInitScriptRequestWire struct { ScriptId *string `json:"script_id,omitempty"` } @@ -127,6 +175,30 @@ func deleteGlobalInitScriptRequestFromWire(w *deleteGlobalInitScriptRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteGlobalInitScriptRequest) MarshalJSON() ([]byte, error) { + w, err := deleteGlobalInitScriptRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteGlobalInitScriptRequest) UnmarshalJSON(data []byte) error { + var w deleteGlobalInitScriptRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteGlobalInitScriptRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteGlobalInitScriptResponseWire struct { } @@ -144,6 +216,30 @@ func deleteGlobalInitScriptResponseFromWire(w *deleteGlobalInitScriptResponseWir return &DeleteGlobalInitScriptResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteGlobalInitScriptResponse) MarshalJSON() ([]byte, error) { + w, err := deleteGlobalInitScriptResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteGlobalInitScriptResponse) UnmarshalJSON(data []byte) error { + var w deleteGlobalInitScriptResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteGlobalInitScriptResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getGlobalInitScriptRequestWire struct { ScriptId *string `json:"script_id,omitempty"` } @@ -166,6 +262,30 @@ func getGlobalInitScriptRequestFromWire(w *getGlobalInitScriptRequestWire) (*Get }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetGlobalInitScriptRequest) MarshalJSON() ([]byte, error) { + w, err := getGlobalInitScriptRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetGlobalInitScriptRequest) UnmarshalJSON(data []byte) error { + var w getGlobalInitScriptRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getGlobalInitScriptRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type globalInitScriptDetailsWire struct { ScriptId *string `json:"script_id,omitempty"` Name *string `json:"name,omitempty"` @@ -225,6 +345,30 @@ func globalInitScriptDetailsFromWire(w *globalInitScriptDetailsWire) (*GlobalIni }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GlobalInitScriptDetails) MarshalJSON() ([]byte, error) { + w, err := globalInitScriptDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GlobalInitScriptDetails) UnmarshalJSON(data []byte) error { + var w globalInitScriptDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := globalInitScriptDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listGlobalInitScriptsRequestWire struct { } @@ -242,6 +386,30 @@ func listGlobalInitScriptsRequestFromWire(w *listGlobalInitScriptsRequestWire) ( return &ListGlobalInitScriptsRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListGlobalInitScriptsRequest) MarshalJSON() ([]byte, error) { + w, err := listGlobalInitScriptsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListGlobalInitScriptsRequest) UnmarshalJSON(data []byte) error { + var w listGlobalInitScriptsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listGlobalInitScriptsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listGlobalInitScriptsResponseWire struct { Scripts []globalInitScriptDetailsWire `json:"scripts,omitempty"` } @@ -272,6 +440,30 @@ func listGlobalInitScriptsResponseFromWire(w *listGlobalInitScriptsResponseWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListGlobalInitScriptsResponse) MarshalJSON() ([]byte, error) { + w, err := listGlobalInitScriptsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListGlobalInitScriptsResponse) UnmarshalJSON(data []byte) error { + var w listGlobalInitScriptsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listGlobalInitScriptsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateGlobalInitScriptRequestWire struct { ScriptId *string `json:"script_id,omitempty"` Name *string `json:"name,omitempty"` @@ -306,6 +498,30 @@ func updateGlobalInitScriptRequestFromWire(w *updateGlobalInitScriptRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateGlobalInitScriptRequest) MarshalJSON() ([]byte, error) { + w, err := updateGlobalInitScriptRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateGlobalInitScriptRequest) UnmarshalJSON(data []byte) error { + var w updateGlobalInitScriptRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateGlobalInitScriptRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateGlobalInitScriptResponseWire struct { } @@ -323,6 +539,30 @@ func updateGlobalInitScriptResponseFromWire(w *updateGlobalInitScriptResponseWir return &UpdateGlobalInitScriptResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateGlobalInitScriptResponse) MarshalJSON() ([]byte, error) { + w, err := updateGlobalInitScriptResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateGlobalInitScriptResponse) UnmarshalJSON(data []byte) error { + var w updateGlobalInitScriptResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateGlobalInitScriptResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/instancepools/CHANGELOG.md b/instancepools/CHANGELOG.md index adc62b26..da57c0ac 100644 --- a/instancepools/CHANGELOG.md +++ b/instancepools/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/instancepools/internal/version.go b/instancepools/internal/version.go index f1b43a80..ed11d353 100644 --- a/instancepools/internal/version.go +++ b/instancepools/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-instancepools" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/instancepools/v2/wire.go b/instancepools/v2/wire.go index f4db3694..b51fb784 100644 --- a/instancepools/v2/wire.go +++ b/instancepools/v2/wire.go @@ -3,6 +3,7 @@ package instancepools import ( + "encoding/json" "fmt" ) @@ -121,6 +122,30 @@ func createInstancePoolRequestFromWire(w *createInstancePoolRequestWire) (*Creat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateInstancePoolRequest) MarshalJSON() ([]byte, error) { + w, err := createInstancePoolRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateInstancePoolRequest) UnmarshalJSON(data []byte) error { + var w createInstancePoolRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createInstancePoolRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createInstancePoolResponseWire struct { InstancePoolId *string `json:"instance_pool_id,omitempty"` } @@ -143,6 +168,30 @@ func createInstancePoolResponseFromWire(w *createInstancePoolResponseWire) (*Cre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateInstancePoolResponse) MarshalJSON() ([]byte, error) { + w, err := createInstancePoolResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateInstancePoolResponse) UnmarshalJSON(data []byte) error { + var w createInstancePoolResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createInstancePoolResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteInstancePoolRequestWire struct { InstancePoolId *string `json:"instance_pool_id,omitempty"` } @@ -165,6 +214,30 @@ func deleteInstancePoolRequestFromWire(w *deleteInstancePoolRequestWire) (*Delet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteInstancePoolRequest) MarshalJSON() ([]byte, error) { + w, err := deleteInstancePoolRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteInstancePoolRequest) UnmarshalJSON(data []byte) error { + var w deleteInstancePoolRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteInstancePoolRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteInstancePoolResponseWire struct { } @@ -182,6 +255,30 @@ func deleteInstancePoolResponseFromWire(w *deleteInstancePoolResponseWire) (*Del return &DeleteInstancePoolResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteInstancePoolResponse) MarshalJSON() ([]byte, error) { + w, err := deleteInstancePoolResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteInstancePoolResponse) UnmarshalJSON(data []byte) error { + var w deleteInstancePoolResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteInstancePoolResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type diskSpecWire struct { DiskType *diskTypeWire `json:"disk_type,omitempty"` DiskCount *int `json:"disk_count,omitempty"` @@ -224,6 +321,30 @@ func diskSpecFromWire(w *diskSpecWire) (*DiskSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DiskSpec) MarshalJSON() ([]byte, error) { + w, err := diskSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DiskSpec) UnmarshalJSON(data []byte) error { + var w diskSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := diskSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type diskTypeWire struct { EbsVolumeType EbsVolumeType `json:"ebs_volume_type,omitempty"` AzureDiskVolumeType AzureDiskVolumeType `json:"azure_disk_volume_type,omitempty"` @@ -280,6 +401,30 @@ func diskTypeFromWire(w *diskTypeWire) (*DiskType, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DiskType) MarshalJSON() ([]byte, error) { + w, err := diskTypeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DiskType) UnmarshalJSON(data []byte) error { + var w diskTypeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := diskTypeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dockerBasicAuthWire struct { Username *string `json:"username,omitempty"` Password *string `json:"password,omitempty"` @@ -305,6 +450,30 @@ func dockerBasicAuthFromWire(w *dockerBasicAuthWire) (*DockerBasicAuth, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DockerBasicAuth) MarshalJSON() ([]byte, error) { + w, err := dockerBasicAuthToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DockerBasicAuth) UnmarshalJSON(data []byte) error { + var w dockerBasicAuthWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dockerBasicAuthFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dockerImageWire struct { Url *string `json:"url,omitempty"` BasicAuth *dockerBasicAuthWire `json:"basic_auth,omitempty"` @@ -360,6 +529,30 @@ func dockerImageFromWire(w *dockerImageWire) (*DockerImage, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DockerImage) MarshalJSON() ([]byte, error) { + w, err := dockerImageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DockerImage) UnmarshalJSON(data []byte) error { + var w dockerImageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dockerImageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type editInstancePoolRequestWire struct { InstancePoolId *string `json:"instance_pool_id,omitempty"` InstancePoolName *string `json:"instance_pool_name,omitempty"` @@ -478,6 +671,30 @@ func editInstancePoolRequestFromWire(w *editInstancePoolRequestWire) (*EditInsta }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EditInstancePoolRequest) MarshalJSON() ([]byte, error) { + w, err := editInstancePoolRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EditInstancePoolRequest) UnmarshalJSON(data []byte) error { + var w editInstancePoolRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := editInstancePoolRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type editInstancePoolResponseWire struct { } @@ -495,6 +712,30 @@ func editInstancePoolResponseFromWire(w *editInstancePoolResponseWire) (*EditIns return &EditInstancePoolResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EditInstancePoolResponse) MarshalJSON() ([]byte, error) { + w, err := editInstancePoolResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EditInstancePoolResponse) UnmarshalJSON(data []byte) error { + var w editInstancePoolResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := editInstancePoolResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getInstancePoolRequestWire struct { InstancePoolId *string `json:"instance_pool_id,omitempty"` } @@ -517,6 +758,30 @@ func getInstancePoolRequestFromWire(w *getInstancePoolRequestWire) (*GetInstance }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetInstancePoolRequest) MarshalJSON() ([]byte, error) { + w, err := getInstancePoolRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetInstancePoolRequest) UnmarshalJSON(data []byte) error { + var w getInstancePoolRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getInstancePoolRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getInstancePoolResponseWire struct { Stats *instancePoolStatsWire `json:"stats,omitempty"` Status *instancePoolStatusWire `json:"status,omitempty"` @@ -663,6 +928,30 @@ func getInstancePoolResponseFromWire(w *getInstancePoolResponseWire) (*GetInstan }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetInstancePoolResponse) MarshalJSON() ([]byte, error) { + w, err := getInstancePoolResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetInstancePoolResponse) UnmarshalJSON(data []byte) error { + var w getInstancePoolResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getInstancePoolResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type instancePoolAndStatsWire struct { Stats *instancePoolStatsWire `json:"stats,omitempty"` Status *instancePoolStatusWire `json:"status,omitempty"` @@ -809,6 +1098,30 @@ func instancePoolAndStatsFromWire(w *instancePoolAndStatsWire) (*InstancePoolAnd }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InstancePoolAndStats) MarshalJSON() ([]byte, error) { + w, err := instancePoolAndStatsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InstancePoolAndStats) UnmarshalJSON(data []byte) error { + var w instancePoolAndStatsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := instancePoolAndStatsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type instancePoolAwsAttributesWire struct { Availability AwsAvailability `json:"availability,omitempty"` ZoneId *string `json:"zone_id,omitempty"` @@ -840,6 +1153,30 @@ func instancePoolAwsAttributesFromWire(w *instancePoolAwsAttributesWire) (*Insta }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InstancePoolAwsAttributes) MarshalJSON() ([]byte, error) { + w, err := instancePoolAwsAttributesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InstancePoolAwsAttributes) UnmarshalJSON(data []byte) error { + var w instancePoolAwsAttributesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := instancePoolAwsAttributesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type instancePoolAzureAttributesWire struct { Availability AzureAvailability `json:"availability,omitempty"` SpotBidMaxPrice *float64 `json:"spot_bid_max_price,omitempty"` @@ -868,6 +1205,30 @@ func instancePoolAzureAttributesFromWire(w *instancePoolAzureAttributesWire) (*I }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InstancePoolAzureAttributes) MarshalJSON() ([]byte, error) { + w, err := instancePoolAzureAttributesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InstancePoolAzureAttributes) UnmarshalJSON(data []byte) error { + var w instancePoolAzureAttributesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := instancePoolAzureAttributesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type instancePoolGcpAttributesWire struct { GcpAvailability GcpAvailability `json:"gcp_availability,omitempty"` LocalSsdCount *int `json:"local_ssd_count,omitempty"` @@ -896,6 +1257,30 @@ func instancePoolGcpAttributesFromWire(w *instancePoolGcpAttributesWire) (*Insta }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InstancePoolGcpAttributes) MarshalJSON() ([]byte, error) { + w, err := instancePoolGcpAttributesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InstancePoolGcpAttributes) UnmarshalJSON(data []byte) error { + var w instancePoolGcpAttributesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := instancePoolGcpAttributesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type instancePoolStatsWire struct { UsedCount *int `json:"used_count,omitempty"` IdleCount *int `json:"idle_count,omitempty"` @@ -927,6 +1312,30 @@ func instancePoolStatsFromWire(w *instancePoolStatsWire) (*InstancePoolStats, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InstancePoolStats) MarshalJSON() ([]byte, error) { + w, err := instancePoolStatsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InstancePoolStats) UnmarshalJSON(data []byte) error { + var w instancePoolStatsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := instancePoolStatsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type instancePoolStatusWire struct { PendingInstanceErrors []pendingInstanceErrorWire `json:"pending_instance_errors,omitempty"` } @@ -957,6 +1366,30 @@ func instancePoolStatusFromWire(w *instancePoolStatusWire) (*InstancePoolStatus, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InstancePoolStatus) MarshalJSON() ([]byte, error) { + w, err := instancePoolStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InstancePoolStatus) UnmarshalJSON(data []byte) error { + var w instancePoolStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := instancePoolStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listInstancePoolsRequestWire struct { } @@ -974,6 +1407,30 @@ func listInstancePoolsRequestFromWire(w *listInstancePoolsRequestWire) (*ListIns return &ListInstancePoolsRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListInstancePoolsRequest) MarshalJSON() ([]byte, error) { + w, err := listInstancePoolsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListInstancePoolsRequest) UnmarshalJSON(data []byte) error { + var w listInstancePoolsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listInstancePoolsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listInstancePoolsResponseWire struct { InstancePools []instancePoolAndStatsWire `json:"instance_pools,omitempty"` } @@ -1004,6 +1461,30 @@ func listInstancePoolsResponseFromWire(w *listInstancePoolsResponseWire) (*ListI }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListInstancePoolsResponse) MarshalJSON() ([]byte, error) { + w, err := listInstancePoolsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListInstancePoolsResponse) UnmarshalJSON(data []byte) error { + var w listInstancePoolsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listInstancePoolsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type nodeTypeFlexibilityWire struct { AlternateNodeTypeIds []string `json:"alternate_node_type_ids,omitempty"` AwsContextId *string `json:"aws_context_id,omitempty"` @@ -1029,6 +1510,30 @@ func nodeTypeFlexibilityFromWire(w *nodeTypeFlexibilityWire) (*NodeTypeFlexibili }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NodeTypeFlexibility) MarshalJSON() ([]byte, error) { + w, err := nodeTypeFlexibilityToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NodeTypeFlexibility) UnmarshalJSON(data []byte) error { + var w nodeTypeFlexibilityWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := nodeTypeFlexibilityFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pendingInstanceErrorWire struct { InstanceId *string `json:"instance_id,omitempty"` Message *string `json:"message,omitempty"` @@ -1054,6 +1559,30 @@ func pendingInstanceErrorFromWire(w *pendingInstanceErrorWire) (*PendingInstance }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PendingInstanceError) MarshalJSON() ([]byte, error) { + w, err := pendingInstanceErrorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PendingInstanceError) UnmarshalJSON(data []byte) error { + var w pendingInstanceErrorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pendingInstanceErrorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/instanceprofiles/CHANGELOG.md b/instanceprofiles/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/instanceprofiles/CHANGELOG.md +++ b/instanceprofiles/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/instanceprofiles/internal/version.go b/instanceprofiles/internal/version.go index c94881b5..1a571a74 100644 --- a/instanceprofiles/internal/version.go +++ b/instanceprofiles/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-instanceprofiles" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/instanceprofiles/v2/wire.go b/instanceprofiles/v2/wire.go index feb801db..34d9a5b3 100644 --- a/instanceprofiles/v2/wire.go +++ b/instanceprofiles/v2/wire.go @@ -3,6 +3,7 @@ package instanceprofiles import ( + "encoding/json" "fmt" ) @@ -37,6 +38,30 @@ func addInstanceProfileRequestFromWire(w *addInstanceProfileRequestWire) (*AddIn }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AddInstanceProfileRequest) MarshalJSON() ([]byte, error) { + w, err := addInstanceProfileRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AddInstanceProfileRequest) UnmarshalJSON(data []byte) error { + var w addInstanceProfileRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := addInstanceProfileRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type addInstanceProfileResponseWire struct { } @@ -54,6 +79,30 @@ func addInstanceProfileResponseFromWire(w *addInstanceProfileResponseWire) (*Add return &AddInstanceProfileResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AddInstanceProfileResponse) MarshalJSON() ([]byte, error) { + w, err := addInstanceProfileResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AddInstanceProfileResponse) UnmarshalJSON(data []byte) error { + var w addInstanceProfileResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := addInstanceProfileResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type editInstanceProfileRequestWire struct { InstanceProfileArn *string `json:"instance_profile_arn,omitempty"` IsMetaInstanceProfile *bool `json:"is_meta_instance_profile,omitempty"` @@ -82,6 +131,30 @@ func editInstanceProfileRequestFromWire(w *editInstanceProfileRequestWire) (*Edi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EditInstanceProfileRequest) MarshalJSON() ([]byte, error) { + w, err := editInstanceProfileRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EditInstanceProfileRequest) UnmarshalJSON(data []byte) error { + var w editInstanceProfileRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := editInstanceProfileRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type editInstanceProfileResponseWire struct { } @@ -99,6 +172,30 @@ func editInstanceProfileResponseFromWire(w *editInstanceProfileResponseWire) (*E return &EditInstanceProfileResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EditInstanceProfileResponse) MarshalJSON() ([]byte, error) { + w, err := editInstanceProfileResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EditInstanceProfileResponse) UnmarshalJSON(data []byte) error { + var w editInstanceProfileResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := editInstanceProfileResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type instanceProfileWire struct { InstanceProfileArn *string `json:"instance_profile_arn,omitempty"` IsMetaInstanceProfile *bool `json:"is_meta_instance_profile,omitempty"` @@ -127,6 +224,30 @@ func instanceProfileFromWire(w *instanceProfileWire) (*InstanceProfile, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InstanceProfile) MarshalJSON() ([]byte, error) { + w, err := instanceProfileToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InstanceProfile) UnmarshalJSON(data []byte) error { + var w instanceProfileWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := instanceProfileFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listInstanceProfilesRequestWire struct { } @@ -144,6 +265,30 @@ func listInstanceProfilesRequestFromWire(w *listInstanceProfilesRequestWire) (*L return &ListInstanceProfilesRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListInstanceProfilesRequest) MarshalJSON() ([]byte, error) { + w, err := listInstanceProfilesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListInstanceProfilesRequest) UnmarshalJSON(data []byte) error { + var w listInstanceProfilesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listInstanceProfilesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listInstanceProfilesResponseWire struct { InstanceProfiles []instanceProfileWire `json:"instance_profiles,omitempty"` } @@ -174,6 +319,30 @@ func listInstanceProfilesResponseFromWire(w *listInstanceProfilesResponseWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListInstanceProfilesResponse) MarshalJSON() ([]byte, error) { + w, err := listInstanceProfilesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListInstanceProfilesResponse) UnmarshalJSON(data []byte) error { + var w listInstanceProfilesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listInstanceProfilesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type removeInstanceProfileRequestWire struct { InstanceProfileArn *string `json:"instance_profile_arn,omitempty"` } @@ -196,6 +365,30 @@ func removeInstanceProfileRequestFromWire(w *removeInstanceProfileRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RemoveInstanceProfileRequest) MarshalJSON() ([]byte, error) { + w, err := removeInstanceProfileRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RemoveInstanceProfileRequest) UnmarshalJSON(data []byte) error { + var w removeInstanceProfileRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := removeInstanceProfileRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type removeInstanceProfileResponseWire struct { } @@ -213,6 +406,30 @@ func removeInstanceProfileResponseFromWire(w *removeInstanceProfileResponseWire) return &RemoveInstanceProfileResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RemoveInstanceProfileResponse) MarshalJSON() ([]byte, error) { + w, err := removeInstanceProfileResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RemoveInstanceProfileResponse) UnmarshalJSON(data []byte) error { + var w removeInstanceProfileResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := removeInstanceProfileResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/jobs/CHANGELOG.md b/jobs/CHANGELOG.md index b6733313..a1c39425 100644 --- a/jobs/CHANGELOG.md +++ b/jobs/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.13.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.12.0 (2026-11-11) ## Release v0.11.0 (2026-11-10) diff --git a/jobs/internal/version.go b/jobs/internal/version.go index 569ae73d..8e878317 100644 --- a/jobs/internal/version.go +++ b/jobs/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-jobs" -const Version = "0.12.0" +const Version = "0.13.0" diff --git a/jobs/v2/wire.go b/jobs/v2/wire.go index 1211f6a5..fb3781dc 100644 --- a/jobs/v2/wire.go +++ b/jobs/v2/wire.go @@ -125,6 +125,30 @@ func accessControlRequestFromWire(w *accessControlRequestWire) (*AccessControlRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccessControlRequest) MarshalJSON() ([]byte, error) { + w, err := accessControlRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccessControlRequest) UnmarshalJSON(data []byte) error { + var w accessControlRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accessControlRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type adlsgen2InfoWire struct { Destination *string `json:"destination,omitempty"` } @@ -147,6 +171,30 @@ func adlsgen2InfoFromWire(w *adlsgen2InfoWire) (*Adlsgen2Info, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Adlsgen2Info) MarshalJSON() ([]byte, error) { + w, err := adlsgen2InfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Adlsgen2Info) UnmarshalJSON(data []byte) error { + var w adlsgen2InfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := adlsgen2InfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiClassifyFunctionWire struct { InlineLabels *aiClassifyFunction_InlineLabelsWire `json:"inline_labels,omitempty"` Instructions *string `json:"instructions,omitempty"` @@ -214,6 +262,30 @@ func aiClassifyFunctionFromWire(w *aiClassifyFunctionWire) (*AiClassifyFunction, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiClassifyFunction) MarshalJSON() ([]byte, error) { + w, err := aiClassifyFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiClassifyFunction) UnmarshalJSON(data []byte) error { + var w aiClassifyFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiClassifyFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiClassifyFunction_InlineLabelsWire struct { Labels []aiClassifyFunction_LabelWire `json:"labels,omitempty"` } @@ -244,6 +316,30 @@ func aiClassifyFunction_InlineLabelsFromWire(w *aiClassifyFunction_InlineLabelsW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiClassifyFunction_InlineLabels) MarshalJSON() ([]byte, error) { + w, err := aiClassifyFunction_InlineLabelsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiClassifyFunction_InlineLabels) UnmarshalJSON(data []byte) error { + var w aiClassifyFunction_InlineLabelsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiClassifyFunction_InlineLabelsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiClassifyFunction_LabelWire struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` @@ -269,6 +365,30 @@ func aiClassifyFunction_LabelFromWire(w *aiClassifyFunction_LabelWire) (*AiClass }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiClassifyFunction_Label) MarshalJSON() ([]byte, error) { + w, err := aiClassifyFunction_LabelToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiClassifyFunction_Label) UnmarshalJSON(data []byte) error { + var w aiClassifyFunction_LabelWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiClassifyFunction_LabelFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiExtractFunctionWire struct { Schema *string `json:"schema,omitempty"` Instructions *string `json:"instructions,omitempty"` @@ -306,6 +426,30 @@ func aiExtractFunctionFromWire(w *aiExtractFunctionWire) (*AiExtractFunction, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiExtractFunction) MarshalJSON() ([]byte, error) { + w, err := aiExtractFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiExtractFunction) UnmarshalJSON(data []byte) error { + var w aiExtractFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiExtractFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiFunctionTaskWire struct { DeltaTable *deltaTableSourceWire `json:"delta_table,omitempty"` Volume *volumeSourceWire `json:"volume,omitempty"` @@ -462,6 +606,30 @@ func aiFunctionTaskFromWire(w *aiFunctionTaskWire) (*AiFunctionTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiFunctionTask) MarshalJSON() ([]byte, error) { + w, err := aiFunctionTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiFunctionTask) UnmarshalJSON(data []byte) error { + var w aiFunctionTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiFunctionTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiFunctionTaskOutputWire struct { TotalRowCount *wireInt64 `json:"total_row_count,omitempty"` SucceededRowCount *wireInt64 `json:"succeeded_row_count,omitempty"` @@ -528,6 +696,30 @@ func aiFunctionTaskOutputFromWire(w *aiFunctionTaskOutputWire) (*AiFunctionTaskO }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiFunctionTaskOutput) MarshalJSON() ([]byte, error) { + w, err := aiFunctionTaskOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiFunctionTaskOutput) UnmarshalJSON(data []byte) error { + var w aiFunctionTaskOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiFunctionTaskOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiParseDocumentFunctionWire struct { Version *string `json:"version,omitempty"` DescriptionElementTypes []AiParseDocumentFunction_DescriptionElementType `json:"description_element_types,omitempty"` @@ -559,6 +751,30 @@ func aiParseDocumentFunctionFromWire(w *aiParseDocumentFunctionWire) (*AiParseDo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiParseDocumentFunction) MarshalJSON() ([]byte, error) { + w, err := aiParseDocumentFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiParseDocumentFunction) UnmarshalJSON(data []byte) error { + var w aiParseDocumentFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiParseDocumentFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiRuntimeTaskWire struct { Experiment *string `json:"experiment,omitempty"` Deployments []deploymentSpecWire `json:"deployments,omitempty"` @@ -613,6 +829,30 @@ func aiRuntimeTaskFromWire(w *aiRuntimeTaskWire) (*AiRuntimeTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiRuntimeTask) MarshalJSON() ([]byte, error) { + w, err := aiRuntimeTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiRuntimeTask) UnmarshalJSON(data []byte) error { + var w aiRuntimeTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiRuntimeTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiRuntimeTaskOutputWire struct { MlflowExperimentId *string `json:"mlflow_experiment_id,omitempty"` MlflowRunId *string `json:"mlflow_run_id,omitempty"` @@ -641,6 +881,30 @@ func aiRuntimeTaskOutputFromWire(w *aiRuntimeTaskOutputWire) (*AiRuntimeTaskOutp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiRuntimeTaskOutput) MarshalJSON() ([]byte, error) { + w, err := aiRuntimeTaskOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiRuntimeTaskOutput) UnmarshalJSON(data []byte) error { + var w aiRuntimeTaskOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiRuntimeTaskOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertEvaluationStateWire struct { } @@ -658,6 +922,30 @@ func alertEvaluationStateFromWire(w *alertEvaluationStateWire) (*AlertEvaluation return &AlertEvaluationState{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertEvaluationState) MarshalJSON() ([]byte, error) { + w, err := alertEvaluationStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertEvaluationState) UnmarshalJSON(data []byte) error { + var w alertEvaluationStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertEvaluationStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertTaskWire struct { AlertId *string `json:"alert_id,omitempty"` WarehouseId *string `json:"warehouse_id,omitempty"` @@ -700,6 +988,30 @@ func alertTaskFromWire(w *alertTaskWire) (*AlertTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertTask) MarshalJSON() ([]byte, error) { + w, err := alertTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertTask) UnmarshalJSON(data []byte) error { + var w alertTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertTaskOutputWire struct { AlertState AlertEvaluationState_AlertEvaluationState `json:"alert_state,omitempty"` } @@ -722,6 +1034,30 @@ func alertTaskOutputFromWire(w *alertTaskOutputWire) (*AlertTaskOutput, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertTaskOutput) MarshalJSON() ([]byte, error) { + w, err := alertTaskOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertTaskOutput) UnmarshalJSON(data []byte) error { + var w alertTaskOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertTaskOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type alertTaskSubscriberWire struct { UserName *string `json:"user_name,omitempty"` DestinationId *string `json:"destination_id,omitempty"` @@ -778,6 +1114,30 @@ func alertTaskSubscriberFromWire(w *alertTaskSubscriberWire) (*AlertTaskSubscrib }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertTaskSubscriber) MarshalJSON() ([]byte, error) { + w, err := alertTaskSubscriberToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertTaskSubscriber) UnmarshalJSON(data []byte) error { + var w alertTaskSubscriberWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertTaskSubscriberFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type autoScaleWire struct { MinWorkers *int `json:"min_workers,omitempty"` MaxWorkers *int `json:"max_workers,omitempty"` @@ -803,6 +1163,30 @@ func autoScaleFromWire(w *autoScaleWire) (*AutoScale, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AutoScale) MarshalJSON() ([]byte, error) { + w, err := autoScaleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AutoScale) UnmarshalJSON(data []byte) error { + var w autoScaleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := autoScaleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type awsAttributesWire struct { FirstOnDemand *int `json:"first_on_demand,omitempty"` Availability AwsAvailability `json:"availability,omitempty"` @@ -852,6 +1236,30 @@ func awsAttributesFromWire(w *awsAttributesWire) (*AwsAttributes, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AwsAttributes) MarshalJSON() ([]byte, error) { + w, err := awsAttributesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AwsAttributes) UnmarshalJSON(data []byte) error { + var w awsAttributesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := awsAttributesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type azureAttributesWire struct { LogAnalyticsInfo *logAnalyticsInfoWire `json:"log_analytics_info,omitempty"` FirstOnDemand *int `json:"first_on_demand,omitempty"` @@ -894,6 +1302,30 @@ func azureAttributesFromWire(w *azureAttributesWire) (*AzureAttributes, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AzureAttributes) MarshalJSON() ([]byte, error) { + w, err := azureAttributesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AzureAttributes) UnmarshalJSON(data []byte) error { + var w azureAttributesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := azureAttributesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type baseJobWire struct { JobId *wireInt64 `json:"job_id,omitempty"` CreatorUserName *string `json:"creator_user_name,omitempty"` @@ -983,6 +1415,30 @@ func baseJobFromWire(w *baseJobWire) (*BaseJob, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BaseJob) MarshalJSON() ([]byte, error) { + w, err := baseJobToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BaseJob) UnmarshalJSON(data []byte) error { + var w baseJobWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := baseJobFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type baseRunWire struct { JobId *wireInt64 `json:"job_id,omitempty"` RunId *wireInt64 `json:"run_id,omitempty"` @@ -1316,6 +1772,30 @@ func baseRunFromWire(w *baseRunWire) (*BaseRun, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BaseRun) MarshalJSON() ([]byte, error) { + w, err := baseRunToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BaseRun) UnmarshalJSON(data []byte) error { + var w baseRunWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := baseRunFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cancelAllRunsRequestWire struct { JobId *wireInt64 `json:"job_id,omitempty"` AllQueuedRuns *bool `json:"all_queued_runs,omitempty"` @@ -1349,6 +1829,30 @@ func cancelAllRunsRequestFromWire(w *cancelAllRunsRequestWire) (*CancelAllRunsRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelAllRunsRequest) MarshalJSON() ([]byte, error) { + w, err := cancelAllRunsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelAllRunsRequest) UnmarshalJSON(data []byte) error { + var w cancelAllRunsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelAllRunsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cancelAllRunsResponseWire struct { } @@ -1366,8 +1870,32 @@ func cancelAllRunsResponseFromWire(w *cancelAllRunsResponseWire) (*CancelAllRuns return &CancelAllRunsResponse{}, nil } -type cancelRunRequestWire struct { - RunId *wireInt64 `json:"run_id,omitempty"` +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelAllRunsResponse) MarshalJSON() ([]byte, error) { + w, err := cancelAllRunsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelAllRunsResponse) UnmarshalJSON(data []byte) error { + var w cancelAllRunsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelAllRunsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type cancelRunRequestWire struct { + RunId *wireInt64 `json:"run_id,omitempty"` } func cancelRunRequestToWire(v *CancelRunRequest) (*cancelRunRequestWire, error) { @@ -1396,6 +1924,30 @@ func cancelRunRequestFromWire(w *cancelRunRequestWire) (*CancelRunRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelRunRequest) MarshalJSON() ([]byte, error) { + w, err := cancelRunRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelRunRequest) UnmarshalJSON(data []byte) error { + var w cancelRunRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelRunRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cancelRunResponseWire struct { } @@ -1413,6 +1965,30 @@ func cancelRunResponseFromWire(w *cancelRunResponseWire) (*CancelRunResponse, er return &CancelRunResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelRunResponse) MarshalJSON() ([]byte, error) { + w, err := cancelRunResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelRunResponse) UnmarshalJSON(data []byte) error { + var w cancelRunResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelRunResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomTaskRunLifeCycleStateWire struct { } @@ -1430,6 +2006,30 @@ func cleanRoomTaskRunLifeCycleStateFromWire(w *cleanRoomTaskRunLifeCycleStateWir return &CleanRoomTaskRunLifeCycleState{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomTaskRunLifeCycleState) MarshalJSON() ([]byte, error) { + w, err := cleanRoomTaskRunLifeCycleStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomTaskRunLifeCycleState) UnmarshalJSON(data []byte) error { + var w cleanRoomTaskRunLifeCycleStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomTaskRunLifeCycleStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomTaskRunResultStateWire struct { } @@ -1447,6 +2047,30 @@ func cleanRoomTaskRunResultStateFromWire(w *cleanRoomTaskRunResultStateWire) (*C return &CleanRoomTaskRunResultState{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomTaskRunResultState) MarshalJSON() ([]byte, error) { + w, err := cleanRoomTaskRunResultStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomTaskRunResultState) UnmarshalJSON(data []byte) error { + var w cleanRoomTaskRunResultStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomTaskRunResultStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomTaskRunStateWire struct { LifeCycleState CleanRoomTaskRunLifeCycleState_CleanRoomTaskRunLifeCycleState `json:"life_cycle_state,omitempty"` ResultState CleanRoomTaskRunResultState_CleanRoomTaskRunResultState `json:"result_state,omitempty"` @@ -1472,6 +2096,30 @@ func cleanRoomTaskRunStateFromWire(w *cleanRoomTaskRunStateWire) (*CleanRoomTask }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomTaskRunState) MarshalJSON() ([]byte, error) { + w, err := cleanRoomTaskRunStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomTaskRunState) UnmarshalJSON(data []byte) error { + var w cleanRoomTaskRunStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomTaskRunStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomsNotebookTaskWire struct { CleanRoomName *string `json:"clean_room_name,omitempty"` NotebookName *string `json:"notebook_name,omitempty"` @@ -1503,6 +2151,30 @@ func cleanRoomsNotebookTaskFromWire(w *cleanRoomsNotebookTaskWire) (*CleanRoomsN }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomsNotebookTask) MarshalJSON() ([]byte, error) { + w, err := cleanRoomsNotebookTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomsNotebookTask) UnmarshalJSON(data []byte) error { + var w cleanRoomsNotebookTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomsNotebookTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cleanRoomsNotebookTask_CleanRoomsNotebookTaskOutputWire struct { CleanRoomJobRunState *cleanRoomTaskRunStateWire `json:"clean_room_job_run_state,omitempty"` NotebookOutput *notebookTask_NotebookOutputWire `json:"notebook_output,omitempty"` @@ -1555,6 +2227,30 @@ func cleanRoomsNotebookTask_CleanRoomsNotebookTaskOutputFromWire(w *cleanRoomsNo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CleanRoomsNotebookTask_CleanRoomsNotebookTaskOutput) MarshalJSON() ([]byte, error) { + w, err := cleanRoomsNotebookTask_CleanRoomsNotebookTaskOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CleanRoomsNotebookTask_CleanRoomsNotebookTaskOutput) UnmarshalJSON(data []byte) error { + var w cleanRoomsNotebookTask_CleanRoomsNotebookTaskOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cleanRoomsNotebookTask_CleanRoomsNotebookTaskOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterInstanceWire struct { ClusterId *string `json:"cluster_id,omitempty"` SparkContextId *string `json:"spark_context_id,omitempty"` @@ -1580,6 +2276,30 @@ func clusterInstanceFromWire(w *clusterInstanceWire) (*ClusterInstance, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterInstance) MarshalJSON() ([]byte, error) { + w, err := clusterInstanceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterInstance) UnmarshalJSON(data []byte) error { + var w clusterInstanceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterInstanceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterLogConfWire struct { Dbfs *dbfsStorageInfoWire `json:"dbfs,omitempty"` S3 *s3StorageInfoWire `json:"s3,omitempty"` @@ -1672,6 +2392,30 @@ func clusterLogConfFromWire(w *clusterLogConfWire) (*ClusterLogConf, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterLogConf) MarshalJSON() ([]byte, error) { + w, err := clusterLogConfToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterLogConf) UnmarshalJSON(data []byte) error { + var w clusterLogConfWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterLogConfFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterSpecWire struct { ExistingClusterId *string `json:"existing_cluster_id,omitempty"` NewCluster *clusterSpec_NewClusterWire `json:"new_cluster,omitempty"` @@ -1759,6 +2503,30 @@ func clusterSpecFromWire(w *clusterSpecWire) (*ClusterSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterSpec) MarshalJSON() ([]byte, error) { + w, err := clusterSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterSpec) UnmarshalJSON(data []byte) error { + var w clusterSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterSpec_NewClusterWire struct { ApplyPolicyDefaultValues *bool `json:"apply_policy_default_values,omitempty"` ClusterName *string `json:"cluster_name,omitempty"` @@ -1994,6 +2762,30 @@ func clusterSpec_NewClusterFromWire(w *clusterSpec_NewClusterWire) (*ClusterSpec }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterSpec_NewCluster) MarshalJSON() ([]byte, error) { + w, err := clusterSpec_NewClusterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterSpec_NewCluster) UnmarshalJSON(data []byte) error { + var w clusterSpec_NewClusterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterSpec_NewClusterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type completedJobWire struct { WorkspaceId *string `json:"workspace_id,omitempty"` JobId *string `json:"job_id,omitempty"` @@ -2028,6 +2820,30 @@ func completedJobFromWire(w *completedJobWire) (*CompletedJob, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CompletedJob) MarshalJSON() ([]byte, error) { + w, err := completedJobToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CompletedJob) UnmarshalJSON(data []byte) error { + var w completedJobWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := completedJobFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type computeWire struct { HardwareAccelerator HardwareAcceleratorType `json:"hardware_accelerator,omitempty"` } @@ -2050,6 +2866,30 @@ func computeFromWire(w *computeWire) (*Compute, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Compute) MarshalJSON() ([]byte, error) { + w, err := computeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Compute) UnmarshalJSON(data []byte) error { + var w computeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := computeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type computeConfigWire struct { NumGpus *int `json:"num_gpus,omitempty"` GpuNodePoolId *string `json:"gpu_node_pool_id,omitempty"` @@ -2078,6 +2918,30 @@ func computeConfigFromWire(w *computeConfigWire) (*ComputeConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ComputeConfig) MarshalJSON() ([]byte, error) { + w, err := computeConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ComputeConfig) UnmarshalJSON(data []byte) error { + var w computeConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := computeConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type computeSpecWire struct { AcceleratorType ComputeSpec_AcceleratorType `json:"accelerator_type,omitempty"` AcceleratorCount *int `json:"accelerator_count,omitempty"` @@ -2106,6 +2970,30 @@ func computeSpecFromWire(w *computeSpecWire) (*ComputeSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ComputeSpec) MarshalJSON() ([]byte, error) { + w, err := computeSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ComputeSpec) UnmarshalJSON(data []byte) error { + var w computeSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := computeSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type conditionTaskWire struct { Op ConditionTask_ConditionTaskOperator `json:"op,omitempty"` Left *string `json:"left,omitempty"` @@ -2137,6 +3025,30 @@ func conditionTaskFromWire(w *conditionTaskWire) (*ConditionTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ConditionTask) MarshalJSON() ([]byte, error) { + w, err := conditionTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ConditionTask) UnmarshalJSON(data []byte) error { + var w conditionTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := conditionTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type continuousSettingsWire struct { PauseStatus SchedulePauseStatus `json:"pause_status,omitempty"` TaskRetryMode TaskRetryMode `json:"task_retry_mode,omitempty"` @@ -2173,6 +3085,30 @@ func continuousSettingsFromWire(w *continuousSettingsWire) (*ContinuousSettings, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ContinuousSettings) MarshalJSON() ([]byte, error) { + w, err := continuousSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ContinuousSettings) UnmarshalJSON(data []byte) error { + var w continuousSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := continuousSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type continuousTriggerConfigurationWire struct { TaskRetryMode TaskRetryMode `json:"task_retry_mode,omitempty"` MaintenanceWindow *maintenanceWindowWire `json:"maintenance_window,omitempty"` @@ -2206,6 +3142,30 @@ func continuousTriggerConfigurationFromWire(w *continuousTriggerConfigurationWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ContinuousTriggerConfiguration) MarshalJSON() ([]byte, error) { + w, err := continuousTriggerConfigurationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ContinuousTriggerConfiguration) UnmarshalJSON(data []byte) error { + var w continuousTriggerConfigurationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := continuousTriggerConfigurationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type continuousTriggerStateWire struct { ConsecutiveFailures *int `json:"consecutive_failures,omitempty"` NextAttemptMs *wireInt64 `json:"next_attempt_ms,omitempty"` @@ -2242,6 +3202,30 @@ func continuousTriggerStateFromWire(w *continuousTriggerStateWire) (*ContinuousT }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ContinuousTriggerState) MarshalJSON() ([]byte, error) { + w, err := continuousTriggerStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ContinuousTriggerState) UnmarshalJSON(data []byte) error { + var w continuousTriggerStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := continuousTriggerStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createJobRequestWire struct { AccessControlList []accessControlRequestWire `json:"access_control_list,omitempty"` Name *string `json:"name,omitempty"` @@ -2507,6 +3491,30 @@ func createJobRequestFromWire(w *createJobRequestWire) (*CreateJobRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateJobRequest) MarshalJSON() ([]byte, error) { + w, err := createJobRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateJobRequest) UnmarshalJSON(data []byte) error { + var w createJobRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createJobRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createJobResponseWire struct { JobId *wireInt64 `json:"job_id,omitempty"` } @@ -2537,10 +3545,34 @@ func createJobResponseFromWire(w *createJobResponseWire) (*CreateJobResponse, er }, nil } -type cronScheduleWire struct { - QuartzCronExpression *string `json:"quartz_cron_expression,omitempty"` - TimezoneId *string `json:"timezone_id,omitempty"` - PauseStatus SchedulePauseStatus `json:"pause_status,omitempty"` +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateJobResponse) MarshalJSON() ([]byte, error) { + w, err := createJobResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateJobResponse) UnmarshalJSON(data []byte) error { + var w createJobResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createJobResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type cronScheduleWire struct { + QuartzCronExpression *string `json:"quartz_cron_expression,omitempty"` + TimezoneId *string `json:"timezone_id,omitempty"` + PauseStatus SchedulePauseStatus `json:"pause_status,omitempty"` SqlCondition *sqlConditionConfigurationWire `json:"sql_condition,omitempty"` } @@ -2576,6 +3608,30 @@ func cronScheduleFromWire(w *cronScheduleWire) (*CronSchedule, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CronSchedule) MarshalJSON() ([]byte, error) { + w, err := cronScheduleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CronSchedule) UnmarshalJSON(data []byte) error { + var w cronScheduleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cronScheduleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cronTriggerConfigurationWire struct { QuartzCronExpression *string `json:"quartz_cron_expression,omitempty"` TimezoneId *string `json:"timezone_id,omitempty"` @@ -2601,6 +3657,30 @@ func cronTriggerConfigurationFromWire(w *cronTriggerConfigurationWire) (*CronTri }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CronTriggerConfiguration) MarshalJSON() ([]byte, error) { + w, err := cronTriggerConfigurationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CronTriggerConfiguration) UnmarshalJSON(data []byte) error { + var w cronTriggerConfigurationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cronTriggerConfigurationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dashboardPageSnapshotWire struct { PageDisplayName *string `json:"page_display_name,omitempty"` WidgetErrorDetails []widgetErrorDetailWire `json:"widget_error_details,omitempty"` @@ -2634,6 +3714,30 @@ func dashboardPageSnapshotFromWire(w *dashboardPageSnapshotWire) (*DashboardPage }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DashboardPageSnapshot) MarshalJSON() ([]byte, error) { + w, err := dashboardPageSnapshotToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DashboardPageSnapshot) UnmarshalJSON(data []byte) error { + var w dashboardPageSnapshotWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dashboardPageSnapshotFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dashboardTaskWire struct { Subscription *subscriptionWire `json:"subscription,omitempty"` WarehouseId *string `json:"warehouse_id,omitempty"` @@ -2673,6 +3777,30 @@ func dashboardTaskFromWire(w *dashboardTaskWire) (*DashboardTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DashboardTask) MarshalJSON() ([]byte, error) { + w, err := dashboardTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DashboardTask) UnmarshalJSON(data []byte) error { + var w dashboardTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dashboardTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dashboardTaskOutputWire struct { PageSnapshots []dashboardPageSnapshotWire `json:"page_snapshots,omitempty"` } @@ -2703,6 +3831,30 @@ func dashboardTaskOutputFromWire(w *dashboardTaskOutputWire) (*DashboardTaskOutp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DashboardTaskOutput) MarshalJSON() ([]byte, error) { + w, err := dashboardTaskOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DashboardTaskOutput) UnmarshalJSON(data []byte) error { + var w dashboardTaskOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dashboardTaskOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dbfsStorageInfoWire struct { Destination *string `json:"destination,omitempty"` } @@ -2725,6 +3877,30 @@ func dbfsStorageInfoFromWire(w *dbfsStorageInfoWire) (*DbfsStorageInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DbfsStorageInfo) MarshalJSON() ([]byte, error) { + w, err := dbfsStorageInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DbfsStorageInfo) UnmarshalJSON(data []byte) error { + var w dbfsStorageInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dbfsStorageInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dbtCloudJobRunStepWire struct { Index *int `json:"index,omitempty"` Name *string `json:"name,omitempty"` @@ -2756,6 +3932,30 @@ func dbtCloudJobRunStepFromWire(w *dbtCloudJobRunStepWire) (*DbtCloudJobRunStep, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DbtCloudJobRunStep) MarshalJSON() ([]byte, error) { + w, err := dbtCloudJobRunStepToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DbtCloudJobRunStep) UnmarshalJSON(data []byte) error { + var w dbtCloudJobRunStepWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dbtCloudJobRunStepFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dbtCloudTaskWire struct { DbtCloudJobId *wireInt64 `json:"dbt_cloud_job_id,omitempty"` ConnectionResourceName *string `json:"connection_resource_name,omitempty"` @@ -2789,6 +3989,30 @@ func dbtCloudTaskFromWire(w *dbtCloudTaskWire) (*DbtCloudTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DbtCloudTask) MarshalJSON() ([]byte, error) { + w, err := dbtCloudTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DbtCloudTask) UnmarshalJSON(data []byte) error { + var w dbtCloudTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dbtCloudTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dbtCloudTaskOutputWire struct { DbtCloudJobRunId *wireInt64 `json:"dbt_cloud_job_run_id,omitempty"` DbtCloudJobRunUrl *string `json:"dbt_cloud_job_run_url,omitempty"` @@ -2833,6 +4057,30 @@ func dbtCloudTaskOutputFromWire(w *dbtCloudTaskOutputWire) (*DbtCloudTaskOutput, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DbtCloudTaskOutput) MarshalJSON() ([]byte, error) { + w, err := dbtCloudTaskOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DbtCloudTaskOutput) UnmarshalJSON(data []byte) error { + var w dbtCloudTaskOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dbtCloudTaskOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dbtPlatformJobRunStepWire struct { Index *int `json:"index,omitempty"` Name *string `json:"name,omitempty"` @@ -2870,6 +4118,30 @@ func dbtPlatformJobRunStepFromWire(w *dbtPlatformJobRunStepWire) (*DbtPlatformJo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DbtPlatformJobRunStep) MarshalJSON() ([]byte, error) { + w, err := dbtPlatformJobRunStepToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DbtPlatformJobRunStep) UnmarshalJSON(data []byte) error { + var w dbtPlatformJobRunStepWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dbtPlatformJobRunStepFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dbtPlatformTaskWire struct { DbtPlatformJobId *string `json:"dbt_platform_job_id,omitempty"` ConnectionResourceName *string `json:"connection_resource_name,omitempty"` @@ -2895,6 +4167,30 @@ func dbtPlatformTaskFromWire(w *dbtPlatformTaskWire) (*DbtPlatformTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DbtPlatformTask) MarshalJSON() ([]byte, error) { + w, err := dbtPlatformTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DbtPlatformTask) UnmarshalJSON(data []byte) error { + var w dbtPlatformTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dbtPlatformTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dbtPlatformTaskOutputWire struct { DbtPlatformJobRunId *string `json:"dbt_platform_job_run_id,omitempty"` DbtPlatformJobRunUrl *string `json:"dbt_platform_job_run_url,omitempty"` @@ -2934,6 +4230,30 @@ func dbtPlatformTaskOutputFromWire(w *dbtPlatformTaskOutputWire) (*DbtPlatformTa }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DbtPlatformTaskOutput) MarshalJSON() ([]byte, error) { + w, err := dbtPlatformTaskOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DbtPlatformTaskOutput) UnmarshalJSON(data []byte) error { + var w dbtPlatformTaskOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dbtPlatformTaskOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dbtTaskWire struct { ProjectDirectory *string `json:"project_directory,omitempty"` Commands []string `json:"commands,omitempty"` @@ -2974,6 +4294,30 @@ func dbtTaskFromWire(w *dbtTaskWire) (*DbtTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DbtTask) MarshalJSON() ([]byte, error) { + w, err := dbtTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DbtTask) UnmarshalJSON(data []byte) error { + var w dbtTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dbtTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dbtTask_DbtTaskOutputWire struct { ArtifactsLink *string `json:"artifacts_link,omitempty"` ArtifactsHeaders map[string]string `json:"artifacts_headers,omitempty"` @@ -2999,6 +4343,30 @@ func dbtTask_DbtTaskOutputFromWire(w *dbtTask_DbtTaskOutputWire) (*DbtTask_DbtTa }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DbtTask_DbtTaskOutput) MarshalJSON() ([]byte, error) { + w, err := dbtTask_DbtTaskOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DbtTask_DbtTaskOutput) UnmarshalJSON(data []byte) error { + var w dbtTask_DbtTaskOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dbtTask_DbtTaskOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteJobRequestWire struct { JobId *wireInt64 `json:"job_id,omitempty"` } @@ -3029,6 +4397,30 @@ func deleteJobRequestFromWire(w *deleteJobRequestWire) (*DeleteJobRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteJobRequest) MarshalJSON() ([]byte, error) { + w, err := deleteJobRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteJobRequest) UnmarshalJSON(data []byte) error { + var w deleteJobRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteJobRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteJobResponseWire struct { } @@ -3046,6 +4438,30 @@ func deleteJobResponseFromWire(w *deleteJobResponseWire) (*DeleteJobResponse, er return &DeleteJobResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteJobResponse) MarshalJSON() ([]byte, error) { + w, err := deleteJobResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteJobResponse) UnmarshalJSON(data []byte) error { + var w deleteJobResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteJobResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRunRequestWire struct { RunId *wireInt64 `json:"run_id,omitempty"` } @@ -3076,6 +4492,30 @@ func deleteRunRequestFromWire(w *deleteRunRequestWire) (*DeleteRunRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRunRequest) MarshalJSON() ([]byte, error) { + w, err := deleteRunRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRunRequest) UnmarshalJSON(data []byte) error { + var w deleteRunRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRunRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRunResponseWire struct { } @@ -3093,6 +4533,30 @@ func deleteRunResponseFromWire(w *deleteRunResponseWire) (*DeleteRunResponse, er return &DeleteRunResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRunResponse) MarshalJSON() ([]byte, error) { + w, err := deleteRunResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRunResponse) UnmarshalJSON(data []byte) error { + var w deleteRunResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRunResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deltaTableSourceWire struct { TableName *string `json:"table_name,omitempty"` InputColumn *string `json:"input_column,omitempty"` @@ -3121,6 +4585,30 @@ func deltaTableSourceFromWire(w *deltaTableSourceWire) (*DeltaTableSource, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeltaTableSource) MarshalJSON() ([]byte, error) { + w, err := deltaTableSourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeltaTableSource) UnmarshalJSON(data []byte) error { + var w deltaTableSourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deltaTableSourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deploymentSpecWire struct { CommandPath *string `json:"command_path,omitempty"` Compute *computeSpecWire `json:"compute,omitempty"` @@ -3157,6 +4645,30 @@ func deploymentSpecFromWire(w *deploymentSpecWire) (*DeploymentSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeploymentSpec) MarshalJSON() ([]byte, error) { + w, err := deploymentSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeploymentSpec) UnmarshalJSON(data []byte) error { + var w deploymentSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deploymentSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dockerBasicAuthWire struct { Username *string `json:"username,omitempty"` Password *string `json:"password,omitempty"` @@ -3182,6 +4694,30 @@ func dockerBasicAuthFromWire(w *dockerBasicAuthWire) (*DockerBasicAuth, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DockerBasicAuth) MarshalJSON() ([]byte, error) { + w, err := dockerBasicAuthToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DockerBasicAuth) UnmarshalJSON(data []byte) error { + var w dockerBasicAuthWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dockerBasicAuthFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dockerImageWire struct { Url *string `json:"url,omitempty"` BasicAuth *dockerBasicAuthWire `json:"basic_auth,omitempty"` @@ -3237,6 +4773,30 @@ func dockerImageFromWire(w *dockerImageWire) (*DockerImage, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DockerImage) MarshalJSON() ([]byte, error) { + w, err := dockerImageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DockerImage) UnmarshalJSON(data []byte) error { + var w dockerImageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dockerImageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type enforcePolicyComplianceForJobWire struct { JobId *wireInt64 `json:"job_id,omitempty"` ValidateOnly *bool `json:"validate_only,omitempty"` @@ -3270,6 +4830,30 @@ func enforcePolicyComplianceForJobFromWire(w *enforcePolicyComplianceForJobWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EnforcePolicyComplianceForJob) MarshalJSON() ([]byte, error) { + w, err := enforcePolicyComplianceForJobToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EnforcePolicyComplianceForJob) UnmarshalJSON(data []byte) error { + var w enforcePolicyComplianceForJobWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := enforcePolicyComplianceForJobFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type enforcePolicyComplianceResponseWire struct { HasChanges *bool `json:"has_changes,omitempty"` JobClusterChanges []enforcePolicyComplianceResponse_JobClusterSettingsChangeWire `json:"job_cluster_changes,omitempty"` @@ -3314,6 +4898,30 @@ func enforcePolicyComplianceResponseFromWire(w *enforcePolicyComplianceResponseW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EnforcePolicyComplianceResponse) MarshalJSON() ([]byte, error) { + w, err := enforcePolicyComplianceResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EnforcePolicyComplianceResponse) UnmarshalJSON(data []byte) error { + var w enforcePolicyComplianceResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := enforcePolicyComplianceResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type enforcePolicyComplianceResponse_JobClusterSettingsChangeWire struct { Field *string `json:"field,omitempty"` PreviousValue *string `json:"previous_value,omitempty"` @@ -3342,6 +4950,30 @@ func enforcePolicyComplianceResponse_JobClusterSettingsChangeFromWire(w *enforce }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EnforcePolicyComplianceResponse_JobClusterSettingsChange) MarshalJSON() ([]byte, error) { + w, err := enforcePolicyComplianceResponse_JobClusterSettingsChangeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EnforcePolicyComplianceResponse_JobClusterSettingsChange) UnmarshalJSON(data []byte) error { + var w enforcePolicyComplianceResponse_JobClusterSettingsChangeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := enforcePolicyComplianceResponse_JobClusterSettingsChangeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type environmentWire struct { Client *string `json:"client,omitempty"` Dependencies []string `json:"dependencies,omitempty"` @@ -3379,6 +5011,30 @@ func environmentFromWire(w *environmentWire) (*Environment, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Environment) MarshalJSON() ([]byte, error) { + w, err := environmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Environment) UnmarshalJSON(data []byte) error { + var w environmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := environmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type exportRunRequestWire struct { RunId *wireInt64 `json:"run_id,omitempty"` ViewsToExport ViewsToExport `json:"views_to_export,omitempty"` @@ -3412,6 +5068,30 @@ func exportRunRequestFromWire(w *exportRunRequestWire) (*ExportRunRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExportRunRequest) MarshalJSON() ([]byte, error) { + w, err := exportRunRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExportRunRequest) UnmarshalJSON(data []byte) error { + var w exportRunRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := exportRunRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type exportRunResponseWire struct { Views []viewItemWire `json:"views,omitempty"` } @@ -3442,6 +5122,30 @@ func exportRunResponseFromWire(w *exportRunResponseWire) (*ExportRunResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExportRunResponse) MarshalJSON() ([]byte, error) { + w, err := exportRunResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExportRunResponse) UnmarshalJSON(data []byte) error { + var w exportRunResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := exportRunResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type fileArrivalTriggerConfigurationWire struct { Url *string `json:"url,omitempty"` MinTimeBetweenTriggersSeconds *int `json:"min_time_between_triggers_seconds,omitempty"` @@ -3470,6 +5174,30 @@ func fileArrivalTriggerConfigurationFromWire(w *fileArrivalTriggerConfigurationW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FileArrivalTriggerConfiguration) MarshalJSON() ([]byte, error) { + w, err := fileArrivalTriggerConfigurationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FileArrivalTriggerConfiguration) UnmarshalJSON(data []byte) error { + var w fileArrivalTriggerConfigurationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := fileArrivalTriggerConfigurationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type fileArrivalTriggerStateWire struct { UsingFileEvents *bool `json:"using_file_events,omitempty"` } @@ -3492,6 +5220,30 @@ func fileArrivalTriggerStateFromWire(w *fileArrivalTriggerStateWire) (*FileArriv }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FileArrivalTriggerState) MarshalJSON() ([]byte, error) { + w, err := fileArrivalTriggerStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FileArrivalTriggerState) UnmarshalJSON(data []byte) error { + var w fileArrivalTriggerStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := fileArrivalTriggerStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type forEachTaskWire struct { Inputs *string `json:"inputs,omitempty"` Concurrency *int `json:"concurrency,omitempty"` @@ -3528,6 +5280,30 @@ func forEachTaskFromWire(w *forEachTaskWire) (*ForEachTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ForEachTask) MarshalJSON() ([]byte, error) { + w, err := forEachTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ForEachTask) UnmarshalJSON(data []byte) error { + var w forEachTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := forEachTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gcpAttributesWire struct { UsePreemptibleExecutors *bool `json:"use_preemptible_executors,omitempty"` GoogleServiceAccount *string `json:"google_service_account,omitempty"` @@ -3571,6 +5347,30 @@ func gcpAttributesFromWire(w *gcpAttributesWire) (*GcpAttributes, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GcpAttributes) MarshalJSON() ([]byte, error) { + w, err := gcpAttributesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GcpAttributes) UnmarshalJSON(data []byte) error { + var w gcpAttributesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gcpAttributesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gcsStorageInfoWire struct { Destination *string `json:"destination,omitempty"` } @@ -3593,6 +5393,30 @@ func gcsStorageInfoFromWire(w *gcsStorageInfoWire) (*GcsStorageInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GcsStorageInfo) MarshalJSON() ([]byte, error) { + w, err := gcsStorageInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GcsStorageInfo) UnmarshalJSON(data []byte) error { + var w gcsStorageInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gcsStorageInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genAiComputeTaskWire struct { DlRuntimeImage *string `json:"dl_runtime_image,omitempty"` Compute *computeConfigWire `json:"compute,omitempty"` @@ -3644,6 +5468,30 @@ func genAiComputeTaskFromWire(w *genAiComputeTaskWire) (*GenAiComputeTask, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenAiComputeTask) MarshalJSON() ([]byte, error) { + w, err := genAiComputeTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenAiComputeTask) UnmarshalJSON(data []byte) error { + var w genAiComputeTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genAiComputeTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getJobRequestWire struct { JobId *wireInt64 `json:"job_id,omitempty"` IncludeTriggerState *bool `json:"include_trigger_state,omitempty"` @@ -3680,6 +5528,30 @@ func getJobRequestFromWire(w *getJobRequestWire) (*GetJobRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetJobRequest) MarshalJSON() ([]byte, error) { + w, err := getJobRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetJobRequest) UnmarshalJSON(data []byte) error { + var w getJobRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getJobRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getJobResponseWire struct { NextPageToken *string `json:"next_page_token,omitempty"` JobId *wireInt64 `json:"job_id,omitempty"` @@ -3772,6 +5644,30 @@ func getJobResponseFromWire(w *getJobResponseWire) (*GetJobResponse, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetJobResponse) MarshalJSON() ([]byte, error) { + w, err := getJobResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetJobResponse) UnmarshalJSON(data []byte) error { + var w getJobResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getJobResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPolicyComplianceForJobRequestWire struct { JobId *wireInt64 `json:"job_id,omitempty"` } @@ -3802,6 +5698,30 @@ func getPolicyComplianceForJobRequestFromWire(w *getPolicyComplianceForJobReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPolicyComplianceForJobRequest) MarshalJSON() ([]byte, error) { + w, err := getPolicyComplianceForJobRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPolicyComplianceForJobRequest) UnmarshalJSON(data []byte) error { + var w getPolicyComplianceForJobRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPolicyComplianceForJobRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPolicyComplianceForJobResponseWire struct { IsCompliant *bool `json:"is_compliant,omitempty"` Violations map[string]string `json:"violations,omitempty"` @@ -3827,6 +5747,30 @@ func getPolicyComplianceForJobResponseFromWire(w *getPolicyComplianceForJobRespo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPolicyComplianceForJobResponse) MarshalJSON() ([]byte, error) { + w, err := getPolicyComplianceForJobResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPolicyComplianceForJobResponse) UnmarshalJSON(data []byte) error { + var w getPolicyComplianceForJobResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPolicyComplianceForJobResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRunOutputRequestWire struct { RunId *wireInt64 `json:"run_id,omitempty"` } @@ -3857,6 +5801,30 @@ func getRunOutputRequestFromWire(w *getRunOutputRequestWire) (*GetRunOutputReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRunOutputRequest) MarshalJSON() ([]byte, error) { + w, err := getRunOutputRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRunOutputRequest) UnmarshalJSON(data []byte) error { + var w getRunOutputRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRunOutputRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRunOutputResponseWire struct { Metadata *runWire `json:"metadata,omitempty"` Error *string `json:"error,omitempty"` @@ -4135,6 +6103,30 @@ func getRunOutputResponseFromWire(w *getRunOutputResponseWire) (*GetRunOutputRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRunOutputResponse) MarshalJSON() ([]byte, error) { + w, err := getRunOutputResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRunOutputResponse) UnmarshalJSON(data []byte) error { + var w getRunOutputResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRunOutputResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRunRequestWire struct { RunId *wireInt64 `json:"run_id,omitempty"` IncludeHistory *bool `json:"include_history,omitempty"` @@ -4174,6 +6166,30 @@ func getRunRequestFromWire(w *getRunRequestWire) (*GetRunRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRunRequest) MarshalJSON() ([]byte, error) { + w, err := getRunRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRunRequest) UnmarshalJSON(data []byte) error { + var w getRunRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRunRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRunResponseWire struct { NextPageToken *string `json:"next_page_token,omitempty"` JobId *wireInt64 `json:"job_id,omitempty"` @@ -4510,6 +6526,30 @@ func getRunResponseFromWire(w *getRunResponseWire) (*GetRunResponse, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRunResponse) MarshalJSON() ([]byte, error) { + w, err := getRunResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRunResponse) UnmarshalJSON(data []byte) error { + var w getRunResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRunResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gitMetadataSnapshotWire struct { UsedCommit *string `json:"used_commit,omitempty"` } @@ -4532,6 +6572,30 @@ func gitMetadataSnapshotFromWire(w *gitMetadataSnapshotWire) (*GitMetadataSnapsh }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GitMetadataSnapshot) MarshalJSON() ([]byte, error) { + w, err := gitMetadataSnapshotToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GitMetadataSnapshot) UnmarshalJSON(data []byte) error { + var w gitMetadataSnapshotWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gitMetadataSnapshotFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gitSourceWire struct { GitUrl *string `json:"git_url,omitempty"` GitProvider *string `json:"git_provider,omitempty"` @@ -4639,6 +6703,30 @@ func gitSourceFromWire(w *gitSourceWire) (*GitSource, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GitSource) MarshalJSON() ([]byte, error) { + w, err := gitSourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GitSource) UnmarshalJSON(data []byte) error { + var w gitSourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gitSourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type initScriptInfoWire struct { Dbfs *dbfsStorageInfoWire `json:"dbfs,omitempty"` S3 *s3StorageInfoWire `json:"s3,omitempty"` @@ -4811,6 +6899,30 @@ func initScriptInfoFromWire(w *initScriptInfoWire) (*InitScriptInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InitScriptInfo) MarshalJSON() ([]byte, error) { + w, err := initScriptInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InitScriptInfo) UnmarshalJSON(data []byte) error { + var w initScriptInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := initScriptInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobClusterWire struct { JobClusterKey *string `json:"job_cluster_key,omitempty"` NewCluster *clusterSpec_NewClusterWire `json:"new_cluster,omitempty"` @@ -4858,6 +6970,30 @@ func jobClusterFromWire(w *jobClusterWire) (*JobCluster, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobCluster) MarshalJSON() ([]byte, error) { + w, err := jobClusterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobCluster) UnmarshalJSON(data []byte) error { + var w jobClusterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobClusterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobCluster_ServerlessComputeWire struct { PolicyId *string `json:"policy_id,omitempty"` } @@ -4880,6 +7016,30 @@ func jobCluster_ServerlessComputeFromWire(w *jobCluster_ServerlessComputeWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobCluster_ServerlessCompute) MarshalJSON() ([]byte, error) { + w, err := jobCluster_ServerlessComputeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobCluster_ServerlessCompute) UnmarshalJSON(data []byte) error { + var w jobCluster_ServerlessComputeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobCluster_ServerlessComputeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobCompletionTriggerConfigurationWire struct { Jobs []jobCompletionTriggerConfiguration_MonitoredJobWire `json:"jobs,omitempty"` IfStatus JobCompletionTriggerConfiguration_IfStatus `json:"if_status,omitempty"` @@ -4903,14 +7063,38 @@ func jobCompletionTriggerConfigurationFromWire(w *jobCompletionTriggerConfigurat if w == nil { return nil, nil } - jobsPublicValue, err := convertSlice(w.Jobs, jobCompletionTriggerConfiguration_MonitoredJobFromWire) + jobsPublicValue, err := convertSlice(w.Jobs, jobCompletionTriggerConfiguration_MonitoredJobFromWire) + if err != nil { + return nil, fmt.Errorf("%s: %w", "JobCompletionTriggerConfiguration.Jobs", err) + } + return &JobCompletionTriggerConfiguration{ + Jobs: jobsPublicValue, + IfStatus: w.IfStatus, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobCompletionTriggerConfiguration) MarshalJSON() ([]byte, error) { + w, err := jobCompletionTriggerConfigurationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobCompletionTriggerConfiguration) UnmarshalJSON(data []byte) error { + var w jobCompletionTriggerConfigurationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobCompletionTriggerConfigurationFromWire(&w) if err != nil { - return nil, fmt.Errorf("%s: %w", "JobCompletionTriggerConfiguration.Jobs", err) + return err } - return &JobCompletionTriggerConfiguration{ - Jobs: jobsPublicValue, - IfStatus: w.IfStatus, - }, nil + *v = *decoded + return nil } type jobCompletionTriggerConfiguration_MonitoredJobWire struct { @@ -4938,6 +7122,30 @@ func jobCompletionTriggerConfiguration_MonitoredJobFromWire(w *jobCompletionTrig }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobCompletionTriggerConfiguration_MonitoredJob) MarshalJSON() ([]byte, error) { + w, err := jobCompletionTriggerConfiguration_MonitoredJobToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobCompletionTriggerConfiguration_MonitoredJob) UnmarshalJSON(data []byte) error { + var w jobCompletionTriggerConfiguration_MonitoredJobWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobCompletionTriggerConfiguration_MonitoredJobFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobCompletionTriggerRunInfoDetailsWire struct { CompletedJobs []completedJobWire `json:"completed_jobs,omitempty"` } @@ -4968,6 +7176,30 @@ func jobCompletionTriggerRunInfoDetailsFromWire(w *jobCompletionTriggerRunInfoDe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobCompletionTriggerRunInfoDetails) MarshalJSON() ([]byte, error) { + w, err := jobCompletionTriggerRunInfoDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobCompletionTriggerRunInfoDetails) UnmarshalJSON(data []byte) error { + var w jobCompletionTriggerRunInfoDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobCompletionTriggerRunInfoDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobCompletionTriggerStateWire struct { MonitoredJobStates []jobCompletionTriggerState_MonitoredJobStateWire `json:"monitored_job_states,omitempty"` } @@ -4998,6 +7230,30 @@ func jobCompletionTriggerStateFromWire(w *jobCompletionTriggerStateWire) (*JobCo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobCompletionTriggerState) MarshalJSON() ([]byte, error) { + w, err := jobCompletionTriggerStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobCompletionTriggerState) UnmarshalJSON(data []byte) error { + var w jobCompletionTriggerStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobCompletionTriggerStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobCompletionTriggerState_MonitoredJobStateWire struct { WorkspaceId *string `json:"workspace_id,omitempty"` JobId *string `json:"job_id,omitempty"` @@ -5041,6 +7297,30 @@ func jobCompletionTriggerState_MonitoredJobStateFromWire(w *jobCompletionTrigger }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobCompletionTriggerState_MonitoredJobState) MarshalJSON() ([]byte, error) { + w, err := jobCompletionTriggerState_MonitoredJobStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobCompletionTriggerState_MonitoredJobState) UnmarshalJSON(data []byte) error { + var w jobCompletionTriggerState_MonitoredJobStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobCompletionTriggerState_MonitoredJobStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobDeploymentWire struct { Kind JobDeployment_DeploymentKind `json:"kind,omitempty"` MetadataFilePath *string `json:"metadata_file_path,omitempty"` @@ -5072,6 +7352,30 @@ func jobDeploymentFromWire(w *jobDeploymentWire) (*JobDeployment, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobDeployment) MarshalJSON() ([]byte, error) { + w, err := jobDeploymentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobDeployment) UnmarshalJSON(data []byte) error { + var w jobDeploymentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobDeploymentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobEmailNotificationsWire struct { OnStart []string `json:"on_start,omitempty"` OnSuccess []string `json:"on_success,omitempty"` @@ -5115,6 +7419,30 @@ func jobEmailNotificationsFromWire(w *jobEmailNotificationsWire) (*JobEmailNotif }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobEmailNotifications) MarshalJSON() ([]byte, error) { + w, err := jobEmailNotificationsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobEmailNotifications) UnmarshalJSON(data []byte) error { + var w jobEmailNotificationsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobEmailNotificationsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobEnvironmentWire struct { EnvironmentKey *string `json:"environment_key,omitempty"` Spec *environmentWire `json:"spec,omitempty"` @@ -5148,6 +7476,30 @@ func jobEnvironmentFromWire(w *jobEnvironmentWire) (*JobEnvironment, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobEnvironment) MarshalJSON() ([]byte, error) { + w, err := jobEnvironmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobEnvironment) UnmarshalJSON(data []byte) error { + var w jobEnvironmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobEnvironmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobEnvironmentVariablesWire struct { EnvironmentVariablesKey *string `json:"environment_variables_key,omitempty"` Spec *jobEnvironmentVariablesSpecWire `json:"spec,omitempty"` @@ -5181,6 +7533,30 @@ func jobEnvironmentVariablesFromWire(w *jobEnvironmentVariablesWire) (*JobEnviro }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobEnvironmentVariables) MarshalJSON() ([]byte, error) { + w, err := jobEnvironmentVariablesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobEnvironmentVariables) UnmarshalJSON(data []byte) error { + var w jobEnvironmentVariablesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobEnvironmentVariablesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobEnvironmentVariablesSpecWire struct { Variables map[string]string `json:"variables,omitempty"` Files []string `json:"files,omitempty"` @@ -5206,6 +7582,30 @@ func jobEnvironmentVariablesSpecFromWire(w *jobEnvironmentVariablesSpecWire) (*J }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobEnvironmentVariablesSpec) MarshalJSON() ([]byte, error) { + w, err := jobEnvironmentVariablesSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobEnvironmentVariablesSpec) UnmarshalJSON(data []byte) error { + var w jobEnvironmentVariablesSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobEnvironmentVariablesSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobLevelParameterWire struct { Name *string `json:"name,omitempty"` Default *string `json:"default,omitempty"` @@ -5231,6 +7631,30 @@ func jobLevelParameterFromWire(w *jobLevelParameterWire) (*JobLevelParameter, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobLevelParameter) MarshalJSON() ([]byte, error) { + w, err := jobLevelParameterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobLevelParameter) UnmarshalJSON(data []byte) error { + var w jobLevelParameterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobLevelParameterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobRunAsWire struct { UserName *string `json:"user_name,omitempty"` ServicePrincipalName *string `json:"service_principal_name,omitempty"` @@ -5299,6 +7723,30 @@ func jobRunAsFromWire(w *jobRunAsWire) (*JobRunAs, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobRunAs) MarshalJSON() ([]byte, error) { + w, err := jobRunAsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobRunAs) UnmarshalJSON(data []byte) error { + var w jobRunAsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobRunAsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobSettingsWire struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` @@ -5553,6 +8001,30 @@ func jobSettingsFromWire(w *jobSettingsWire) (*JobSettings, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobSettings) MarshalJSON() ([]byte, error) { + w, err := jobSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobSettings) UnmarshalJSON(data []byte) error { + var w jobSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobSourceWire struct { JobConfigPath *string `json:"job_config_path,omitempty"` ImportFromGitBranch *string `json:"import_from_git_branch,omitempty"` @@ -5603,6 +8075,30 @@ func jobSourceFromWire(w *jobSourceWire) (*JobSource, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobSource) MarshalJSON() ([]byte, error) { + w, err := jobSourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobSource) UnmarshalJSON(data []byte) error { + var w jobSourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobSourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobsHealthRuleWire struct { Metric JobsHealthMetric `json:"metric,omitempty"` Op JobsHealthOperator `json:"op,omitempty"` @@ -5639,6 +8135,30 @@ func jobsHealthRuleFromWire(w *jobsHealthRuleWire) (*JobsHealthRule, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobsHealthRule) MarshalJSON() ([]byte, error) { + w, err := jobsHealthRuleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobsHealthRule) UnmarshalJSON(data []byte) error { + var w jobsHealthRuleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobsHealthRuleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobsHealthRulesWire struct { Rules []jobsHealthRuleWire `json:"rules,omitempty"` } @@ -5669,6 +8189,30 @@ func jobsHealthRulesFromWire(w *jobsHealthRulesWire) (*JobsHealthRules, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobsHealthRules) MarshalJSON() ([]byte, error) { + w, err := jobsHealthRulesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobsHealthRules) UnmarshalJSON(data []byte) error { + var w jobsHealthRulesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobsHealthRulesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type libraryWire struct { Jar *string `json:"jar,omitempty"` Egg *string `json:"egg,omitempty"` @@ -5809,6 +8353,30 @@ func libraryFromWire(w *libraryWire) (*Library, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Library) MarshalJSON() ([]byte, error) { + w, err := libraryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Library) UnmarshalJSON(data []byte) error { + var w libraryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := libraryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listJobComplianceForPolicyWire struct { PolicyId *string `json:"policy_id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -5837,6 +8405,30 @@ func listJobComplianceForPolicyFromWire(w *listJobComplianceForPolicyWire) (*Lis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListJobComplianceForPolicy) MarshalJSON() ([]byte, error) { + w, err := listJobComplianceForPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListJobComplianceForPolicy) UnmarshalJSON(data []byte) error { + var w listJobComplianceForPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listJobComplianceForPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listJobComplianceForPolicy_JobComplianceWire struct { JobId *wireInt64 `json:"job_id,omitempty"` IsCompliant *bool `json:"is_compliant,omitempty"` @@ -5873,6 +8465,30 @@ func listJobComplianceForPolicy_JobComplianceFromWire(w *listJobComplianceForPol }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListJobComplianceForPolicy_JobCompliance) MarshalJSON() ([]byte, error) { + w, err := listJobComplianceForPolicy_JobComplianceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListJobComplianceForPolicy_JobCompliance) UnmarshalJSON(data []byte) error { + var w listJobComplianceForPolicy_JobComplianceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listJobComplianceForPolicy_JobComplianceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listJobComplianceResponseWire struct { Jobs []listJobComplianceForPolicy_JobComplianceWire `json:"jobs,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -5909,6 +8525,30 @@ func listJobComplianceResponseFromWire(w *listJobComplianceResponseWire) (*ListJ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListJobComplianceResponse) MarshalJSON() ([]byte, error) { + w, err := listJobComplianceResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListJobComplianceResponse) UnmarshalJSON(data []byte) error { + var w listJobComplianceResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listJobComplianceResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listJobsRequestWire struct { Offset *int `json:"offset,omitempty"` Limit *int `json:"limit,omitempty"` @@ -5943,6 +8583,30 @@ func listJobsRequestFromWire(w *listJobsRequestWire) (*ListJobsRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListJobsRequest) MarshalJSON() ([]byte, error) { + w, err := listJobsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListJobsRequest) UnmarshalJSON(data []byte) error { + var w listJobsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listJobsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listJobsResponseWire struct { Jobs []baseJobWire `json:"jobs,omitempty"` HasMore *bool `json:"has_more,omitempty"` @@ -5982,6 +8646,30 @@ func listJobsResponseFromWire(w *listJobsResponseWire) (*ListJobsResponse, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListJobsResponse) MarshalJSON() ([]byte, error) { + w, err := listJobsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListJobsResponse) UnmarshalJSON(data []byte) error { + var w listJobsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listJobsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRunsRequestWire struct { JobId *wireInt64 `json:"job_id,omitempty"` ActiveOnly *bool `json:"active_only,omitempty"` @@ -6086,6 +8774,30 @@ func listRunsRequestFromWire(w *listRunsRequestWire) (*ListRunsRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRunsRequest) MarshalJSON() ([]byte, error) { + w, err := listRunsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRunsRequest) UnmarshalJSON(data []byte) error { + var w listRunsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRunsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRunsResponseWire struct { Runs []baseRunWire `json:"runs,omitempty"` HasMore *bool `json:"has_more,omitempty"` @@ -6125,6 +8837,30 @@ func listRunsResponseFromWire(w *listRunsResponseWire) (*ListRunsResponse, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRunsResponse) MarshalJSON() ([]byte, error) { + w, err := listRunsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRunsResponse) UnmarshalJSON(data []byte) error { + var w listRunsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRunsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type localFileInfoWire struct { Destination *string `json:"destination,omitempty"` } @@ -6147,6 +8883,30 @@ func localFileInfoFromWire(w *localFileInfoWire) (*LocalFileInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LocalFileInfo) MarshalJSON() ([]byte, error) { + w, err := localFileInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LocalFileInfo) UnmarshalJSON(data []byte) error { + var w localFileInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := localFileInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logAnalyticsInfoWire struct { LogAnalyticsWorkspaceId *string `json:"log_analytics_workspace_id,omitempty"` LogAnalyticsPrimaryKey *string `json:"log_analytics_primary_key,omitempty"` @@ -6172,6 +8932,30 @@ func logAnalyticsInfoFromWire(w *logAnalyticsInfoWire) (*LogAnalyticsInfo, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogAnalyticsInfo) MarshalJSON() ([]byte, error) { + w, err := logAnalyticsInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogAnalyticsInfo) UnmarshalJSON(data []byte) error { + var w logAnalyticsInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logAnalyticsInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type maintenanceWindowWire struct { StartHour *int `json:"start_hour,omitempty"` DayOfWeek DayOfWeek `json:"day_of_week,omitempty"` @@ -6200,6 +8984,30 @@ func maintenanceWindowFromWire(w *maintenanceWindowWire) (*MaintenanceWindow, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MaintenanceWindow) MarshalJSON() ([]byte, error) { + w, err := maintenanceWindowToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MaintenanceWindow) UnmarshalJSON(data []byte) error { + var w maintenanceWindowWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := maintenanceWindowFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type mavenLibraryWire struct { Coordinates *string `json:"coordinates,omitempty"` Repo *string `json:"repo,omitempty"` @@ -6228,6 +9036,30 @@ func mavenLibraryFromWire(w *mavenLibraryWire) (*MavenLibrary, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MavenLibrary) MarshalJSON() ([]byte, error) { + w, err := mavenLibraryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MavenLibrary) UnmarshalJSON(data []byte) error { + var w mavenLibraryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := mavenLibraryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelTriggerConfigurationWire struct { SecurableName *string `json:"securable_name,omitempty"` Aliases []string `json:"aliases,omitempty"` @@ -6262,6 +9094,30 @@ func modelTriggerConfigurationFromWire(w *modelTriggerConfigurationWire) (*Model }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelTriggerConfiguration) MarshalJSON() ([]byte, error) { + w, err := modelTriggerConfigurationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelTriggerConfiguration) UnmarshalJSON(data []byte) error { + var w modelTriggerConfigurationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelTriggerConfigurationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelTriggerStateWire struct { } @@ -6279,6 +9135,30 @@ func modelTriggerStateFromWire(w *modelTriggerStateWire) (*ModelTriggerState, er return &ModelTriggerState{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelTriggerState) MarshalJSON() ([]byte, error) { + w, err := modelTriggerStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelTriggerState) UnmarshalJSON(data []byte) error { + var w modelTriggerStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelTriggerStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type nodeTypeFlexibilityWire struct { AlternateNodeTypeIds []string `json:"alternate_node_type_ids,omitempty"` AwsContextId *string `json:"aws_context_id,omitempty"` @@ -6304,6 +9184,30 @@ func nodeTypeFlexibilityFromWire(w *nodeTypeFlexibilityWire) (*NodeTypeFlexibili }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NodeTypeFlexibility) MarshalJSON() ([]byte, error) { + w, err := nodeTypeFlexibilityToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NodeTypeFlexibility) UnmarshalJSON(data []byte) error { + var w nodeTypeFlexibilityWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := nodeTypeFlexibilityFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type notebookTaskWire struct { NotebookPath *string `json:"notebook_path,omitempty"` BaseParameters map[string]string `json:"base_parameters,omitempty"` @@ -6335,6 +9239,30 @@ func notebookTaskFromWire(w *notebookTaskWire) (*NotebookTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NotebookTask) MarshalJSON() ([]byte, error) { + w, err := notebookTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NotebookTask) UnmarshalJSON(data []byte) error { + var w notebookTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := notebookTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type notebookTask_NotebookOutputWire struct { Result *string `json:"result,omitempty"` Truncated *bool `json:"truncated,omitempty"` @@ -6360,6 +9288,30 @@ func notebookTask_NotebookOutputFromWire(w *notebookTask_NotebookOutputWire) (*N }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NotebookTask_NotebookOutput) MarshalJSON() ([]byte, error) { + w, err := notebookTask_NotebookOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NotebookTask_NotebookOutput) UnmarshalJSON(data []byte) error { + var w notebookTask_NotebookOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := notebookTask_NotebookOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type notificationSettingsWire struct { NoAlertForSkippedRuns *bool `json:"no_alert_for_skipped_runs,omitempty"` NoAlertForCanceledRuns *bool `json:"no_alert_for_canceled_runs,omitempty"` @@ -6388,6 +9340,30 @@ func notificationSettingsFromWire(w *notificationSettingsWire) (*NotificationSet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NotificationSettings) MarshalJSON() ([]byte, error) { + w, err := notificationSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NotificationSettings) UnmarshalJSON(data []byte) error { + var w notificationSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := notificationSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type outputSchemaInfoWire struct { CatalogName *string `json:"catalog_name,omitempty"` SchemaName *string `json:"schema_name,omitempty"` @@ -6424,6 +9400,30 @@ func outputSchemaInfoFromWire(w *outputSchemaInfoWire) (*OutputSchemaInfo, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OutputSchemaInfo) MarshalJSON() ([]byte, error) { + w, err := outputSchemaInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OutputSchemaInfo) UnmarshalJSON(data []byte) error { + var w outputSchemaInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := outputSchemaInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type perTriggerStateWire struct { Periodic *periodicTriggerStateWire `json:"periodic,omitempty"` Schedule *scheduleTriggerStateWire `json:"schedule,omitempty"` @@ -6610,6 +9610,30 @@ func perTriggerStateFromWire(w *perTriggerStateWire) (*PerTriggerState, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PerTriggerState) MarshalJSON() ([]byte, error) { + w, err := perTriggerStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PerTriggerState) UnmarshalJSON(data []byte) error { + var w perTriggerStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := perTriggerStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type performanceTargetWire struct { } @@ -6627,6 +9651,30 @@ func performanceTargetFromWire(w *performanceTargetWire) (*PerformanceTarget, er return &PerformanceTarget{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PerformanceTarget) MarshalJSON() ([]byte, error) { + w, err := performanceTargetToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PerformanceTarget) UnmarshalJSON(data []byte) error { + var w performanceTargetWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := performanceTargetFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type periodicTriggerConfigurationWire struct { Interval *int `json:"interval,omitempty"` Unit PeriodicTriggerConfiguration_TimeUnit `json:"unit,omitempty"` @@ -6652,6 +9700,30 @@ func periodicTriggerConfigurationFromWire(w *periodicTriggerConfigurationWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PeriodicTriggerConfiguration) MarshalJSON() ([]byte, error) { + w, err := periodicTriggerConfigurationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PeriodicTriggerConfiguration) UnmarshalJSON(data []byte) error { + var w periodicTriggerConfigurationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := periodicTriggerConfigurationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type periodicTriggerStateWire struct { NextRunTime *wireInt64 `json:"next_run_time,omitempty"` } @@ -6682,6 +9754,30 @@ func periodicTriggerStateFromWire(w *periodicTriggerStateWire) (*PeriodicTrigger }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PeriodicTriggerState) MarshalJSON() ([]byte, error) { + w, err := periodicTriggerStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PeriodicTriggerState) UnmarshalJSON(data []byte) error { + var w periodicTriggerStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := periodicTriggerStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelineParametersWire struct { FullRefresh *bool `json:"full_refresh,omitempty"` RefreshSelection []string `json:"refresh_selection,omitempty"` @@ -6716,6 +9812,30 @@ func pipelineParametersFromWire(w *pipelineParametersWire) (*PipelineParameters, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelineParameters) MarshalJSON() ([]byte, error) { + w, err := pipelineParametersToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelineParameters) UnmarshalJSON(data []byte) error { + var w pipelineParametersWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelineParametersFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelineTaskWire struct { PipelineId *string `json:"pipeline_id,omitempty"` PipelineTaskParameters map[string]string `json:"parameters,omitempty"` @@ -6756,6 +9876,30 @@ func pipelineTaskFromWire(w *pipelineTaskWire) (*PipelineTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelineTask) MarshalJSON() ([]byte, error) { + w, err := pipelineTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelineTask) UnmarshalJSON(data []byte) error { + var w pipelineTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelineTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type powerBiModelWire struct { WorkspaceName *string `json:"workspace_name,omitempty"` ModelName *string `json:"model_name,omitempty"` @@ -6790,6 +9934,30 @@ func powerBiModelFromWire(w *powerBiModelWire) (*PowerBiModel, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PowerBiModel) MarshalJSON() ([]byte, error) { + w, err := powerBiModelToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PowerBiModel) UnmarshalJSON(data []byte) error { + var w powerBiModelWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := powerBiModelFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type powerBiTableWire struct { Name *string `json:"name,omitempty"` Catalog *string `json:"catalog,omitempty"` @@ -6821,6 +9989,30 @@ func powerBiTableFromWire(w *powerBiTableWire) (*PowerBiTable, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PowerBiTable) MarshalJSON() ([]byte, error) { + w, err := powerBiTableToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PowerBiTable) UnmarshalJSON(data []byte) error { + var w powerBiTableWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := powerBiTableFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type powerBiTaskWire struct { Tables []powerBiTableWire `json:"tables,omitempty"` WarehouseId *string `json:"warehouse_id,omitempty"` @@ -6871,6 +10063,30 @@ func powerBiTaskFromWire(w *powerBiTaskWire) (*PowerBiTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PowerBiTask) MarshalJSON() ([]byte, error) { + w, err := powerBiTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PowerBiTask) UnmarshalJSON(data []byte) error { + var w powerBiTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := powerBiTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pythonOperatorTaskWire struct { Parameters []pythonOperatorTask_ParameterWire `json:"parameters,omitempty"` Main *string `json:"main,omitempty"` @@ -6904,6 +10120,30 @@ func pythonOperatorTaskFromWire(w *pythonOperatorTaskWire) (*PythonOperatorTask, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PythonOperatorTask) MarshalJSON() ([]byte, error) { + w, err := pythonOperatorTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PythonOperatorTask) UnmarshalJSON(data []byte) error { + var w pythonOperatorTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pythonOperatorTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pythonOperatorTask_ParameterWire struct { Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` @@ -6929,6 +10169,30 @@ func pythonOperatorTask_ParameterFromWire(w *pythonOperatorTask_ParameterWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PythonOperatorTask_Parameter) MarshalJSON() ([]byte, error) { + w, err := pythonOperatorTask_ParameterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PythonOperatorTask_Parameter) UnmarshalJSON(data []byte) error { + var w pythonOperatorTask_ParameterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pythonOperatorTask_ParameterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pythonPyPiLibraryWire struct { Package *string `json:"package,omitempty"` Repo *string `json:"repo,omitempty"` @@ -6954,6 +10218,30 @@ func pythonPyPiLibraryFromWire(w *pythonPyPiLibraryWire) (*PythonPyPiLibrary, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PythonPyPiLibrary) MarshalJSON() ([]byte, error) { + w, err := pythonPyPiLibraryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PythonPyPiLibrary) UnmarshalJSON(data []byte) error { + var w pythonPyPiLibraryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pythonPyPiLibraryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pythonWheelTaskWire struct { PackageName *string `json:"package_name,omitempty"` EntryPoint *string `json:"entry_point,omitempty"` @@ -6985,6 +10273,30 @@ func pythonWheelTaskFromWire(w *pythonWheelTaskWire) (*PythonWheelTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PythonWheelTask) MarshalJSON() ([]byte, error) { + w, err := pythonWheelTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PythonWheelTask) UnmarshalJSON(data []byte) error { + var w pythonWheelTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pythonWheelTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type qualifiedNameWire struct { Catalog *string `json:"catalog,omitempty"` Schema *string `json:"schema,omitempty"` @@ -7013,6 +10325,30 @@ func qualifiedNameFromWire(w *qualifiedNameWire) (*QualifiedName, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QualifiedName) MarshalJSON() ([]byte, error) { + w, err := qualifiedNameToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QualifiedName) UnmarshalJSON(data []byte) error { + var w qualifiedNameWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := qualifiedNameFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queueDetailsWire struct { Code QueueDetailsCode_Code `json:"code,omitempty"` Message *string `json:"message,omitempty"` @@ -7038,6 +10374,30 @@ func queueDetailsFromWire(w *queueDetailsWire) (*QueueDetails, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueueDetails) MarshalJSON() ([]byte, error) { + w, err := queueDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueueDetails) UnmarshalJSON(data []byte) error { + var w queueDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queueDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queueDetailsCodeWire struct { } @@ -7055,6 +10415,30 @@ func queueDetailsCodeFromWire(w *queueDetailsCodeWire) (*QueueDetailsCode, error return &QueueDetailsCode{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueueDetailsCode) MarshalJSON() ([]byte, error) { + w, err := queueDetailsCodeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueueDetailsCode) UnmarshalJSON(data []byte) error { + var w queueDetailsCodeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queueDetailsCodeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queueSettingsWire struct { Enabled *bool `json:"enabled,omitempty"` } @@ -7077,6 +10461,30 @@ func queueSettingsFromWire(w *queueSettingsWire) (*QueueSettings, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueueSettings) MarshalJSON() ([]byte, error) { + w, err := queueSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueueSettings) UnmarshalJSON(data []byte) error { + var w queueSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queueSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rCranLibraryWire struct { Package *string `json:"package,omitempty"` Repo *string `json:"repo,omitempty"` @@ -7102,6 +10510,30 @@ func rCranLibraryFromWire(w *rCranLibraryWire) (*RCranLibrary, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RCranLibrary) MarshalJSON() ([]byte, error) { + w, err := rCranLibraryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RCranLibrary) UnmarshalJSON(data []byte) error { + var w rCranLibraryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rCranLibraryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type repairWire struct { Type RepairType `json:"type,omitempty"` StartTime *wireInt64 `json:"start_time,omitempty"` @@ -7193,6 +10625,30 @@ func repairFromWire(w *repairWire) (*Repair, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Repair) MarshalJSON() ([]byte, error) { + w, err := repairToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Repair) UnmarshalJSON(data []byte) error { + var w repairWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := repairFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type repairRunRequestWire struct { RunId *wireInt64 `json:"run_id,omitempty"` LatestRepairId *wireInt64 `json:"latest_repair_id,omitempty"` @@ -7284,6 +10740,30 @@ func repairRunRequestFromWire(w *repairRunRequestWire) (*RepairRunRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RepairRunRequest) MarshalJSON() ([]byte, error) { + w, err := repairRunRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RepairRunRequest) UnmarshalJSON(data []byte) error { + var w repairRunRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := repairRunRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type repairRunResponseWire struct { RepairId *wireInt64 `json:"repair_id,omitempty"` } @@ -7314,6 +10794,30 @@ func repairRunResponseFromWire(w *repairRunResponseWire) (*RepairRunResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RepairRunResponse) MarshalJSON() ([]byte, error) { + w, err := repairRunResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RepairRunResponse) UnmarshalJSON(data []byte) error { + var w repairRunResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := repairRunResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resetJobRequestWire struct { JobId *wireInt64 `json:"job_id,omitempty"` NewSettings *jobSettingsWire `json:"new_settings,omitempty"` @@ -7355,6 +10859,30 @@ func resetJobRequestFromWire(w *resetJobRequestWire) (*ResetJobRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResetJobRequest) MarshalJSON() ([]byte, error) { + w, err := resetJobRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResetJobRequest) UnmarshalJSON(data []byte) error { + var w resetJobRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resetJobRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resetJobResponseWire struct { } @@ -7372,6 +10900,30 @@ func resetJobResponseFromWire(w *resetJobResponseWire) (*ResetJobResponse, error return &ResetJobResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResetJobResponse) MarshalJSON() ([]byte, error) { + w, err := resetJobResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResetJobResponse) UnmarshalJSON(data []byte) error { + var w resetJobResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resetJobResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resolvedValuesWire struct { NotebookTask *resolvedValues_NotebookTaskResolvedValuesWire `json:"notebook_task,omitempty"` SparkJarTask *resolvedValues_SparkJarTaskResolvedValuesWire `json:"spark_jar_task,omitempty"` @@ -7664,6 +11216,30 @@ func resolvedValuesFromWire(w *resolvedValuesWire) (*ResolvedValues, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResolvedValues) MarshalJSON() ([]byte, error) { + w, err := resolvedValuesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResolvedValues) UnmarshalJSON(data []byte) error { + var w resolvedValuesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resolvedValuesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resolvedValues_AiFunctionTaskResolvedValuesWire struct { DeltaTable *deltaTableSourceWire `json:"delta_table,omitempty"` } @@ -7694,6 +11270,30 @@ func resolvedValues_AiFunctionTaskResolvedValuesFromWire(w *resolvedValues_AiFun }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResolvedValues_AiFunctionTaskResolvedValues) MarshalJSON() ([]byte, error) { + w, err := resolvedValues_AiFunctionTaskResolvedValuesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResolvedValues_AiFunctionTaskResolvedValues) UnmarshalJSON(data []byte) error { + var w resolvedValues_AiFunctionTaskResolvedValuesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resolvedValues_AiFunctionTaskResolvedValuesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resolvedValues_AiRuntimeTaskResolvedValuesWire struct { } @@ -7711,6 +11311,30 @@ func resolvedValues_AiRuntimeTaskResolvedValuesFromWire(w *resolvedValues_AiRunt return &ResolvedValues_AiRuntimeTaskResolvedValues{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResolvedValues_AiRuntimeTaskResolvedValues) MarshalJSON() ([]byte, error) { + w, err := resolvedValues_AiRuntimeTaskResolvedValuesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResolvedValues_AiRuntimeTaskResolvedValues) UnmarshalJSON(data []byte) error { + var w resolvedValues_AiRuntimeTaskResolvedValuesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resolvedValues_AiRuntimeTaskResolvedValuesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resolvedValues_ConditionTaskResolvedValuesWire struct { Left *string `json:"left,omitempty"` Right *string `json:"right,omitempty"` @@ -7736,6 +11360,30 @@ func resolvedValues_ConditionTaskResolvedValuesFromWire(w *resolvedValues_Condit }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResolvedValues_ConditionTaskResolvedValues) MarshalJSON() ([]byte, error) { + w, err := resolvedValues_ConditionTaskResolvedValuesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResolvedValues_ConditionTaskResolvedValues) UnmarshalJSON(data []byte) error { + var w resolvedValues_ConditionTaskResolvedValuesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resolvedValues_ConditionTaskResolvedValuesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resolvedValues_DbtTaskResolvedValuesWire struct { Commands []string `json:"commands,omitempty"` } @@ -7758,6 +11406,30 @@ func resolvedValues_DbtTaskResolvedValuesFromWire(w *resolvedValues_DbtTaskResol }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResolvedValues_DbtTaskResolvedValues) MarshalJSON() ([]byte, error) { + w, err := resolvedValues_DbtTaskResolvedValuesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResolvedValues_DbtTaskResolvedValues) UnmarshalJSON(data []byte) error { + var w resolvedValues_DbtTaskResolvedValuesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resolvedValues_DbtTaskResolvedValuesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resolvedValues_NotebookTaskResolvedValuesWire struct { BaseParameters map[string]string `json:"base_parameters,omitempty"` } @@ -7775,9 +11447,33 @@ func resolvedValues_NotebookTaskResolvedValuesFromWire(w *resolvedValues_Noteboo if w == nil { return nil, nil } - return &ResolvedValues_NotebookTaskResolvedValues{ - BaseParameters: w.BaseParameters, - }, nil + return &ResolvedValues_NotebookTaskResolvedValues{ + BaseParameters: w.BaseParameters, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResolvedValues_NotebookTaskResolvedValues) MarshalJSON() ([]byte, error) { + w, err := resolvedValues_NotebookTaskResolvedValuesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResolvedValues_NotebookTaskResolvedValues) UnmarshalJSON(data []byte) error { + var w resolvedValues_NotebookTaskResolvedValuesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resolvedValues_NotebookTaskResolvedValuesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil } type resolvedValues_PipelineTaskResolvedValuesWire struct { @@ -7802,6 +11498,30 @@ func resolvedValues_PipelineTaskResolvedValuesFromWire(w *resolvedValues_Pipelin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResolvedValues_PipelineTaskResolvedValues) MarshalJSON() ([]byte, error) { + w, err := resolvedValues_PipelineTaskResolvedValuesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResolvedValues_PipelineTaskResolvedValues) UnmarshalJSON(data []byte) error { + var w resolvedValues_PipelineTaskResolvedValuesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resolvedValues_PipelineTaskResolvedValuesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resolvedValues_PythonWheelTaskResolvedValuesWire struct { Parameters []string `json:"parameters,omitempty"` NamedParameters map[string]string `json:"named_parameters,omitempty"` @@ -7827,6 +11547,30 @@ func resolvedValues_PythonWheelTaskResolvedValuesFromWire(w *resolvedValues_Pyth }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResolvedValues_PythonWheelTaskResolvedValues) MarshalJSON() ([]byte, error) { + w, err := resolvedValues_PythonWheelTaskResolvedValuesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResolvedValues_PythonWheelTaskResolvedValues) UnmarshalJSON(data []byte) error { + var w resolvedValues_PythonWheelTaskResolvedValuesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resolvedValues_PythonWheelTaskResolvedValuesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resolvedValues_RunJobTaskResolvedValuesWire struct { Parameters map[string]string `json:"parameters,omitempty"` JobParameters map[string]string `json:"job_parameters,omitempty"` @@ -7852,6 +11596,30 @@ func resolvedValues_RunJobTaskResolvedValuesFromWire(w *resolvedValues_RunJobTas }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResolvedValues_RunJobTaskResolvedValues) MarshalJSON() ([]byte, error) { + w, err := resolvedValues_RunJobTaskResolvedValuesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResolvedValues_RunJobTaskResolvedValues) UnmarshalJSON(data []byte) error { + var w resolvedValues_RunJobTaskResolvedValuesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resolvedValues_RunJobTaskResolvedValuesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resolvedValues_SimulationTaskResolvedValuesWire struct { Parameters map[string]string `json:"parameters,omitempty"` } @@ -7874,6 +11642,30 @@ func resolvedValues_SimulationTaskResolvedValuesFromWire(w *resolvedValues_Simul }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResolvedValues_SimulationTaskResolvedValues) MarshalJSON() ([]byte, error) { + w, err := resolvedValues_SimulationTaskResolvedValuesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResolvedValues_SimulationTaskResolvedValues) UnmarshalJSON(data []byte) error { + var w resolvedValues_SimulationTaskResolvedValuesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resolvedValues_SimulationTaskResolvedValuesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resolvedValues_SparkJarTaskResolvedValuesWire struct { Parameters []string `json:"parameters,omitempty"` } @@ -7896,6 +11688,30 @@ func resolvedValues_SparkJarTaskResolvedValuesFromWire(w *resolvedValues_SparkJa }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResolvedValues_SparkJarTaskResolvedValues) MarshalJSON() ([]byte, error) { + w, err := resolvedValues_SparkJarTaskResolvedValuesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResolvedValues_SparkJarTaskResolvedValues) UnmarshalJSON(data []byte) error { + var w resolvedValues_SparkJarTaskResolvedValuesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resolvedValues_SparkJarTaskResolvedValuesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resolvedValues_SparkPythonTaskResolvedValuesWire struct { } @@ -7913,6 +11729,30 @@ func resolvedValues_SparkPythonTaskResolvedValuesFromWire(w *resolvedValues_Spar return &ResolvedValues_SparkPythonTaskResolvedValues{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResolvedValues_SparkPythonTaskResolvedValues) MarshalJSON() ([]byte, error) { + w, err := resolvedValues_SparkPythonTaskResolvedValuesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResolvedValues_SparkPythonTaskResolvedValues) UnmarshalJSON(data []byte) error { + var w resolvedValues_SparkPythonTaskResolvedValuesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resolvedValues_SparkPythonTaskResolvedValuesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resolvedValues_SparkSubmitTaskResolvedValuesWire struct { } @@ -7930,6 +11770,30 @@ func resolvedValues_SparkSubmitTaskResolvedValuesFromWire(w *resolvedValues_Spar return &ResolvedValues_SparkSubmitTaskResolvedValues{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResolvedValues_SparkSubmitTaskResolvedValues) MarshalJSON() ([]byte, error) { + w, err := resolvedValues_SparkSubmitTaskResolvedValuesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResolvedValues_SparkSubmitTaskResolvedValues) UnmarshalJSON(data []byte) error { + var w resolvedValues_SparkSubmitTaskResolvedValuesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resolvedValues_SparkSubmitTaskResolvedValuesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resolvedValues_SqlTaskResolvedValuesWire struct { Parameters map[string]string `json:"parameters,omitempty"` } @@ -7952,6 +11816,30 @@ func resolvedValues_SqlTaskResolvedValuesFromWire(w *resolvedValues_SqlTaskResol }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResolvedValues_SqlTaskResolvedValues) MarshalJSON() ([]byte, error) { + w, err := resolvedValues_SqlTaskResolvedValuesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResolvedValues_SqlTaskResolvedValues) UnmarshalJSON(data []byte) error { + var w resolvedValues_SqlTaskResolvedValuesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resolvedValues_SqlTaskResolvedValuesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runWire struct { JobId *wireInt64 `json:"job_id,omitempty"` RunId *wireInt64 `json:"run_id,omitempty"` @@ -8285,6 +12173,30 @@ func runFromWire(w *runWire) (*Run, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Run) MarshalJSON() ([]byte, error) { + w, err := runToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Run) UnmarshalJSON(data []byte) error { + var w runWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type run_JobLevelParametersWire struct { Name *string `json:"name,omitempty"` Default *string `json:"default,omitempty"` @@ -8313,6 +12225,30 @@ func run_JobLevelParametersFromWire(w *run_JobLevelParametersWire) (*Run_JobLeve }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Run_JobLevelParameters) MarshalJSON() ([]byte, error) { + w, err := run_JobLevelParametersToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Run_JobLevelParameters) UnmarshalJSON(data []byte) error { + var w run_JobLevelParametersWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := run_JobLevelParametersFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runJobTaskWire struct { JobId *wireInt64 `json:"job_id,omitempty"` JobParameters map[string]string `json:"job_parameters,omitempty"` @@ -8378,6 +12314,30 @@ func runJobTaskFromWire(w *runJobTaskWire) (*RunJobTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunJobTask) MarshalJSON() ([]byte, error) { + w, err := runJobTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunJobTask) UnmarshalJSON(data []byte) error { + var w runJobTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runJobTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runJobTask_RunJobTaskOutputWire struct { RunId *wireInt64 `json:"run_id,omitempty"` } @@ -8408,6 +12368,30 @@ func runJobTask_RunJobTaskOutputFromWire(w *runJobTask_RunJobTaskOutputWire) (*R }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunJobTask_RunJobTaskOutput) MarshalJSON() ([]byte, error) { + w, err := runJobTask_RunJobTaskOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunJobTask_RunJobTaskOutput) UnmarshalJSON(data []byte) error { + var w runJobTask_RunJobTaskOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runJobTask_RunJobTaskOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runLifeCycleStateWire struct { } @@ -8425,6 +12409,30 @@ func runLifeCycleStateFromWire(w *runLifeCycleStateWire) (*RunLifeCycleState, er return &RunLifeCycleState{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunLifeCycleState) MarshalJSON() ([]byte, error) { + w, err := runLifeCycleStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunLifeCycleState) UnmarshalJSON(data []byte) error { + var w runLifeCycleStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runLifeCycleStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runLifecycleStateV2Wire struct { } @@ -8442,6 +12450,30 @@ func runLifecycleStateV2FromWire(w *runLifecycleStateV2Wire) (*RunLifecycleState return &RunLifecycleStateV2{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunLifecycleStateV2) MarshalJSON() ([]byte, error) { + w, err := runLifecycleStateV2ToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunLifecycleStateV2) UnmarshalJSON(data []byte) error { + var w runLifecycleStateV2Wire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runLifecycleStateV2FromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runNowRequestWire struct { JobId *wireInt64 `json:"job_id,omitempty"` JobParameters map[string]string `json:"job_parameters,omitempty"` @@ -8530,6 +12562,30 @@ func runNowRequestFromWire(w *runNowRequestWire) (*RunNowRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunNowRequest) MarshalJSON() ([]byte, error) { + w, err := runNowRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunNowRequest) UnmarshalJSON(data []byte) error { + var w runNowRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runNowRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runNowResponseWire struct { RunId *wireInt64 `json:"run_id,omitempty"` NumberInJob *wireInt64 `json:"number_in_job,omitempty"` @@ -8571,6 +12627,30 @@ func runNowResponseFromWire(w *runNowResponseWire) (*RunNowResponse, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunNowResponse) MarshalJSON() ([]byte, error) { + w, err := runNowResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunNowResponse) UnmarshalJSON(data []byte) error { + var w runNowResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runNowResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runParametersWire struct { PipelineParams *pipelineParametersWire `json:"pipeline_params,omitempty"` JarParams []string `json:"jar_params,omitempty"` @@ -8622,6 +12702,30 @@ func runParametersFromWire(w *runParametersWire) (*RunParameters, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunParameters) MarshalJSON() ([]byte, error) { + w, err := runParametersToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunParameters) UnmarshalJSON(data []byte) error { + var w runParametersWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runParametersFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runResultStateWire struct { } @@ -8639,6 +12743,30 @@ func runResultStateFromWire(w *runResultStateWire) (*RunResultState, error) { return &RunResultState{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunResultState) MarshalJSON() ([]byte, error) { + w, err := runResultStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunResultState) UnmarshalJSON(data []byte) error { + var w runResultStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runResultStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runStateWire struct { LifeCycleState RunLifeCycleState_RunLifeCycleState `json:"life_cycle_state,omitempty"` ResultState RunResultState_RunResultState `json:"result_state,omitempty"` @@ -8673,6 +12801,30 @@ func runStateFromWire(w *runStateWire) (*RunState, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunState) MarshalJSON() ([]byte, error) { + w, err := runStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunState) UnmarshalJSON(data []byte) error { + var w runStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runStatusWire struct { State RunLifecycleStateV2_State `json:"state,omitempty"` TerminationDetails *terminationDetailsWire `json:"termination_details,omitempty"` @@ -8717,6 +12869,30 @@ func runStatusFromWire(w *runStatusWire) (*RunStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunStatus) MarshalJSON() ([]byte, error) { + w, err := runStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunStatus) UnmarshalJSON(data []byte) error { + var w runStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runTaskWire struct { RunId *wireInt64 `json:"run_id,omitempty"` State *runStateWire `json:"state,omitempty"` @@ -9510,6 +13686,30 @@ func runTaskFromWire(w *runTaskWire) (*RunTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunTask) MarshalJSON() ([]byte, error) { + w, err := runTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunTask) UnmarshalJSON(data []byte) error { + var w runTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runTaskSettingsWire struct { TaskKey *string `json:"task_key,omitempty"` Description *string `json:"description,omitempty"` @@ -10151,6 +14351,30 @@ func runTaskSettingsFromWire(w *runTaskSettingsWire) (*RunTaskSettings, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunTaskSettings) MarshalJSON() ([]byte, error) { + w, err := runTaskSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunTaskSettings) UnmarshalJSON(data []byte) error { + var w runTaskSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runTaskSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type runTriggerInfoWire struct { SqlCondition *sqlConditionRunInfoDetailsWire `json:"sql_condition,omitempty"` JobCompletion *jobCompletionTriggerRunInfoDetailsWire `json:"job_completion,omitempty"` @@ -10203,6 +14427,30 @@ func runTriggerInfoFromWire(w *runTriggerInfoWire) (*RunTriggerInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RunTriggerInfo) MarshalJSON() ([]byte, error) { + w, err := runTriggerInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RunTriggerInfo) UnmarshalJSON(data []byte) error { + var w runTriggerInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := runTriggerInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type s3StorageInfoWire struct { Destination *string `json:"destination,omitempty"` Region *string `json:"region,omitempty"` @@ -10243,6 +14491,30 @@ func s3StorageInfoFromWire(w *s3StorageInfoWire) (*S3StorageInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v S3StorageInfo) MarshalJSON() ([]byte, error) { + w, err := s3StorageInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *S3StorageInfo) UnmarshalJSON(data []byte) error { + var w s3StorageInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := s3StorageInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type scheduleTriggerStateWire struct { } @@ -10260,6 +14532,30 @@ func scheduleTriggerStateFromWire(w *scheduleTriggerStateWire) (*ScheduleTrigger return &ScheduleTriggerState{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ScheduleTriggerState) MarshalJSON() ([]byte, error) { + w, err := scheduleTriggerStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ScheduleTriggerState) UnmarshalJSON(data []byte) error { + var w scheduleTriggerStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := scheduleTriggerStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sparkJarTaskWire struct { JarUri *string `json:"jar_uri,omitempty"` MainClassName *string `json:"main_class_name,omitempty"` @@ -10291,6 +14587,30 @@ func sparkJarTaskFromWire(w *sparkJarTaskWire) (*SparkJarTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SparkJarTask) MarshalJSON() ([]byte, error) { + w, err := sparkJarTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SparkJarTask) UnmarshalJSON(data []byte) error { + var w sparkJarTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sparkJarTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sparkPythonTaskWire struct { PythonFile *string `json:"python_file,omitempty"` Parameters []string `json:"parameters,omitempty"` @@ -10319,6 +14639,30 @@ func sparkPythonTaskFromWire(w *sparkPythonTaskWire) (*SparkPythonTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SparkPythonTask) MarshalJSON() ([]byte, error) { + w, err := sparkPythonTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SparkPythonTask) UnmarshalJSON(data []byte) error { + var w sparkPythonTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sparkPythonTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sparkSubmitTaskWire struct { Parameters []string `json:"parameters,omitempty"` } @@ -10341,6 +14685,30 @@ func sparkSubmitTaskFromWire(w *sparkSubmitTaskWire) (*SparkSubmitTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SparkSubmitTask) MarshalJSON() ([]byte, error) { + w, err := sparkSubmitTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SparkSubmitTask) UnmarshalJSON(data []byte) error { + var w sparkSubmitTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sparkSubmitTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sparseCheckoutWire struct { Patterns []string `json:"patterns,omitempty"` } @@ -10363,6 +14731,30 @@ func sparseCheckoutFromWire(w *sparseCheckoutWire) (*SparseCheckout, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SparseCheckout) MarshalJSON() ([]byte, error) { + w, err := sparseCheckoutToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SparseCheckout) UnmarshalJSON(data []byte) error { + var w sparseCheckoutWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sparseCheckoutFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlAlertStateWire struct { } @@ -10380,6 +14772,30 @@ func sqlAlertStateFromWire(w *sqlAlertStateWire) (*SqlAlertState, error) { return &SqlAlertState{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlAlertState) MarshalJSON() ([]byte, error) { + w, err := sqlAlertStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlAlertState) UnmarshalJSON(data []byte) error { + var w sqlAlertStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlAlertStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlConditionConfigurationWire struct { SqlQueryId *string `json:"sql_query_id,omitempty"` WarehouseId *string `json:"warehouse_id,omitempty"` @@ -10408,6 +14824,30 @@ func sqlConditionConfigurationFromWire(w *sqlConditionConfigurationWire) (*SqlCo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlConditionConfiguration) MarshalJSON() ([]byte, error) { + w, err := sqlConditionConfigurationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlConditionConfiguration) UnmarshalJSON(data []byte) error { + var w sqlConditionConfigurationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlConditionConfigurationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlConditionRunInfoDetailsWire struct { ConditionEvaluationSqlStatementId *string `json:"condition_evaluation_sql_statement_id,omitempty"` ConditionEvaluationSatisfied *bool `json:"condition_evaluation_satisfied,omitempty"` @@ -10436,6 +14876,30 @@ func sqlConditionRunInfoDetailsFromWire(w *sqlConditionRunInfoDetailsWire) (*Sql }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlConditionRunInfoDetails) MarshalJSON() ([]byte, error) { + w, err := sqlConditionRunInfoDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlConditionRunInfoDetails) UnmarshalJSON(data []byte) error { + var w sqlConditionRunInfoDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlConditionRunInfoDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlConditionStateWire struct { LatestConditionEvaluationSqlStatementId *string `json:"latest_condition_evaluation_sql_statement_id,omitempty"` LatestConditionEvaluationSatisfied *bool `json:"latest_condition_evaluation_satisfied,omitempty"` @@ -10464,6 +14928,30 @@ func sqlConditionStateFromWire(w *sqlConditionStateWire) (*SqlConditionState, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlConditionState) MarshalJSON() ([]byte, error) { + w, err := sqlConditionStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlConditionState) UnmarshalJSON(data []byte) error { + var w sqlConditionStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlConditionStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlStatementQueryResultWire struct { Columns []sqlStatementQueryResult_ColumnWire `json:"columns,omitempty"` Rows []sqlStatementQueryResult_RowWire `json:"rows,omitempty"` @@ -10508,6 +14996,30 @@ func sqlStatementQueryResultFromWire(w *sqlStatementQueryResultWire) (*SqlStatem }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlStatementQueryResult) MarshalJSON() ([]byte, error) { + w, err := sqlStatementQueryResultToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlStatementQueryResult) UnmarshalJSON(data []byte) error { + var w sqlStatementQueryResultWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlStatementQueryResultFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlStatementQueryResult_ColumnWire struct { Name *string `json:"name,omitempty"` } @@ -10530,6 +15042,30 @@ func sqlStatementQueryResult_ColumnFromWire(w *sqlStatementQueryResult_ColumnWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlStatementQueryResult_Column) MarshalJSON() ([]byte, error) { + w, err := sqlStatementQueryResult_ColumnToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlStatementQueryResult_Column) UnmarshalJSON(data []byte) error { + var w sqlStatementQueryResult_ColumnWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlStatementQueryResult_ColumnFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlStatementQueryResult_RowWire struct { Values []sqlStatementQueryResult_Row_RowValueWire `json:"values,omitempty"` } @@ -10560,6 +15096,30 @@ func sqlStatementQueryResult_RowFromWire(w *sqlStatementQueryResult_RowWire) (*S }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlStatementQueryResult_Row) MarshalJSON() ([]byte, error) { + w, err := sqlStatementQueryResult_RowToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlStatementQueryResult_Row) UnmarshalJSON(data []byte) error { + var w sqlStatementQueryResult_RowWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlStatementQueryResult_RowFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlStatementQueryResult_Row_RowValueWire struct { StringValue *string `json:"string_value,omitempty"` } @@ -10582,6 +15142,30 @@ func sqlStatementQueryResult_Row_RowValueFromWire(w *sqlStatementQueryResult_Row }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlStatementQueryResult_Row_RowValue) MarshalJSON() ([]byte, error) { + w, err := sqlStatementQueryResult_Row_RowValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlStatementQueryResult_Row_RowValue) UnmarshalJSON(data []byte) error { + var w sqlStatementQueryResult_Row_RowValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlStatementQueryResult_Row_RowValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlTaskWire struct { Parameters map[string]string `json:"parameters,omitempty"` Query *sqlTaskQueryWire `json:"query,omitempty"` @@ -10700,6 +15284,30 @@ func sqlTaskFromWire(w *sqlTaskWire) (*SqlTask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlTask) MarshalJSON() ([]byte, error) { + w, err := sqlTaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlTask) UnmarshalJSON(data []byte) error { + var w sqlTaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlTaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlTask_SqlAlertOutputWire struct { QueryText *string `json:"query_text,omitempty"` SqlStatements []sqlTask_SqlStatementOutputWire `json:"sql_statements,omitempty"` @@ -10742,6 +15350,30 @@ func sqlTask_SqlAlertOutputFromWire(w *sqlTask_SqlAlertOutputWire) (*SqlTask_Sql }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlTask_SqlAlertOutput) MarshalJSON() ([]byte, error) { + w, err := sqlTask_SqlAlertOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlTask_SqlAlertOutput) UnmarshalJSON(data []byte) error { + var w sqlTask_SqlAlertOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlTask_SqlAlertOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlTask_SqlDashboardOutputWire struct { Widgets []sqlTask_SqlDashboardWidgetOutputWire `json:"widgets,omitempty"` WarehouseId *string `json:"warehouse_id,omitempty"` @@ -10775,6 +15407,30 @@ func sqlTask_SqlDashboardOutputFromWire(w *sqlTask_SqlDashboardOutputWire) (*Sql }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlTask_SqlDashboardOutput) MarshalJSON() ([]byte, error) { + w, err := sqlTask_SqlDashboardOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlTask_SqlDashboardOutput) UnmarshalJSON(data []byte) error { + var w sqlTask_SqlDashboardOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlTask_SqlDashboardOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlTask_SqlDashboardWidgetOutputWire struct { WidgetId *string `json:"widget_id,omitempty"` WidgetTitle *string `json:"widget_title,omitempty"` @@ -10839,6 +15495,30 @@ func sqlTask_SqlDashboardWidgetOutputFromWire(w *sqlTask_SqlDashboardWidgetOutpu }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlTask_SqlDashboardWidgetOutput) MarshalJSON() ([]byte, error) { + w, err := sqlTask_SqlDashboardWidgetOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlTask_SqlDashboardWidgetOutput) UnmarshalJSON(data []byte) error { + var w sqlTask_SqlDashboardWidgetOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlTask_SqlDashboardWidgetOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlTask_SqlFileOutputWire struct { QueryText *string `json:"query_text,omitempty"` SqlStatements []sqlTask_SqlStatementOutputWire `json:"sql_statements,omitempty"` @@ -10878,12 +15558,36 @@ func sqlTask_SqlFileOutputFromWire(w *sqlTask_SqlFileOutputWire) (*SqlTask_SqlFi if err != nil { return nil, fmt.Errorf("%s: %w", "SqlTask_SqlFileOutput.QueryResult", err) } - return &SqlTask_SqlFileOutput{ - QueryText: w.QueryText, - SqlStatements: sqlStatementsPublicValue, - QueryResult: queryResultPublicValue, - WarehouseId: w.WarehouseId, - }, nil + return &SqlTask_SqlFileOutput{ + QueryText: w.QueryText, + SqlStatements: sqlStatementsPublicValue, + QueryResult: queryResultPublicValue, + WarehouseId: w.WarehouseId, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlTask_SqlFileOutput) MarshalJSON() ([]byte, error) { + w, err := sqlTask_SqlFileOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlTask_SqlFileOutput) UnmarshalJSON(data []byte) error { + var w sqlTask_SqlFileOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlTask_SqlFileOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil } type sqlTask_SqlOutputWire struct { @@ -10998,6 +15702,30 @@ func sqlTask_SqlOutputFromWire(w *sqlTask_SqlOutputWire) (*SqlTask_SqlOutput, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlTask_SqlOutput) MarshalJSON() ([]byte, error) { + w, err := sqlTask_SqlOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlTask_SqlOutput) UnmarshalJSON(data []byte) error { + var w sqlTask_SqlOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlTask_SqlOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlTask_SqlOutputErrorWire struct { Message *string `json:"message,omitempty"` } @@ -11020,6 +15748,30 @@ func sqlTask_SqlOutputErrorFromWire(w *sqlTask_SqlOutputErrorWire) (*SqlTask_Sql }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlTask_SqlOutputError) MarshalJSON() ([]byte, error) { + w, err := sqlTask_SqlOutputErrorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlTask_SqlOutputError) UnmarshalJSON(data []byte) error { + var w sqlTask_SqlOutputErrorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlTask_SqlOutputErrorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlTask_SqlQueryOutputWire struct { QueryText *string `json:"query_text,omitempty"` EndpointId *string `json:"endpoint_id,omitempty"` @@ -11062,6 +15814,30 @@ func sqlTask_SqlQueryOutputFromWire(w *sqlTask_SqlQueryOutputWire) (*SqlTask_Sql }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlTask_SqlQueryOutput) MarshalJSON() ([]byte, error) { + w, err := sqlTask_SqlQueryOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlTask_SqlQueryOutput) UnmarshalJSON(data []byte) error { + var w sqlTask_SqlQueryOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlTask_SqlQueryOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlTask_SqlStatementOutputWire struct { LookupKey *string `json:"lookup_key,omitempty"` } @@ -11084,6 +15860,30 @@ func sqlTask_SqlStatementOutputFromWire(w *sqlTask_SqlStatementOutputWire) (*Sql }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlTask_SqlStatementOutput) MarshalJSON() ([]byte, error) { + w, err := sqlTask_SqlStatementOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlTask_SqlStatementOutput) UnmarshalJSON(data []byte) error { + var w sqlTask_SqlStatementOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlTask_SqlStatementOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlTaskAlertWire struct { AlertId *string `json:"alert_id,omitempty"` Subscriptions []sqlTaskSubscriptionWire `json:"subscriptions,omitempty"` @@ -11120,6 +15920,30 @@ func sqlTaskAlertFromWire(w *sqlTaskAlertWire) (*SqlTaskAlert, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlTaskAlert) MarshalJSON() ([]byte, error) { + w, err := sqlTaskAlertToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlTaskAlert) UnmarshalJSON(data []byte) error { + var w sqlTaskAlertWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlTaskAlertFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlTaskDashboardWire struct { DashboardId *string `json:"dashboard_id,omitempty"` Subscriptions []sqlTaskSubscriptionWire `json:"subscriptions,omitempty"` @@ -11159,6 +15983,30 @@ func sqlTaskDashboardFromWire(w *sqlTaskDashboardWire) (*SqlTaskDashboard, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlTaskDashboard) MarshalJSON() ([]byte, error) { + w, err := sqlTaskDashboardToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlTaskDashboard) UnmarshalJSON(data []byte) error { + var w sqlTaskDashboardWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlTaskDashboardFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlTaskFileWire struct { Path *string `json:"path,omitempty"` Source Source `json:"source,omitempty"` @@ -11184,6 +16032,30 @@ func sqlTaskFileFromWire(w *sqlTaskFileWire) (*SqlTaskFile, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlTaskFile) MarshalJSON() ([]byte, error) { + w, err := sqlTaskFileToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlTaskFile) UnmarshalJSON(data []byte) error { + var w sqlTaskFileWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlTaskFileFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlTaskQueryWire struct { QueryId *string `json:"query_id,omitempty"` } @@ -11228,6 +16100,30 @@ func sqlTaskQueryFromWire(w *sqlTaskQueryWire) (*SqlTaskQuery, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlTaskQuery) MarshalJSON() ([]byte, error) { + w, err := sqlTaskQueryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlTaskQuery) UnmarshalJSON(data []byte) error { + var w sqlTaskQueryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlTaskQueryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sqlTaskSubscriptionWire struct { UserName *string `json:"user_name,omitempty"` DestinationId *string `json:"destination_id,omitempty"` @@ -11284,6 +16180,30 @@ func sqlTaskSubscriptionFromWire(w *sqlTaskSubscriptionWire) (*SqlTaskSubscripti }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SqlTaskSubscription) MarshalJSON() ([]byte, error) { + w, err := sqlTaskSubscriptionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SqlTaskSubscription) UnmarshalJSON(data []byte) error { + var w sqlTaskSubscriptionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sqlTaskSubscriptionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type submitRunRequestWire struct { AccessControlList []accessControlRequestWire `json:"access_control_list,omitempty"` Queue *queueSettingsWire `json:"queue,omitempty"` @@ -11445,6 +16365,30 @@ func submitRunRequestFromWire(w *submitRunRequestWire) (*SubmitRunRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SubmitRunRequest) MarshalJSON() ([]byte, error) { + w, err := submitRunRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SubmitRunRequest) UnmarshalJSON(data []byte) error { + var w submitRunRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := submitRunRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type submitRunResponseWire struct { RunId *wireInt64 `json:"run_id,omitempty"` } @@ -11475,6 +16419,30 @@ func submitRunResponseFromWire(w *submitRunResponseWire) (*SubmitRunResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SubmitRunResponse) MarshalJSON() ([]byte, error) { + w, err := submitRunResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SubmitRunResponse) UnmarshalJSON(data []byte) error { + var w submitRunResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := submitRunResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type subscriptionWire struct { Subscribers []subscription_SubscriberWire `json:"subscribers,omitempty"` Paused *bool `json:"paused,omitempty"` @@ -11522,6 +16490,30 @@ func subscriptionFromWire(w *subscriptionWire) (*Subscription, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Subscription) MarshalJSON() ([]byte, error) { + w, err := subscriptionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Subscription) UnmarshalJSON(data []byte) error { + var w subscriptionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := subscriptionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type subscription_AttachmentWire struct { DataAttachment *subscription_Attachment_DataAttachmentWire `json:"data_attachment,omitempty"` PageAttachment *subscription_Attachment_PageAttachmentWire `json:"page_attachment,omitempty"` @@ -11563,6 +16555,30 @@ func subscription_AttachmentFromWire(w *subscription_AttachmentWire) (*Subscript }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Subscription_Attachment) MarshalJSON() ([]byte, error) { + w, err := subscription_AttachmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Subscription_Attachment) UnmarshalJSON(data []byte) error { + var w subscription_AttachmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := subscription_AttachmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type subscription_Attachment_DataAttachmentWire struct { Widgets []subscription_Attachment_DataAttachment_WidgetWire `json:"widgets,omitempty"` FileFormat Subscription_Attachment_DataAttachment_FileFormat `json:"file_format,omitempty"` @@ -11599,6 +16615,30 @@ func subscription_Attachment_DataAttachmentFromWire(w *subscription_Attachment_D }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Subscription_Attachment_DataAttachment) MarshalJSON() ([]byte, error) { + w, err := subscription_Attachment_DataAttachmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Subscription_Attachment_DataAttachment) UnmarshalJSON(data []byte) error { + var w subscription_Attachment_DataAttachmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := subscription_Attachment_DataAttachmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type subscription_Attachment_DataAttachment_WidgetWire struct { PageId *string `json:"page_id,omitempty"` WidgetId *string `json:"widget_id,omitempty"` @@ -11624,6 +16664,30 @@ func subscription_Attachment_DataAttachment_WidgetFromWire(w *subscription_Attac }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Subscription_Attachment_DataAttachment_Widget) MarshalJSON() ([]byte, error) { + w, err := subscription_Attachment_DataAttachment_WidgetToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Subscription_Attachment_DataAttachment_Widget) UnmarshalJSON(data []byte) error { + var w subscription_Attachment_DataAttachment_WidgetWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := subscription_Attachment_DataAttachment_WidgetFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type subscription_Attachment_PageAttachmentWire struct { PageSelection Subscription_Attachment_PageAttachment_PageSelection `json:"page_selection,omitempty"` PageIds []string `json:"page_ids,omitempty"` @@ -11649,6 +16713,30 @@ func subscription_Attachment_PageAttachmentFromWire(w *subscription_Attachment_P }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Subscription_Attachment_PageAttachment) MarshalJSON() ([]byte, error) { + w, err := subscription_Attachment_PageAttachmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Subscription_Attachment_PageAttachment) UnmarshalJSON(data []byte) error { + var w subscription_Attachment_PageAttachmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := subscription_Attachment_PageAttachmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type subscription_SubscriberWire struct { UserName *string `json:"user_name,omitempty"` DestinationId *string `json:"destination_id,omitempty"` @@ -11705,6 +16793,30 @@ func subscription_SubscriberFromWire(w *subscription_SubscriberWire) (*Subscript }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Subscription_Subscriber) MarshalJSON() ([]byte, error) { + w, err := subscription_SubscriberToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Subscription_Subscriber) UnmarshalJSON(data []byte) error { + var w subscription_SubscriberWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := subscription_SubscriberFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tableStateWire struct { TableName *string `json:"table_name,omitempty"` HasSeenUpdates *bool `json:"has_seen_updates,omitempty"` @@ -11730,6 +16842,30 @@ func tableStateFromWire(w *tableStateWire) (*TableState, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TableState) MarshalJSON() ([]byte, error) { + w, err := tableStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TableState) UnmarshalJSON(data []byte) error { + var w tableStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tableStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tableTriggerConfigurationWire struct { TableNames []string `json:"table_names,omitempty"` MinTimeBetweenTriggersSeconds *int `json:"min_time_between_triggers_seconds,omitempty"` @@ -11761,6 +16897,30 @@ func tableTriggerConfigurationFromWire(w *tableTriggerConfigurationWire) (*Table }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TableTriggerConfiguration) MarshalJSON() ([]byte, error) { + w, err := tableTriggerConfigurationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TableTriggerConfiguration) UnmarshalJSON(data []byte) error { + var w tableTriggerConfigurationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tableTriggerConfigurationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tableTriggerStateWire struct { LastSeenTableStates []tableStateWire `json:"last_seen_table_states,omitempty"` UsingScalableMonitoring *bool `json:"using_scalable_monitoring,omitempty"` @@ -11794,6 +16954,30 @@ func tableTriggerStateFromWire(w *tableTriggerStateWire) (*TableTriggerState, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TableTriggerState) MarshalJSON() ([]byte, error) { + w, err := tableTriggerStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TableTriggerState) UnmarshalJSON(data []byte) error { + var w tableTriggerStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tableTriggerStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type taskDependencyWire struct { TaskKey *string `json:"task_key,omitempty"` Outcome *string `json:"outcome,omitempty"` @@ -11819,6 +17003,30 @@ func taskDependencyFromWire(w *taskDependencyWire) (*TaskDependency, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TaskDependency) MarshalJSON() ([]byte, error) { + w, err := taskDependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TaskDependency) UnmarshalJSON(data []byte) error { + var w taskDependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := taskDependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type taskSettingsWire struct { TaskKey *string `json:"task_key,omitempty"` DependsOn []taskDependencyWire `json:"depends_on,omitempty"` @@ -12460,6 +17668,30 @@ func taskSettingsFromWire(w *taskSettingsWire) (*TaskSettings, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TaskSettings) MarshalJSON() ([]byte, error) { + w, err := taskSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TaskSettings) UnmarshalJSON(data []byte) error { + var w taskSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := taskSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type terminationCodeWire struct { } @@ -12477,6 +17709,30 @@ func terminationCodeFromWire(w *terminationCodeWire) (*TerminationCode, error) { return &TerminationCode{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TerminationCode) MarshalJSON() ([]byte, error) { + w, err := terminationCodeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TerminationCode) UnmarshalJSON(data []byte) error { + var w terminationCodeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := terminationCodeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type terminationDetailsWire struct { Code TerminationCode_Code `json:"code,omitempty"` Type TerminationType_Type `json:"type,omitempty"` @@ -12505,6 +17761,30 @@ func terminationDetailsFromWire(w *terminationDetailsWire) (*TerminationDetails, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TerminationDetails) MarshalJSON() ([]byte, error) { + w, err := terminationDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TerminationDetails) UnmarshalJSON(data []byte) error { + var w terminationDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := terminationDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type terminationTypeWire struct { } @@ -12522,6 +17802,30 @@ func terminationTypeFromWire(w *terminationTypeWire) (*TerminationType, error) { return &TerminationType{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TerminationType) MarshalJSON() ([]byte, error) { + w, err := terminationTypeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TerminationType) UnmarshalJSON(data []byte) error { + var w terminationTypeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := terminationTypeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type triggerConfigurationWire struct { PauseStatus SchedulePauseStatus `json:"pause_status,omitempty"` Periodic *periodicTriggerConfigurationWire `json:"periodic,omitempty"` @@ -12632,6 +17936,30 @@ func triggerConfigurationFromWire(w *triggerConfigurationWire) (*TriggerConfigur }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TriggerConfiguration) MarshalJSON() ([]byte, error) { + w, err := triggerConfigurationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TriggerConfiguration) UnmarshalJSON(data []byte) error { + var w triggerConfigurationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := triggerConfigurationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type triggerDetailsWire struct { State *perTriggerStateWire `json:"state,omitempty"` History *triggerHistoryWire `json:"history,omitempty"` @@ -12673,6 +18001,30 @@ func triggerDetailsFromWire(w *triggerDetailsWire) (*TriggerDetails, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TriggerDetails) MarshalJSON() ([]byte, error) { + w, err := triggerDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TriggerDetails) UnmarshalJSON(data []byte) error { + var w triggerDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := triggerDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type triggerEvaluationWire struct { Timestamp *wireInt64 `json:"timestamp,omitempty"` Description *string `json:"description,omitempty"` @@ -12717,6 +18069,30 @@ func triggerEvaluationFromWire(w *triggerEvaluationWire) (*TriggerEvaluation, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TriggerEvaluation) MarshalJSON() ([]byte, error) { + w, err := triggerEvaluationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TriggerEvaluation) UnmarshalJSON(data []byte) error { + var w triggerEvaluationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := triggerEvaluationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type triggerHistoryWire struct { LastTriggered *triggerEvaluationWire `json:"last_triggered,omitempty"` LastNotTriggered *triggerEvaluationWire `json:"last_not_triggered,omitempty"` @@ -12769,6 +18145,30 @@ func triggerHistoryFromWire(w *triggerHistoryWire) (*TriggerHistory, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TriggerHistory) MarshalJSON() ([]byte, error) { + w, err := triggerHistoryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TriggerHistory) UnmarshalJSON(data []byte) error { + var w triggerHistoryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := triggerHistoryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type triggerSettingsWire struct { PauseStatus SchedulePauseStatus `json:"pause_status,omitempty"` FileArrival *fileArrivalTriggerConfigurationWire `json:"file_arrival,omitempty"` @@ -12915,6 +18315,30 @@ func triggerSettingsFromWire(w *triggerSettingsWire) (*TriggerSettings, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TriggerSettings) MarshalJSON() ([]byte, error) { + w, err := triggerSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TriggerSettings) UnmarshalJSON(data []byte) error { + var w triggerSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := triggerSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type triggerStateWire struct { Table *tableTriggerStateWire `json:"table,omitempty"` FileArrival *fileArrivalTriggerStateWire `json:"file_arrival,omitempty"` @@ -13021,6 +18445,30 @@ func triggerStateFromWire(w *triggerStateWire) (*TriggerState, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TriggerState) MarshalJSON() ([]byte, error) { + w, err := triggerStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TriggerState) UnmarshalJSON(data []byte) error { + var w triggerStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := triggerStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateJobRequestWire struct { JobId *wireInt64 `json:"job_id,omitempty"` NewSettings *jobSettingsWire `json:"new_settings,omitempty"` @@ -13065,6 +18513,30 @@ func updateJobRequestFromWire(w *updateJobRequestWire) (*UpdateJobRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateJobRequest) MarshalJSON() ([]byte, error) { + w, err := updateJobRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateJobRequest) UnmarshalJSON(data []byte) error { + var w updateJobRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateJobRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateJobResponseWire struct { } @@ -13082,6 +18554,30 @@ func updateJobResponseFromWire(w *updateJobResponseWire) (*UpdateJobResponse, er return &UpdateJobResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateJobResponse) MarshalJSON() ([]byte, error) { + w, err := updateJobResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateJobResponse) UnmarshalJSON(data []byte) error { + var w updateJobResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateJobResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type viewItemWire struct { Content *string `json:"content,omitempty"` Name *string `json:"name,omitempty"` @@ -13110,6 +18606,30 @@ func viewItemFromWire(w *viewItemWire) (*ViewItem, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ViewItem) MarshalJSON() ([]byte, error) { + w, err := viewItemToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ViewItem) UnmarshalJSON(data []byte) error { + var w viewItemWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := viewItemFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type volumeSourceWire struct { VolumePath *string `json:"volume_path,omitempty"` } @@ -13132,6 +18652,30 @@ func volumeSourceFromWire(w *volumeSourceWire) (*VolumeSource, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v VolumeSource) MarshalJSON() ([]byte, error) { + w, err := volumeSourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *VolumeSource) UnmarshalJSON(data []byte) error { + var w volumeSourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := volumeSourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type volumesStorageInfoWire struct { Destination *string `json:"destination,omitempty"` } @@ -13154,6 +18698,30 @@ func volumesStorageInfoFromWire(w *volumesStorageInfoWire) (*VolumesStorageInfo, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v VolumesStorageInfo) MarshalJSON() ([]byte, error) { + w, err := volumesStorageInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *VolumesStorageInfo) UnmarshalJSON(data []byte) error { + var w volumesStorageInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := volumesStorageInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type webhookWire struct { Id *string `json:"id,omitempty"` } @@ -13176,6 +18744,30 @@ func webhookFromWire(w *webhookWire) (*Webhook, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Webhook) MarshalJSON() ([]byte, error) { + w, err := webhookToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Webhook) UnmarshalJSON(data []byte) error { + var w webhookWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := webhookFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type webhookNotificationsWire struct { OnStart []webhookWire `json:"on_start,omitempty"` OnSuccess []webhookWire `json:"on_success,omitempty"` @@ -13272,6 +18864,30 @@ func webhookNotificationsFromWire(w *webhookNotificationsWire) (*WebhookNotifica }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WebhookNotifications) MarshalJSON() ([]byte, error) { + w, err := webhookNotificationsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WebhookNotifications) UnmarshalJSON(data []byte) error { + var w webhookNotificationsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := webhookNotificationsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type widgetErrorDetailWire struct { Message *string `json:"message,omitempty"` } @@ -13294,6 +18910,30 @@ func widgetErrorDetailFromWire(w *widgetErrorDetailWire) (*WidgetErrorDetail, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WidgetErrorDetail) MarshalJSON() ([]byte, error) { + w, err := widgetErrorDetailToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WidgetErrorDetail) UnmarshalJSON(data []byte) error { + var w widgetErrorDetailWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := widgetErrorDetailFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type workloadTypeWire struct { Clients *workloadType_ClientsTypesWire `json:"clients,omitempty"` } @@ -13324,6 +18964,30 @@ func workloadTypeFromWire(w *workloadTypeWire) (*WorkloadType, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WorkloadType) MarshalJSON() ([]byte, error) { + w, err := workloadTypeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WorkloadType) UnmarshalJSON(data []byte) error { + var w workloadTypeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := workloadTypeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type workloadType_ClientsTypesWire struct { Notebooks *bool `json:"notebooks,omitempty"` Jobs *bool `json:"jobs,omitempty"` @@ -13349,6 +19013,30 @@ func workloadType_ClientsTypesFromWire(w *workloadType_ClientsTypesWire) (*Workl }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WorkloadType_ClientsTypes) MarshalJSON() ([]byte, error) { + w, err := workloadType_ClientsTypesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WorkloadType_ClientsTypes) UnmarshalJSON(data []byte) error { + var w workloadType_ClientsTypesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := workloadType_ClientsTypesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type workspaceStorageInfoWire struct { Destination *string `json:"destination,omitempty"` } @@ -13371,6 +19059,30 @@ func workspaceStorageInfoFromWire(w *workspaceStorageInfoWire) (*WorkspaceStorag }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WorkspaceStorageInfo) MarshalJSON() ([]byte, error) { + w, err := workspaceStorageInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WorkspaceStorageInfo) UnmarshalJSON(data []byte) error { + var w workspaceStorageInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := workspaceStorageInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/keyconfigurations/CHANGELOG.md b/keyconfigurations/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/keyconfigurations/CHANGELOG.md +++ b/keyconfigurations/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/keyconfigurations/internal/version.go b/keyconfigurations/internal/version.go index b135317e..12498729 100644 --- a/keyconfigurations/internal/version.go +++ b/keyconfigurations/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-keyconfigurations" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/keyconfigurations/v1/wire.go b/keyconfigurations/v1/wire.go index df976487..2448212e 100644 --- a/keyconfigurations/v1/wire.go +++ b/keyconfigurations/v1/wire.go @@ -83,6 +83,30 @@ func awsKeyInfoOutputFromWire(w *awsKeyInfoOutputWire) (*AwsKeyInfoOutput, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AwsKeyInfoOutput) MarshalJSON() ([]byte, error) { + w, err := awsKeyInfoOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AwsKeyInfoOutput) UnmarshalJSON(data []byte) error { + var w awsKeyInfoOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := awsKeyInfoOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type azureKeyInfoWire struct { KeyVaultUri *string `json:"key_vault_uri,omitempty"` KeyName *string `json:"key_name,omitempty"` @@ -128,6 +152,30 @@ func azureKeyInfoFromWire(w *azureKeyInfoWire) (*AzureKeyInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AzureKeyInfo) MarshalJSON() ([]byte, error) { + w, err := azureKeyInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AzureKeyInfo) UnmarshalJSON(data []byte) error { + var w azureKeyInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := azureKeyInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAwsKeyInfoWire struct { KeyArn *string `json:"key_arn,omitempty"` KeyAlias *string `json:"key_alias,omitempty"` @@ -159,6 +207,30 @@ func createAwsKeyInfoFromWire(w *createAwsKeyInfoWire) (*CreateAwsKeyInfo, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAwsKeyInfo) MarshalJSON() ([]byte, error) { + w, err := createAwsKeyInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAwsKeyInfo) UnmarshalJSON(data []byte) error { + var w createAwsKeyInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAwsKeyInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAzureKeyInfoWire struct { KeyVaultUri *string `json:"key_vault_uri,omitempty"` KeyName *string `json:"key_name,omitempty"` @@ -204,6 +276,30 @@ func createAzureKeyInfoFromWire(w *createAzureKeyInfoWire) (*CreateAzureKeyInfo, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAzureKeyInfo) MarshalJSON() ([]byte, error) { + w, err := createAzureKeyInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAzureKeyInfo) UnmarshalJSON(data []byte) error { + var w createAzureKeyInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAzureKeyInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCustomerManagedKeyRequestWire struct { AccountId *string `json:"account_id,omitempty"` AwsKeyInfo *createAwsKeyInfoWire `json:"aws_key_info,omitempty"` @@ -302,6 +398,30 @@ func createCustomerManagedKeyRequestFromWire(w *createCustomerManagedKeyRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCustomerManagedKeyRequest) MarshalJSON() ([]byte, error) { + w, err := createCustomerManagedKeyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCustomerManagedKeyRequest) UnmarshalJSON(data []byte) error { + var w createCustomerManagedKeyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCustomerManagedKeyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createGcpKeyInfoWire struct { KmsKeyId *string `json:"kms_key_id,omitempty"` GcpServiceAccount *gcpServiceAccountWire `json:"gcp_service_account,omitempty"` @@ -338,6 +458,30 @@ func createGcpKeyInfoFromWire(w *createGcpKeyInfoWire) (*CreateGcpKeyInfo, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateGcpKeyInfo) MarshalJSON() ([]byte, error) { + w, err := createGcpKeyInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateGcpKeyInfo) UnmarshalJSON(data []byte) error { + var w createGcpKeyInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createGcpKeyInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type customerManagedKeyWire struct { CustomerManagedKeyId *string `json:"customer_managed_key_id,omitempty"` CreationTime *wireInt64 `json:"creation_time,omitempty"` @@ -450,6 +594,30 @@ func customerManagedKeyFromWire(w *customerManagedKeyWire) (*CustomerManagedKey, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CustomerManagedKey) MarshalJSON() ([]byte, error) { + w, err := customerManagedKeyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CustomerManagedKey) UnmarshalJSON(data []byte) error { + var w customerManagedKeyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := customerManagedKeyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCustomerManagedKeyRequestWire struct { CustomerManagedKeyId *string `json:"customer_managed_key_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -475,6 +643,30 @@ func deleteCustomerManagedKeyRequestFromWire(w *deleteCustomerManagedKeyRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCustomerManagedKeyRequest) MarshalJSON() ([]byte, error) { + w, err := deleteCustomerManagedKeyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCustomerManagedKeyRequest) UnmarshalJSON(data []byte) error { + var w deleteCustomerManagedKeyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCustomerManagedKeyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gcpKeyInfoWire struct { KmsKeyId *string `json:"kms_key_id,omitempty"` GcpServiceAccount *gcpServiceAccountWire `json:"gcp_service_account,omitempty"` @@ -511,6 +703,30 @@ func gcpKeyInfoFromWire(w *gcpKeyInfoWire) (*GcpKeyInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GcpKeyInfo) MarshalJSON() ([]byte, error) { + w, err := gcpKeyInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GcpKeyInfo) UnmarshalJSON(data []byte) error { + var w gcpKeyInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gcpKeyInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gcpServiceAccountWire struct { ServiceAccountEmail *string `json:"service_account_email,omitempty"` } @@ -533,6 +749,30 @@ func gcpServiceAccountFromWire(w *gcpServiceAccountWire) (*GcpServiceAccount, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GcpServiceAccount) MarshalJSON() ([]byte, error) { + w, err := gcpServiceAccountToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GcpServiceAccount) UnmarshalJSON(data []byte) error { + var w gcpServiceAccountWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gcpServiceAccountFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCustomerManagedKeyRequestWire struct { CustomerManagedKeyId *string `json:"customer_managed_key_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -558,6 +798,30 @@ func getCustomerManagedKeyRequestFromWire(w *getCustomerManagedKeyRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCustomerManagedKeyRequest) MarshalJSON() ([]byte, error) { + w, err := getCustomerManagedKeyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCustomerManagedKeyRequest) UnmarshalJSON(data []byte) error { + var w getCustomerManagedKeyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCustomerManagedKeyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type keyAccessConfigurationWire struct { CredentialId *string `json:"credential_id,omitempty"` } @@ -580,6 +844,30 @@ func keyAccessConfigurationFromWire(w *keyAccessConfigurationWire) (*KeyAccessCo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v KeyAccessConfiguration) MarshalJSON() ([]byte, error) { + w, err := keyAccessConfigurationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *KeyAccessConfiguration) UnmarshalJSON(data []byte) error { + var w keyAccessConfigurationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := keyAccessConfigurationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCustomerManagedKeyRequestWire struct { AccountId *string `json:"account_id,omitempty"` } @@ -602,6 +890,30 @@ func listCustomerManagedKeyRequestFromWire(w *listCustomerManagedKeyRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCustomerManagedKeyRequest) MarshalJSON() ([]byte, error) { + w, err := listCustomerManagedKeyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCustomerManagedKeyRequest) UnmarshalJSON(data []byte) error { + var w listCustomerManagedKeyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCustomerManagedKeyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCustomerManagedKeyResponseWire struct { CustomerManagedKeys []customerManagedKeyWire `json:"customer_managed_keys,omitempty"` } @@ -632,6 +944,30 @@ func listCustomerManagedKeyResponseFromWire(w *listCustomerManagedKeyResponseWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCustomerManagedKeyResponse) MarshalJSON() ([]byte, error) { + w, err := listCustomerManagedKeyResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCustomerManagedKeyResponse) UnmarshalJSON(data []byte) error { + var w listCustomerManagedKeyResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCustomerManagedKeyResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/knowledge/CHANGELOG.md b/knowledge/CHANGELOG.md index db6576ba..1a070324 100644 --- a/knowledge/CHANGELOG.md +++ b/knowledge/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.5.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.4.0 (2026-11-11) ## Release v0.3.0 (2026-11-10) diff --git a/knowledge/internal/version.go b/knowledge/internal/version.go index 8e2103c6..8fb8e1c7 100644 --- a/knowledge/internal/version.go +++ b/knowledge/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-knowledge" -const Version = "0.4.0" +const Version = "0.5.0" diff --git a/knowledge/v1/wire.go b/knowledge/v1/wire.go index aedc9cfa..8557e8da 100644 --- a/knowledge/v1/wire.go +++ b/knowledge/v1/wire.go @@ -3,6 +3,7 @@ package knowledge import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -42,6 +43,30 @@ func assetLinkFromWire(w *assetLinkWire) (*AssetLink, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AssetLink) MarshalJSON() ([]byte, error) { + w, err := assetLinkToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AssetLink) UnmarshalJSON(data []byte) error { + var w assetLinkWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := assetLinkFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAssetLinkRequestWire struct { Parent *string `json:"parent,omitempty"` AssetLink *assetLinkWire `json:"asset_link,omitempty"` @@ -75,6 +100,30 @@ func createAssetLinkRequestFromWire(w *createAssetLinkRequestWire) (*CreateAsset }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAssetLinkRequest) MarshalJSON() ([]byte, error) { + w, err := createAssetLinkRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAssetLinkRequest) UnmarshalJSON(data []byte) error { + var w createAssetLinkRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAssetLinkRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createPageRequestWire struct { Page *pageWire `json:"page,omitempty"` RequestId *string `json:"request_id,omitempty"` @@ -108,6 +157,30 @@ func createPageRequestFromWire(w *createPageRequestWire) (*CreatePageRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreatePageRequest) MarshalJSON() ([]byte, error) { + w, err := createPageRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreatePageRequest) UnmarshalJSON(data []byte) error { + var w createPageRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createPageRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteAssetLinkRequestWire struct { Name *string `json:"name,omitempty"` } @@ -130,6 +203,30 @@ func deleteAssetLinkRequestFromWire(w *deleteAssetLinkRequestWire) (*DeleteAsset }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteAssetLinkRequest) MarshalJSON() ([]byte, error) { + w, err := deleteAssetLinkRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteAssetLinkRequest) UnmarshalJSON(data []byte) error { + var w deleteAssetLinkRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteAssetLinkRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deletePageRequestWire struct { Name *string `json:"name,omitempty"` } @@ -152,6 +249,30 @@ func deletePageRequestFromWire(w *deletePageRequestWire) (*DeletePageRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeletePageRequest) MarshalJSON() ([]byte, error) { + w, err := deletePageRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeletePageRequest) UnmarshalJSON(data []byte) error { + var w deletePageRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deletePageRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAssetLinkRequestWire struct { Name *string `json:"name,omitempty"` } @@ -174,6 +295,30 @@ func getAssetLinkRequestFromWire(w *getAssetLinkRequestWire) (*GetAssetLinkReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAssetLinkRequest) MarshalJSON() ([]byte, error) { + w, err := getAssetLinkRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAssetLinkRequest) UnmarshalJSON(data []byte) error { + var w getAssetLinkRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAssetLinkRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPageRequestWire struct { Name *string `json:"name,omitempty"` } @@ -196,6 +341,30 @@ func getPageRequestFromWire(w *getPageRequestWire) (*GetPageRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPageRequest) MarshalJSON() ([]byte, error) { + w, err := getPageRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPageRequest) UnmarshalJSON(data []byte) error { + var w getPageRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPageRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPagesRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -224,6 +393,30 @@ func listPagesRequestFromWire(w *listPagesRequestWire) (*ListPagesRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPagesRequest) MarshalJSON() ([]byte, error) { + w, err := listPagesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPagesRequest) UnmarshalJSON(data []byte) error { + var w listPagesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPagesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPagesResponseWire struct { Pages []pageWire `json:"pages,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -257,6 +450,30 @@ func listPagesResponseFromWire(w *listPagesResponseWire) (*ListPagesResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPagesResponse) MarshalJSON() ([]byte, error) { + w, err := listPagesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPagesResponse) UnmarshalJSON(data []byte) error { + var w listPagesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPagesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pageWire struct { Name *string `json:"name,omitempty"` Domain *string `json:"domain,omitempty"` @@ -306,6 +523,30 @@ func pageFromWire(w *pageWire) (*Page, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Page) MarshalJSON() ([]byte, error) { + w, err := pageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Page) UnmarshalJSON(data []byte) error { + var w pageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updatePageRequestWire struct { Page *pageWire `json:"page,omitempty"` UpdateMask *types.FieldMask[Page] `json:"update_mask,omitempty"` @@ -339,6 +580,30 @@ func updatePageRequestFromWire(w *updatePageRequestWire) (*UpdatePageRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdatePageRequest) MarshalJSON() ([]byte, error) { + w, err := updatePageRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdatePageRequest) UnmarshalJSON(data []byte) error { + var w updatePageRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updatePageRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/knowledgeassistants/CHANGELOG.md b/knowledgeassistants/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/knowledgeassistants/CHANGELOG.md +++ b/knowledgeassistants/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/knowledgeassistants/internal/version.go b/knowledgeassistants/internal/version.go index 4564cd26..809e0e18 100644 --- a/knowledgeassistants/internal/version.go +++ b/knowledgeassistants/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-knowledgeassistants" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/knowledgeassistants/v1/wire.go b/knowledgeassistants/v1/wire.go index 0019875e..15e7a38e 100644 --- a/knowledgeassistants/v1/wire.go +++ b/knowledgeassistants/v1/wire.go @@ -3,6 +3,7 @@ package knowledgeassistants import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -41,6 +42,30 @@ func createExampleRequestFromWire(w *createExampleRequestWire) (*CreateExampleRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateExampleRequest) MarshalJSON() ([]byte, error) { + w, err := createExampleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateExampleRequest) UnmarshalJSON(data []byte) error { + var w createExampleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createExampleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createKnowledgeAssistantRequestWire struct { KnowledgeAssistant *knowledgeAssistantWire `json:"knowledge_assistant,omitempty"` } @@ -71,6 +96,30 @@ func createKnowledgeAssistantRequestFromWire(w *createKnowledgeAssistantRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateKnowledgeAssistantRequest) MarshalJSON() ([]byte, error) { + w, err := createKnowledgeAssistantRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateKnowledgeAssistantRequest) UnmarshalJSON(data []byte) error { + var w createKnowledgeAssistantRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createKnowledgeAssistantRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createKnowledgeSourceRequestWire struct { Parent *string `json:"parent,omitempty"` KnowledgeSource *knowledgeSourceWire `json:"knowledge_source,omitempty"` @@ -104,6 +153,30 @@ func createKnowledgeSourceRequestFromWire(w *createKnowledgeSourceRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateKnowledgeSourceRequest) MarshalJSON() ([]byte, error) { + w, err := createKnowledgeSourceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateKnowledgeSourceRequest) UnmarshalJSON(data []byte) error { + var w createKnowledgeSourceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createKnowledgeSourceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteExampleRequestWire struct { Name *string `json:"name,omitempty"` } @@ -126,6 +199,30 @@ func deleteExampleRequestFromWire(w *deleteExampleRequestWire) (*DeleteExampleRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteExampleRequest) MarshalJSON() ([]byte, error) { + w, err := deleteExampleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteExampleRequest) UnmarshalJSON(data []byte) error { + var w deleteExampleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteExampleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteKnowledgeAssistantRequestWire struct { Name *string `json:"name,omitempty"` } @@ -148,6 +245,30 @@ func deleteKnowledgeAssistantRequestFromWire(w *deleteKnowledgeAssistantRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteKnowledgeAssistantRequest) MarshalJSON() ([]byte, error) { + w, err := deleteKnowledgeAssistantRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteKnowledgeAssistantRequest) UnmarshalJSON(data []byte) error { + var w deleteKnowledgeAssistantRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteKnowledgeAssistantRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteKnowledgeSourceRequestWire struct { Name *string `json:"name,omitempty"` } @@ -170,6 +291,30 @@ func deleteKnowledgeSourceRequestFromWire(w *deleteKnowledgeSourceRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteKnowledgeSourceRequest) MarshalJSON() ([]byte, error) { + w, err := deleteKnowledgeSourceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteKnowledgeSourceRequest) UnmarshalJSON(data []byte) error { + var w deleteKnowledgeSourceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteKnowledgeSourceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type exampleWire struct { Name *string `json:"name,omitempty"` Question *string `json:"question,omitempty"` @@ -207,6 +352,30 @@ func exampleFromWire(w *exampleWire) (*Example, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Example) MarshalJSON() ([]byte, error) { + w, err := exampleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Example) UnmarshalJSON(data []byte) error { + var w exampleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := exampleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type fileTableSpecWire struct { TableName *string `json:"table_name,omitempty"` FileCol *string `json:"file_col,omitempty"` @@ -232,6 +401,30 @@ func fileTableSpecFromWire(w *fileTableSpecWire) (*FileTableSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FileTableSpec) MarshalJSON() ([]byte, error) { + w, err := fileTableSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FileTableSpec) UnmarshalJSON(data []byte) error { + var w fileTableSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := fileTableSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type filesSpecWire struct { Path *string `json:"path,omitempty"` } @@ -254,6 +447,30 @@ func filesSpecFromWire(w *filesSpecWire) (*FilesSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FilesSpec) MarshalJSON() ([]byte, error) { + w, err := filesSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FilesSpec) UnmarshalJSON(data []byte) error { + var w filesSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := filesSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getExampleRequestWire struct { Name *string `json:"name,omitempty"` } @@ -276,6 +493,30 @@ func getExampleRequestFromWire(w *getExampleRequestWire) (*GetExampleRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetExampleRequest) MarshalJSON() ([]byte, error) { + w, err := getExampleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetExampleRequest) UnmarshalJSON(data []byte) error { + var w getExampleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getExampleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getKnowledgeAssistantRequestWire struct { Name *string `json:"name,omitempty"` } @@ -298,6 +539,30 @@ func getKnowledgeAssistantRequestFromWire(w *getKnowledgeAssistantRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetKnowledgeAssistantRequest) MarshalJSON() ([]byte, error) { + w, err := getKnowledgeAssistantRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetKnowledgeAssistantRequest) UnmarshalJSON(data []byte) error { + var w getKnowledgeAssistantRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getKnowledgeAssistantRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getKnowledgeSourceRequestWire struct { Name *string `json:"name,omitempty"` } @@ -320,6 +585,30 @@ func getKnowledgeSourceRequestFromWire(w *getKnowledgeSourceRequestWire) (*GetKn }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetKnowledgeSourceRequest) MarshalJSON() ([]byte, error) { + w, err := getKnowledgeSourceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetKnowledgeSourceRequest) UnmarshalJSON(data []byte) error { + var w getKnowledgeSourceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getKnowledgeSourceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type indexSpecWire struct { IndexName *string `json:"index_name,omitempty"` TextCol *string `json:"text_col,omitempty"` @@ -348,6 +637,30 @@ func indexSpecFromWire(w *indexSpecWire) (*IndexSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IndexSpec) MarshalJSON() ([]byte, error) { + w, err := indexSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IndexSpec) UnmarshalJSON(data []byte) error { + var w indexSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := indexSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type knowledgeAssistantWire struct { Name *string `json:"name,omitempty"` State KnowledgeAssistant_State `json:"state,omitempty"` @@ -400,6 +713,30 @@ func knowledgeAssistantFromWire(w *knowledgeAssistantWire) (*KnowledgeAssistant, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v KnowledgeAssistant) MarshalJSON() ([]byte, error) { + w, err := knowledgeAssistantToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *KnowledgeAssistant) UnmarshalJSON(data []byte) error { + var w knowledgeAssistantWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := knowledgeAssistantFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type knowledgeSourceWire struct { Name *string `json:"name,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -516,6 +853,30 @@ func knowledgeSourceFromWire(w *knowledgeSourceWire) (*KnowledgeSource, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v KnowledgeSource) MarshalJSON() ([]byte, error) { + w, err := knowledgeSourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *KnowledgeSource) UnmarshalJSON(data []byte) error { + var w knowledgeSourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := knowledgeSourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExamplesRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -544,6 +905,30 @@ func listExamplesRequestFromWire(w *listExamplesRequestWire) (*ListExamplesReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExamplesRequest) MarshalJSON() ([]byte, error) { + w, err := listExamplesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExamplesRequest) UnmarshalJSON(data []byte) error { + var w listExamplesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExamplesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExamplesResponseWire struct { Examples []exampleWire `json:"examples,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -577,6 +962,30 @@ func listExamplesResponseFromWire(w *listExamplesResponseWire) (*ListExamplesRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExamplesResponse) MarshalJSON() ([]byte, error) { + w, err := listExamplesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExamplesResponse) UnmarshalJSON(data []byte) error { + var w listExamplesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExamplesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listKnowledgeAssistantsRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -602,6 +1011,30 @@ func listKnowledgeAssistantsRequestFromWire(w *listKnowledgeAssistantsRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListKnowledgeAssistantsRequest) MarshalJSON() ([]byte, error) { + w, err := listKnowledgeAssistantsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListKnowledgeAssistantsRequest) UnmarshalJSON(data []byte) error { + var w listKnowledgeAssistantsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listKnowledgeAssistantsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listKnowledgeAssistantsResponseWire struct { KnowledgeAssistants []knowledgeAssistantWire `json:"knowledge_assistants,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -635,6 +1068,30 @@ func listKnowledgeAssistantsResponseFromWire(w *listKnowledgeAssistantsResponseW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListKnowledgeAssistantsResponse) MarshalJSON() ([]byte, error) { + w, err := listKnowledgeAssistantsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListKnowledgeAssistantsResponse) UnmarshalJSON(data []byte) error { + var w listKnowledgeAssistantsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listKnowledgeAssistantsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listKnowledgeSourcesRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -663,6 +1120,30 @@ func listKnowledgeSourcesRequestFromWire(w *listKnowledgeSourcesRequestWire) (*L }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListKnowledgeSourcesRequest) MarshalJSON() ([]byte, error) { + w, err := listKnowledgeSourcesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListKnowledgeSourcesRequest) UnmarshalJSON(data []byte) error { + var w listKnowledgeSourcesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listKnowledgeSourcesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listKnowledgeSourcesResponseWire struct { KnowledgeSources []knowledgeSourceWire `json:"knowledge_sources,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -696,6 +1177,30 @@ func listKnowledgeSourcesResponseFromWire(w *listKnowledgeSourcesResponseWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListKnowledgeSourcesResponse) MarshalJSON() ([]byte, error) { + w, err := listKnowledgeSourcesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListKnowledgeSourcesResponse) UnmarshalJSON(data []byte) error { + var w listKnowledgeSourcesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listKnowledgeSourcesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncKnowledgeSourcesRequestWire struct { Name *string `json:"name,omitempty"` } @@ -718,6 +1223,30 @@ func syncKnowledgeSourcesRequestFromWire(w *syncKnowledgeSourcesRequestWire) (*S }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncKnowledgeSourcesRequest) MarshalJSON() ([]byte, error) { + w, err := syncKnowledgeSourcesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncKnowledgeSourcesRequest) UnmarshalJSON(data []byte) error { + var w syncKnowledgeSourcesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncKnowledgeSourcesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateExampleRequestWire struct { Name *string `json:"name,omitempty"` Example *exampleWire `json:"example,omitempty"` @@ -754,6 +1283,30 @@ func updateExampleRequestFromWire(w *updateExampleRequestWire) (*UpdateExampleRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateExampleRequest) MarshalJSON() ([]byte, error) { + w, err := updateExampleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateExampleRequest) UnmarshalJSON(data []byte) error { + var w updateExampleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateExampleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateKnowledgeAssistantRequestWire struct { KnowledgeAssistant *knowledgeAssistantWire `json:"knowledge_assistant,omitempty"` UpdateMask *types.FieldMask[KnowledgeAssistant] `json:"update_mask,omitempty"` @@ -787,6 +1340,30 @@ func updateKnowledgeAssistantRequestFromWire(w *updateKnowledgeAssistantRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateKnowledgeAssistantRequest) MarshalJSON() ([]byte, error) { + w, err := updateKnowledgeAssistantRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateKnowledgeAssistantRequest) UnmarshalJSON(data []byte) error { + var w updateKnowledgeAssistantRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateKnowledgeAssistantRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateKnowledgeSourceRequestWire struct { Name *string `json:"name,omitempty"` KnowledgeSource *knowledgeSourceWire `json:"knowledge_source,omitempty"` @@ -823,6 +1400,30 @@ func updateKnowledgeSourceRequestFromWire(w *updateKnowledgeSourceRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateKnowledgeSourceRequest) MarshalJSON() ([]byte, error) { + w, err := updateKnowledgeSourceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateKnowledgeSourceRequest) UnmarshalJSON(data []byte) error { + var w updateKnowledgeSourceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateKnowledgeSourceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/lakeview/CHANGELOG.md b/lakeview/CHANGELOG.md index 09e14119..143d9f1d 100644 --- a/lakeview/CHANGELOG.md +++ b/lakeview/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/lakeview/internal/version.go b/lakeview/internal/version.go index c49876b2..83ea6248 100644 --- a/lakeview/internal/version.go +++ b/lakeview/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-lakeview" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/lakeview/v1/wire.go b/lakeview/v1/wire.go index f53475f5..d2780a44 100644 --- a/lakeview/v1/wire.go +++ b/lakeview/v1/wire.go @@ -93,6 +93,30 @@ func authorizationDetailsFromWire(w *authorizationDetailsWire) (*AuthorizationDe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AuthorizationDetails) MarshalJSON() ([]byte, error) { + w, err := authorizationDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AuthorizationDetails) UnmarshalJSON(data []byte) error { + var w authorizationDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := authorizationDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type authorizationDetails_GrantRuleWire struct { PermissionSet *string `json:"permission_set,omitempty"` } @@ -115,6 +139,30 @@ func authorizationDetails_GrantRuleFromWire(w *authorizationDetails_GrantRuleWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AuthorizationDetails_GrantRule) MarshalJSON() ([]byte, error) { + w, err := authorizationDetails_GrantRuleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AuthorizationDetails_GrantRule) UnmarshalJSON(data []byte) error { + var w authorizationDetails_GrantRuleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := authorizationDetails_GrantRuleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createDashboardRequestWire struct { Dashboard *dashboardCreateWire `json:"dashboard,omitempty"` DatasetCatalog *string `json:"dataset_catalog,omitempty"` @@ -151,6 +199,30 @@ func createDashboardRequestFromWire(w *createDashboardRequestWire) (*CreateDashb }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateDashboardRequest) MarshalJSON() ([]byte, error) { + w, err := createDashboardRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateDashboardRequest) UnmarshalJSON(data []byte) error { + var w createDashboardRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createDashboardRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createScheduleRequestWire struct { Schedule *scheduleCreateWire `json:"schedule,omitempty"` } @@ -181,6 +253,30 @@ func createScheduleRequestFromWire(w *createScheduleRequestWire) (*CreateSchedul }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateScheduleRequest) MarshalJSON() ([]byte, error) { + w, err := createScheduleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateScheduleRequest) UnmarshalJSON(data []byte) error { + var w createScheduleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createScheduleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createSubscriptionRequestWire struct { Subscription *subscriptionCreateWire `json:"subscription,omitempty"` } @@ -211,6 +307,30 @@ func createSubscriptionRequestFromWire(w *createSubscriptionRequestWire) (*Creat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateSubscriptionRequest) MarshalJSON() ([]byte, error) { + w, err := createSubscriptionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateSubscriptionRequest) UnmarshalJSON(data []byte) error { + var w createSubscriptionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createSubscriptionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cronScheduleWire struct { QuartzCronExpression *string `json:"quartz_cron_expression,omitempty"` TimezoneId *string `json:"timezone_id,omitempty"` @@ -236,6 +356,30 @@ func cronScheduleFromWire(w *cronScheduleWire) (*CronSchedule, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CronSchedule) MarshalJSON() ([]byte, error) { + w, err := cronScheduleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CronSchedule) UnmarshalJSON(data []byte) error { + var w cronScheduleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cronScheduleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dashboardWire struct { DashboardId *string `json:"dashboard_id,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -285,6 +429,30 @@ func dashboardFromWire(w *dashboardWire) (*Dashboard, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Dashboard) MarshalJSON() ([]byte, error) { + w, err := dashboardToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Dashboard) UnmarshalJSON(data []byte) error { + var w dashboardWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dashboardFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dashboardCreateWire struct { DashboardId *string `json:"dashboard_id,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -331,6 +499,30 @@ func dashboardCreateFromWire(w *dashboardCreateWire) (*DashboardCreate, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DashboardCreate) MarshalJSON() ([]byte, error) { + w, err := dashboardCreateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DashboardCreate) UnmarshalJSON(data []byte) error { + var w dashboardCreateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dashboardCreateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteScheduleRequestWire struct { ScheduleId *string `json:"schedule_id,omitempty"` DashboardId *string `json:"dashboard_id,omitempty"` @@ -359,6 +551,30 @@ func deleteScheduleRequestFromWire(w *deleteScheduleRequestWire) (*DeleteSchedul }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteScheduleRequest) MarshalJSON() ([]byte, error) { + w, err := deleteScheduleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteScheduleRequest) UnmarshalJSON(data []byte) error { + var w deleteScheduleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteScheduleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteSubscriptionRequestWire struct { SubscriptionId *string `json:"subscription_id,omitempty"` ScheduleId *string `json:"schedule_id,omitempty"` @@ -390,6 +606,30 @@ func deleteSubscriptionRequestFromWire(w *deleteSubscriptionRequestWire) (*Delet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteSubscriptionRequest) MarshalJSON() ([]byte, error) { + w, err := deleteSubscriptionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteSubscriptionRequest) UnmarshalJSON(data []byte) error { + var w deleteSubscriptionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteSubscriptionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getDashboardRequestWire struct { DashboardId *string `json:"dashboard_id,omitempty"` } @@ -412,6 +652,30 @@ func getDashboardRequestFromWire(w *getDashboardRequestWire) (*GetDashboardReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetDashboardRequest) MarshalJSON() ([]byte, error) { + w, err := getDashboardRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetDashboardRequest) UnmarshalJSON(data []byte) error { + var w getDashboardRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getDashboardRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPublishedDashboardRequestWire struct { DashboardId *string `json:"dashboard_id,omitempty"` } @@ -434,6 +698,30 @@ func getPublishedDashboardRequestFromWire(w *getPublishedDashboardRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPublishedDashboardRequest) MarshalJSON() ([]byte, error) { + w, err := getPublishedDashboardRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPublishedDashboardRequest) UnmarshalJSON(data []byte) error { + var w getPublishedDashboardRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPublishedDashboardRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPublishedDashboardTokenInfoRequestWire struct { DashboardId *string `json:"dashboard_id,omitempty"` ExternalValue *string `json:"external_value,omitempty"` @@ -462,6 +750,30 @@ func getPublishedDashboardTokenInfoRequestFromWire(w *getPublishedDashboardToken }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPublishedDashboardTokenInfoRequest) MarshalJSON() ([]byte, error) { + w, err := getPublishedDashboardTokenInfoRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPublishedDashboardTokenInfoRequest) UnmarshalJSON(data []byte) error { + var w getPublishedDashboardTokenInfoRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPublishedDashboardTokenInfoRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPublishedDashboardTokenInfoResponseWire struct { CustomClaim *string `json:"custom_claim,omitempty"` Scope *string `json:"scope,omitempty"` @@ -498,6 +810,30 @@ func getPublishedDashboardTokenInfoResponseFromWire(w *getPublishedDashboardToke }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPublishedDashboardTokenInfoResponse) MarshalJSON() ([]byte, error) { + w, err := getPublishedDashboardTokenInfoResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPublishedDashboardTokenInfoResponse) UnmarshalJSON(data []byte) error { + var w getPublishedDashboardTokenInfoResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPublishedDashboardTokenInfoResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getScheduleRequestWire struct { ScheduleId *string `json:"schedule_id,omitempty"` DashboardId *string `json:"dashboard_id,omitempty"` @@ -523,6 +859,30 @@ func getScheduleRequestFromWire(w *getScheduleRequestWire) (*GetScheduleRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetScheduleRequest) MarshalJSON() ([]byte, error) { + w, err := getScheduleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetScheduleRequest) UnmarshalJSON(data []byte) error { + var w getScheduleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getScheduleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSubscriptionRequestWire struct { SubscriptionId *string `json:"subscription_id,omitempty"` ScheduleId *string `json:"schedule_id,omitempty"` @@ -551,6 +911,30 @@ func getSubscriptionRequestFromWire(w *getSubscriptionRequestWire) (*GetSubscrip }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSubscriptionRequest) MarshalJSON() ([]byte, error) { + w, err := getSubscriptionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSubscriptionRequest) UnmarshalJSON(data []byte) error { + var w getSubscriptionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSubscriptionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDashboardsRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -582,6 +966,30 @@ func listDashboardsRequestFromWire(w *listDashboardsRequestWire) (*ListDashboard }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDashboardsRequest) MarshalJSON() ([]byte, error) { + w, err := listDashboardsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDashboardsRequest) UnmarshalJSON(data []byte) error { + var w listDashboardsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDashboardsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDashboardsResponseWire struct { Dashboards []dashboardWire `json:"dashboards,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -615,6 +1023,30 @@ func listDashboardsResponseFromWire(w *listDashboardsResponseWire) (*ListDashboa }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDashboardsResponse) MarshalJSON() ([]byte, error) { + w, err := listDashboardsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDashboardsResponse) UnmarshalJSON(data []byte) error { + var w listDashboardsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDashboardsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSchedulesRequestWire struct { DashboardId *string `json:"dashboard_id,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -643,6 +1075,30 @@ func listSchedulesRequestFromWire(w *listSchedulesRequestWire) (*ListSchedulesRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSchedulesRequest) MarshalJSON() ([]byte, error) { + w, err := listSchedulesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSchedulesRequest) UnmarshalJSON(data []byte) error { + var w listSchedulesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSchedulesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSchedulesResponseWire struct { Schedules []scheduleWire `json:"schedules,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -676,6 +1132,30 @@ func listSchedulesResponseFromWire(w *listSchedulesResponseWire) (*ListSchedules }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSchedulesResponse) MarshalJSON() ([]byte, error) { + w, err := listSchedulesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSchedulesResponse) UnmarshalJSON(data []byte) error { + var w listSchedulesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSchedulesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSubscriptionsRequestWire struct { DashboardId *string `json:"dashboard_id,omitempty"` ScheduleId *string `json:"schedule_id,omitempty"` @@ -707,6 +1187,30 @@ func listSubscriptionsRequestFromWire(w *listSubscriptionsRequestWire) (*ListSub }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSubscriptionsRequest) MarshalJSON() ([]byte, error) { + w, err := listSubscriptionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSubscriptionsRequest) UnmarshalJSON(data []byte) error { + var w listSubscriptionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSubscriptionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSubscriptionsResponseWire struct { Subscriptions []subscriptionWire `json:"subscriptions,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -740,6 +1244,30 @@ func listSubscriptionsResponseFromWire(w *listSubscriptionsResponseWire) (*ListS }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSubscriptionsResponse) MarshalJSON() ([]byte, error) { + w, err := listSubscriptionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSubscriptionsResponse) UnmarshalJSON(data []byte) error { + var w listSubscriptionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSubscriptionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type migrateDashboardRequestWire struct { SourceDashboardId *string `json:"source_dashboard_id,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -771,6 +1299,30 @@ func migrateDashboardRequestFromWire(w *migrateDashboardRequestWire) (*MigrateDa }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MigrateDashboardRequest) MarshalJSON() ([]byte, error) { + w, err := migrateDashboardRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MigrateDashboardRequest) UnmarshalJSON(data []byte) error { + var w migrateDashboardRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := migrateDashboardRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type publishDashboardRequestWire struct { DashboardId *string `json:"dashboard_id,omitempty"` EmbedCredentials *bool `json:"embed_credentials,omitempty"` @@ -799,6 +1351,30 @@ func publishDashboardRequestFromWire(w *publishDashboardRequestWire) (*PublishDa }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PublishDashboardRequest) MarshalJSON() ([]byte, error) { + w, err := publishDashboardRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PublishDashboardRequest) UnmarshalJSON(data []byte) error { + var w publishDashboardRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := publishDashboardRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type publishedDashboardWire struct { DisplayName *string `json:"display_name,omitempty"` WarehouseId *string `json:"warehouse_id,omitempty"` @@ -830,6 +1406,30 @@ func publishedDashboardFromWire(w *publishedDashboardWire) (*PublishedDashboard, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PublishedDashboard) MarshalJSON() ([]byte, error) { + w, err := publishedDashboardToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PublishedDashboard) UnmarshalJSON(data []byte) error { + var w publishedDashboardWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := publishedDashboardFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type revertDashboardRequestWire struct { DashboardId *string `json:"dashboard_id,omitempty"` Etag *string `json:"etag,omitempty"` @@ -855,6 +1455,30 @@ func revertDashboardRequestFromWire(w *revertDashboardRequestWire) (*RevertDashb }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RevertDashboardRequest) MarshalJSON() ([]byte, error) { + w, err := revertDashboardRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RevertDashboardRequest) UnmarshalJSON(data []byte) error { + var w revertDashboardRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := revertDashboardRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type revertDashboardResponseWire struct { Dashboard *dashboardWire `json:"dashboard,omitempty"` } @@ -885,6 +1509,30 @@ func revertDashboardResponseFromWire(w *revertDashboardResponseWire) (*RevertDas }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RevertDashboardResponse) MarshalJSON() ([]byte, error) { + w, err := revertDashboardResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RevertDashboardResponse) UnmarshalJSON(data []byte) error { + var w revertDashboardResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := revertDashboardResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type scheduleWire struct { ScheduleId *string `json:"schedule_id,omitempty"` DashboardId *string `json:"dashboard_id,omitempty"` @@ -939,6 +1587,30 @@ func scheduleFromWire(w *scheduleWire) (*Schedule, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Schedule) MarshalJSON() ([]byte, error) { + w, err := scheduleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Schedule) UnmarshalJSON(data []byte) error { + var w scheduleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := scheduleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type scheduleCreateWire struct { ScheduleId *string `json:"schedule_id,omitempty"` DashboardId *string `json:"dashboard_id,omitempty"` @@ -990,6 +1662,30 @@ func scheduleCreateFromWire(w *scheduleCreateWire) (*ScheduleCreate, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ScheduleCreate) MarshalJSON() ([]byte, error) { + w, err := scheduleCreateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ScheduleCreate) UnmarshalJSON(data []byte) error { + var w scheduleCreateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := scheduleCreateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type subscriptionWire struct { SubscriptionId *string `json:"subscription_id,omitempty"` ScheduleId *string `json:"schedule_id,omitempty"` @@ -1052,6 +1748,30 @@ func subscriptionFromWire(w *subscriptionWire) (*Subscription, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Subscription) MarshalJSON() ([]byte, error) { + w, err := subscriptionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Subscription) UnmarshalJSON(data []byte) error { + var w subscriptionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := subscriptionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type subscription_SubscriberWire struct { UserSubscriber *subscription_Subscriber_UserWire `json:"user_subscriber,omitempty"` DestinationSubscriber *subscription_Subscriber_DestinationWire `json:"destination_subscriber,omitempty"` @@ -1093,6 +1813,30 @@ func subscription_SubscriberFromWire(w *subscription_SubscriberWire) (*Subscript }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Subscription_Subscriber) MarshalJSON() ([]byte, error) { + w, err := subscription_SubscriberToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Subscription_Subscriber) UnmarshalJSON(data []byte) error { + var w subscription_SubscriberWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := subscription_SubscriberFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type subscription_Subscriber_DestinationWire struct { DestinationId *string `json:"destination_id,omitempty"` } @@ -1115,6 +1859,30 @@ func subscription_Subscriber_DestinationFromWire(w *subscription_Subscriber_Dest }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Subscription_Subscriber_Destination) MarshalJSON() ([]byte, error) { + w, err := subscription_Subscriber_DestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Subscription_Subscriber_Destination) UnmarshalJSON(data []byte) error { + var w subscription_Subscriber_DestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := subscription_Subscriber_DestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type subscription_Subscriber_UserWire struct { UserId *wireInt64 `json:"user_id,omitempty"` } @@ -1145,6 +1913,30 @@ func subscription_Subscriber_UserFromWire(w *subscription_Subscriber_UserWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Subscription_Subscriber_User) MarshalJSON() ([]byte, error) { + w, err := subscription_Subscriber_UserToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Subscription_Subscriber_User) UnmarshalJSON(data []byte) error { + var w subscription_Subscriber_UserWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := subscription_Subscriber_UserFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type subscriptionCreateWire struct { SubscriptionId *string `json:"subscription_id,omitempty"` ScheduleId *string `json:"schedule_id,omitempty"` @@ -1204,6 +1996,30 @@ func subscriptionCreateFromWire(w *subscriptionCreateWire) (*SubscriptionCreate, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SubscriptionCreate) MarshalJSON() ([]byte, error) { + w, err := subscriptionCreateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SubscriptionCreate) UnmarshalJSON(data []byte) error { + var w subscriptionCreateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := subscriptionCreateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type trashDashboardRequestWire struct { DashboardId *string `json:"dashboard_id,omitempty"` } @@ -1226,6 +2042,30 @@ func trashDashboardRequestFromWire(w *trashDashboardRequestWire) (*TrashDashboar }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TrashDashboardRequest) MarshalJSON() ([]byte, error) { + w, err := trashDashboardRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TrashDashboardRequest) UnmarshalJSON(data []byte) error { + var w trashDashboardRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := trashDashboardRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type trashDashboardResponseWire struct { } @@ -1243,6 +2083,30 @@ func trashDashboardResponseFromWire(w *trashDashboardResponseWire) (*TrashDashbo return &TrashDashboardResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TrashDashboardResponse) MarshalJSON() ([]byte, error) { + w, err := trashDashboardResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TrashDashboardResponse) UnmarshalJSON(data []byte) error { + var w trashDashboardResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := trashDashboardResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type unpublishDashboardRequestWire struct { DashboardId *string `json:"dashboard_id,omitempty"` } @@ -1265,6 +2129,30 @@ func unpublishDashboardRequestFromWire(w *unpublishDashboardRequestWire) (*Unpub }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UnpublishDashboardRequest) MarshalJSON() ([]byte, error) { + w, err := unpublishDashboardRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UnpublishDashboardRequest) UnmarshalJSON(data []byte) error { + var w unpublishDashboardRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := unpublishDashboardRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type unpublishDashboardResponseWire struct { } @@ -1282,6 +2170,30 @@ func unpublishDashboardResponseFromWire(w *unpublishDashboardResponseWire) (*Unp return &UnpublishDashboardResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UnpublishDashboardResponse) MarshalJSON() ([]byte, error) { + w, err := unpublishDashboardResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UnpublishDashboardResponse) UnmarshalJSON(data []byte) error { + var w unpublishDashboardResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := unpublishDashboardResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateDashboardRequestWire struct { Dashboard *dashboardWire `json:"dashboard,omitempty"` DatasetCatalog *string `json:"dataset_catalog,omitempty"` @@ -1318,6 +2230,30 @@ func updateDashboardRequestFromWire(w *updateDashboardRequestWire) (*UpdateDashb }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateDashboardRequest) MarshalJSON() ([]byte, error) { + w, err := updateDashboardRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateDashboardRequest) UnmarshalJSON(data []byte) error { + var w updateDashboardRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateDashboardRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateScheduleRequestWire struct { Schedule *scheduleWire `json:"schedule,omitempty"` } @@ -1348,6 +2284,30 @@ func updateScheduleRequestFromWire(w *updateScheduleRequestWire) (*UpdateSchedul }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateScheduleRequest) MarshalJSON() ([]byte, error) { + w, err := updateScheduleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateScheduleRequest) UnmarshalJSON(data []byte) error { + var w updateScheduleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateScheduleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/lakewatch/CHANGELOG.md b/lakewatch/CHANGELOG.md index 5d86db6d..7c412190 100644 --- a/lakewatch/CHANGELOG.md +++ b/lakewatch/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.5.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.4.0 (2026-11-11) ## Release v0.3.0 (2026-11-10) diff --git a/lakewatch/internal/version.go b/lakewatch/internal/version.go index c0e117fb..ea199b60 100644 --- a/lakewatch/internal/version.go +++ b/lakewatch/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-lakewatch" -const Version = "0.4.0" +const Version = "0.5.0" diff --git a/lakewatch/v1/model.go b/lakewatch/v1/model.go index 11e40dda..6db1e791 100644 --- a/lakewatch/v1/model.go +++ b/lakewatch/v1/model.go @@ -907,8 +907,9 @@ type Rule struct { // Reference to the content pack this rule was originally installed from. OriginalContentPack *ContentPackReference `fieldmask:"original_content_pack"` // ID of the workspace whose compute runs this rule's jobs and owns its - // associated resources, such as the SQL warehouse a scheduled rule runs on. - // Server-assigned; a rule's warehouse can only be changed from this workspace. + // associated resources, such as the SQL warehouse a scheduled detection runs + // on. Server-assigned; a rule's warehouse can only be changed from this + // workspace. ComputeWorkspaceId *string `fieldmask:"compute_workspace_id"` // Immutable UUIDv4 identifying the authored content resource installed as this // rule. @@ -922,8 +923,8 @@ type Rule struct { // Supports Markdown; analysts and the investigation agent follow it when // triaging this rule's alerts. Runbook *string `fieldmask:"runbook"` - // Time-range configuration for batch rules. If unset, the execution time range - // is extended by a fixed `15m` lookback. + // Time-range configuration for scheduled detections. If unset, the execution + // time range is extended by a fixed `15m` lookback. Timerange *RuleTimeRange `fieldmask:"timerange"` _ [0]ruleSourceFieldMaskMetadata `fieldmask_oneof:"Source"` } @@ -933,7 +934,7 @@ type isRule_Source interface { } // Rule_Source_Batch selects Batch for Rule.Source. -// Batch SQL rule input. +// Scheduled detection (also known as batch detection) input. type Rule_Source_Batch struct { Batch RuleInputBatch `fieldmask:"batch"` } @@ -984,11 +985,12 @@ type RuleConfig struct { EffectiveDefaultFolder *string `fieldmask:"effective_default_folder"` } -// Batch input for a detection rule.. +// Input for a scheduled detection (also known as batch detection).. type RuleInputBatch struct { - // How the batch input is produced. Exactly one shape is required. + // How the scheduled detection's input is produced. Exactly one shape is + // required. Shape isRuleInputBatch_Shape - // SQL warehouse used to run this batch rule. + // SQL warehouse that runs this scheduled detection. WarehouseId *string `fieldmask:"warehouse_id"` _ [0]ruleInputBatchShapeFieldMaskMetadata `fieldmask_oneof:"Shape"` } @@ -1018,7 +1020,7 @@ type ruleInputBatchShapeFieldMaskMetadata struct { *RuleInputBatch_Shape_Custom } -// Batch SQL input for a detection rule.. +// SQL query input for a scheduled detection.. type RuleInputBatchSql struct { // Default catalog used to resolve unqualified identifiers in `query`. If unset, // the rule's `catalog_name` is used. @@ -1030,7 +1032,7 @@ type RuleInputBatchSql struct { Query *string `fieldmask:"query"` } -// Reference to a custom-user-function notebook for stream or batch input.. +// Reference to a custom-user-function notebook for scheduled detection input.. type RuleInputCustomNotebook struct { // Fully-qualified notebook path, or a path relative to the configured base // notebook directory. @@ -1073,10 +1075,10 @@ type RuleOutput struct { // Defines when a detection rule executes. // -// A batch rule sets exactly one of `at_least_every` or `cron_expression`. A -// streaming rule runs continuously and sets no timing; it accepts only -// `enabled`, and an omitted schedule means enabled. The server rejects any -// other combination. `enabled` is orthogonal to the timing.. +// A scheduled detection sets exactly one of `at_least_every` or +// `cron_expression`. A streaming rule runs continuously and sets no timing; it +// accepts only `enabled`, and an omitted schedule means enabled. The server +// rejects any other combination. `enabled` is orthogonal to the timing.. type RuleSchedule struct { Timing isRuleSchedule_Timing // Sets whether the job is scheduled to run. Defaults to true. @@ -1106,29 +1108,19 @@ type RuleSchedule_Timing_CronExpression struct { func (*RuleSchedule_Timing_CronExpression) isRuleSchedule_Timing() {} -// RuleSchedule_Timing_Continuous selects Continuous for RuleSchedule.Timing. -// Runs the rule continuously. Detection rules do not accept it: batch rules -// reject it, and streaming rules run continuously without it. -type RuleSchedule_Timing_Continuous struct { - Continuous bool `fieldmask:"continuous"` -} - -func (*RuleSchedule_Timing_Continuous) isRuleSchedule_Timing() {} - type ruleScheduleTimingFieldMaskMetadata struct { *RuleSchedule_Timing_AtLeastEvery *RuleSchedule_Timing_CronExpression - *RuleSchedule_Timing_Continuous } -// Time-range configuration for a batch detection rule.. +// Time-range configuration for a scheduled detection.. type RuleTimeRange struct { // Extends the start of the execution time range by a compact duration with // integer days, hours, minutes, and seconds in that order, such as `1h30m` or // `15m`. Zero duration disables extension. Unset or empty uses a fixed `15m` at // execution time. Only the start moves; the end is unchanged. Has no effect on - // batch SQL that does not use `IN_TIMERANGE`. Values must fit signed 64-bit - // microseconds. + // a detection query that does not use `IN_TIMERANGE`. Values must fit signed + // 64-bit microseconds. ExtendLookback *string `fieldmask:"extend_lookback"` } diff --git a/lakewatch/v1/wire.go b/lakewatch/v1/wire.go index 4ec6a124..b34580e1 100644 --- a/lakewatch/v1/wire.go +++ b/lakewatch/v1/wire.go @@ -138,6 +138,30 @@ func alertConfigFromWire(w *alertConfigWire) (*AlertConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AlertConfig) MarshalJSON() ([]byte, error) { + w, err := alertConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AlertConfig) UnmarshalJSON(data []byte) error { + var w alertConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := alertConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type autoLoaderWire struct { Format AutoLoader_Format `json:"format,omitempty"` Location *string `json:"location,omitempty"` @@ -248,6 +272,30 @@ func autoLoaderFromWire(w *autoLoaderWire) (*AutoLoader, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AutoLoader) MarshalJSON() ([]byte, error) { + w, err := autoLoaderToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AutoLoader) UnmarshalJSON(data []byte) error { + var w autoLoaderWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := autoLoaderFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cloudWatchLogsEnvelopeWire struct { HeaderRetention *bool `json:"header_retention,omitempty"` } @@ -270,6 +318,30 @@ func cloudWatchLogsEnvelopeFromWire(w *cloudWatchLogsEnvelopeWire) (*CloudWatchL }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CloudWatchLogsEnvelope) MarshalJSON() ([]byte, error) { + w, err := cloudWatchLogsEnvelopeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CloudWatchLogsEnvelope) UnmarshalJSON(data []byte) error { + var w cloudWatchLogsEnvelopeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cloudWatchLogsEnvelopeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type commonConfigWire struct { Name *string `json:"name,omitempty"` Version *wireInt64 `json:"version,omitempty"` @@ -323,6 +395,30 @@ func commonConfigFromWire(w *commonConfigWire) (*CommonConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CommonConfig) MarshalJSON() ([]byte, error) { + w, err := commonConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CommonConfig) UnmarshalJSON(data []byte) error { + var w commonConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := commonConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type contentPackReferenceWire struct { Uuid *string `json:"uuid,omitempty"` Version *string `json:"version,omitempty"` @@ -348,6 +444,30 @@ func contentPackReferenceFromWire(w *contentPackReferenceWire) (*ContentPackRefe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ContentPackReference) MarshalJSON() ([]byte, error) { + w, err := contentPackReferenceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ContentPackReference) UnmarshalJSON(data []byte) error { + var w contentPackReferenceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := contentPackReferenceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createDatasourceRequestWire struct { Datasource *datasourceWire `json:"datasource,omitempty"` } @@ -378,6 +498,30 @@ func createDatasourceRequestFromWire(w *createDatasourceRequestWire) (*CreateDat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateDatasourceRequest) MarshalJSON() ([]byte, error) { + w, err := createDatasourceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateDatasourceRequest) UnmarshalJSON(data []byte) error { + var w createDatasourceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createDatasourceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createRuleRequestWire struct { Rule *ruleWire `json:"rule,omitempty"` } @@ -408,6 +552,30 @@ func createRuleRequestFromWire(w *createRuleRequestWire) (*CreateRuleRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateRuleRequest) MarshalJSON() ([]byte, error) { + w, err := createRuleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateRuleRequest) UnmarshalJSON(data []byte) error { + var w createRuleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createRuleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type datasourceWire struct { Name *string `json:"name,omitempty"` DatasourceId *string `json:"datasource_id,omitempty"` @@ -631,6 +799,30 @@ func datasourceFromWire(w *datasourceWire) (*Datasource, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Datasource) MarshalJSON() ([]byte, error) { + w, err := datasourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Datasource) UnmarshalJSON(data []byte) error { + var w datasourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := datasourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type datasourceConfigWire struct { Name *string `json:"name,omitempty"` Version *wireInt64 `json:"version,omitempty"` @@ -690,6 +882,30 @@ func datasourceConfigFromWire(w *datasourceConfigWire) (*DatasourceConfig, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatasourceConfig) MarshalJSON() ([]byte, error) { + w, err := datasourceConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatasourceConfig) UnmarshalJSON(data []byte) error { + var w datasourceConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := datasourceConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type datasourceStatusWire struct { IngestionJob *resourceStatusWire `json:"ingestion_job,omitempty"` IngestionPipeline *resourceStatusWire `json:"ingestion_pipeline,omitempty"` @@ -731,6 +947,30 @@ func datasourceStatusFromWire(w *datasourceStatusWire) (*DatasourceStatus, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatasourceStatus) MarshalJSON() ([]byte, error) { + w, err := datasourceStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatasourceStatus) UnmarshalJSON(data []byte) error { + var w datasourceStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := datasourceStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteDatasourceRequestWire struct { Name *string `json:"name,omitempty"` } @@ -753,6 +993,30 @@ func deleteDatasourceRequestFromWire(w *deleteDatasourceRequestWire) (*DeleteDat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteDatasourceRequest) MarshalJSON() ([]byte, error) { + w, err := deleteDatasourceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteDatasourceRequest) UnmarshalJSON(data []byte) error { + var w deleteDatasourceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteDatasourceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRuleRequestWire struct { Name *string `json:"name,omitempty"` } @@ -775,6 +1039,30 @@ func deleteRuleRequestFromWire(w *deleteRuleRequestWire) (*DeleteRuleRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRuleRequest) MarshalJSON() ([]byte, error) { + w, err := deleteRuleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRuleRequest) UnmarshalJSON(data []byte) error { + var w deleteRuleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRuleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type envelopeWire struct { JsonArray *jsonArrayEnvelopeWire `json:"json_array,omitempty"` CloudWatchLogs *cloudWatchLogsEnvelopeWire `json:"cloud_watch_logs,omitempty"` @@ -847,6 +1135,30 @@ func envelopeFromWire(w *envelopeWire) (*Envelope, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Envelope) MarshalJSON() ([]byte, error) { + w, err := envelopeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Envelope) UnmarshalJSON(data []byte) error { + var w envelopeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := envelopeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type existingTableWire struct { Name *string `json:"name,omitempty"` Catalog *string `json:"catalog,omitempty"` @@ -887,6 +1199,30 @@ func existingTableFromWire(w *existingTableWire) (*ExistingTable, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExistingTable) MarshalJSON() ([]byte, error) { + w, err := existingTableToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExistingTable) UnmarshalJSON(data []byte) error { + var w existingTableWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := existingTableFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type exportConfigWire struct { Enabled *bool `json:"enabled,omitempty"` Webhook *webhookExportConfigWire `json:"webhook,omitempty"` @@ -1025,6 +1361,30 @@ func exportConfigFromWire(w *exportConfigWire) (*ExportConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExportConfig) MarshalJSON() ([]byte, error) { + w, err := exportConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExportConfig) UnmarshalJSON(data []byte) error { + var w exportConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := exportConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAlertConfigRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1047,6 +1407,30 @@ func getAlertConfigRequestFromWire(w *getAlertConfigRequestWire) (*GetAlertConfi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAlertConfigRequest) MarshalJSON() ([]byte, error) { + w, err := getAlertConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAlertConfigRequest) UnmarshalJSON(data []byte) error { + var w getAlertConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAlertConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCommonConfigRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1069,6 +1453,30 @@ func getCommonConfigRequestFromWire(w *getCommonConfigRequestWire) (*GetCommonCo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCommonConfigRequest) MarshalJSON() ([]byte, error) { + w, err := getCommonConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCommonConfigRequest) UnmarshalJSON(data []byte) error { + var w getCommonConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCommonConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getDatasourceConfigRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1091,6 +1499,30 @@ func getDatasourceConfigRequestFromWire(w *getDatasourceConfigRequestWire) (*Get }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetDatasourceConfigRequest) MarshalJSON() ([]byte, error) { + w, err := getDatasourceConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetDatasourceConfigRequest) UnmarshalJSON(data []byte) error { + var w getDatasourceConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getDatasourceConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getDatasourceRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1113,6 +1545,30 @@ func getDatasourceRequestFromWire(w *getDatasourceRequestWire) (*GetDatasourceRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetDatasourceRequest) MarshalJSON() ([]byte, error) { + w, err := getDatasourceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetDatasourceRequest) UnmarshalJSON(data []byte) error { + var w getDatasourceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getDatasourceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRuleConfigRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1135,6 +1591,30 @@ func getRuleConfigRequestFromWire(w *getRuleConfigRequestWire) (*GetRuleConfigRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRuleConfigRequest) MarshalJSON() ([]byte, error) { + w, err := getRuleConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRuleConfigRequest) UnmarshalJSON(data []byte) error { + var w getRuleConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRuleConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRuleRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1157,6 +1637,30 @@ func getRuleRequestFromWire(w *getRuleRequestWire) (*GetRuleRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRuleRequest) MarshalJSON() ([]byte, error) { + w, err := getRuleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRuleRequest) UnmarshalJSON(data []byte) error { + var w getRuleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRuleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jiraExportConfigWire struct { InstanceUrl *string `json:"instance_url,omitempty"` ProjectKey *string `json:"project_key,omitempty"` @@ -1191,8 +1695,32 @@ func jiraExportConfigFromWire(w *jiraExportConfigWire) (*JiraExportConfig, error }, nil } -type jsonArrayEnvelopeWire struct { - Path *string `json:"path,omitempty"` +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JiraExportConfig) MarshalJSON() ([]byte, error) { + w, err := jiraExportConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JiraExportConfig) UnmarshalJSON(data []byte) error { + var w jiraExportConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jiraExportConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type jsonArrayEnvelopeWire struct { + Path *string `json:"path,omitempty"` } func jsonArrayEnvelopeToWire(v *JsonArrayEnvelope) (*jsonArrayEnvelopeWire, error) { @@ -1213,6 +1741,30 @@ func jsonArrayEnvelopeFromWire(w *jsonArrayEnvelopeWire) (*JsonArrayEnvelope, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JsonArrayEnvelope) MarshalJSON() ([]byte, error) { + w, err := jsonArrayEnvelopeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JsonArrayEnvelope) UnmarshalJSON(data []byte) error { + var w jsonArrayEnvelopeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jsonArrayEnvelopeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDatasourcesRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -1250,6 +1802,30 @@ func listDatasourcesRequestFromWire(w *listDatasourcesRequestWire) (*ListDatasou }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDatasourcesRequest) MarshalJSON() ([]byte, error) { + w, err := listDatasourcesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDatasourcesRequest) UnmarshalJSON(data []byte) error { + var w listDatasourcesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDatasourcesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDatasourcesResponseWire struct { Datasources []datasourceWire `json:"datasources,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1283,6 +1859,30 @@ func listDatasourcesResponseFromWire(w *listDatasourcesResponseWire) (*ListDatas }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDatasourcesResponse) MarshalJSON() ([]byte, error) { + w, err := listDatasourcesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDatasourcesResponse) UnmarshalJSON(data []byte) error { + var w listDatasourcesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDatasourcesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRulesRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -1320,6 +1920,30 @@ func listRulesRequestFromWire(w *listRulesRequestWire) (*ListRulesRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRulesRequest) MarshalJSON() ([]byte, error) { + w, err := listRulesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRulesRequest) UnmarshalJSON(data []byte) error { + var w listRulesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRulesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRulesResponseWire struct { Rules []ruleWire `json:"rules,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1353,6 +1977,30 @@ func listRulesResponseFromWire(w *listRulesResponseWire) (*ListRulesResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRulesResponse) MarshalJSON() ([]byte, error) { + w, err := listRulesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRulesResponse) UnmarshalJSON(data []byte) error { + var w listRulesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRulesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type parserRefWire struct { Id *string `json:"id,omitempty"` Version *string `json:"version,omitempty"` @@ -1400,6 +2048,30 @@ func parserRefFromWire(w *parserRefWire) (*ParserRef, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ParserRef) MarshalJSON() ([]byte, error) { + w, err := parserRefToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ParserRef) UnmarshalJSON(data []byte) error { + var w parserRefWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := parserRefFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type principalWire struct { Id *string `json:"id,omitempty"` PrincipalType PrincipalType `json:"principal_type,omitempty"` @@ -1431,6 +2103,30 @@ func principalFromWire(w *principalWire) (*Principal, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Principal) MarshalJSON() ([]byte, error) { + w, err := principalToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Principal) UnmarshalJSON(data []byte) error { + var w principalWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := principalFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resourceStatusWire struct { JobId *string `json:"job_id,omitempty"` LifecycleState ResourceStatus_Lifecycle `json:"lifecycle_state,omitempty"` @@ -1477,6 +2173,30 @@ func resourceStatusFromWire(w *resourceStatusWire) (*ResourceStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResourceStatus) MarshalJSON() ([]byte, error) { + w, err := resourceStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResourceStatus) UnmarshalJSON(data []byte) error { + var w resourceStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resourceStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ruleWire struct { Name *string `json:"name,omitempty"` RuleId *string `json:"rule_id,omitempty"` @@ -1717,6 +2437,30 @@ func ruleFromWire(w *ruleWire) (*Rule, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Rule) MarshalJSON() ([]byte, error) { + w, err := ruleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Rule) UnmarshalJSON(data []byte) error { + var w ruleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ruleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ruleConfigWire struct { Name *string `json:"name,omitempty"` Version *wireInt64 `json:"version,omitempty"` @@ -1793,6 +2537,30 @@ func ruleConfigFromWire(w *ruleConfigWire) (*RuleConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RuleConfig) MarshalJSON() ([]byte, error) { + w, err := ruleConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RuleConfig) UnmarshalJSON(data []byte) error { + var w ruleConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ruleConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ruleInputBatchWire struct { Sql *ruleInputBatchSqlWire `json:"sql,omitempty"` Custom *ruleInputCustomNotebookWire `json:"custom,omitempty"` @@ -1868,6 +2636,30 @@ func ruleInputBatchFromWire(w *ruleInputBatchWire) (*RuleInputBatch, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RuleInputBatch) MarshalJSON() ([]byte, error) { + w, err := ruleInputBatchToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RuleInputBatch) UnmarshalJSON(data []byte) error { + var w ruleInputBatchWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ruleInputBatchFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ruleInputBatchSqlWire struct { DefaultCatalogName *string `json:"default_catalog_name,omitempty"` DefaultSchemaName *string `json:"default_schema_name,omitempty"` @@ -1896,6 +2688,30 @@ func ruleInputBatchSqlFromWire(w *ruleInputBatchSqlWire) (*RuleInputBatchSql, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RuleInputBatchSql) MarshalJSON() ([]byte, error) { + w, err := ruleInputBatchSqlToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RuleInputBatchSql) UnmarshalJSON(data []byte) error { + var w ruleInputBatchSqlWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ruleInputBatchSqlFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ruleInputCustomNotebookWire struct { Notebook *string `json:"notebook,omitempty"` Options map[string]string `json:"options,omitempty"` @@ -1921,6 +2737,30 @@ func ruleInputCustomNotebookFromWire(w *ruleInputCustomNotebookWire) (*RuleInput }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RuleInputCustomNotebook) MarshalJSON() ([]byte, error) { + w, err := ruleInputCustomNotebookToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RuleInputCustomNotebook) UnmarshalJSON(data []byte) error { + var w ruleInputCustomNotebookWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ruleInputCustomNotebookFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ruleMitreMappingWire struct { Taxonomy *string `json:"taxonomy,omitempty"` Tactic *string `json:"tactic,omitempty"` @@ -1958,6 +2798,30 @@ func ruleMitreMappingFromWire(w *ruleMitreMappingWire) (*RuleMitreMapping, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RuleMitreMapping) MarshalJSON() ([]byte, error) { + w, err := ruleMitreMappingToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RuleMitreMapping) UnmarshalJSON(data []byte) error { + var w ruleMitreMappingWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ruleMitreMappingFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ruleOutputWire struct { Summary *string `json:"summary,omitempty"` Context map[string]string `json:"context,omitempty"` @@ -1989,10 +2853,33 @@ func ruleOutputFromWire(w *ruleOutputWire) (*RuleOutput, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RuleOutput) MarshalJSON() ([]byte, error) { + w, err := ruleOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RuleOutput) UnmarshalJSON(data []byte) error { + var w ruleOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ruleOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ruleScheduleWire struct { AtLeastEvery *string `json:"at_least_every,omitempty"` CronExpression *string `json:"cron_expression,omitempty"` - Continuous *bool `json:"continuous,omitempty"` Enabled *bool `json:"enabled,omitempty"` } @@ -2002,7 +2889,6 @@ func ruleScheduleToWire(v *RuleSchedule) (*ruleScheduleWire, error) { } var timingAtLeastEveryWire *string var timingCronExpressionWire *string - var timingContinuousWire *bool switch value := v.Timing.(type) { case nil: case *RuleSchedule_Timing_AtLeastEvery: @@ -2013,17 +2899,12 @@ func ruleScheduleToWire(v *RuleSchedule) (*ruleScheduleWire, error) { if value != nil { timingCronExpressionWire = new(value.CronExpression) } - case *RuleSchedule_Timing_Continuous: - if value != nil { - timingContinuousWire = new(value.Continuous) - } default: return nil, fmt.Errorf("%s: unsupported oneof implementation %T", "RuleSchedule.Timing", value) } return &ruleScheduleWire{ AtLeastEvery: timingAtLeastEveryWire, CronExpression: timingCronExpressionWire, - Continuous: timingContinuousWire, Enabled: v.Enabled, }, nil } @@ -2039,9 +2920,6 @@ func ruleScheduleFromWire(w *ruleScheduleWire) (*RuleSchedule, error) { if w.CronExpression != nil { timingMembers++ } - if w.Continuous != nil { - timingMembers++ - } if timingMembers > 1 { return nil, fmt.Errorf("%s: multiple oneof members set", "RuleSchedule.Timing") } @@ -2051,8 +2929,6 @@ func ruleScheduleFromWire(w *ruleScheduleWire) (*RuleSchedule, error) { timingSelection = &RuleSchedule_Timing_AtLeastEvery{AtLeastEvery: *w.AtLeastEvery} case w.CronExpression != nil: timingSelection = &RuleSchedule_Timing_CronExpression{CronExpression: *w.CronExpression} - case w.Continuous != nil: - timingSelection = &RuleSchedule_Timing_Continuous{Continuous: *w.Continuous} } return &RuleSchedule{ Enabled: w.Enabled, @@ -2060,6 +2936,30 @@ func ruleScheduleFromWire(w *ruleScheduleWire) (*RuleSchedule, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RuleSchedule) MarshalJSON() ([]byte, error) { + w, err := ruleScheduleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RuleSchedule) UnmarshalJSON(data []byte) error { + var w ruleScheduleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ruleScheduleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ruleTimeRangeWire struct { ExtendLookback *string `json:"extend_lookback,omitempty"` } @@ -2082,6 +2982,30 @@ func ruleTimeRangeFromWire(w *ruleTimeRangeWire) (*RuleTimeRange, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RuleTimeRange) MarshalJSON() ([]byte, error) { + w, err := ruleTimeRangeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RuleTimeRange) UnmarshalJSON(data []byte) error { + var w ruleTimeRangeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ruleTimeRangeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type scheduleWire struct { AtLeastEvery *string `json:"at_least_every,omitempty"` CronExpression *string `json:"cron_expression,omitempty"` @@ -2156,6 +3080,30 @@ func scheduleFromWire(w *scheduleWire) (*Schedule, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Schedule) MarshalJSON() ([]byte, error) { + w, err := scheduleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Schedule) UnmarshalJSON(data []byte) error { + var w scheduleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := scheduleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type serviceNowExportConfigWire struct { InstanceId *string `json:"instance_id,omitempty"` ClientId *string `json:"client_id,omitempty"` @@ -2184,6 +3132,30 @@ func serviceNowExportConfigFromWire(w *serviceNowExportConfigWire) (*ServiceNowE }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ServiceNowExportConfig) MarshalJSON() ([]byte, error) { + w, err := serviceNowExportConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ServiceNowExportConfig) UnmarshalJSON(data []byte) error { + var w serviceNowExportConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := serviceNowExportConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type slackExportConfigWire struct { Channel *string `json:"channel,omitempty"` BotTokenUcSecret *string `json:"bot_token_uc_secret,omitempty"` @@ -2209,6 +3181,30 @@ func slackExportConfigFromWire(w *slackExportConfigWire) (*SlackExportConfig, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SlackExportConfig) MarshalJSON() ([]byte, error) { + w, err := slackExportConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SlackExportConfig) UnmarshalJSON(data []byte) error { + var w slackExportConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := slackExportConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tableNameWire struct { CatalogName *string `json:"catalog_name,omitempty"` SchemaName *string `json:"schema_name,omitempty"` @@ -2237,6 +3233,30 @@ func tableNameFromWire(w *tableNameWire) (*TableName, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TableName) MarshalJSON() ([]byte, error) { + w, err := tableNameToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TableName) UnmarshalJSON(data []byte) error { + var w tableNameWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tableNameFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tinesExportConfigWire struct { WebhookUri *string `json:"webhook_uri,omitempty"` WebhookSecretUcSecret *string `json:"webhook_secret_uc_secret,omitempty"` @@ -2265,6 +3285,30 @@ func tinesExportConfigFromWire(w *tinesExportConfigWire) (*TinesExportConfig, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TinesExportConfig) MarshalJSON() ([]byte, error) { + w, err := tinesExportConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TinesExportConfig) UnmarshalJSON(data []byte) error { + var w tinesExportConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tinesExportConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type unityCatalogConnectionWire struct { ConnectionName *string `json:"connection_name,omitempty"` Connector *string `json:"connector,omitempty"` @@ -2299,6 +3343,30 @@ func unityCatalogConnectionFromWire(w *unityCatalogConnectionWire) (*UnityCatalo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UnityCatalogConnection) MarshalJSON() ([]byte, error) { + w, err := unityCatalogConnectionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UnityCatalogConnection) UnmarshalJSON(data []byte) error { + var w unityCatalogConnectionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := unityCatalogConnectionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateAlertConfigRequestWire struct { AlertConfig *alertConfigWire `json:"alert_config,omitempty"` UpdateMask *types.FieldMask[AlertConfig] `json:"update_mask,omitempty"` @@ -2335,6 +3403,30 @@ func updateAlertConfigRequestFromWire(w *updateAlertConfigRequestWire) (*UpdateA }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateAlertConfigRequest) MarshalJSON() ([]byte, error) { + w, err := updateAlertConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateAlertConfigRequest) UnmarshalJSON(data []byte) error { + var w updateAlertConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateAlertConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCommonConfigRequestWire struct { CommonConfig *commonConfigWire `json:"common_config,omitempty"` UpdateMask *types.FieldMask[CommonConfig] `json:"update_mask,omitempty"` @@ -2371,6 +3463,30 @@ func updateCommonConfigRequestFromWire(w *updateCommonConfigRequestWire) (*Updat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCommonConfigRequest) MarshalJSON() ([]byte, error) { + w, err := updateCommonConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCommonConfigRequest) UnmarshalJSON(data []byte) error { + var w updateCommonConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCommonConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateDatasourceConfigRequestWire struct { DatasourceConfig *datasourceConfigWire `json:"datasource_config,omitempty"` UpdateMask *types.FieldMask[DatasourceConfig] `json:"update_mask,omitempty"` @@ -2407,6 +3523,30 @@ func updateDatasourceConfigRequestFromWire(w *updateDatasourceConfigRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateDatasourceConfigRequest) MarshalJSON() ([]byte, error) { + w, err := updateDatasourceConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateDatasourceConfigRequest) UnmarshalJSON(data []byte) error { + var w updateDatasourceConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateDatasourceConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateDatasourceRequestWire struct { Datasource *datasourceWire `json:"datasource,omitempty"` UpdateMask *types.FieldMask[Datasource] `json:"update_mask,omitempty"` @@ -2443,6 +3583,30 @@ func updateDatasourceRequestFromWire(w *updateDatasourceRequestWire) (*UpdateDat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateDatasourceRequest) MarshalJSON() ([]byte, error) { + w, err := updateDatasourceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateDatasourceRequest) UnmarshalJSON(data []byte) error { + var w updateDatasourceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateDatasourceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateRuleConfigRequestWire struct { RuleConfig *ruleConfigWire `json:"rule_config,omitempty"` UpdateMask *types.FieldMask[RuleConfig] `json:"update_mask,omitempty"` @@ -2479,6 +3643,30 @@ func updateRuleConfigRequestFromWire(w *updateRuleConfigRequestWire) (*UpdateRul }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateRuleConfigRequest) MarshalJSON() ([]byte, error) { + w, err := updateRuleConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateRuleConfigRequest) UnmarshalJSON(data []byte) error { + var w updateRuleConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateRuleConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateRuleRequestWire struct { Rule *ruleWire `json:"rule,omitempty"` UpdateMask *types.FieldMask[Rule] `json:"update_mask,omitempty"` @@ -2515,6 +3703,30 @@ func updateRuleRequestFromWire(w *updateRuleRequestWire) (*UpdateRuleRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateRuleRequest) MarshalJSON() ([]byte, error) { + w, err := updateRuleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateRuleRequest) UnmarshalJSON(data []byte) error { + var w updateRuleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateRuleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type webhookExportConfigWire struct { Url *string `json:"url,omitempty"` ExportUpdates *bool `json:"export_updates,omitempty"` @@ -2540,6 +3752,30 @@ func webhookExportConfigFromWire(w *webhookExportConfigWire) (*WebhookExportConf }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WebhookExportConfig) MarshalJSON() ([]byte, error) { + w, err := webhookExportConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WebhookExportConfig) UnmarshalJSON(data []byte) error { + var w webhookExportConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := webhookExportConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/logdelivery/CHANGELOG.md b/logdelivery/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/logdelivery/CHANGELOG.md +++ b/logdelivery/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/logdelivery/internal/version.go b/logdelivery/internal/version.go index 14a35df7..23925150 100644 --- a/logdelivery/internal/version.go +++ b/logdelivery/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-logdelivery" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/logdelivery/v1/wire.go b/logdelivery/v1/wire.go index e89df55f..d82b76cf 100644 --- a/logdelivery/v1/wire.go +++ b/logdelivery/v1/wire.go @@ -145,6 +145,30 @@ func createLogDeliveryConfigurationParamsFromWire(w *createLogDeliveryConfigurat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateLogDeliveryConfigurationParams) MarshalJSON() ([]byte, error) { + w, err := createLogDeliveryConfigurationParamsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateLogDeliveryConfigurationParams) UnmarshalJSON(data []byte) error { + var w createLogDeliveryConfigurationParamsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createLogDeliveryConfigurationParamsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createLogDeliveryConfigurationRequestWire struct { LogDeliveryConfiguration *createLogDeliveryConfigurationParamsWire `json:"log_delivery_configuration,omitempty"` } @@ -175,6 +199,30 @@ func createLogDeliveryConfigurationRequestFromWire(w *createLogDeliveryConfigura }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateLogDeliveryConfigurationRequest) MarshalJSON() ([]byte, error) { + w, err := createLogDeliveryConfigurationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateLogDeliveryConfigurationRequest) UnmarshalJSON(data []byte) error { + var w createLogDeliveryConfigurationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createLogDeliveryConfigurationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createLogDeliveryConfigurationResponseWire struct { LogDeliveryConfiguration *logDeliveryConfigurationWire `json:"log_delivery_configuration,omitempty"` } @@ -205,6 +253,30 @@ func createLogDeliveryConfigurationResponseFromWire(w *createLogDeliveryConfigur }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateLogDeliveryConfigurationResponse) MarshalJSON() ([]byte, error) { + w, err := createLogDeliveryConfigurationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateLogDeliveryConfigurationResponse) UnmarshalJSON(data []byte) error { + var w createLogDeliveryConfigurationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createLogDeliveryConfigurationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getLogDeliveryConfigurationRequestWire struct { ConfigId *string `json:"config_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -230,6 +302,30 @@ func getLogDeliveryConfigurationRequestFromWire(w *getLogDeliveryConfigurationRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetLogDeliveryConfigurationRequest) MarshalJSON() ([]byte, error) { + w, err := getLogDeliveryConfigurationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetLogDeliveryConfigurationRequest) UnmarshalJSON(data []byte) error { + var w getLogDeliveryConfigurationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getLogDeliveryConfigurationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getLogDeliveryConfigurationResponseWire struct { LogDeliveryConfiguration *logDeliveryConfigurationWire `json:"log_delivery_configuration,omitempty"` } @@ -260,6 +356,30 @@ func getLogDeliveryConfigurationResponseFromWire(w *getLogDeliveryConfigurationR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetLogDeliveryConfigurationResponse) MarshalJSON() ([]byte, error) { + w, err := getLogDeliveryConfigurationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetLogDeliveryConfigurationResponse) UnmarshalJSON(data []byte) error { + var w getLogDeliveryConfigurationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getLogDeliveryConfigurationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listLogDeliveryConfigurationRequestWire struct { AccountId *string `json:"account_id,omitempty"` CredentialsId *string `json:"credentials_id,omitempty"` @@ -294,6 +414,30 @@ func listLogDeliveryConfigurationRequestFromWire(w *listLogDeliveryConfiguration }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListLogDeliveryConfigurationRequest) MarshalJSON() ([]byte, error) { + w, err := listLogDeliveryConfigurationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListLogDeliveryConfigurationRequest) UnmarshalJSON(data []byte) error { + var w listLogDeliveryConfigurationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listLogDeliveryConfigurationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listLogDeliveryConfigurationResponseWire struct { LogDeliveryConfigurations []logDeliveryConfigurationWire `json:"log_delivery_configurations,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -327,6 +471,30 @@ func listLogDeliveryConfigurationResponseFromWire(w *listLogDeliveryConfiguratio }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListLogDeliveryConfigurationResponse) MarshalJSON() ([]byte, error) { + w, err := listLogDeliveryConfigurationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListLogDeliveryConfigurationResponse) UnmarshalJSON(data []byte) error { + var w listLogDeliveryConfigurationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listLogDeliveryConfigurationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logDeliveryConfigurationWire struct { ConfigId *string `json:"config_id,omitempty"` ConfigName *string `json:"config_name,omitempty"` @@ -420,6 +588,30 @@ func logDeliveryConfigurationFromWire(w *logDeliveryConfigurationWire) (*LogDeli }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogDeliveryConfiguration) MarshalJSON() ([]byte, error) { + w, err := logDeliveryConfigurationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogDeliveryConfiguration) UnmarshalJSON(data []byte) error { + var w logDeliveryConfigurationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logDeliveryConfigurationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type logDeliveryStatusWire struct { Status LogDeliveryStatusEnum `json:"status,omitempty"` LastAttemptTime *string `json:"last_attempt_time,omitempty"` @@ -451,6 +643,30 @@ func logDeliveryStatusFromWire(w *logDeliveryStatusWire) (*LogDeliveryStatus, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LogDeliveryStatus) MarshalJSON() ([]byte, error) { + w, err := logDeliveryStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LogDeliveryStatus) UnmarshalJSON(data []byte) error { + var w logDeliveryStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := logDeliveryStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateLogDeliveryConfigurationRequestWire struct { ConfigId *string `json:"config_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -479,6 +695,30 @@ func updateLogDeliveryConfigurationRequestFromWire(w *updateLogDeliveryConfigura }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateLogDeliveryConfigurationRequest) MarshalJSON() ([]byte, error) { + w, err := updateLogDeliveryConfigurationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateLogDeliveryConfigurationRequest) UnmarshalJSON(data []byte) error { + var w updateLogDeliveryConfigurationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateLogDeliveryConfigurationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateLogDeliveryConfigurationResponseWire struct { } @@ -496,6 +736,30 @@ func updateLogDeliveryConfigurationResponseFromWire(w *updateLogDeliveryConfigur return &UpdateLogDeliveryConfigurationResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateLogDeliveryConfigurationResponse) MarshalJSON() ([]byte, error) { + w, err := updateLogDeliveryConfigurationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateLogDeliveryConfigurationResponse) UnmarshalJSON(data []byte) error { + var w updateLogDeliveryConfigurationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateLogDeliveryConfigurationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/marketplaces/CHANGELOG.md b/marketplaces/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/marketplaces/CHANGELOG.md +++ b/marketplaces/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/marketplaces/internal/version.go b/marketplaces/internal/version.go index 8080818d..6ce38f19 100644 --- a/marketplaces/internal/version.go +++ b/marketplaces/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-marketplaces" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/marketplaces/v1/wire.go b/marketplaces/v1/wire.go index 41f9af77..a7bc5b0f 100644 --- a/marketplaces/v1/wire.go +++ b/marketplaces/v1/wire.go @@ -77,6 +77,30 @@ func addExchangeForListingRequestFromWire(w *addExchangeForListingRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AddExchangeForListingRequest) MarshalJSON() ([]byte, error) { + w, err := addExchangeForListingRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AddExchangeForListingRequest) UnmarshalJSON(data []byte) error { + var w addExchangeForListingRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := addExchangeForListingRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type addExchangeForListingResponseWire struct { ExchangeForListing *exchangeListingWire `json:"exchange_for_listing,omitempty"` } @@ -107,6 +131,30 @@ func addExchangeForListingResponseFromWire(w *addExchangeForListingResponseWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AddExchangeForListingResponse) MarshalJSON() ([]byte, error) { + w, err := addExchangeForListingResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AddExchangeForListingResponse) UnmarshalJSON(data []byte) error { + var w addExchangeForListingResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := addExchangeForListingResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type batchGetListingsRequestWire struct { Ids []string `json:"ids,omitempty"` } @@ -129,6 +177,30 @@ func batchGetListingsRequestFromWire(w *batchGetListingsRequestWire) (*BatchGetL }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BatchGetListingsRequest) MarshalJSON() ([]byte, error) { + w, err := batchGetListingsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BatchGetListingsRequest) UnmarshalJSON(data []byte) error { + var w batchGetListingsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := batchGetListingsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type batchGetListingsResponseWire struct { Listings []listingWire `json:"listings,omitempty"` } @@ -159,6 +231,30 @@ func batchGetListingsResponseFromWire(w *batchGetListingsResponseWire) (*BatchGe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BatchGetListingsResponse) MarshalJSON() ([]byte, error) { + w, err := batchGetListingsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BatchGetListingsResponse) UnmarshalJSON(data []byte) error { + var w batchGetListingsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := batchGetListingsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type batchGetProvidersRequestWire struct { Ids []string `json:"ids,omitempty"` } @@ -181,6 +277,30 @@ func batchGetProvidersRequestFromWire(w *batchGetProvidersRequestWire) (*BatchGe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BatchGetProvidersRequest) MarshalJSON() ([]byte, error) { + w, err := batchGetProvidersRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BatchGetProvidersRequest) UnmarshalJSON(data []byte) error { + var w batchGetProvidersRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := batchGetProvidersRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type batchGetProvidersResponseWire struct { Providers []providerInfoWire `json:"providers,omitempty"` } @@ -211,6 +331,30 @@ func batchGetProvidersResponseFromWire(w *batchGetProvidersResponseWire) (*Batch }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BatchGetProvidersResponse) MarshalJSON() ([]byte, error) { + w, err := batchGetProvidersResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BatchGetProvidersResponse) UnmarshalJSON(data []byte) error { + var w batchGetProvidersResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := batchGetProvidersResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type consumerTermsWire struct { Version *string `json:"version,omitempty"` } @@ -233,6 +377,30 @@ func consumerTermsFromWire(w *consumerTermsWire) (*ConsumerTerms, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ConsumerTerms) MarshalJSON() ([]byte, error) { + w, err := consumerTermsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ConsumerTerms) UnmarshalJSON(data []byte) error { + var w consumerTermsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := consumerTermsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type contactInfoWire struct { FirstName *string `json:"first_name,omitempty"` LastName *string `json:"last_name,omitempty"` @@ -264,6 +432,30 @@ func contactInfoFromWire(w *contactInfoWire) (*ContactInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ContactInfo) MarshalJSON() ([]byte, error) { + w, err := contactInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ContactInfo) UnmarshalJSON(data []byte) error { + var w contactInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := contactInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createExchangeFilterRequestWire struct { Filter *exchangeFilterWire `json:"filter,omitempty"` } @@ -294,6 +486,30 @@ func createExchangeFilterRequestFromWire(w *createExchangeFilterRequestWire) (*C }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateExchangeFilterRequest) MarshalJSON() ([]byte, error) { + w, err := createExchangeFilterRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateExchangeFilterRequest) UnmarshalJSON(data []byte) error { + var w createExchangeFilterRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createExchangeFilterRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createExchangeFilterResponseWire struct { FilterId *string `json:"filter_id,omitempty"` } @@ -316,6 +532,30 @@ func createExchangeFilterResponseFromWire(w *createExchangeFilterResponseWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateExchangeFilterResponse) MarshalJSON() ([]byte, error) { + w, err := createExchangeFilterResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateExchangeFilterResponse) UnmarshalJSON(data []byte) error { + var w createExchangeFilterResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createExchangeFilterResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createExchangeRequestWire struct { Exchange *exchangeWire `json:"exchange,omitempty"` } @@ -346,6 +586,30 @@ func createExchangeRequestFromWire(w *createExchangeRequestWire) (*CreateExchang }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateExchangeRequest) MarshalJSON() ([]byte, error) { + w, err := createExchangeRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateExchangeRequest) UnmarshalJSON(data []byte) error { + var w createExchangeRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createExchangeRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createExchangeResponseWire struct { ExchangeId *string `json:"exchange_id,omitempty"` } @@ -368,6 +632,30 @@ func createExchangeResponseFromWire(w *createExchangeResponseWire) (*CreateExcha }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateExchangeResponse) MarshalJSON() ([]byte, error) { + w, err := createExchangeResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateExchangeResponse) UnmarshalJSON(data []byte) error { + var w createExchangeResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createExchangeResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createFileRequestWire struct { FileParent *fileParentWire `json:"file_parent,omitempty"` MarketplaceFileType MarketplaceFileType `json:"marketplace_file_type,omitempty"` @@ -407,6 +695,30 @@ func createFileRequestFromWire(w *createFileRequestWire) (*CreateFileRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateFileRequest) MarshalJSON() ([]byte, error) { + w, err := createFileRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateFileRequest) UnmarshalJSON(data []byte) error { + var w createFileRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createFileRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createFileResponseWire struct { UploadUrl *string `json:"upload_url,omitempty"` FileInfo *fileInfoWire `json:"file_info,omitempty"` @@ -440,6 +752,30 @@ func createFileResponseFromWire(w *createFileResponseWire) (*CreateFileResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateFileResponse) MarshalJSON() ([]byte, error) { + w, err := createFileResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateFileResponse) UnmarshalJSON(data []byte) error { + var w createFileResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createFileResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createInstallationRequestWire struct { ListingId *string `json:"listing_id,omitempty"` ShareName *string `json:"share_name,omitempty"` @@ -493,6 +829,30 @@ func createInstallationRequestFromWire(w *createInstallationRequestWire) (*Creat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateInstallationRequest) MarshalJSON() ([]byte, error) { + w, err := createInstallationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateInstallationRequest) UnmarshalJSON(data []byte) error { + var w createInstallationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createInstallationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createInstallationResponseWire struct { Installation *installationDetailWire `json:"installation,omitempty"` } @@ -523,6 +883,30 @@ func createInstallationResponseFromWire(w *createInstallationResponseWire) (*Cre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateInstallationResponse) MarshalJSON() ([]byte, error) { + w, err := createInstallationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateInstallationResponse) UnmarshalJSON(data []byte) error { + var w createInstallationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createInstallationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createListingRequestWire struct { Listing *listingWire `json:"listing,omitempty"` } @@ -553,6 +937,30 @@ func createListingRequestFromWire(w *createListingRequestWire) (*CreateListingRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateListingRequest) MarshalJSON() ([]byte, error) { + w, err := createListingRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateListingRequest) UnmarshalJSON(data []byte) error { + var w createListingRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createListingRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createListingResponseWire struct { ListingId *string `json:"listing_id,omitempty"` } @@ -575,6 +983,30 @@ func createListingResponseFromWire(w *createListingResponseWire) (*CreateListing }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateListingResponse) MarshalJSON() ([]byte, error) { + w, err := createListingResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateListingResponse) UnmarshalJSON(data []byte) error { + var w createListingResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createListingResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createPersonalizationRequestWire struct { ListingId *string `json:"listing_id,omitempty"` Comment *string `json:"comment,omitempty"` @@ -629,6 +1061,30 @@ func createPersonalizationRequestFromWire(w *createPersonalizationRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreatePersonalizationRequest) MarshalJSON() ([]byte, error) { + w, err := createPersonalizationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreatePersonalizationRequest) UnmarshalJSON(data []byte) error { + var w createPersonalizationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createPersonalizationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createPersonalizationResponseWire struct { Id *string `json:"id,omitempty"` } @@ -651,6 +1107,30 @@ func createPersonalizationResponseFromWire(w *createPersonalizationResponseWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreatePersonalizationResponse) MarshalJSON() ([]byte, error) { + w, err := createPersonalizationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreatePersonalizationResponse) UnmarshalJSON(data []byte) error { + var w createPersonalizationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createPersonalizationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createProviderAnalyticsDashboardRequestWire struct { } @@ -668,6 +1148,30 @@ func createProviderAnalyticsDashboardRequestFromWire(w *createProviderAnalyticsD return &CreateProviderAnalyticsDashboardRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateProviderAnalyticsDashboardRequest) MarshalJSON() ([]byte, error) { + w, err := createProviderAnalyticsDashboardRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateProviderAnalyticsDashboardRequest) UnmarshalJSON(data []byte) error { + var w createProviderAnalyticsDashboardRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createProviderAnalyticsDashboardRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createProviderAnalyticsDashboardResponseWire struct { Id *string `json:"id,omitempty"` } @@ -690,8 +1194,32 @@ func createProviderAnalyticsDashboardResponseFromWire(w *createProviderAnalytics }, nil } -type createProviderRequestWire struct { - Provider *providerInfoWire `json:"provider,omitempty"` +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateProviderAnalyticsDashboardResponse) MarshalJSON() ([]byte, error) { + w, err := createProviderAnalyticsDashboardResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateProviderAnalyticsDashboardResponse) UnmarshalJSON(data []byte) error { + var w createProviderAnalyticsDashboardResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createProviderAnalyticsDashboardResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type createProviderRequestWire struct { + Provider *providerInfoWire `json:"provider,omitempty"` } func createProviderRequestToWire(v *CreateProviderRequest) (*createProviderRequestWire, error) { @@ -720,6 +1248,30 @@ func createProviderRequestFromWire(w *createProviderRequestWire) (*CreateProvide }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateProviderRequest) MarshalJSON() ([]byte, error) { + w, err := createProviderRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateProviderRequest) UnmarshalJSON(data []byte) error { + var w createProviderRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createProviderRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createProviderResponseWire struct { Id *string `json:"id,omitempty"` } @@ -742,6 +1294,30 @@ func createProviderResponseFromWire(w *createProviderResponseWire) (*CreateProvi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateProviderResponse) MarshalJSON() ([]byte, error) { + w, err := createProviderResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateProviderResponse) UnmarshalJSON(data []byte) error { + var w createProviderResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createProviderResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dataRefreshInfoWire struct { Interval *wireInt64 `json:"interval,omitempty"` Unit DataRefresh `json:"unit,omitempty"` @@ -775,6 +1351,30 @@ func dataRefreshInfoFromWire(w *dataRefreshInfoWire) (*DataRefreshInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DataRefreshInfo) MarshalJSON() ([]byte, error) { + w, err := dataRefreshInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DataRefreshInfo) UnmarshalJSON(data []byte) error { + var w dataRefreshInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dataRefreshInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteExchangeFilterRequestWire struct { Id *string `json:"id,omitempty"` } @@ -797,6 +1397,30 @@ func deleteExchangeFilterRequestFromWire(w *deleteExchangeFilterRequestWire) (*D }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteExchangeFilterRequest) MarshalJSON() ([]byte, error) { + w, err := deleteExchangeFilterRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteExchangeFilterRequest) UnmarshalJSON(data []byte) error { + var w deleteExchangeFilterRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteExchangeFilterRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteExchangeFilterResponseWire struct { } @@ -814,6 +1438,30 @@ func deleteExchangeFilterResponseFromWire(w *deleteExchangeFilterResponseWire) ( return &DeleteExchangeFilterResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteExchangeFilterResponse) MarshalJSON() ([]byte, error) { + w, err := deleteExchangeFilterResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteExchangeFilterResponse) UnmarshalJSON(data []byte) error { + var w deleteExchangeFilterResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteExchangeFilterResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteExchangeRequestWire struct { Id *string `json:"id,omitempty"` } @@ -836,6 +1484,30 @@ func deleteExchangeRequestFromWire(w *deleteExchangeRequestWire) (*DeleteExchang }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteExchangeRequest) MarshalJSON() ([]byte, error) { + w, err := deleteExchangeRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteExchangeRequest) UnmarshalJSON(data []byte) error { + var w deleteExchangeRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteExchangeRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteExchangeResponseWire struct { } @@ -853,6 +1525,30 @@ func deleteExchangeResponseFromWire(w *deleteExchangeResponseWire) (*DeleteExcha return &DeleteExchangeResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteExchangeResponse) MarshalJSON() ([]byte, error) { + w, err := deleteExchangeResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteExchangeResponse) UnmarshalJSON(data []byte) error { + var w deleteExchangeResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteExchangeResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteFileRequestWire struct { FileId *string `json:"file_id,omitempty"` } @@ -875,6 +1571,30 @@ func deleteFileRequestFromWire(w *deleteFileRequestWire) (*DeleteFileRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteFileRequest) MarshalJSON() ([]byte, error) { + w, err := deleteFileRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteFileRequest) UnmarshalJSON(data []byte) error { + var w deleteFileRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteFileRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteFileResponseWire struct { } @@ -892,6 +1612,30 @@ func deleteFileResponseFromWire(w *deleteFileResponseWire) (*DeleteFileResponse, return &DeleteFileResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteFileResponse) MarshalJSON() ([]byte, error) { + w, err := deleteFileResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteFileResponse) UnmarshalJSON(data []byte) error { + var w deleteFileResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteFileResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteInstallationRequestWire struct { ListingId *string `json:"listing_id,omitempty"` InstallationId *string `json:"installation_id,omitempty"` @@ -917,6 +1661,30 @@ func deleteInstallationRequestFromWire(w *deleteInstallationRequestWire) (*Delet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteInstallationRequest) MarshalJSON() ([]byte, error) { + w, err := deleteInstallationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteInstallationRequest) UnmarshalJSON(data []byte) error { + var w deleteInstallationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteInstallationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteInstallationResponseWire struct { } @@ -934,6 +1702,30 @@ func deleteInstallationResponseFromWire(w *deleteInstallationResponseWire) (*Del return &DeleteInstallationResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteInstallationResponse) MarshalJSON() ([]byte, error) { + w, err := deleteInstallationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteInstallationResponse) UnmarshalJSON(data []byte) error { + var w deleteInstallationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteInstallationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteListingRequestWire struct { Id *string `json:"id,omitempty"` } @@ -956,6 +1748,30 @@ func deleteListingRequestFromWire(w *deleteListingRequestWire) (*DeleteListingRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteListingRequest) MarshalJSON() ([]byte, error) { + w, err := deleteListingRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteListingRequest) UnmarshalJSON(data []byte) error { + var w deleteListingRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteListingRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteListingResponseWire struct { } @@ -973,6 +1789,30 @@ func deleteListingResponseFromWire(w *deleteListingResponseWire) (*DeleteListing return &DeleteListingResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteListingResponse) MarshalJSON() ([]byte, error) { + w, err := deleteListingResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteListingResponse) UnmarshalJSON(data []byte) error { + var w deleteListingResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteListingResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteProviderRequestWire struct { Id *string `json:"id,omitempty"` } @@ -995,6 +1835,30 @@ func deleteProviderRequestFromWire(w *deleteProviderRequestWire) (*DeleteProvide }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteProviderRequest) MarshalJSON() ([]byte, error) { + w, err := deleteProviderRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteProviderRequest) UnmarshalJSON(data []byte) error { + var w deleteProviderRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteProviderRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteProviderResponseWire struct { } @@ -1012,6 +1876,30 @@ func deleteProviderResponseFromWire(w *deleteProviderResponseWire) (*DeleteProvi return &DeleteProviderResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteProviderResponse) MarshalJSON() ([]byte, error) { + w, err := deleteProviderResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteProviderResponse) UnmarshalJSON(data []byte) error { + var w deleteProviderResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteProviderResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type exchangeWire struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -1090,6 +1978,30 @@ func exchangeFromWire(w *exchangeWire) (*Exchange, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Exchange) MarshalJSON() ([]byte, error) { + w, err := exchangeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Exchange) UnmarshalJSON(data []byte) error { + var w exchangeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := exchangeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type exchangeFilterWire struct { Id *string `json:"id,omitempty"` ExchangeId *string `json:"exchange_id,omitempty"` @@ -1152,6 +2064,30 @@ func exchangeFilterFromWire(w *exchangeFilterWire) (*ExchangeFilter, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExchangeFilter) MarshalJSON() ([]byte, error) { + w, err := exchangeFilterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExchangeFilter) UnmarshalJSON(data []byte) error { + var w exchangeFilterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := exchangeFilterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type exchangeListingWire struct { Id *string `json:"id,omitempty"` ExchangeId *string `json:"exchange_id,omitempty"` @@ -1200,6 +2136,30 @@ func exchangeListingFromWire(w *exchangeListingWire) (*ExchangeListing, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExchangeListing) MarshalJSON() ([]byte, error) { + w, err := exchangeListingToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExchangeListing) UnmarshalJSON(data []byte) error { + var w exchangeListingWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := exchangeListingFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type fileInfoWire struct { Id *string `json:"id,omitempty"` MarketplaceFileType MarketplaceFileType `json:"marketplace_file_type,omitempty"` @@ -1273,6 +2233,30 @@ func fileInfoFromWire(w *fileInfoWire) (*FileInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FileInfo) MarshalJSON() ([]byte, error) { + w, err := fileInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FileInfo) UnmarshalJSON(data []byte) error { + var w fileInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := fileInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type fileParentWire struct { ParentId *string `json:"parent_id,omitempty"` FileParentType FileParentType `json:"file_parent_type,omitempty"` @@ -1298,6 +2282,30 @@ func fileParentFromWire(w *fileParentWire) (*FileParent, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FileParent) MarshalJSON() ([]byte, error) { + w, err := fileParentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FileParent) UnmarshalJSON(data []byte) error { + var w fileParentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := fileParentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAllPersonalizationRequestsForConsumerResponseWire struct { PersonalizationRequests []personalizationRequestWire `json:"personalization_requests,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1331,6 +2339,30 @@ func getAllPersonalizationRequestsForConsumerResponseFromWire(w *getAllPersonali }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAllPersonalizationRequestsForConsumerResponse) MarshalJSON() ([]byte, error) { + w, err := getAllPersonalizationRequestsForConsumerResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAllPersonalizationRequestsForConsumerResponse) UnmarshalJSON(data []byte) error { + var w getAllPersonalizationRequestsForConsumerResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAllPersonalizationRequestsForConsumerResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getExchangeRequestWire struct { Id *string `json:"id,omitempty"` } @@ -1353,6 +2385,30 @@ func getExchangeRequestFromWire(w *getExchangeRequestWire) (*GetExchangeRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetExchangeRequest) MarshalJSON() ([]byte, error) { + w, err := getExchangeRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetExchangeRequest) UnmarshalJSON(data []byte) error { + var w getExchangeRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getExchangeRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getExchangeResponseWire struct { Exchange *exchangeWire `json:"exchange,omitempty"` } @@ -1383,6 +2439,30 @@ func getExchangeResponseFromWire(w *getExchangeResponseWire) (*GetExchangeRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetExchangeResponse) MarshalJSON() ([]byte, error) { + w, err := getExchangeResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetExchangeResponse) UnmarshalJSON(data []byte) error { + var w getExchangeResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getExchangeResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getFileRequestWire struct { FileId *string `json:"file_id,omitempty"` } @@ -1405,6 +2485,30 @@ func getFileRequestFromWire(w *getFileRequestWire) (*GetFileRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetFileRequest) MarshalJSON() ([]byte, error) { + w, err := getFileRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetFileRequest) UnmarshalJSON(data []byte) error { + var w getFileRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getFileRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getFileResponseWire struct { FileInfo *fileInfoWire `json:"file_info,omitempty"` } @@ -1435,6 +2539,30 @@ func getFileResponseFromWire(w *getFileResponseWire) (*GetFileResponse, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetFileResponse) MarshalJSON() ([]byte, error) { + w, err := getFileResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetFileResponse) UnmarshalJSON(data []byte) error { + var w getFileResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getFileResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getInstallationDetailsRequestWire struct { ListingId *string `json:"listing_id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -1463,6 +2591,30 @@ func getInstallationDetailsRequestFromWire(w *getInstallationDetailsRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetInstallationDetailsRequest) MarshalJSON() ([]byte, error) { + w, err := getInstallationDetailsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetInstallationDetailsRequest) UnmarshalJSON(data []byte) error { + var w getInstallationDetailsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getInstallationDetailsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getLatestVersionProviderAnalyticsDashboardRequestWire struct { } @@ -1480,6 +2632,30 @@ func getLatestVersionProviderAnalyticsDashboardRequestFromWire(w *getLatestVersi return &GetLatestVersionProviderAnalyticsDashboardRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetLatestVersionProviderAnalyticsDashboardRequest) MarshalJSON() ([]byte, error) { + w, err := getLatestVersionProviderAnalyticsDashboardRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetLatestVersionProviderAnalyticsDashboardRequest) UnmarshalJSON(data []byte) error { + var w getLatestVersionProviderAnalyticsDashboardRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getLatestVersionProviderAnalyticsDashboardRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getLatestVersionProviderAnalyticsDashboardResponseWire struct { Version *wireInt64 `json:"version,omitempty"` } @@ -1510,6 +2686,30 @@ func getLatestVersionProviderAnalyticsDashboardResponseFromWire(w *getLatestVers }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetLatestVersionProviderAnalyticsDashboardResponse) MarshalJSON() ([]byte, error) { + w, err := getLatestVersionProviderAnalyticsDashboardResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetLatestVersionProviderAnalyticsDashboardResponse) UnmarshalJSON(data []byte) error { + var w getLatestVersionProviderAnalyticsDashboardResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getLatestVersionProviderAnalyticsDashboardResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getListingContentMetadataRequestWire struct { ListingId *string `json:"listing_id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -1538,6 +2738,30 @@ func getListingContentMetadataRequestFromWire(w *getListingContentMetadataReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetListingContentMetadataRequest) MarshalJSON() ([]byte, error) { + w, err := getListingContentMetadataRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetListingContentMetadataRequest) UnmarshalJSON(data []byte) error { + var w getListingContentMetadataRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getListingContentMetadataRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getListingContentMetadataResponseWire struct { SharedDataObjects []sharedDataObjectWire `json:"shared_data_objects,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1571,6 +2795,30 @@ func getListingContentMetadataResponseFromWire(w *getListingContentMetadataRespo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetListingContentMetadataResponse) MarshalJSON() ([]byte, error) { + w, err := getListingContentMetadataResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetListingContentMetadataResponse) UnmarshalJSON(data []byte) error { + var w getListingContentMetadataResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getListingContentMetadataResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getListingRequestWire struct { Id *string `json:"id,omitempty"` } @@ -1593,6 +2841,30 @@ func getListingRequestFromWire(w *getListingRequestWire) (*GetListingRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetListingRequest) MarshalJSON() ([]byte, error) { + w, err := getListingRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetListingRequest) UnmarshalJSON(data []byte) error { + var w getListingRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getListingRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getListingResponseWire struct { Listing *listingWire `json:"listing,omitempty"` } @@ -1623,6 +2895,30 @@ func getListingResponseFromWire(w *getListingResponseWire) (*GetListingResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetListingResponse) MarshalJSON() ([]byte, error) { + w, err := getListingResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetListingResponse) UnmarshalJSON(data []byte) error { + var w getListingResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getListingResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getListingsResponseWire struct { Listings []listingWire `json:"listings,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1656,6 +2952,30 @@ func getListingsResponseFromWire(w *getListingsResponseWire) (*GetListingsRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetListingsResponse) MarshalJSON() ([]byte, error) { + w, err := getListingsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetListingsResponse) UnmarshalJSON(data []byte) error { + var w getListingsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getListingsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPersonalizationRequestsForConsumerRequestWire struct { ListingId *string `json:"listing_id,omitempty"` } @@ -1678,6 +2998,30 @@ func getPersonalizationRequestsForConsumerRequestFromWire(w *getPersonalizationR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPersonalizationRequestsForConsumerRequest) MarshalJSON() ([]byte, error) { + w, err := getPersonalizationRequestsForConsumerRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPersonalizationRequestsForConsumerRequest) UnmarshalJSON(data []byte) error { + var w getPersonalizationRequestsForConsumerRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPersonalizationRequestsForConsumerRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPersonalizationRequestsForConsumerResponseWire struct { PersonalizationRequests []personalizationRequestWire `json:"personalization_requests,omitempty"` } @@ -1708,6 +3052,30 @@ func getPersonalizationRequestsForConsumerResponseFromWire(w *getPersonalization }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPersonalizationRequestsForConsumerResponse) MarshalJSON() ([]byte, error) { + w, err := getPersonalizationRequestsForConsumerResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPersonalizationRequestsForConsumerResponse) UnmarshalJSON(data []byte) error { + var w getPersonalizationRequestsForConsumerResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPersonalizationRequestsForConsumerResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPersonalizationRequestsForProviderRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -1733,6 +3101,30 @@ func getPersonalizationRequestsForProviderRequestFromWire(w *getPersonalizationR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPersonalizationRequestsForProviderRequest) MarshalJSON() ([]byte, error) { + w, err := getPersonalizationRequestsForProviderRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPersonalizationRequestsForProviderRequest) UnmarshalJSON(data []byte) error { + var w getPersonalizationRequestsForProviderRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPersonalizationRequestsForProviderRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPersonalizationRequestsForProviderResponseWire struct { PersonalizationRequests []personalizationRequestWire `json:"personalization_requests,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1766,6 +3158,30 @@ func getPersonalizationRequestsForProviderResponseFromWire(w *getPersonalization }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPersonalizationRequestsForProviderResponse) MarshalJSON() ([]byte, error) { + w, err := getPersonalizationRequestsForProviderResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPersonalizationRequestsForProviderResponse) UnmarshalJSON(data []byte) error { + var w getPersonalizationRequestsForProviderResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPersonalizationRequestsForProviderResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getProviderRequestWire struct { Id *string `json:"id,omitempty"` } @@ -1788,6 +3204,30 @@ func getProviderRequestFromWire(w *getProviderRequestWire) (*GetProviderRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetProviderRequest) MarshalJSON() ([]byte, error) { + w, err := getProviderRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetProviderRequest) UnmarshalJSON(data []byte) error { + var w getProviderRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getProviderRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getProviderResponseWire struct { Provider *providerInfoWire `json:"provider,omitempty"` } @@ -1811,11 +3251,35 @@ func getProviderResponseFromWire(w *getProviderResponseWire) (*GetProviderRespon } providerPublicValue, err := providerInfoFromWire(w.Provider) if err != nil { - return nil, fmt.Errorf("%s: %w", "GetProviderResponse.Provider", err) + return nil, fmt.Errorf("%s: %w", "GetProviderResponse.Provider", err) + } + return &GetProviderResponse{ + Provider: providerPublicValue, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetProviderResponse) MarshalJSON() ([]byte, error) { + w, err := getProviderResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetProviderResponse) UnmarshalJSON(data []byte) error { + var w getProviderResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getProviderResponseFromWire(&w) + if err != nil { + return err } - return &GetProviderResponse{ - Provider: providerPublicValue, - }, nil + *v = *decoded + return nil } type getPublishedListingForConsumerRequestWire struct { @@ -1840,6 +3304,30 @@ func getPublishedListingForConsumerRequestFromWire(w *getPublishedListingForCons }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPublishedListingForConsumerRequest) MarshalJSON() ([]byte, error) { + w, err := getPublishedListingForConsumerRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPublishedListingForConsumerRequest) UnmarshalJSON(data []byte) error { + var w getPublishedListingForConsumerRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPublishedListingForConsumerRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPublishedListingForConsumerResponseWire struct { Listing *listingWire `json:"listing,omitempty"` } @@ -1870,6 +3358,30 @@ func getPublishedListingForConsumerResponseFromWire(w *getPublishedListingForCon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPublishedListingForConsumerResponse) MarshalJSON() ([]byte, error) { + w, err := getPublishedListingForConsumerResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPublishedListingForConsumerResponse) UnmarshalJSON(data []byte) error { + var w getPublishedListingForConsumerResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPublishedListingForConsumerResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPublishedListingsForConsumerResponseWire struct { Listings []listingWire `json:"listings,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1903,6 +3415,30 @@ func getPublishedListingsForConsumerResponseFromWire(w *getPublishedListingsForC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPublishedListingsForConsumerResponse) MarshalJSON() ([]byte, error) { + w, err := getPublishedListingsForConsumerResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPublishedListingsForConsumerResponse) UnmarshalJSON(data []byte) error { + var w getPublishedListingsForConsumerResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPublishedListingsForConsumerResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPublishedProviderForConsumerRequestWire struct { Id *string `json:"id,omitempty"` } @@ -1925,6 +3461,30 @@ func getPublishedProviderForConsumerRequestFromWire(w *getPublishedProviderForCo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPublishedProviderForConsumerRequest) MarshalJSON() ([]byte, error) { + w, err := getPublishedProviderForConsumerRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPublishedProviderForConsumerRequest) UnmarshalJSON(data []byte) error { + var w getPublishedProviderForConsumerRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPublishedProviderForConsumerRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPublishedProviderForConsumerResponseWire struct { Provider *providerInfoWire `json:"provider,omitempty"` } @@ -1955,6 +3515,30 @@ func getPublishedProviderForConsumerResponseFromWire(w *getPublishedProviderForC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPublishedProviderForConsumerResponse) MarshalJSON() ([]byte, error) { + w, err := getPublishedProviderForConsumerResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPublishedProviderForConsumerResponse) UnmarshalJSON(data []byte) error { + var w getPublishedProviderForConsumerResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPublishedProviderForConsumerResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type installationDetailWire struct { Id *string `json:"id,omitempty"` ListingId *string `json:"listing_id,omitempty"` @@ -2037,6 +3621,30 @@ func installationDetailFromWire(w *installationDetailWire) (*InstallationDetail, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InstallationDetail) MarshalJSON() ([]byte, error) { + w, err := installationDetailToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InstallationDetail) UnmarshalJSON(data []byte) error { + var w installationDetailWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := installationDetailFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAllInstallationsResponseWire struct { Installations []installationDetailWire `json:"installations,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2070,6 +3678,30 @@ func listAllInstallationsResponseFromWire(w *listAllInstallationsResponseWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAllInstallationsResponse) MarshalJSON() ([]byte, error) { + w, err := listAllInstallationsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAllInstallationsResponse) UnmarshalJSON(data []byte) error { + var w listAllInstallationsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAllInstallationsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExchangeFiltersRequestWire struct { ExchangeId *string `json:"exchange_id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -2098,6 +3730,30 @@ func listExchangeFiltersRequestFromWire(w *listExchangeFiltersRequestWire) (*Lis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExchangeFiltersRequest) MarshalJSON() ([]byte, error) { + w, err := listExchangeFiltersRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExchangeFiltersRequest) UnmarshalJSON(data []byte) error { + var w listExchangeFiltersRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExchangeFiltersRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExchangeFiltersResponseWire struct { Filters []exchangeFilterWire `json:"filters,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2131,6 +3787,30 @@ func listExchangeFiltersResponseFromWire(w *listExchangeFiltersResponseWire) (*L }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExchangeFiltersResponse) MarshalJSON() ([]byte, error) { + w, err := listExchangeFiltersResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExchangeFiltersResponse) UnmarshalJSON(data []byte) error { + var w listExchangeFiltersResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExchangeFiltersResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExchangesForListingRequestWire struct { ListingId *string `json:"listing_id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -2159,6 +3839,30 @@ func listExchangesForListingRequestFromWire(w *listExchangesForListingRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExchangesForListingRequest) MarshalJSON() ([]byte, error) { + w, err := listExchangesForListingRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExchangesForListingRequest) UnmarshalJSON(data []byte) error { + var w listExchangesForListingRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExchangesForListingRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExchangesForListingResponseWire struct { ExchangeListing []exchangeListingWire `json:"exchange_listing,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2192,6 +3896,30 @@ func listExchangesForListingResponseFromWire(w *listExchangesForListingResponseW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExchangesForListingResponse) MarshalJSON() ([]byte, error) { + w, err := listExchangesForListingResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExchangesForListingResponse) UnmarshalJSON(data []byte) error { + var w listExchangesForListingResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExchangesForListingResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExchangesRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -2217,6 +3945,30 @@ func listExchangesRequestFromWire(w *listExchangesRequestWire) (*ListExchangesRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExchangesRequest) MarshalJSON() ([]byte, error) { + w, err := listExchangesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExchangesRequest) UnmarshalJSON(data []byte) error { + var w listExchangesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExchangesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExchangesResponseWire struct { Exchanges []exchangeWire `json:"exchanges,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2250,6 +4002,30 @@ func listExchangesResponseFromWire(w *listExchangesResponseWire) (*ListExchanges }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExchangesResponse) MarshalJSON() ([]byte, error) { + w, err := listExchangesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExchangesResponse) UnmarshalJSON(data []byte) error { + var w listExchangesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExchangesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listFilesRequestWire struct { FileParent *fileParentWire `json:"file_parent,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -2286,6 +4062,30 @@ func listFilesRequestFromWire(w *listFilesRequestWire) (*ListFilesRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListFilesRequest) MarshalJSON() ([]byte, error) { + w, err := listFilesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListFilesRequest) UnmarshalJSON(data []byte) error { + var w listFilesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listFilesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listFilesResponseWire struct { FileInfos []fileInfoWire `json:"file_infos,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2319,6 +4119,30 @@ func listFilesResponseFromWire(w *listFilesResponseWire) (*ListFilesResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListFilesResponse) MarshalJSON() ([]byte, error) { + w, err := listFilesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListFilesResponse) UnmarshalJSON(data []byte) error { + var w listFilesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listFilesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listFulfillmentsResponseWire struct { Fulfillments []listingFulfillmentWire `json:"fulfillments,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2352,6 +4176,30 @@ func listFulfillmentsResponseFromWire(w *listFulfillmentsResponseWire) (*ListFul }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListFulfillmentsResponse) MarshalJSON() ([]byte, error) { + w, err := listFulfillmentsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListFulfillmentsResponse) UnmarshalJSON(data []byte) error { + var w listFulfillmentsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listFulfillmentsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listInstallationsRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -2377,6 +4225,30 @@ func listInstallationsRequestFromWire(w *listInstallationsRequestWire) (*ListIns }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListInstallationsRequest) MarshalJSON() ([]byte, error) { + w, err := listInstallationsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListInstallationsRequest) UnmarshalJSON(data []byte) error { + var w listInstallationsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listInstallationsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listInstallationsResponseWire struct { Installations []installationDetailWire `json:"installations,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2410,6 +4282,30 @@ func listInstallationsResponseFromWire(w *listInstallationsResponseWire) (*ListI }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListInstallationsResponse) MarshalJSON() ([]byte, error) { + w, err := listInstallationsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListInstallationsResponse) UnmarshalJSON(data []byte) error { + var w listInstallationsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listInstallationsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listListingFulfillmentsRequestWire struct { ListingId *string `json:"listing_id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -2438,6 +4334,30 @@ func listListingFulfillmentsRequestFromWire(w *listListingFulfillmentsRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListListingFulfillmentsRequest) MarshalJSON() ([]byte, error) { + w, err := listListingFulfillmentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListListingFulfillmentsRequest) UnmarshalJSON(data []byte) error { + var w listListingFulfillmentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listListingFulfillmentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listListingsForExchangeRequestWire struct { ExchangeId *string `json:"exchange_id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -2466,6 +4386,30 @@ func listListingsForExchangeRequestFromWire(w *listListingsForExchangeRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListListingsForExchangeRequest) MarshalJSON() ([]byte, error) { + w, err := listListingsForExchangeRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListListingsForExchangeRequest) UnmarshalJSON(data []byte) error { + var w listListingsForExchangeRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listListingsForExchangeRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listListingsForExchangeResponseWire struct { ExchangeListings []exchangeListingWire `json:"exchange_listings,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2499,6 +4443,30 @@ func listListingsForExchangeResponseFromWire(w *listListingsForExchangeResponseW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListListingsForExchangeResponse) MarshalJSON() ([]byte, error) { + w, err := listListingsForExchangeResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListListingsForExchangeResponse) UnmarshalJSON(data []byte) error { + var w listListingsForExchangeResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listListingsForExchangeResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listListingsRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -2524,6 +4492,30 @@ func listListingsRequestFromWire(w *listListingsRequestWire) (*ListListingsReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListListingsRequest) MarshalJSON() ([]byte, error) { + w, err := listListingsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListListingsRequest) UnmarshalJSON(data []byte) error { + var w listListingsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listListingsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPersonalizationRequestsForConsumerRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -2549,6 +4541,30 @@ func listPersonalizationRequestsForConsumerRequestFromWire(w *listPersonalizatio }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPersonalizationRequestsForConsumerRequest) MarshalJSON() ([]byte, error) { + w, err := listPersonalizationRequestsForConsumerRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPersonalizationRequestsForConsumerRequest) UnmarshalJSON(data []byte) error { + var w listPersonalizationRequestsForConsumerRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPersonalizationRequestsForConsumerRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listProviderAnalyticsDashboardRequestWire struct { } @@ -2566,6 +4582,30 @@ func listProviderAnalyticsDashboardRequestFromWire(w *listProviderAnalyticsDashb return &ListProviderAnalyticsDashboardRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListProviderAnalyticsDashboardRequest) MarshalJSON() ([]byte, error) { + w, err := listProviderAnalyticsDashboardRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListProviderAnalyticsDashboardRequest) UnmarshalJSON(data []byte) error { + var w listProviderAnalyticsDashboardRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listProviderAnalyticsDashboardRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listProviderAnalyticsDashboardResponseWire struct { Id *string `json:"id,omitempty"` Version *wireInt64 `json:"version,omitempty"` @@ -2602,6 +4642,30 @@ func listProviderAnalyticsDashboardResponseFromWire(w *listProviderAnalyticsDash }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListProviderAnalyticsDashboardResponse) MarshalJSON() ([]byte, error) { + w, err := listProviderAnalyticsDashboardResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListProviderAnalyticsDashboardResponse) UnmarshalJSON(data []byte) error { + var w listProviderAnalyticsDashboardResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listProviderAnalyticsDashboardResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listProvidersRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -2627,6 +4691,30 @@ func listProvidersRequestFromWire(w *listProvidersRequestWire) (*ListProvidersRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListProvidersRequest) MarshalJSON() ([]byte, error) { + w, err := listProvidersRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListProvidersRequest) UnmarshalJSON(data []byte) error { + var w listProvidersRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listProvidersRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listProvidersResponseWire struct { Providers []providerInfoWire `json:"providers,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2660,6 +4748,30 @@ func listProvidersResponseFromWire(w *listProvidersResponseWire) (*ListProviders }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListProvidersResponse) MarshalJSON() ([]byte, error) { + w, err := listProvidersResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListProvidersResponse) UnmarshalJSON(data []byte) error { + var w listProvidersResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listProvidersResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPublishedListingsForConsumerRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -2714,6 +4826,30 @@ func listPublishedListingsForConsumerRequestFromWire(w *listPublishedListingsFor }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPublishedListingsForConsumerRequest) MarshalJSON() ([]byte, error) { + w, err := listPublishedListingsForConsumerRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPublishedListingsForConsumerRequest) UnmarshalJSON(data []byte) error { + var w listPublishedListingsForConsumerRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPublishedListingsForConsumerRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPublishedProvidersForConsumerRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -2742,6 +4878,30 @@ func listPublishedProvidersForConsumerRequestFromWire(w *listPublishedProvidersF }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPublishedProvidersForConsumerRequest) MarshalJSON() ([]byte, error) { + w, err := listPublishedProvidersForConsumerRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPublishedProvidersForConsumerRequest) UnmarshalJSON(data []byte) error { + var w listPublishedProvidersForConsumerRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPublishedProvidersForConsumerRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPublishedProvidersForConsumerResponseWire struct { Providers []providerInfoWire `json:"providers,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2775,6 +4935,30 @@ func listPublishedProvidersForConsumerResponseFromWire(w *listPublishedProviders }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPublishedProvidersForConsumerResponse) MarshalJSON() ([]byte, error) { + w, err := listPublishedProvidersForConsumerResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPublishedProvidersForConsumerResponse) UnmarshalJSON(data []byte) error { + var w listPublishedProvidersForConsumerResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPublishedProvidersForConsumerResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listingWire struct { Id *string `json:"id,omitempty"` Summary *listingSummaryWire `json:"summary,omitempty"` @@ -2819,6 +5003,30 @@ func listingFromWire(w *listingWire) (*Listing, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Listing) MarshalJSON() ([]byte, error) { + w, err := listingToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Listing) UnmarshalJSON(data []byte) error { + var w listingWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listingFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listingDetailWire struct { Description *string `json:"description,omitempty"` TermsOfService *string `json:"terms_of_service,omitempty"` @@ -2943,6 +5151,30 @@ func listingDetailFromWire(w *listingDetailWire) (*ListingDetail, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListingDetail) MarshalJSON() ([]byte, error) { + w, err := listingDetailToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListingDetail) UnmarshalJSON(data []byte) error { + var w listingDetailWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listingDetailFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listingFulfillmentWire struct { ListingId *string `json:"listing_id,omitempty"` FulfillmentType FulfillmentType `json:"fulfillment_type,omitempty"` @@ -2993,6 +5225,30 @@ func listingFulfillmentFromWire(w *listingFulfillmentWire) (*ListingFulfillment, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListingFulfillment) MarshalJSON() ([]byte, error) { + w, err := listingFulfillmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListingFulfillment) UnmarshalJSON(data []byte) error { + var w listingFulfillmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listingFulfillmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listingSettingWire struct { Visibility Visibility `json:"visibility,omitempty"` } @@ -3015,6 +5271,30 @@ func listingSettingFromWire(w *listingSettingWire) (*ListingSetting, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListingSetting) MarshalJSON() ([]byte, error) { + w, err := listingSettingToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListingSetting) UnmarshalJSON(data []byte) error { + var w listingSettingWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listingSettingFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listingSummaryWire struct { Name *string `json:"name,omitempty"` Subtitle *string `json:"subtitle,omitempty"` @@ -3163,6 +5443,30 @@ func listingSummaryFromWire(w *listingSummaryWire) (*ListingSummary, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListingSummary) MarshalJSON() ([]byte, error) { + w, err := listingSummaryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListingSummary) UnmarshalJSON(data []byte) error { + var w listingSummaryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listingSummaryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listingTagWire struct { TagName ListingTagType `json:"tag_name,omitempty"` TagValues []string `json:"tag_values,omitempty"` @@ -3188,6 +5492,30 @@ func listingTagFromWire(w *listingTagWire) (*ListingTag, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListingTag) MarshalJSON() ([]byte, error) { + w, err := listingTagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListingTag) UnmarshalJSON(data []byte) error { + var w listingTagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listingTagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type personalizationRequestWire struct { Id *string `json:"id,omitempty"` ConsumerRegion *regionInfoWire `json:"consumer_region,omitempty"` @@ -3295,6 +5623,30 @@ func personalizationRequestFromWire(w *personalizationRequestWire) (*Personaliza }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PersonalizationRequest) MarshalJSON() ([]byte, error) { + w, err := personalizationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PersonalizationRequest) UnmarshalJSON(data []byte) error { + var w personalizationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := personalizationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type providerInfoWire struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -3356,6 +5708,30 @@ func providerInfoFromWire(w *providerInfoWire) (*ProviderInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProviderInfo) MarshalJSON() ([]byte, error) { + w, err := providerInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProviderInfo) UnmarshalJSON(data []byte) error { + var w providerInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := providerInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type regionInfoWire struct { Cloud *string `json:"cloud,omitempty"` Region *string `json:"region,omitempty"` @@ -3381,6 +5757,30 @@ func regionInfoFromWire(w *regionInfoWire) (*RegionInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RegionInfo) MarshalJSON() ([]byte, error) { + w, err := regionInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RegionInfo) UnmarshalJSON(data []byte) error { + var w regionInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := regionInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type removeExchangeForListingRequestWire struct { Id *string `json:"id,omitempty"` } @@ -3403,6 +5803,30 @@ func removeExchangeForListingRequestFromWire(w *removeExchangeForListingRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RemoveExchangeForListingRequest) MarshalJSON() ([]byte, error) { + w, err := removeExchangeForListingRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RemoveExchangeForListingRequest) UnmarshalJSON(data []byte) error { + var w removeExchangeForListingRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := removeExchangeForListingRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type removeExchangeForListingResponseWire struct { } @@ -3420,6 +5844,30 @@ func removeExchangeForListingResponseFromWire(w *removeExchangeForListingRespons return &RemoveExchangeForListingResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RemoveExchangeForListingResponse) MarshalJSON() ([]byte, error) { + w, err := removeExchangeForListingResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RemoveExchangeForListingResponse) UnmarshalJSON(data []byte) error { + var w removeExchangeForListingResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := removeExchangeForListingResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type repoInfoWire struct { GitRepoUrl *string `json:"git_repo_url,omitempty"` } @@ -3437,9 +5885,33 @@ func repoInfoFromWire(w *repoInfoWire) (*RepoInfo, error) { if w == nil { return nil, nil } - return &RepoInfo{ - GitRepoUrl: w.GitRepoUrl, - }, nil + return &RepoInfo{ + GitRepoUrl: w.GitRepoUrl, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RepoInfo) MarshalJSON() ([]byte, error) { + w, err := repoInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RepoInfo) UnmarshalJSON(data []byte) error { + var w repoInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := repoInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil } type repoInstallationWire struct { @@ -3467,6 +5939,30 @@ func repoInstallationFromWire(w *repoInstallationWire) (*RepoInstallation, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RepoInstallation) MarshalJSON() ([]byte, error) { + w, err := repoInstallationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RepoInstallation) UnmarshalJSON(data []byte) error { + var w repoInstallationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := repoInstallationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchPublishedListingsForConsumerRequestWire struct { Query *string `json:"query,omitempty"` IsFree *bool `json:"is_free,omitempty"` @@ -3510,6 +6006,30 @@ func searchPublishedListingsForConsumerRequestFromWire(w *searchPublishedListing }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchPublishedListingsForConsumerRequest) MarshalJSON() ([]byte, error) { + w, err := searchPublishedListingsForConsumerRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchPublishedListingsForConsumerRequest) UnmarshalJSON(data []byte) error { + var w searchPublishedListingsForConsumerRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchPublishedListingsForConsumerRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchPublishedListingsForConsumerResponseWire struct { Listings []listingWire `json:"listings,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3543,6 +6063,30 @@ func searchPublishedListingsForConsumerResponseFromWire(w *searchPublishedListin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchPublishedListingsForConsumerResponse) MarshalJSON() ([]byte, error) { + w, err := searchPublishedListingsForConsumerResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchPublishedListingsForConsumerResponse) UnmarshalJSON(data []byte) error { + var w searchPublishedListingsForConsumerResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchPublishedListingsForConsumerResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type shareInfoWire struct { Name *string `json:"name,omitempty"` Type ListingShareType `json:"type,omitempty"` @@ -3568,6 +6112,30 @@ func shareInfoFromWire(w *shareInfoWire) (*ShareInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ShareInfo) MarshalJSON() ([]byte, error) { + w, err := shareInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ShareInfo) UnmarshalJSON(data []byte) error { + var w shareInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := shareInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sharedDataObjectWire struct { Name *string `json:"name,omitempty"` DataObjectType *string `json:"data_object_type,omitempty"` @@ -3593,6 +6161,30 @@ func sharedDataObjectFromWire(w *sharedDataObjectWire) (*SharedDataObject, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SharedDataObject) MarshalJSON() ([]byte, error) { + w, err := sharedDataObjectToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SharedDataObject) UnmarshalJSON(data []byte) error { + var w sharedDataObjectWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sharedDataObjectFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tokenDetailWire struct { ShareCredentialsVersion *int `json:"shareCredentialsVersion,omitempty"` BearerToken *string `json:"bearerToken,omitempty"` @@ -3624,6 +6216,30 @@ func tokenDetailFromWire(w *tokenDetailWire) (*TokenDetail, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TokenDetail) MarshalJSON() ([]byte, error) { + w, err := tokenDetailToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TokenDetail) UnmarshalJSON(data []byte) error { + var w tokenDetailWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tokenDetailFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tokenInfoWire struct { Id *string `json:"id,omitempty"` CreatedAt *wireInt64 `json:"created_at,omitempty"` @@ -3688,6 +6304,30 @@ func tokenInfoFromWire(w *tokenInfoWire) (*TokenInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TokenInfo) MarshalJSON() ([]byte, error) { + w, err := tokenInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TokenInfo) UnmarshalJSON(data []byte) error { + var w tokenInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tokenInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateExchangeFilterRequestWire struct { Id *string `json:"id,omitempty"` Filter *exchangeFilterWire `json:"filter,omitempty"` @@ -3721,6 +6361,30 @@ func updateExchangeFilterRequestFromWire(w *updateExchangeFilterRequestWire) (*U }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateExchangeFilterRequest) MarshalJSON() ([]byte, error) { + w, err := updateExchangeFilterRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateExchangeFilterRequest) UnmarshalJSON(data []byte) error { + var w updateExchangeFilterRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateExchangeFilterRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateExchangeFilterResponseWire struct { Filter *exchangeFilterWire `json:"filter,omitempty"` } @@ -3751,6 +6415,30 @@ func updateExchangeFilterResponseFromWire(w *updateExchangeFilterResponseWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateExchangeFilterResponse) MarshalJSON() ([]byte, error) { + w, err := updateExchangeFilterResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateExchangeFilterResponse) UnmarshalJSON(data []byte) error { + var w updateExchangeFilterResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateExchangeFilterResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateExchangeRequestWire struct { Id *string `json:"id,omitempty"` Exchange *exchangeWire `json:"exchange,omitempty"` @@ -3784,6 +6472,30 @@ func updateExchangeRequestFromWire(w *updateExchangeRequestWire) (*UpdateExchang }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateExchangeRequest) MarshalJSON() ([]byte, error) { + w, err := updateExchangeRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateExchangeRequest) UnmarshalJSON(data []byte) error { + var w updateExchangeRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateExchangeRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateExchangeResponseWire struct { Exchange *exchangeWire `json:"exchange,omitempty"` } @@ -3814,6 +6526,30 @@ func updateExchangeResponseFromWire(w *updateExchangeResponseWire) (*UpdateExcha }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateExchangeResponse) MarshalJSON() ([]byte, error) { + w, err := updateExchangeResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateExchangeResponse) UnmarshalJSON(data []byte) error { + var w updateExchangeResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateExchangeResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateInstallationRequestWire struct { ListingId *string `json:"listing_id,omitempty"` InstallationId *string `json:"installation_id,omitempty"` @@ -3853,6 +6589,30 @@ func updateInstallationRequestFromWire(w *updateInstallationRequestWire) (*Updat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateInstallationRequest) MarshalJSON() ([]byte, error) { + w, err := updateInstallationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateInstallationRequest) UnmarshalJSON(data []byte) error { + var w updateInstallationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateInstallationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateInstallationResponseWire struct { Installation *installationDetailWire `json:"installation,omitempty"` } @@ -3883,6 +6643,30 @@ func updateInstallationResponseFromWire(w *updateInstallationResponseWire) (*Upd }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateInstallationResponse) MarshalJSON() ([]byte, error) { + w, err := updateInstallationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateInstallationResponse) UnmarshalJSON(data []byte) error { + var w updateInstallationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateInstallationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateListingRequestWire struct { Id *string `json:"id,omitempty"` Listing *listingWire `json:"listing,omitempty"` @@ -3916,6 +6700,30 @@ func updateListingRequestFromWire(w *updateListingRequestWire) (*UpdateListingRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateListingRequest) MarshalJSON() ([]byte, error) { + w, err := updateListingRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateListingRequest) UnmarshalJSON(data []byte) error { + var w updateListingRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateListingRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateListingResponseWire struct { Listing *listingWire `json:"listing,omitempty"` } @@ -3946,6 +6754,30 @@ func updateListingResponseFromWire(w *updateListingResponseWire) (*UpdateListing }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateListingResponse) MarshalJSON() ([]byte, error) { + w, err := updateListingResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateListingResponse) UnmarshalJSON(data []byte) error { + var w updateListingResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateListingResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updatePersonalizationRequestStatusRequestWire struct { ListingId *string `json:"listing_id,omitempty"` RequestId *string `json:"request_id,omitempty"` @@ -3988,6 +6820,30 @@ func updatePersonalizationRequestStatusRequestFromWire(w *updatePersonalizationR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdatePersonalizationRequestStatusRequest) MarshalJSON() ([]byte, error) { + w, err := updatePersonalizationRequestStatusRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdatePersonalizationRequestStatusRequest) UnmarshalJSON(data []byte) error { + var w updatePersonalizationRequestStatusRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updatePersonalizationRequestStatusRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updatePersonalizationRequestStatusResponseWire struct { Request *personalizationRequestWire `json:"request,omitempty"` } @@ -4018,6 +6874,30 @@ func updatePersonalizationRequestStatusResponseFromWire(w *updatePersonalization }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdatePersonalizationRequestStatusResponse) MarshalJSON() ([]byte, error) { + w, err := updatePersonalizationRequestStatusResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdatePersonalizationRequestStatusResponse) UnmarshalJSON(data []byte) error { + var w updatePersonalizationRequestStatusResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updatePersonalizationRequestStatusResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateProviderAnalyticsDashboardRequestWire struct { Id *string `json:"id,omitempty"` Version *wireInt64 `json:"version,omitempty"` @@ -4051,6 +6931,30 @@ func updateProviderAnalyticsDashboardRequestFromWire(w *updateProviderAnalyticsD }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateProviderAnalyticsDashboardRequest) MarshalJSON() ([]byte, error) { + w, err := updateProviderAnalyticsDashboardRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateProviderAnalyticsDashboardRequest) UnmarshalJSON(data []byte) error { + var w updateProviderAnalyticsDashboardRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateProviderAnalyticsDashboardRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateProviderAnalyticsDashboardResponseWire struct { Id *string `json:"id,omitempty"` Version *wireInt64 `json:"version,omitempty"` @@ -4087,6 +6991,30 @@ func updateProviderAnalyticsDashboardResponseFromWire(w *updateProviderAnalytics }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateProviderAnalyticsDashboardResponse) MarshalJSON() ([]byte, error) { + w, err := updateProviderAnalyticsDashboardResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateProviderAnalyticsDashboardResponse) UnmarshalJSON(data []byte) error { + var w updateProviderAnalyticsDashboardResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateProviderAnalyticsDashboardResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateProviderRequestWire struct { Id *string `json:"id,omitempty"` Provider *providerInfoWire `json:"provider,omitempty"` @@ -4120,6 +7048,30 @@ func updateProviderRequestFromWire(w *updateProviderRequestWire) (*UpdateProvide }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateProviderRequest) MarshalJSON() ([]byte, error) { + w, err := updateProviderRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateProviderRequest) UnmarshalJSON(data []byte) error { + var w updateProviderRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateProviderRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateProviderResponseWire struct { Provider *providerInfoWire `json:"provider,omitempty"` } @@ -4150,6 +7102,30 @@ func updateProviderResponseFromWire(w *updateProviderResponseWire) (*UpdateProvi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateProviderResponse) MarshalJSON() ([]byte, error) { + w, err := updateProviderResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateProviderResponse) UnmarshalJSON(data []byte) error { + var w updateProviderResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateProviderResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/modelregistry/CHANGELOG.md b/modelregistry/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/modelregistry/CHANGELOG.md +++ b/modelregistry/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/modelregistry/internal/version.go b/modelregistry/internal/version.go index 34d66fd3..a2594dcc 100644 --- a/modelregistry/internal/version.go +++ b/modelregistry/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-modelregistry" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/modelregistry/v1/wire.go b/modelregistry/v1/wire.go index 558b2fde..4f5d514b 100644 --- a/modelregistry/v1/wire.go +++ b/modelregistry/v1/wire.go @@ -117,6 +117,30 @@ func activityFromWire(w *activityWire) (*Activity, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Activity) MarshalJSON() ([]byte, error) { + w, err := activityToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Activity) UnmarshalJSON(data []byte) error { + var w activityWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := activityFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type approveTransitionRequestWire struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -151,6 +175,30 @@ func approveTransitionRequestFromWire(w *approveTransitionRequestWire) (*Approve }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApproveTransitionRequest) MarshalJSON() ([]byte, error) { + w, err := approveTransitionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApproveTransitionRequest) UnmarshalJSON(data []byte) error { + var w approveTransitionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := approveTransitionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type approveTransitionResponseWire struct { Activity *activityWire `json:"activity,omitempty"` } @@ -181,6 +229,30 @@ func approveTransitionResponseFromWire(w *approveTransitionResponseWire) (*Appro }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApproveTransitionResponse) MarshalJSON() ([]byte, error) { + w, err := approveTransitionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApproveTransitionResponse) UnmarshalJSON(data []byte) error { + var w approveTransitionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := approveTransitionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type commentObjectWire struct { CreationTimestamp *wireInt64 `json:"creation_timestamp,omitempty"` UserId *string `json:"user_id,omitempty"` @@ -246,6 +318,30 @@ func commentObjectFromWire(w *commentObjectWire) (*CommentObject, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CommentObject) MarshalJSON() ([]byte, error) { + w, err := commentObjectToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CommentObject) UnmarshalJSON(data []byte) error { + var w commentObjectWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := commentObjectFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCommentRequestWire struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -274,6 +370,30 @@ func createCommentRequestFromWire(w *createCommentRequestWire) (*CreateCommentRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCommentRequest) MarshalJSON() ([]byte, error) { + w, err := createCommentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCommentRequest) UnmarshalJSON(data []byte) error { + var w createCommentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCommentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCommentResponseWire struct { Comment *commentObjectWire `json:"comment,omitempty"` } @@ -304,6 +424,30 @@ func createCommentResponseFromWire(w *createCommentResponseWire) (*CreateComment }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCommentResponse) MarshalJSON() ([]byte, error) { + w, err := createCommentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCommentResponse) UnmarshalJSON(data []byte) error { + var w createCommentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCommentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createModelVersionRequestWire struct { Name *string `json:"name,omitempty"` Source *string `json:"source,omitempty"` @@ -349,6 +493,30 @@ func createModelVersionRequestFromWire(w *createModelVersionRequestWire) (*Creat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateModelVersionRequest) MarshalJSON() ([]byte, error) { + w, err := createModelVersionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateModelVersionRequest) UnmarshalJSON(data []byte) error { + var w createModelVersionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createModelVersionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createModelVersionResponseWire struct { ModelVersion *modelVersionWire `json:"model_version,omitempty"` } @@ -379,6 +547,30 @@ func createModelVersionResponseFromWire(w *createModelVersionResponseWire) (*Cre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateModelVersionResponse) MarshalJSON() ([]byte, error) { + w, err := createModelVersionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateModelVersionResponse) UnmarshalJSON(data []byte) error { + var w createModelVersionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createModelVersionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createRegisteredModelRequestWire struct { Name *string `json:"name,omitempty"` Tags []registeredModelTagWire `json:"tags,omitempty"` @@ -415,6 +607,30 @@ func createRegisteredModelRequestFromWire(w *createRegisteredModelRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateRegisteredModelRequest) MarshalJSON() ([]byte, error) { + w, err := createRegisteredModelRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateRegisteredModelRequest) UnmarshalJSON(data []byte) error { + var w createRegisteredModelRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createRegisteredModelRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createRegisteredModelResponseWire struct { RegisteredModel *registeredModelWire `json:"registered_model,omitempty"` } @@ -445,6 +661,30 @@ func createRegisteredModelResponseFromWire(w *createRegisteredModelResponseWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateRegisteredModelResponse) MarshalJSON() ([]byte, error) { + w, err := createRegisteredModelResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateRegisteredModelResponse) UnmarshalJSON(data []byte) error { + var w createRegisteredModelResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createRegisteredModelResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createRegistryWebhookRequestWire struct { ModelName *string `json:"model_name,omitempty"` Events []RegistryWebhookEvent `json:"events,omitempty"` @@ -498,6 +738,30 @@ func createRegistryWebhookRequestFromWire(w *createRegistryWebhookRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateRegistryWebhookRequest) MarshalJSON() ([]byte, error) { + w, err := createRegistryWebhookRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateRegistryWebhookRequest) UnmarshalJSON(data []byte) error { + var w createRegistryWebhookRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createRegistryWebhookRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createRegistryWebhookResponseWire struct { Webhook *registryWebhookWire `json:"webhook,omitempty"` } @@ -528,6 +792,30 @@ func createRegistryWebhookResponseFromWire(w *createRegistryWebhookResponseWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateRegistryWebhookResponse) MarshalJSON() ([]byte, error) { + w, err := createRegistryWebhookResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateRegistryWebhookResponse) UnmarshalJSON(data []byte) error { + var w createRegistryWebhookResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createRegistryWebhookResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createTransitionRequestWire struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -559,6 +847,30 @@ func createTransitionRequestFromWire(w *createTransitionRequestWire) (*CreateTra }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateTransitionRequest) MarshalJSON() ([]byte, error) { + w, err := createTransitionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateTransitionRequest) UnmarshalJSON(data []byte) error { + var w createTransitionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createTransitionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createTransitionResponseWire struct { Request *transitionRequestWire `json:"request,omitempty"` } @@ -589,6 +901,30 @@ func createTransitionResponseFromWire(w *createTransitionResponseWire) (*CreateT }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateTransitionResponse) MarshalJSON() ([]byte, error) { + w, err := createTransitionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateTransitionResponse) UnmarshalJSON(data []byte) error { + var w createTransitionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createTransitionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCommentRequestWire struct { Id *string `json:"id,omitempty"` } @@ -611,6 +947,30 @@ func deleteCommentRequestFromWire(w *deleteCommentRequestWire) (*DeleteCommentRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCommentRequest) MarshalJSON() ([]byte, error) { + w, err := deleteCommentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCommentRequest) UnmarshalJSON(data []byte) error { + var w deleteCommentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCommentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCommentResponseWire struct { } @@ -628,6 +988,30 @@ func deleteCommentResponseFromWire(w *deleteCommentResponseWire) (*DeleteComment return &DeleteCommentResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCommentResponse) MarshalJSON() ([]byte, error) { + w, err := deleteCommentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCommentResponse) UnmarshalJSON(data []byte) error { + var w deleteCommentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCommentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteModelVersionRequestWire struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -653,6 +1037,30 @@ func deleteModelVersionRequestFromWire(w *deleteModelVersionRequestWire) (*Delet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteModelVersionRequest) MarshalJSON() ([]byte, error) { + w, err := deleteModelVersionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteModelVersionRequest) UnmarshalJSON(data []byte) error { + var w deleteModelVersionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteModelVersionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteModelVersionResponseWire struct { } @@ -670,6 +1078,30 @@ func deleteModelVersionResponseFromWire(w *deleteModelVersionResponseWire) (*Del return &DeleteModelVersionResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteModelVersionResponse) MarshalJSON() ([]byte, error) { + w, err := deleteModelVersionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteModelVersionResponse) UnmarshalJSON(data []byte) error { + var w deleteModelVersionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteModelVersionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteModelVersionTagRequestWire struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -698,6 +1130,30 @@ func deleteModelVersionTagRequestFromWire(w *deleteModelVersionTagRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteModelVersionTagRequest) MarshalJSON() ([]byte, error) { + w, err := deleteModelVersionTagRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteModelVersionTagRequest) UnmarshalJSON(data []byte) error { + var w deleteModelVersionTagRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteModelVersionTagRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteModelVersionTagResponseWire struct { } @@ -715,6 +1171,30 @@ func deleteModelVersionTagResponseFromWire(w *deleteModelVersionTagResponseWire) return &DeleteModelVersionTagResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteModelVersionTagResponse) MarshalJSON() ([]byte, error) { + w, err := deleteModelVersionTagResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteModelVersionTagResponse) UnmarshalJSON(data []byte) error { + var w deleteModelVersionTagResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteModelVersionTagResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRegisteredModelRequestWire struct { Name *string `json:"name,omitempty"` } @@ -737,6 +1217,30 @@ func deleteRegisteredModelRequestFromWire(w *deleteRegisteredModelRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRegisteredModelRequest) MarshalJSON() ([]byte, error) { + w, err := deleteRegisteredModelRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRegisteredModelRequest) UnmarshalJSON(data []byte) error { + var w deleteRegisteredModelRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRegisteredModelRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRegisteredModelResponseWire struct { } @@ -754,6 +1258,30 @@ func deleteRegisteredModelResponseFromWire(w *deleteRegisteredModelResponseWire) return &DeleteRegisteredModelResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRegisteredModelResponse) MarshalJSON() ([]byte, error) { + w, err := deleteRegisteredModelResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRegisteredModelResponse) UnmarshalJSON(data []byte) error { + var w deleteRegisteredModelResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRegisteredModelResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRegisteredModelTagRequestWire struct { Name *string `json:"name,omitempty"` Key *string `json:"key,omitempty"` @@ -779,6 +1307,30 @@ func deleteRegisteredModelTagRequestFromWire(w *deleteRegisteredModelTagRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRegisteredModelTagRequest) MarshalJSON() ([]byte, error) { + w, err := deleteRegisteredModelTagRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRegisteredModelTagRequest) UnmarshalJSON(data []byte) error { + var w deleteRegisteredModelTagRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRegisteredModelTagRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRegisteredModelTagResponseWire struct { } @@ -796,6 +1348,30 @@ func deleteRegisteredModelTagResponseFromWire(w *deleteRegisteredModelTagRespons return &DeleteRegisteredModelTagResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRegisteredModelTagResponse) MarshalJSON() ([]byte, error) { + w, err := deleteRegisteredModelTagResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRegisteredModelTagResponse) UnmarshalJSON(data []byte) error { + var w deleteRegisteredModelTagResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRegisteredModelTagResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRegistryWebhookRequestWire struct { Id *string `json:"id,omitempty"` } @@ -818,6 +1394,30 @@ func deleteRegistryWebhookRequestFromWire(w *deleteRegistryWebhookRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRegistryWebhookRequest) MarshalJSON() ([]byte, error) { + w, err := deleteRegistryWebhookRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRegistryWebhookRequest) UnmarshalJSON(data []byte) error { + var w deleteRegistryWebhookRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRegistryWebhookRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRegistryWebhookResponseWire struct { } @@ -835,6 +1435,30 @@ func deleteRegistryWebhookResponseFromWire(w *deleteRegistryWebhookResponseWire) return &DeleteRegistryWebhookResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRegistryWebhookResponse) MarshalJSON() ([]byte, error) { + w, err := deleteRegistryWebhookResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRegistryWebhookResponse) UnmarshalJSON(data []byte) error { + var w deleteRegistryWebhookResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRegistryWebhookResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteTransitionRequestWire struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -869,6 +1493,30 @@ func deleteTransitionRequestFromWire(w *deleteTransitionRequestWire) (*DeleteTra }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteTransitionRequest) MarshalJSON() ([]byte, error) { + w, err := deleteTransitionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteTransitionRequest) UnmarshalJSON(data []byte) error { + var w deleteTransitionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteTransitionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteTransitionResponseWire struct { Activity *activityWire `json:"activity,omitempty"` } @@ -899,6 +1547,30 @@ func deleteTransitionResponseFromWire(w *deleteTransitionResponseWire) (*DeleteT }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteTransitionResponse) MarshalJSON() ([]byte, error) { + w, err := deleteTransitionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteTransitionResponse) UnmarshalJSON(data []byte) error { + var w deleteTransitionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteTransitionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type featureListWire struct { Features []linkedFeatureWire `json:"features,omitempty"` } @@ -929,6 +1601,30 @@ func featureListFromWire(w *featureListWire) (*FeatureList, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FeatureList) MarshalJSON() ([]byte, error) { + w, err := featureListToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FeatureList) UnmarshalJSON(data []byte) error { + var w featureListWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := featureListFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getLatestVersionsResponseWire struct { ModelVersions []modelVersionWire `json:"model_versions,omitempty"` } @@ -959,6 +1655,30 @@ func getLatestVersionsResponseFromWire(w *getLatestVersionsResponseWire) (*GetLa }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetLatestVersionsResponse) MarshalJSON() ([]byte, error) { + w, err := getLatestVersionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetLatestVersionsResponse) UnmarshalJSON(data []byte) error { + var w getLatestVersionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getLatestVersionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getModelVersionDownloadUriRequestWire struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -984,6 +1704,30 @@ func getModelVersionDownloadUriRequestFromWire(w *getModelVersionDownloadUriRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetModelVersionDownloadUriRequest) MarshalJSON() ([]byte, error) { + w, err := getModelVersionDownloadUriRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetModelVersionDownloadUriRequest) UnmarshalJSON(data []byte) error { + var w getModelVersionDownloadUriRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getModelVersionDownloadUriRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getModelVersionDownloadUriResponseWire struct { ArtifactUri *string `json:"artifact_uri,omitempty"` } @@ -1006,6 +1750,30 @@ func getModelVersionDownloadUriResponseFromWire(w *getModelVersionDownloadUriRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetModelVersionDownloadUriResponse) MarshalJSON() ([]byte, error) { + w, err := getModelVersionDownloadUriResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetModelVersionDownloadUriResponse) UnmarshalJSON(data []byte) error { + var w getModelVersionDownloadUriResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getModelVersionDownloadUriResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getModelVersionRequestWire struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -1031,6 +1799,30 @@ func getModelVersionRequestFromWire(w *getModelVersionRequestWire) (*GetModelVer }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetModelVersionRequest) MarshalJSON() ([]byte, error) { + w, err := getModelVersionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetModelVersionRequest) UnmarshalJSON(data []byte) error { + var w getModelVersionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getModelVersionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getModelVersionResponseWire struct { ModelVersion *modelVersionWire `json:"model_version,omitempty"` } @@ -1061,6 +1853,30 @@ func getModelVersionResponseFromWire(w *getModelVersionResponseWire) (*GetModelV }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetModelVersionResponse) MarshalJSON() ([]byte, error) { + w, err := getModelVersionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetModelVersionResponse) UnmarshalJSON(data []byte) error { + var w getModelVersionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getModelVersionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRegisteredModelDatabricksRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1083,6 +1899,30 @@ func getRegisteredModelDatabricksRequestFromWire(w *getRegisteredModelDatabricks }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRegisteredModelDatabricksRequest) MarshalJSON() ([]byte, error) { + w, err := getRegisteredModelDatabricksRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRegisteredModelDatabricksRequest) UnmarshalJSON(data []byte) error { + var w getRegisteredModelDatabricksRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRegisteredModelDatabricksRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRegisteredModelDatabricksResponseWire struct { RegisteredModelDatabricks *registeredModelDatabricksWire `json:"registered_model_databricks,omitempty"` } @@ -1113,6 +1953,30 @@ func getRegisteredModelDatabricksResponseFromWire(w *getRegisteredModelDatabrick }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRegisteredModelDatabricksResponse) MarshalJSON() ([]byte, error) { + w, err := getRegisteredModelDatabricksResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRegisteredModelDatabricksResponse) UnmarshalJSON(data []byte) error { + var w getRegisteredModelDatabricksResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRegisteredModelDatabricksResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type httpUrlSpecWire struct { Url *string `json:"url,omitempty"` EnableSslVerification *bool `json:"enable_ssl_verification,omitempty"` @@ -1144,6 +2008,30 @@ func httpUrlSpecFromWire(w *httpUrlSpecWire) (*HttpUrlSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v HttpUrlSpec) MarshalJSON() ([]byte, error) { + w, err := httpUrlSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *HttpUrlSpec) UnmarshalJSON(data []byte) error { + var w httpUrlSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := httpUrlSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jobSpecWire struct { JobId *string `json:"job_id,omitempty"` WorkspaceUrl *string `json:"workspace_url,omitempty"` @@ -1172,6 +2060,30 @@ func jobSpecFromWire(w *jobSpecWire) (*JobSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JobSpec) MarshalJSON() ([]byte, error) { + w, err := jobSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JobSpec) UnmarshalJSON(data []byte) error { + var w jobSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jobSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type linkedFeatureWire struct { FeatureTableName *string `json:"feature_table_name,omitempty"` FeatureName *string `json:"feature_name,omitempty"` @@ -1200,6 +2112,30 @@ func linkedFeatureFromWire(w *linkedFeatureWire) (*LinkedFeature, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LinkedFeature) MarshalJSON() ([]byte, error) { + w, err := linkedFeatureToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LinkedFeature) UnmarshalJSON(data []byte) error { + var w linkedFeatureWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := linkedFeatureFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listLatestVersionsRequestWire struct { Name *string `json:"name,omitempty"` Stages []string `json:"stages,omitempty"` @@ -1225,6 +2161,30 @@ func listLatestVersionsRequestFromWire(w *listLatestVersionsRequestWire) (*ListL }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListLatestVersionsRequest) MarshalJSON() ([]byte, error) { + w, err := listLatestVersionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListLatestVersionsRequest) UnmarshalJSON(data []byte) error { + var w listLatestVersionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listLatestVersionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRegisteredModelsRequestWire struct { MaxResults *wireInt64 `json:"max_results,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -1258,6 +2218,30 @@ func listRegisteredModelsRequestFromWire(w *listRegisteredModelsRequestWire) (*L }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRegisteredModelsRequest) MarshalJSON() ([]byte, error) { + w, err := listRegisteredModelsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRegisteredModelsRequest) UnmarshalJSON(data []byte) error { + var w listRegisteredModelsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRegisteredModelsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRegisteredModelsResponseWire struct { RegisteredModels []registeredModelWire `json:"registered_models,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1291,6 +2275,30 @@ func listRegisteredModelsResponseFromWire(w *listRegisteredModelsResponseWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRegisteredModelsResponse) MarshalJSON() ([]byte, error) { + w, err := listRegisteredModelsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRegisteredModelsResponse) UnmarshalJSON(data []byte) error { + var w listRegisteredModelsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRegisteredModelsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRegistryWebhooksRequestWire struct { ModelName *string `json:"model_name,omitempty"` Events []RegistryWebhookEvent `json:"events,omitempty"` @@ -1330,6 +2338,30 @@ func listRegistryWebhooksRequestFromWire(w *listRegistryWebhooksRequestWire) (*L }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRegistryWebhooksRequest) MarshalJSON() ([]byte, error) { + w, err := listRegistryWebhooksRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRegistryWebhooksRequest) UnmarshalJSON(data []byte) error { + var w listRegistryWebhooksRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRegistryWebhooksRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRegistryWebhooksResponseWire struct { Webhooks []registryWebhookWire `json:"webhooks,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1363,6 +2395,30 @@ func listRegistryWebhooksResponseFromWire(w *listRegistryWebhooksResponseWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRegistryWebhooksResponse) MarshalJSON() ([]byte, error) { + w, err := listRegistryWebhooksResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRegistryWebhooksResponse) UnmarshalJSON(data []byte) error { + var w listRegistryWebhooksResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRegistryWebhooksResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listTransitionRequestWire struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -1388,6 +2444,30 @@ func listTransitionRequestFromWire(w *listTransitionRequestWire) (*ListTransitio }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListTransitionRequest) MarshalJSON() ([]byte, error) { + w, err := listTransitionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListTransitionRequest) UnmarshalJSON(data []byte) error { + var w listTransitionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listTransitionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listTransitionResponseWire struct { Requests []activityWire `json:"requests,omitempty"` } @@ -1418,6 +2498,30 @@ func listTransitionResponseFromWire(w *listTransitionResponseWire) (*ListTransit }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListTransitionResponse) MarshalJSON() ([]byte, error) { + w, err := listTransitionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListTransitionResponse) UnmarshalJSON(data []byte) error { + var w listTransitionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listTransitionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelVersionWire struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -1500,6 +2604,30 @@ func modelVersionFromWire(w *modelVersionWire) (*ModelVersion, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelVersion) MarshalJSON() ([]byte, error) { + w, err := modelVersionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelVersion) UnmarshalJSON(data []byte) error { + var w modelVersionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelVersionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelVersionDatabricksWire struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -1610,6 +2738,30 @@ func modelVersionDatabricksFromWire(w *modelVersionDatabricksWire) (*ModelVersio }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelVersionDatabricks) MarshalJSON() ([]byte, error) { + w, err := modelVersionDatabricksToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelVersionDatabricks) UnmarshalJSON(data []byte) error { + var w modelVersionDatabricksWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelVersionDatabricksFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelVersionTagWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -1635,6 +2787,30 @@ func modelVersionTagFromWire(w *modelVersionTagWire) (*ModelVersionTag, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelVersionTag) MarshalJSON() ([]byte, error) { + w, err := modelVersionTagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelVersionTag) UnmarshalJSON(data []byte) error { + var w modelVersionTagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelVersionTagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type registeredModelWire struct { Name *string `json:"name,omitempty"` CreationTimestamp *wireInt64 `json:"creation_timestamp,omitempty"` @@ -1707,6 +2883,30 @@ func registeredModelFromWire(w *registeredModelWire) (*RegisteredModel, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RegisteredModel) MarshalJSON() ([]byte, error) { + w, err := registeredModelToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RegisteredModel) UnmarshalJSON(data []byte) error { + var w registeredModelWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := registeredModelFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type registeredModelDatabricksWire struct { Name *string `json:"name,omitempty"` CreationTimestamp *wireInt64 `json:"creation_timestamp,omitempty"` @@ -1785,6 +2985,30 @@ func registeredModelDatabricksFromWire(w *registeredModelDatabricksWire) (*Regis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RegisteredModelDatabricks) MarshalJSON() ([]byte, error) { + w, err := registeredModelDatabricksToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RegisteredModelDatabricks) UnmarshalJSON(data []byte) error { + var w registeredModelDatabricksWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := registeredModelDatabricksFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type registeredModelTagWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -1810,6 +3034,30 @@ func registeredModelTagFromWire(w *registeredModelTagWire) (*RegisteredModelTag, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RegisteredModelTag) MarshalJSON() ([]byte, error) { + w, err := registeredModelTagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RegisteredModelTag) UnmarshalJSON(data []byte) error { + var w registeredModelTagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := registeredModelTagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type registryWebhookWire struct { Id *string `json:"id,omitempty"` Events []RegistryWebhookEvent `json:"events,omitempty"` @@ -1888,6 +3136,30 @@ func registryWebhookFromWire(w *registryWebhookWire) (*RegistryWebhook, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RegistryWebhook) MarshalJSON() ([]byte, error) { + w, err := registryWebhookToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RegistryWebhook) UnmarshalJSON(data []byte) error { + var w registryWebhookWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := registryWebhookFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rejectTransitionRequestWire struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -1919,6 +3191,30 @@ func rejectTransitionRequestFromWire(w *rejectTransitionRequestWire) (*RejectTra }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RejectTransitionRequest) MarshalJSON() ([]byte, error) { + w, err := rejectTransitionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RejectTransitionRequest) UnmarshalJSON(data []byte) error { + var w rejectTransitionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rejectTransitionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rejectTransitionResponseWire struct { Activity *activityWire `json:"activity,omitempty"` } @@ -1949,6 +3245,30 @@ func rejectTransitionResponseFromWire(w *rejectTransitionResponseWire) (*RejectT }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RejectTransitionResponse) MarshalJSON() ([]byte, error) { + w, err := rejectTransitionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RejectTransitionResponse) UnmarshalJSON(data []byte) error { + var w rejectTransitionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rejectTransitionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type renameRegisteredModelRequestWire struct { Name *string `json:"name,omitempty"` NewName *string `json:"new_name,omitempty"` @@ -1974,6 +3294,30 @@ func renameRegisteredModelRequestFromWire(w *renameRegisteredModelRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RenameRegisteredModelRequest) MarshalJSON() ([]byte, error) { + w, err := renameRegisteredModelRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RenameRegisteredModelRequest) UnmarshalJSON(data []byte) error { + var w renameRegisteredModelRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := renameRegisteredModelRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type renameRegisteredModelResponseWire struct { RegisteredModel *registeredModelWire `json:"registered_model,omitempty"` } @@ -1999,9 +3343,33 @@ func renameRegisteredModelResponseFromWire(w *renameRegisteredModelResponseWire) if err != nil { return nil, fmt.Errorf("%s: %w", "RenameRegisteredModelResponse.RegisteredModel", err) } - return &RenameRegisteredModelResponse{ - RegisteredModel: registeredModelPublicValue, - }, nil + return &RenameRegisteredModelResponse{ + RegisteredModel: registeredModelPublicValue, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RenameRegisteredModelResponse) MarshalJSON() ([]byte, error) { + w, err := renameRegisteredModelResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RenameRegisteredModelResponse) UnmarshalJSON(data []byte) error { + var w renameRegisteredModelResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := renameRegisteredModelResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil } type searchModelVersionsRequestWire struct { @@ -2043,6 +3411,30 @@ func searchModelVersionsRequestFromWire(w *searchModelVersionsRequestWire) (*Sea }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchModelVersionsRequest) MarshalJSON() ([]byte, error) { + w, err := searchModelVersionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchModelVersionsRequest) UnmarshalJSON(data []byte) error { + var w searchModelVersionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchModelVersionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchModelVersionsResponseWire struct { ModelVersions []modelVersionWire `json:"model_versions,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2076,6 +3468,30 @@ func searchModelVersionsResponseFromWire(w *searchModelVersionsResponseWire) (*S }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchModelVersionsResponse) MarshalJSON() ([]byte, error) { + w, err := searchModelVersionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchModelVersionsResponse) UnmarshalJSON(data []byte) error { + var w searchModelVersionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchModelVersionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchRegisteredModelsRequestWire struct { Filter *string `json:"filter,omitempty"` MaxResults *wireInt64 `json:"max_results,omitempty"` @@ -2115,6 +3531,30 @@ func searchRegisteredModelsRequestFromWire(w *searchRegisteredModelsRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchRegisteredModelsRequest) MarshalJSON() ([]byte, error) { + w, err := searchRegisteredModelsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchRegisteredModelsRequest) UnmarshalJSON(data []byte) error { + var w searchRegisteredModelsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchRegisteredModelsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type searchRegisteredModelsResponseWire struct { RegisteredModels []registeredModelWire `json:"registered_models,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2148,6 +3588,30 @@ func searchRegisteredModelsResponseFromWire(w *searchRegisteredModelsResponseWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SearchRegisteredModelsResponse) MarshalJSON() ([]byte, error) { + w, err := searchRegisteredModelsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SearchRegisteredModelsResponse) UnmarshalJSON(data []byte) error { + var w searchRegisteredModelsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := searchRegisteredModelsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type setModelVersionTagRequestWire struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -2179,6 +3643,30 @@ func setModelVersionTagRequestFromWire(w *setModelVersionTagRequestWire) (*SetMo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SetModelVersionTagRequest) MarshalJSON() ([]byte, error) { + w, err := setModelVersionTagRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SetModelVersionTagRequest) UnmarshalJSON(data []byte) error { + var w setModelVersionTagRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := setModelVersionTagRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type setModelVersionTagResponseWire struct { } @@ -2196,6 +3684,30 @@ func setModelVersionTagResponseFromWire(w *setModelVersionTagResponseWire) (*Set return &SetModelVersionTagResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SetModelVersionTagResponse) MarshalJSON() ([]byte, error) { + w, err := setModelVersionTagResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SetModelVersionTagResponse) UnmarshalJSON(data []byte) error { + var w setModelVersionTagResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := setModelVersionTagResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type setRegisteredModelTagRequestWire struct { Name *string `json:"name,omitempty"` Key *string `json:"key,omitempty"` @@ -2224,6 +3736,30 @@ func setRegisteredModelTagRequestFromWire(w *setRegisteredModelTagRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SetRegisteredModelTagRequest) MarshalJSON() ([]byte, error) { + w, err := setRegisteredModelTagRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SetRegisteredModelTagRequest) UnmarshalJSON(data []byte) error { + var w setRegisteredModelTagRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := setRegisteredModelTagRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type setRegisteredModelTagResponseWire struct { } @@ -2241,6 +3777,30 @@ func setRegisteredModelTagResponseFromWire(w *setRegisteredModelTagResponseWire) return &SetRegisteredModelTagResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SetRegisteredModelTagResponse) MarshalJSON() ([]byte, error) { + w, err := setRegisteredModelTagResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SetRegisteredModelTagResponse) UnmarshalJSON(data []byte) error { + var w setRegisteredModelTagResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := setRegisteredModelTagResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type testRegistryWebhookRequestWire struct { Id *string `json:"id,omitempty"` Event RegistryWebhookEvent `json:"event,omitempty"` @@ -2266,6 +3826,30 @@ func testRegistryWebhookRequestFromWire(w *testRegistryWebhookRequestWire) (*Tes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TestRegistryWebhookRequest) MarshalJSON() ([]byte, error) { + w, err := testRegistryWebhookRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TestRegistryWebhookRequest) UnmarshalJSON(data []byte) error { + var w testRegistryWebhookRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := testRegistryWebhookRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type testRegistryWebhookResponseWire struct { StatusCode *int `json:"status_code,omitempty"` Body *string `json:"body,omitempty"` @@ -2291,6 +3875,30 @@ func testRegistryWebhookResponseFromWire(w *testRegistryWebhookResponseWire) (*T }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TestRegistryWebhookResponse) MarshalJSON() ([]byte, error) { + w, err := testRegistryWebhookResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TestRegistryWebhookResponse) UnmarshalJSON(data []byte) error { + var w testRegistryWebhookResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := testRegistryWebhookResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type transitionModelVersionStageDatabricksRequestWire struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -2325,6 +3933,30 @@ func transitionModelVersionStageDatabricksRequestFromWire(w *transitionModelVers }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TransitionModelVersionStageDatabricksRequest) MarshalJSON() ([]byte, error) { + w, err := transitionModelVersionStageDatabricksRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TransitionModelVersionStageDatabricksRequest) UnmarshalJSON(data []byte) error { + var w transitionModelVersionStageDatabricksRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := transitionModelVersionStageDatabricksRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type transitionModelVersionStageDatabricksResponseWire struct { ModelVersionDatabricks *modelVersionDatabricksWire `json:"model_version_databricks,omitempty"` } @@ -2355,6 +3987,30 @@ func transitionModelVersionStageDatabricksResponseFromWire(w *transitionModelVer }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TransitionModelVersionStageDatabricksResponse) MarshalJSON() ([]byte, error) { + w, err := transitionModelVersionStageDatabricksResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TransitionModelVersionStageDatabricksResponse) UnmarshalJSON(data []byte) error { + var w transitionModelVersionStageDatabricksResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := transitionModelVersionStageDatabricksResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type transitionRequestWire struct { CreationTimestamp *wireInt64 `json:"creation_timestamp,omitempty"` UserId *string `json:"user_id,omitempty"` @@ -2420,6 +4076,30 @@ func transitionRequestFromWire(w *transitionRequestWire) (*TransitionRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TransitionRequest) MarshalJSON() ([]byte, error) { + w, err := transitionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TransitionRequest) UnmarshalJSON(data []byte) error { + var w transitionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := transitionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCommentRequestWire struct { Id *string `json:"id,omitempty"` Comment *string `json:"comment,omitempty"` @@ -2445,6 +4125,30 @@ func updateCommentRequestFromWire(w *updateCommentRequestWire) (*UpdateCommentRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCommentRequest) MarshalJSON() ([]byte, error) { + w, err := updateCommentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCommentRequest) UnmarshalJSON(data []byte) error { + var w updateCommentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCommentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCommentResponseWire struct { Comment *commentObjectWire `json:"comment,omitempty"` } @@ -2475,6 +4179,30 @@ func updateCommentResponseFromWire(w *updateCommentResponseWire) (*UpdateComment }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCommentResponse) MarshalJSON() ([]byte, error) { + w, err := updateCommentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCommentResponse) UnmarshalJSON(data []byte) error { + var w updateCommentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCommentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateModelVersionRequestWire struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -2503,6 +4231,30 @@ func updateModelVersionRequestFromWire(w *updateModelVersionRequestWire) (*Updat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateModelVersionRequest) MarshalJSON() ([]byte, error) { + w, err := updateModelVersionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateModelVersionRequest) UnmarshalJSON(data []byte) error { + var w updateModelVersionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateModelVersionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateModelVersionResponseWire struct { ModelVersion *modelVersionWire `json:"model_version,omitempty"` } @@ -2533,6 +4285,30 @@ func updateModelVersionResponseFromWire(w *updateModelVersionResponseWire) (*Upd }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateModelVersionResponse) MarshalJSON() ([]byte, error) { + w, err := updateModelVersionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateModelVersionResponse) UnmarshalJSON(data []byte) error { + var w updateModelVersionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateModelVersionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateRegisteredModelRequestWire struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` @@ -2558,6 +4334,30 @@ func updateRegisteredModelRequestFromWire(w *updateRegisteredModelRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateRegisteredModelRequest) MarshalJSON() ([]byte, error) { + w, err := updateRegisteredModelRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateRegisteredModelRequest) UnmarshalJSON(data []byte) error { + var w updateRegisteredModelRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateRegisteredModelRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateRegisteredModelResponseWire struct { RegisteredModel *registeredModelWire `json:"registered_model,omitempty"` } @@ -2588,6 +4388,30 @@ func updateRegisteredModelResponseFromWire(w *updateRegisteredModelResponseWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateRegisteredModelResponse) MarshalJSON() ([]byte, error) { + w, err := updateRegisteredModelResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateRegisteredModelResponse) UnmarshalJSON(data []byte) error { + var w updateRegisteredModelResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateRegisteredModelResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateRegistryWebhookRequestWire struct { Id *string `json:"id,omitempty"` Events []RegistryWebhookEvent `json:"events,omitempty"` @@ -2641,6 +4465,30 @@ func updateRegistryWebhookRequestFromWire(w *updateRegistryWebhookRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateRegistryWebhookRequest) MarshalJSON() ([]byte, error) { + w, err := updateRegistryWebhookRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateRegistryWebhookRequest) UnmarshalJSON(data []byte) error { + var w updateRegistryWebhookRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateRegistryWebhookRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateRegistryWebhookResponseWire struct { Webhook *registryWebhookWire `json:"webhook,omitempty"` } @@ -2671,6 +4519,30 @@ func updateRegistryWebhookResponseFromWire(w *updateRegistryWebhookResponseWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateRegistryWebhookResponse) MarshalJSON() ([]byte, error) { + w, err := updateRegistryWebhookResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateRegistryWebhookResponse) UnmarshalJSON(data []byte) error { + var w updateRegistryWebhookResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateRegistryWebhookResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/modelserving/CHANGELOG.md b/modelserving/CHANGELOG.md index cdc2530b..2e783e0c 100644 --- a/modelserving/CHANGELOG.md +++ b/modelserving/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/modelserving/internal/version.go b/modelserving/internal/version.go index 43793ed7..35c1802a 100644 --- a/modelserving/internal/version.go +++ b/modelserving/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-modelserving" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/modelserving/v1/model.go b/modelserving/v1/model.go index 30e0b12b..b0dd73ea 100644 --- a/modelserving/v1/model.go +++ b/modelserving/v1/model.go @@ -15,6 +15,29 @@ const ( Behavior_Mask Behavior = "MASK" ) +// The commitment term length for a Provisioned Throughput pool. +type CommitmentTerm string + +const ( + CommitmentTerm_Unspecified CommitmentTerm = "" + // A one-month commitment term. + CommitmentTerm_CommitmentTerm1Month CommitmentTerm = "COMMITMENT_TERM_1_MONTH" + // A three-month commitment term. + CommitmentTerm_CommitmentTerm3Months CommitmentTerm = "COMMITMENT_TERM_3_MONTHS" + // A one-hour commitment term. + CommitmentTerm_CommitmentTerm1Hour CommitmentTerm = "COMMITMENT_TERM_1_HOUR" + // A twelve-hour commitment term. + CommitmentTerm_CommitmentTerm12Hours CommitmentTerm = "COMMITMENT_TERM_12_HOURS" + // A one-day commitment term. + CommitmentTerm_CommitmentTerm1Day CommitmentTerm = "COMMITMENT_TERM_1_DAY" + // A one-week commitment term. + CommitmentTerm_CommitmentTerm1Week CommitmentTerm = "COMMITMENT_TERM_1_WEEK" + // A six-month commitment term. + CommitmentTerm_CommitmentTerm6Months CommitmentTerm = "COMMITMENT_TERM_6_MONTHS" + // A one-year commitment term. + CommitmentTerm_CommitmentTerm1Year CommitmentTerm = "COMMITMENT_TERM_1_YEAR" +) + type ServedModelDeploymentState string const ( @@ -232,12 +255,14 @@ type AutoCaptureConfig struct { // The prefix of the table in Unity Catalog. NOTE: On update, you cannot change // the prefix name if the inference table is already enabled. TableNamePrefix *string - State *AutoCaptureState + // The state of the inference table. + State *AutoCaptureState // Indicates whether the inference table is enabled. Enabled *bool } type AutoCaptureState struct { + // The payload table that stores the logged requests and responses. PayloadTable *PayloadTable } @@ -289,7 +314,8 @@ type CreateInferenceEndpointRequest struct { BudgetPolicyId *string // Email notification settings. EmailNotifications *EmailNotifications - Description *string + // The description of the serving endpoint. + Description *string // Configuration for persisting endpoint telemetry (logs, traces, and metrics) // to Unity Catalog tables. TelemetryConfig *TelemetryConfig @@ -354,6 +380,7 @@ type DatabricksModelServingConfig struct { } type DeleteInferenceEndpointRequest struct { + // The name of the serving endpoint to delete. Name *string } @@ -560,9 +587,13 @@ type FallbackConfig struct { // All fields are not sensitive as they are hard-coded in the system and made // available to customers.. type FoundationModel struct { - Name *string + // The name of the foundation model. + Name *string + // The human-readable display name of the foundation model. DisplayName *string - Docs *string + // The URL of the Databricks documentation page for the foundation model. + Docs *string + // A description of the foundation model. Description *string } @@ -652,9 +683,11 @@ type InferenceEndpoint struct { Name *string // The email of the user who created the serving endpoint. Creator *string - // The timestamp when the endpoint was created in Unix time. + // The timestamp when the endpoint was created, in milliseconds since the Unix + // epoch. CreationTimestamp *int64 - // The timestamp when the endpoint was last updated by a user in Unix time. + // The timestamp when the endpoint was last updated by a user, in milliseconds + // since the Unix epoch. LastUpdatedTimestamp *int64 // Information corresponding to the state of the serving endpoint. State *InferenceEndpointState @@ -687,9 +720,11 @@ type InferenceEndpointDetailed struct { Name *string // The email of the user who created the serving endpoint. Creator *string - // The timestamp when the endpoint was created in Unix time. + // The timestamp when the endpoint was created, in milliseconds since the Unix + // epoch. CreationTimestamp *int64 - // The timestamp when the endpoint was last updated by a user in Unix time. + // The timestamp when the endpoint was last updated by a user, in milliseconds + // since the Unix epoch. LastUpdatedTimestamp *int64 // Information corresponding to the state of the serving endpoint. State *InferenceEndpointState @@ -720,7 +755,7 @@ type InferenceEndpointDetailed struct { BudgetPolicyId *string // Email notification settings. EmailNotifications *EmailNotifications - // Description of the serving model + // Description of the serving endpoint. Description *string // Telemetry configuration for the endpoint, including inference-table payload // logging. @@ -848,6 +883,7 @@ type PatchInferenceEndpointTagsRequest struct { } type PatchInferenceEndpointTagsResponse struct { + // The tags attached to the serving endpoint after the update. Tags []EndpointTag } @@ -865,8 +901,11 @@ type PatchInferenceEndpointTelemetryConfigRequest struct { } type PayloadTable struct { - Name *string - Status *string + // The name of the payload table within the configured catalog and schema. + Name *string + // The status of the payload table. One of PENDING, READY, FAILED or DISABLED. + Status *string + // More information about the status of the payload table, if available. StatusMessage *string } @@ -882,7 +921,8 @@ type PendingConfig struct { TrafficConfig *TrafficConfig // The config version that the serving endpoint is currently serving. ConfigVersion *int - // The timestamp when the update to the pending config started. + // The timestamp when the update to the pending config started, in milliseconds + // since the Unix epoch. StartTime *int64 // Configuration for legacy Inference Tables which automatically log requests // and responses to Unity Catalog. Deprecated: please use AI Gateway inference @@ -899,7 +939,8 @@ type PiiSettings struct { type PtEndpointCoreConfig struct { // The list of served entities under the serving endpoint config. ServedEntities []PtServedModel - TrafficConfig *TrafficConfig + // The traffic configuration associated with the serving endpoint config. + TrafficConfig *TrafficConfig } type PtServedModel struct { @@ -914,7 +955,8 @@ type PtServedModel struct { // of type FEATURE_SPEC in the UC. If it is a UC object, the full name of the // object should be given in the form of // **catalog_name.schema_name.model_name**. - EntityName *string + EntityName *string + // The version of the model in Unity Catalog to be served. EntityVersion *string // The number of model units to be provisioned. Dedicated inference requires // positive fixed capacity and does not support scale-to-zero. @@ -924,6 +966,10 @@ type PtServedModel struct { // When disabled, the endpoint maintains fixed capacity at // provisioned_model_units. BurstScalingEnabled *bool + // Commitment term to purchase for this served entity; its presence marks the + // entity as reserved (vs on-demand) PT. Valid on create and on update + // (purchases a commitment for a scale-up). + PtTerm CommitmentTerm } type PutInferenceEndpointAiGatewayRequest struct { @@ -1001,7 +1047,8 @@ type PutInferenceEndpointRateLimitsResponse struct { type PutPtEndpointConfigRequest struct { // The name of the pt endpoint to update. This field is required. - Name *string + Name *string + // The core config of the serving endpoint. Config *PtEndpointCoreConfig } @@ -1023,7 +1070,8 @@ type Route struct { // The percentage of endpoint traffic to send to this route. It must be an // integer between 0 and 100 inclusive. TrafficPercentage *int - ServedEntityName *string + // The name of the served entity this route configures traffic for. + ServedEntityName *string } type ServedModel struct { @@ -1047,7 +1095,9 @@ type ServedModel struct { // of type FEATURE_SPEC in the UC. If it is a UC object, the full name of the // object should be given in the form of // **catalog_name.schema_name.model_name**. - EntityName *string + EntityName *string + // The version of the model in Databricks Model Registry or Unity Catalog to be + // served, or empty if the entity is a FEATURE_SPEC function. EntityVersion *string // The minimum tokens per second that the endpoint can scale down to. MinProvisionedThroughput *int @@ -1079,8 +1129,13 @@ type ServedModel struct { // Whether the compute resources for the served entity should scale down to // zero. ScaleToZeroEnabled *bool - ModelName *string - ModelVersion *string + // The name of the model in Databricks Model Registry to be served or, if the + // model resides in Unity Catalog, the full name of the model in the form of + // **catalog_name.schema_name.model_name**. + ModelName *string + // The version of the model in Databricks Model Registry or Unity Catalog to be + // served. + ModelVersion *string // An object containing a set of optional, user-specified environment variable // key-value pairs used for serving this entity. Note: this is an experimental // feature and subject to change. Example entity environment variables that @@ -1091,26 +1146,61 @@ type ServedModel struct { // ARN of the instance profile that the served entity uses to access AWS // resources. InstanceProfileArn *string - FoundationModel *FoundationModel - State *ServedModelState - Creator *string - CreationTimestamp *int64 + // The foundation model that is served. Present for served entities that serve a + // Databricks-hosted foundation model. + FoundationModel *FoundationModel + // Information corresponding to the state of the served entity. + State *ServedModelState + // The email of the user who created the served entity. + Creator *string + // The timestamp when the served entity was created, in milliseconds since the + // Unix epoch. + CreationTimestamp *int64 } type ServedModelLite struct { + // The name of the served entity. Name *string - // Only one of model_name and entity_name should be populated - ModelName *string + // The name of the model in Databricks Model Registry to be served or, if the + // model resides in Unity Catalog, the full name of the model in the form of + // **catalog_name.schema_name.model_name**. + ModelName *string + // The name of the entity to be served. The entity may be a model in the + // Databricks Model Registry, a model in the Unity Catalog (UC), or a function + // of type FEATURE_SPEC in the UC. If it is a UC object, the full name of the + // object is given in the form of **catalog_name.schema_name.model_name**. EntityName *string - // Only one of model_version and entity_version should be populated - ModelVersion *string - EntityVersion *string - ExternalModel *ExternalModel + // The version of the model in Databricks Model Registry or Unity Catalog to be + // served. + ModelVersion *string + // The version of the model in Databricks Model Registry or Unity Catalog to be + // served, or empty if the entity is a FEATURE_SPEC function. + EntityVersion *string + // The external model that is served. NOTE: Only one of external_model, + // foundation_model, and (entity_name, entity_version) is returned based on the + // endpoint type. + ExternalModel *ExternalModel + // The foundation model that is served. NOTE: Only one of foundation_model, + // external_model, and (entity_name, entity_version) is returned based on the + // endpoint type. FoundationModel *FoundationModel } type ServedModelState struct { - Deployment ServedModelDeploymentState + // The state of the deployment of the served entity. DEPLOYMENT_CREATING + // indicates that the served entity is not ready yet because the deployment is + // still being created (for example, the container image is building or the + // model server is starting for the first time). DEPLOYMENT_RECOVERING indicates + // that the served entity was previously ready but no longer is and is + // attempting to recover. DEPLOYMENT_READY indicates that the served entity is + // ready to receive traffic. DEPLOYMENT_FAILED indicates that there was an error + // bringing up the served entity (for example, the container image build failed + // or the model server failed to start due to a model loading error). + // DEPLOYMENT_ABORTED indicates that the deployment was terminated, likely due + // to a failure in bringing up another served entity under the same endpoint and + // config version. + Deployment ServedModelDeploymentState + // More information about the state of the served entity, if available. DeploymentStateMessage *string } @@ -1186,7 +1276,9 @@ type UpdateInferenceEndpointNotificationsRequest struct { } type UpdateInferenceEndpointNotificationsResponse struct { - Name *string + // The name of the serving endpoint whose notification settings were updated. + Name *string + // The email notification settings now in effect for the serving endpoint. EmailNotifications *EmailNotifications } diff --git a/modelserving/v1/wire.go b/modelserving/v1/wire.go index e52c703a..96607ff0 100644 --- a/modelserving/v1/wire.go +++ b/modelserving/v1/wire.go @@ -77,6 +77,30 @@ func ai21LabsConfigFromWire(w *ai21LabsConfigWire) (*Ai21LabsConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Ai21LabsConfig) MarshalJSON() ([]byte, error) { + w, err := ai21LabsConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Ai21LabsConfig) UnmarshalJSON(data []byte) error { + var w ai21LabsConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ai21LabsConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiGatewayConfigWire struct { UsageTrackingConfig *usageTrackingConfigWire `json:"usage_tracking_config,omitempty"` InferenceTableConfig *inferenceTableConfigWire `json:"inference_table_config,omitempty"` @@ -151,6 +175,30 @@ func aiGatewayConfigFromWire(w *aiGatewayConfigWire) (*AiGatewayConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiGatewayConfig) MarshalJSON() ([]byte, error) { + w, err := aiGatewayConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiGatewayConfig) UnmarshalJSON(data []byte) error { + var w aiGatewayConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiGatewayConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiGatewayRateLimitWire struct { Calls *wireInt64 `json:"calls,omitempty"` Key *string `json:"key,omitempty"` @@ -201,6 +249,30 @@ func aiGatewayRateLimitFromWire(w *aiGatewayRateLimitWire) (*AiGatewayRateLimit, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiGatewayRateLimit) MarshalJSON() ([]byte, error) { + w, err := aiGatewayRateLimitToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiGatewayRateLimit) UnmarshalJSON(data []byte) error { + var w aiGatewayRateLimitWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiGatewayRateLimitFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiGuardrailParametersWire struct { Safety *bool `json:"safety,omitempty"` Pii *piiSettingsWire `json:"pii,omitempty"` @@ -240,6 +312,30 @@ func aiGuardrailParametersFromWire(w *aiGuardrailParametersWire) (*AiGuardrailPa }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiGuardrailParameters) MarshalJSON() ([]byte, error) { + w, err := aiGuardrailParametersToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiGuardrailParameters) UnmarshalJSON(data []byte) error { + var w aiGuardrailParametersWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiGuardrailParametersFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aiGuardrailsWire struct { Input *aiGuardrailParametersWire `json:"input,omitempty"` Output *aiGuardrailParametersWire `json:"output,omitempty"` @@ -281,6 +377,30 @@ func aiGuardrailsFromWire(w *aiGuardrailsWire) (*AiGuardrails, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AiGuardrails) MarshalJSON() ([]byte, error) { + w, err := aiGuardrailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AiGuardrails) UnmarshalJSON(data []byte) error { + var w aiGuardrailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aiGuardrailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type amazonBedrockConfigWire struct { AwsRegion *string `json:"aws_region,omitempty"` AwsAccessKeyId *string `json:"aws_access_key_id,omitempty"` @@ -324,6 +444,30 @@ func amazonBedrockConfigFromWire(w *amazonBedrockConfigWire) (*AmazonBedrockConf }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AmazonBedrockConfig) MarshalJSON() ([]byte, error) { + w, err := amazonBedrockConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AmazonBedrockConfig) UnmarshalJSON(data []byte) error { + var w amazonBedrockConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := amazonBedrockConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type anthropicConfigWire struct { AnthropicApiKey *string `json:"anthropic_api_key,omitempty"` AnthropicApiKeyPlaintext *string `json:"anthropic_api_key_plaintext,omitempty"` @@ -349,6 +493,30 @@ func anthropicConfigFromWire(w *anthropicConfigWire) (*AnthropicConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AnthropicConfig) MarshalJSON() ([]byte, error) { + w, err := anthropicConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AnthropicConfig) UnmarshalJSON(data []byte) error { + var w anthropicConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := anthropicConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type apiKeyAuthWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -377,6 +545,30 @@ func apiKeyAuthFromWire(w *apiKeyAuthWire) (*ApiKeyAuth, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApiKeyAuth) MarshalJSON() ([]byte, error) { + w, err := apiKeyAuthToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApiKeyAuth) UnmarshalJSON(data []byte) error { + var w apiKeyAuthWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := apiKeyAuthFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type autoCaptureConfigWire struct { CatalogName *string `json:"catalog_name,omitempty"` SchemaName *string `json:"schema_name,omitempty"` @@ -419,6 +611,30 @@ func autoCaptureConfigFromWire(w *autoCaptureConfigWire) (*AutoCaptureConfig, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AutoCaptureConfig) MarshalJSON() ([]byte, error) { + w, err := autoCaptureConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AutoCaptureConfig) UnmarshalJSON(data []byte) error { + var w autoCaptureConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := autoCaptureConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type autoCaptureStateWire struct { PayloadTable *payloadTableWire `json:"payload_table,omitempty"` } @@ -449,6 +665,30 @@ func autoCaptureStateFromWire(w *autoCaptureStateWire) (*AutoCaptureState, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AutoCaptureState) MarshalJSON() ([]byte, error) { + w, err := autoCaptureStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AutoCaptureState) UnmarshalJSON(data []byte) error { + var w autoCaptureStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := autoCaptureStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type bearerTokenAuthWire struct { Token *string `json:"token,omitempty"` TokenPlaintext *string `json:"token_plaintext,omitempty"` @@ -474,6 +714,30 @@ func bearerTokenAuthFromWire(w *bearerTokenAuthWire) (*BearerTokenAuth, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BearerTokenAuth) MarshalJSON() ([]byte, error) { + w, err := bearerTokenAuthToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BearerTokenAuth) UnmarshalJSON(data []byte) error { + var w bearerTokenAuthWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := bearerTokenAuthFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cohereConfigWire struct { CohereApiKey *string `json:"cohere_api_key,omitempty"` CohereApiKeyPlaintext *string `json:"cohere_api_key_plaintext,omitempty"` @@ -502,6 +766,30 @@ func cohereConfigFromWire(w *cohereConfigWire) (*CohereConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CohereConfig) MarshalJSON() ([]byte, error) { + w, err := cohereConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CohereConfig) UnmarshalJSON(data []byte) error { + var w cohereConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cohereConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createInferenceEndpointRequestWire struct { Name *string `json:"name,omitempty"` Config *endpointCoreConfigWire `json:"config,omitempty"` @@ -599,6 +887,30 @@ func createInferenceEndpointRequestFromWire(w *createInferenceEndpointRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateInferenceEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := createInferenceEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateInferenceEndpointRequest) UnmarshalJSON(data []byte) error { + var w createInferenceEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createInferenceEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createPtEndpointRequestWire struct { Name *string `json:"name,omitempty"` Config *ptEndpointCoreConfigWire `json:"config,omitempty"` @@ -668,6 +980,30 @@ func createPtEndpointRequestFromWire(w *createPtEndpointRequestWire) (*CreatePtE }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreatePtEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := createPtEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreatePtEndpointRequest) UnmarshalJSON(data []byte) error { + var w createPtEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createPtEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type customProviderConfigWire struct { CustomProviderUrl *string `json:"custom_provider_url,omitempty"` BearerTokenAuth *bearerTokenAuthWire `json:"bearer_token_auth,omitempty"` @@ -712,6 +1048,30 @@ func customProviderConfigFromWire(w *customProviderConfigWire) (*CustomProviderC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CustomProviderConfig) MarshalJSON() ([]byte, error) { + w, err := customProviderConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CustomProviderConfig) UnmarshalJSON(data []byte) error { + var w customProviderConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := customProviderConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dataPlaneInfoWire struct { EndpointUrl *string `json:"endpoint_url,omitempty"` AuthorizationDetails *string `json:"authorization_details,omitempty"` @@ -737,6 +1097,30 @@ func dataPlaneInfoFromWire(w *dataPlaneInfoWire) (*DataPlaneInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DataPlaneInfo) MarshalJSON() ([]byte, error) { + w, err := dataPlaneInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DataPlaneInfo) UnmarshalJSON(data []byte) error { + var w dataPlaneInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dataPlaneInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databricksModelServingConfigWire struct { DatabricksApiToken *string `json:"databricks_api_token,omitempty"` DatabricksWorkspaceUrl *string `json:"databricks_workspace_url,omitempty"` @@ -765,6 +1149,30 @@ func databricksModelServingConfigFromWire(w *databricksModelServingConfigWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatabricksModelServingConfig) MarshalJSON() ([]byte, error) { + w, err := databricksModelServingConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatabricksModelServingConfig) UnmarshalJSON(data []byte) error { + var w databricksModelServingConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databricksModelServingConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteInferenceEndpointRequestWire struct { Name *string `json:"name,omitempty"` } @@ -787,6 +1195,30 @@ func deleteInferenceEndpointRequestFromWire(w *deleteInferenceEndpointRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteInferenceEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := deleteInferenceEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteInferenceEndpointRequest) UnmarshalJSON(data []byte) error { + var w deleteInferenceEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteInferenceEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteInferenceEndpointResponseWire struct { } @@ -804,6 +1236,30 @@ func deleteInferenceEndpointResponseFromWire(w *deleteInferenceEndpointResponseW return &DeleteInferenceEndpointResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteInferenceEndpointResponse) MarshalJSON() ([]byte, error) { + w, err := deleteInferenceEndpointResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteInferenceEndpointResponse) UnmarshalJSON(data []byte) error { + var w deleteInferenceEndpointResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteInferenceEndpointResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type emailNotificationsWire struct { OnUpdateSuccess []string `json:"on_update_success,omitempty"` OnUpdateFailure []string `json:"on_update_failure,omitempty"` @@ -829,6 +1285,30 @@ func emailNotificationsFromWire(w *emailNotificationsWire) (*EmailNotifications, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EmailNotifications) MarshalJSON() ([]byte, error) { + w, err := emailNotificationsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EmailNotifications) UnmarshalJSON(data []byte) error { + var w emailNotificationsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := emailNotificationsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointCoreConfigWire struct { ServedEntities []servedModelWire `json:"served_entities,omitempty"` ServedModels []servedModelWire `json:"served_models,omitempty"` @@ -892,6 +1372,30 @@ func endpointCoreConfigFromWire(w *endpointCoreConfigWire) (*EndpointCoreConfig, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointCoreConfig) MarshalJSON() ([]byte, error) { + w, err := endpointCoreConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointCoreConfig) UnmarshalJSON(data []byte) error { + var w endpointCoreConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointCoreConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointCoreConfigOutputWire struct { ConfigVersion *wireInt64 `json:"config_version,omitempty"` ServedEntities []servedModelWire `json:"served_entities,omitempty"` @@ -966,10 +1470,34 @@ func endpointCoreConfigOutputFromWire(w *endpointCoreConfigOutputWire) (*Endpoin }, nil } -type endpointCoreConfigSummaryWire struct { - ServedEntities []servedModelLiteWire `json:"served_entities,omitempty"` - ServedModels []servedModelLiteWire `json:"served_models,omitempty"` -} +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointCoreConfigOutput) MarshalJSON() ([]byte, error) { + w, err := endpointCoreConfigOutputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointCoreConfigOutput) UnmarshalJSON(data []byte) error { + var w endpointCoreConfigOutputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointCoreConfigOutputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type endpointCoreConfigSummaryWire struct { + ServedEntities []servedModelLiteWire `json:"served_entities,omitempty"` + ServedModels []servedModelLiteWire `json:"served_models,omitempty"` +} func endpointCoreConfigSummaryToWire(v *EndpointCoreConfigSummary) (*endpointCoreConfigSummaryWire, error) { if v == nil { @@ -1007,6 +1535,30 @@ func endpointCoreConfigSummaryFromWire(w *endpointCoreConfigSummaryWire) (*Endpo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointCoreConfigSummary) MarshalJSON() ([]byte, error) { + w, err := endpointCoreConfigSummaryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointCoreConfigSummary) UnmarshalJSON(data []byte) error { + var w endpointCoreConfigSummaryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointCoreConfigSummaryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointTagWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -1032,6 +1584,30 @@ func endpointTagFromWire(w *endpointTagWire) (*EndpointTag, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointTag) MarshalJSON() ([]byte, error) { + w, err := endpointTagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointTag) UnmarshalJSON(data []byte) error { + var w endpointTagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointTagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type exportMetricsResponseWire struct { } @@ -1089,6 +1665,30 @@ func externalFunctionRequestFromWire(w *externalFunctionRequestWire) (*ExternalF }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalFunctionRequest) MarshalJSON() ([]byte, error) { + w, err := externalFunctionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalFunctionRequest) UnmarshalJSON(data []byte) error { + var w externalFunctionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalFunctionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type externalFunctionResponseWire struct { } @@ -1327,6 +1927,30 @@ func externalModelFromWire(w *externalModelWire) (*ExternalModel, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalModel) MarshalJSON() ([]byte, error) { + w, err := externalModelToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalModel) UnmarshalJSON(data []byte) error { + var w externalModelWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalModelFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type fallbackConfigWire struct { Enabled *bool `json:"enabled,omitempty"` } @@ -1349,6 +1973,30 @@ func fallbackConfigFromWire(w *fallbackConfigWire) (*FallbackConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FallbackConfig) MarshalJSON() ([]byte, error) { + w, err := fallbackConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FallbackConfig) UnmarshalJSON(data []byte) error { + var w fallbackConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := fallbackConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type foundationModelWire struct { Name *string `json:"name,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -1380,6 +2028,30 @@ func foundationModelFromWire(w *foundationModelWire) (*FoundationModel, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FoundationModel) MarshalJSON() ([]byte, error) { + w, err := foundationModelToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FoundationModel) UnmarshalJSON(data []byte) error { + var w foundationModelWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := foundationModelFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getExportEndpointMetricsRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1402,6 +2074,30 @@ func getExportEndpointMetricsRequestFromWire(w *getExportEndpointMetricsRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetExportEndpointMetricsRequest) MarshalJSON() ([]byte, error) { + w, err := getExportEndpointMetricsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetExportEndpointMetricsRequest) UnmarshalJSON(data []byte) error { + var w getExportEndpointMetricsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getExportEndpointMetricsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getInferenceEndpointRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1424,6 +2120,30 @@ func getInferenceEndpointRequestFromWire(w *getInferenceEndpointRequestWire) (*G }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetInferenceEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := getInferenceEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetInferenceEndpointRequest) UnmarshalJSON(data []byte) error { + var w getInferenceEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getInferenceEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getInferenceEndpointSchemaRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1446,6 +2166,30 @@ func getInferenceEndpointSchemaRequestFromWire(w *getInferenceEndpointSchemaRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetInferenceEndpointSchemaRequest) MarshalJSON() ([]byte, error) { + w, err := getInferenceEndpointSchemaRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetInferenceEndpointSchemaRequest) UnmarshalJSON(data []byte) error { + var w getInferenceEndpointSchemaRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getInferenceEndpointSchemaRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getOpenApiResponseWire struct { } @@ -1488,6 +2232,30 @@ func getServedModelBuildLogsRequestFromWire(w *getServedModelBuildLogsRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetServedModelBuildLogsRequest) MarshalJSON() ([]byte, error) { + w, err := getServedModelBuildLogsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetServedModelBuildLogsRequest) UnmarshalJSON(data []byte) error { + var w getServedModelBuildLogsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getServedModelBuildLogsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getServedModelBuildLogsResponseWire struct { Logs *string `json:"logs,omitempty"` } @@ -1510,6 +2278,30 @@ func getServedModelBuildLogsResponseFromWire(w *getServedModelBuildLogsResponseW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetServedModelBuildLogsResponse) MarshalJSON() ([]byte, error) { + w, err := getServedModelBuildLogsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetServedModelBuildLogsResponse) UnmarshalJSON(data []byte) error { + var w getServedModelBuildLogsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getServedModelBuildLogsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getServedModelLogsRequestWire struct { Name *string `json:"name,omitempty"` ServedModelName *string `json:"served_model_name,omitempty"` @@ -1535,6 +2327,30 @@ func getServedModelLogsRequestFromWire(w *getServedModelLogsRequestWire) (*GetSe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetServedModelLogsRequest) MarshalJSON() ([]byte, error) { + w, err := getServedModelLogsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetServedModelLogsRequest) UnmarshalJSON(data []byte) error { + var w getServedModelLogsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getServedModelLogsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getServedModelLogsResponseWire struct { Logs *string `json:"logs,omitempty"` } @@ -1557,6 +2373,30 @@ func getServedModelLogsResponseFromWire(w *getServedModelLogsResponseWire) (*Get }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetServedModelLogsResponse) MarshalJSON() ([]byte, error) { + w, err := getServedModelLogsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetServedModelLogsResponse) UnmarshalJSON(data []byte) error { + var w getServedModelLogsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getServedModelLogsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type googleCloudVertexAiConfigWire struct { PrivateKey *string `json:"private_key,omitempty"` ProjectId *string `json:"project_id,omitempty"` @@ -1588,6 +2428,30 @@ func googleCloudVertexAiConfigFromWire(w *googleCloudVertexAiConfigWire) (*Googl }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GoogleCloudVertexAiConfig) MarshalJSON() ([]byte, error) { + w, err := googleCloudVertexAiConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GoogleCloudVertexAiConfig) UnmarshalJSON(data []byte) error { + var w googleCloudVertexAiConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := googleCloudVertexAiConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type inferenceEndpointWire struct { Name *string `json:"name,omitempty"` Creator *string `json:"creator,omitempty"` @@ -1705,6 +2569,30 @@ func inferenceEndpointFromWire(w *inferenceEndpointWire) (*InferenceEndpoint, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InferenceEndpoint) MarshalJSON() ([]byte, error) { + w, err := inferenceEndpointToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InferenceEndpoint) UnmarshalJSON(data []byte) error { + var w inferenceEndpointWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := inferenceEndpointFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type inferenceEndpointDetailedWire struct { Name *string `json:"name,omitempty"` Creator *string `json:"creator,omitempty"` @@ -1861,6 +2749,30 @@ func inferenceEndpointDetailedFromWire(w *inferenceEndpointDetailedWire) (*Infer }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InferenceEndpointDetailed) MarshalJSON() ([]byte, error) { + w, err := inferenceEndpointDetailedToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InferenceEndpointDetailed) UnmarshalJSON(data []byte) error { + var w inferenceEndpointDetailedWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := inferenceEndpointDetailedFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type inferenceEndpointStateWire struct { Ready InferenceEndpointState_ReadyState `json:"ready,omitempty"` ConfigUpdate InferenceEndpointState_ConfigUpdateState `json:"config_update,omitempty"` @@ -1886,6 +2798,30 @@ func inferenceEndpointStateFromWire(w *inferenceEndpointStateWire) (*InferenceEn }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InferenceEndpointState) MarshalJSON() ([]byte, error) { + w, err := inferenceEndpointStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InferenceEndpointState) UnmarshalJSON(data []byte) error { + var w inferenceEndpointStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := inferenceEndpointStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type inferenceTableConfigWire struct { CatalogName *string `json:"catalog_name,omitempty"` SchemaName *string `json:"schema_name,omitempty"` @@ -1917,6 +2853,30 @@ func inferenceTableConfigFromWire(w *inferenceTableConfigWire) (*InferenceTableC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InferenceTableConfig) MarshalJSON() ([]byte, error) { + w, err := inferenceTableConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InferenceTableConfig) UnmarshalJSON(data []byte) error { + var w inferenceTableConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := inferenceTableConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listInferenceEndpointsRequestWire struct { } @@ -1934,6 +2894,30 @@ func listInferenceEndpointsRequestFromWire(w *listInferenceEndpointsRequestWire) return &ListInferenceEndpointsRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListInferenceEndpointsRequest) MarshalJSON() ([]byte, error) { + w, err := listInferenceEndpointsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListInferenceEndpointsRequest) UnmarshalJSON(data []byte) error { + var w listInferenceEndpointsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listInferenceEndpointsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listInferenceEndpointsResponseWire struct { Endpoints []inferenceEndpointWire `json:"endpoints,omitempty"` } @@ -1964,6 +2948,30 @@ func listInferenceEndpointsResponseFromWire(w *listInferenceEndpointsResponseWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListInferenceEndpointsResponse) MarshalJSON() ([]byte, error) { + w, err := listInferenceEndpointsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListInferenceEndpointsResponse) UnmarshalJSON(data []byte) error { + var w listInferenceEndpointsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listInferenceEndpointsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelDataPlaneInfoWire struct { QueryInfo *dataPlaneInfoWire `json:"query_info,omitempty"` } @@ -1994,6 +3002,30 @@ func modelDataPlaneInfoFromWire(w *modelDataPlaneInfoWire) (*ModelDataPlaneInfo, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelDataPlaneInfo) MarshalJSON() ([]byte, error) { + w, err := modelDataPlaneInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelDataPlaneInfo) UnmarshalJSON(data []byte) error { + var w modelDataPlaneInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelDataPlaneInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type openAiConfigWire struct { OpenaiApiKey *string `json:"openai_api_key,omitempty"` OpenaiApiType *string `json:"openai_api_type,omitempty"` @@ -2046,6 +3078,30 @@ func openAiConfigFromWire(w *openAiConfigWire) (*OpenAiConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OpenAiConfig) MarshalJSON() ([]byte, error) { + w, err := openAiConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OpenAiConfig) UnmarshalJSON(data []byte) error { + var w openAiConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := openAiConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type paLmConfigWire struct { PalmApiKey *string `json:"palm_api_key,omitempty"` PalmApiKeyPlaintext *string `json:"palm_api_key_plaintext,omitempty"` @@ -2071,6 +3127,30 @@ func paLmConfigFromWire(w *paLmConfigWire) (*PaLmConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PaLmConfig) MarshalJSON() ([]byte, error) { + w, err := paLmConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PaLmConfig) UnmarshalJSON(data []byte) error { + var w paLmConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := paLmConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type patchInferenceEndpointTagsRequestWire struct { Name *string `json:"name,omitempty"` AddTags []endpointTagWire `json:"add_tags,omitempty"` @@ -2107,6 +3187,30 @@ func patchInferenceEndpointTagsRequestFromWire(w *patchInferenceEndpointTagsRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PatchInferenceEndpointTagsRequest) MarshalJSON() ([]byte, error) { + w, err := patchInferenceEndpointTagsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PatchInferenceEndpointTagsRequest) UnmarshalJSON(data []byte) error { + var w patchInferenceEndpointTagsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := patchInferenceEndpointTagsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type patchInferenceEndpointTagsResponseWire struct { Tags []endpointTagWire `json:"tags,omitempty"` } @@ -2137,6 +3241,30 @@ func patchInferenceEndpointTagsResponseFromWire(w *patchInferenceEndpointTagsRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PatchInferenceEndpointTagsResponse) MarshalJSON() ([]byte, error) { + w, err := patchInferenceEndpointTagsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PatchInferenceEndpointTagsResponse) UnmarshalJSON(data []byte) error { + var w patchInferenceEndpointTagsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := patchInferenceEndpointTagsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type patchInferenceEndpointTelemetryConfigRequestWire struct { Name *string `json:"name,omitempty"` TelemetryConfig *telemetryConfigWire `json:"telemetry_config,omitempty"` @@ -2170,6 +3298,30 @@ func patchInferenceEndpointTelemetryConfigRequestFromWire(w *patchInferenceEndpo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PatchInferenceEndpointTelemetryConfigRequest) MarshalJSON() ([]byte, error) { + w, err := patchInferenceEndpointTelemetryConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PatchInferenceEndpointTelemetryConfigRequest) UnmarshalJSON(data []byte) error { + var w patchInferenceEndpointTelemetryConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := patchInferenceEndpointTelemetryConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type payloadTableWire struct { Name *string `json:"name,omitempty"` Status *string `json:"status,omitempty"` @@ -2198,6 +3350,30 @@ func payloadTableFromWire(w *payloadTableWire) (*PayloadTable, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PayloadTable) MarshalJSON() ([]byte, error) { + w, err := payloadTableToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PayloadTable) UnmarshalJSON(data []byte) error { + var w payloadTableWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := payloadTableFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pendingConfigWire struct { ServedEntities []servedModelWire `json:"served_entities,omitempty"` ServedModels []servedModelWire `json:"served_models,omitempty"` @@ -2275,6 +3451,30 @@ func pendingConfigFromWire(w *pendingConfigWire) (*PendingConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PendingConfig) MarshalJSON() ([]byte, error) { + w, err := pendingConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PendingConfig) UnmarshalJSON(data []byte) error { + var w pendingConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pendingConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type piiSettingsWire struct { Behavior Behavior `json:"behavior,omitempty"` } @@ -2297,6 +3497,30 @@ func piiSettingsFromWire(w *piiSettingsWire) (*PiiSettings, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PiiSettings) MarshalJSON() ([]byte, error) { + w, err := piiSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PiiSettings) UnmarshalJSON(data []byte) error { + var w piiSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := piiSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ptEndpointCoreConfigWire struct { ServedEntities []ptServedModelWire `json:"served_entities,omitempty"` TrafficConfig *trafficConfigWire `json:"traffic_config,omitempty"` @@ -2338,12 +3562,37 @@ func ptEndpointCoreConfigFromWire(w *ptEndpointCoreConfigWire) (*PtEndpointCoreC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PtEndpointCoreConfig) MarshalJSON() ([]byte, error) { + w, err := ptEndpointCoreConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PtEndpointCoreConfig) UnmarshalJSON(data []byte) error { + var w ptEndpointCoreConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ptEndpointCoreConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ptServedModelWire struct { - Name *string `json:"name,omitempty"` - EntityName *string `json:"entity_name,omitempty"` - EntityVersion *string `json:"entity_version,omitempty"` - ProvisionedModelUnits *wireInt64 `json:"provisioned_model_units,omitempty"` - BurstScalingEnabled *bool `json:"burst_scaling_enabled,omitempty"` + Name *string `json:"name,omitempty"` + EntityName *string `json:"entity_name,omitempty"` + EntityVersion *string `json:"entity_version,omitempty"` + ProvisionedModelUnits *wireInt64 `json:"provisioned_model_units,omitempty"` + BurstScalingEnabled *bool `json:"burst_scaling_enabled,omitempty"` + PtTerm CommitmentTerm `json:"pt_term,omitempty"` } func ptServedModelToWire(v *PtServedModel) (*ptServedModelWire, error) { @@ -2360,6 +3609,7 @@ func ptServedModelToWire(v *PtServedModel) (*ptServedModelWire, error) { EntityVersion: v.EntityVersion, ProvisionedModelUnits: provisionedModelUnitsWireValue, BurstScalingEnabled: v.BurstScalingEnabled, + PtTerm: v.PtTerm, }, nil } @@ -2377,9 +3627,34 @@ func ptServedModelFromWire(w *ptServedModelWire) (*PtServedModel, error) { EntityVersion: w.EntityVersion, ProvisionedModelUnits: provisionedModelUnitsPublicValue, BurstScalingEnabled: w.BurstScalingEnabled, + PtTerm: w.PtTerm, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PtServedModel) MarshalJSON() ([]byte, error) { + w, err := ptServedModelToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PtServedModel) UnmarshalJSON(data []byte) error { + var w ptServedModelWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ptServedModelFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type putInferenceEndpointAiGatewayRequestWire struct { Name *string `json:"name,omitempty"` UsageTrackingConfig *usageTrackingConfigWire `json:"usage_tracking_config,omitempty"` @@ -2457,6 +3732,30 @@ func putInferenceEndpointAiGatewayRequestFromWire(w *putInferenceEndpointAiGatew }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PutInferenceEndpointAiGatewayRequest) MarshalJSON() ([]byte, error) { + w, err := putInferenceEndpointAiGatewayRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PutInferenceEndpointAiGatewayRequest) UnmarshalJSON(data []byte) error { + var w putInferenceEndpointAiGatewayRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := putInferenceEndpointAiGatewayRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type putInferenceEndpointAiGatewayResponseWire struct { UsageTrackingConfig *usageTrackingConfigWire `json:"usage_tracking_config,omitempty"` InferenceTableConfig *inferenceTableConfigWire `json:"inference_table_config,omitempty"` @@ -2531,6 +3830,30 @@ func putInferenceEndpointAiGatewayResponseFromWire(w *putInferenceEndpointAiGate }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PutInferenceEndpointAiGatewayResponse) MarshalJSON() ([]byte, error) { + w, err := putInferenceEndpointAiGatewayResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PutInferenceEndpointAiGatewayResponse) UnmarshalJSON(data []byte) error { + var w putInferenceEndpointAiGatewayResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := putInferenceEndpointAiGatewayResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type putInferenceEndpointConfigRequestWire struct { Name *string `json:"name,omitempty"` ServedEntities []servedModelWire `json:"served_entities,omitempty"` @@ -2597,6 +3920,30 @@ func putInferenceEndpointConfigRequestFromWire(w *putInferenceEndpointConfigRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PutInferenceEndpointConfigRequest) MarshalJSON() ([]byte, error) { + w, err := putInferenceEndpointConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PutInferenceEndpointConfigRequest) UnmarshalJSON(data []byte) error { + var w putInferenceEndpointConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := putInferenceEndpointConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type putInferenceEndpointRateLimitsRequestWire struct { Name *string `json:"name,omitempty"` RateLimits []rateLimitWire `json:"rate_limits,omitempty"` @@ -2630,6 +3977,30 @@ func putInferenceEndpointRateLimitsRequestFromWire(w *putInferenceEndpointRateLi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PutInferenceEndpointRateLimitsRequest) MarshalJSON() ([]byte, error) { + w, err := putInferenceEndpointRateLimitsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PutInferenceEndpointRateLimitsRequest) UnmarshalJSON(data []byte) error { + var w putInferenceEndpointRateLimitsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := putInferenceEndpointRateLimitsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type putInferenceEndpointRateLimitsResponseWire struct { RateLimits []rateLimitWire `json:"rate_limits,omitempty"` } @@ -2660,6 +4031,30 @@ func putInferenceEndpointRateLimitsResponseFromWire(w *putInferenceEndpointRateL }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PutInferenceEndpointRateLimitsResponse) MarshalJSON() ([]byte, error) { + w, err := putInferenceEndpointRateLimitsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PutInferenceEndpointRateLimitsResponse) UnmarshalJSON(data []byte) error { + var w putInferenceEndpointRateLimitsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := putInferenceEndpointRateLimitsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type putPtEndpointConfigRequestWire struct { Name *string `json:"name,omitempty"` Config *ptEndpointCoreConfigWire `json:"config,omitempty"` @@ -2693,6 +4088,30 @@ func putPtEndpointConfigRequestFromWire(w *putPtEndpointConfigRequestWire) (*Put }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PutPtEndpointConfigRequest) MarshalJSON() ([]byte, error) { + w, err := putPtEndpointConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PutPtEndpointConfigRequest) UnmarshalJSON(data []byte) error { + var w putPtEndpointConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := putPtEndpointConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rateLimitWire struct { Calls *wireInt64 `json:"calls,omitempty"` Key *string `json:"key,omitempty"` @@ -2729,6 +4148,30 @@ func rateLimitFromWire(w *rateLimitWire) (*RateLimit, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RateLimit) MarshalJSON() ([]byte, error) { + w, err := rateLimitToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RateLimit) UnmarshalJSON(data []byte) error { + var w rateLimitWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rateLimitFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type routeWire struct { ServedModelName *string `json:"served_model_name,omitempty"` TrafficPercentage *int `json:"traffic_percentage,omitempty"` @@ -2757,6 +4200,30 @@ func routeFromWire(w *routeWire) (*Route, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Route) MarshalJSON() ([]byte, error) { + w, err := routeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Route) UnmarshalJSON(data []byte) error { + var w routeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := routeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type servedModelWire struct { Name *string `json:"name,omitempty"` ExternalModel *externalModelWire `json:"external_model,omitempty"` @@ -2876,6 +4343,30 @@ func servedModelFromWire(w *servedModelWire) (*ServedModel, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ServedModel) MarshalJSON() ([]byte, error) { + w, err := servedModelToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ServedModel) UnmarshalJSON(data []byte) error { + var w servedModelWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := servedModelFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type servedModelLiteWire struct { Name *string `json:"name,omitempty"` ModelName *string `json:"model_name,omitempty"` @@ -2932,6 +4423,30 @@ func servedModelLiteFromWire(w *servedModelLiteWire) (*ServedModelLite, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ServedModelLite) MarshalJSON() ([]byte, error) { + w, err := servedModelLiteToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ServedModelLite) UnmarshalJSON(data []byte) error { + var w servedModelLiteWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := servedModelLiteFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type servedModelStateWire struct { Deployment ServedModelDeploymentState `json:"deployment,omitempty"` DeploymentStateMessage *string `json:"deployment_state_message,omitempty"` @@ -2957,6 +4472,30 @@ func servedModelStateFromWire(w *servedModelStateWire) (*ServedModelState, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ServedModelState) MarshalJSON() ([]byte, error) { + w, err := servedModelStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ServedModelState) UnmarshalJSON(data []byte) error { + var w servedModelStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := servedModelStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type telemetryConfigWire struct { TelemetryProfileId *string `json:"telemetry_profile_id,omitempty"` TableNames *unityCatalogTableNamesWire `json:"table_names,omitempty"` @@ -3035,6 +4574,30 @@ func telemetryConfigFromWire(w *telemetryConfigWire) (*TelemetryConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TelemetryConfig) MarshalJSON() ([]byte, error) { + w, err := telemetryConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TelemetryConfig) UnmarshalJSON(data []byte) error { + var w telemetryConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := telemetryConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type telemetryInferenceTableConfigWire struct { SamplingFraction *float64 `json:"sampling_fraction,omitempty"` Name *string `json:"name,omitempty"` @@ -3060,6 +4623,30 @@ func telemetryInferenceTableConfigFromWire(w *telemetryInferenceTableConfigWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TelemetryInferenceTableConfig) MarshalJSON() ([]byte, error) { + w, err := telemetryInferenceTableConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TelemetryInferenceTableConfig) UnmarshalJSON(data []byte) error { + var w telemetryInferenceTableConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := telemetryInferenceTableConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type trafficConfigWire struct { Routes []routeWire `json:"routes,omitempty"` } @@ -3090,6 +4677,30 @@ func trafficConfigFromWire(w *trafficConfigWire) (*TrafficConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TrafficConfig) MarshalJSON() ([]byte, error) { + w, err := trafficConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TrafficConfig) UnmarshalJSON(data []byte) error { + var w trafficConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := trafficConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type unityCatalogTableNamesWire struct { LogsTable *string `json:"logs_table,omitempty"` MetricsTable *string `json:"metrics_table,omitempty"` @@ -3121,6 +4732,30 @@ func unityCatalogTableNamesFromWire(w *unityCatalogTableNamesWire) (*UnityCatalo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UnityCatalogTableNames) MarshalJSON() ([]byte, error) { + w, err := unityCatalogTableNamesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UnityCatalogTableNames) UnmarshalJSON(data []byte) error { + var w unityCatalogTableNamesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := unityCatalogTableNamesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateInferenceEndpointNotificationsRequestWire struct { Name *string `json:"name,omitempty"` EmailNotifications *emailNotificationsWire `json:"email_notifications,omitempty"` @@ -3154,6 +4789,30 @@ func updateInferenceEndpointNotificationsRequestFromWire(w *updateInferenceEndpo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateInferenceEndpointNotificationsRequest) MarshalJSON() ([]byte, error) { + w, err := updateInferenceEndpointNotificationsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateInferenceEndpointNotificationsRequest) UnmarshalJSON(data []byte) error { + var w updateInferenceEndpointNotificationsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateInferenceEndpointNotificationsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateInferenceEndpointNotificationsResponseWire struct { Name *string `json:"name,omitempty"` EmailNotifications *emailNotificationsWire `json:"email_notifications,omitempty"` @@ -3187,6 +4846,30 @@ func updateInferenceEndpointNotificationsResponseFromWire(w *updateInferenceEndp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateInferenceEndpointNotificationsResponse) MarshalJSON() ([]byte, error) { + w, err := updateInferenceEndpointNotificationsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateInferenceEndpointNotificationsResponse) UnmarshalJSON(data []byte) error { + var w updateInferenceEndpointNotificationsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateInferenceEndpointNotificationsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type usageTrackingConfigWire struct { Enabled *bool `json:"enabled,omitempty"` } @@ -3209,6 +4892,30 @@ func usageTrackingConfigFromWire(w *usageTrackingConfigWire) (*UsageTrackingConf }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UsageTrackingConfig) MarshalJSON() ([]byte, error) { + w, err := usageTrackingConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UsageTrackingConfig) UnmarshalJSON(data []byte) error { + var w usageTrackingConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := usageTrackingConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/modelservingquery/CHANGELOG.md b/modelservingquery/CHANGELOG.md index a31993d7..8575fa10 100644 --- a/modelservingquery/CHANGELOG.md +++ b/modelservingquery/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.5.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.4.0 (2026-11-11) ## Release v0.3.0 (2026-10-13) diff --git a/modelservingquery/internal/version.go b/modelservingquery/internal/version.go index a1176e64..5ed45711 100644 --- a/modelservingquery/internal/version.go +++ b/modelservingquery/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-modelservingquery" -const Version = "0.4.0" +const Version = "0.5.0" diff --git a/modelservingquery/v1/wire.go b/modelservingquery/v1/wire.go index 7a610548..dec6a0c9 100644 --- a/modelservingquery/v1/wire.go +++ b/modelservingquery/v1/wire.go @@ -77,6 +77,30 @@ func chatMessageFromWire(w *chatMessageWire) (*ChatMessage, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ChatMessage) MarshalJSON() ([]byte, error) { + w, err := chatMessageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ChatMessage) UnmarshalJSON(data []byte) error { + var w chatMessageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := chatMessageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dataframeSplitInputWire struct { Index []int `json:"index,omitempty"` Columns []json.RawMessage `json:"columns,omitempty"` @@ -105,6 +129,30 @@ func dataframeSplitInputFromWire(w *dataframeSplitInputWire) (*DataframeSplitInp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DataframeSplitInput) MarshalJSON() ([]byte, error) { + w, err := dataframeSplitInputToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DataframeSplitInput) UnmarshalJSON(data []byte) error { + var w dataframeSplitInputWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dataframeSplitInputFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type embeddingsV1ResponseEmbeddingElementWire struct { Embedding []float64 `json:"embedding,omitempty"` Index *int `json:"index,omitempty"` @@ -133,6 +181,30 @@ func embeddingsV1ResponseEmbeddingElementFromWire(w *embeddingsV1ResponseEmbeddi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EmbeddingsV1ResponseEmbeddingElement) MarshalJSON() ([]byte, error) { + w, err := embeddingsV1ResponseEmbeddingElementToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EmbeddingsV1ResponseEmbeddingElement) UnmarshalJSON(data []byte) error { + var w embeddingsV1ResponseEmbeddingElementWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := embeddingsV1ResponseEmbeddingElementFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type externalModelUsageElementWire struct { PromptTokens *int `json:"prompt_tokens,omitempty"` CompletionTokens *int `json:"completion_tokens,omitempty"` @@ -161,6 +233,30 @@ func externalModelUsageElementFromWire(w *externalModelUsageElementWire) (*Exter }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalModelUsageElement) MarshalJSON() ([]byte, error) { + w, err := externalModelUsageElementToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalModelUsageElement) UnmarshalJSON(data []byte) error { + var w externalModelUsageElementWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalModelUsageElementFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queryEndpointRequestWire struct { Name *string `json:"name,omitempty"` Prompt json.RawMessage `json:"prompt,omitempty"` @@ -244,6 +340,30 @@ func queryEndpointRequestFromWire(w *queryEndpointRequestWire) (*QueryEndpointRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueryEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := queryEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueryEndpointRequest) UnmarshalJSON(data []byte) error { + var w queryEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queryEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queryEndpointResponseWire struct { Choices []v1ResponseChoiceElementWire `json:"choices,omitempty"` Data []embeddingsV1ResponseEmbeddingElementWire `json:"data,omitempty"` @@ -364,6 +484,30 @@ func v1ResponseChoiceElementFromWire(w *v1ResponseChoiceElementWire) (*V1Respons }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v V1ResponseChoiceElement) MarshalJSON() ([]byte, error) { + w, err := v1ResponseChoiceElementToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *V1ResponseChoiceElement) UnmarshalJSON(data []byte) error { + var w v1ResponseChoiceElementWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := v1ResponseChoiceElementFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/networking/CHANGELOG.md b/networking/CHANGELOG.md index f5036c9f..b8fe9121 100644 --- a/networking/CHANGELOG.md +++ b/networking/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.9.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.8.0 (2026-11-11) ## Release v0.7.0 (2026-11-10) diff --git a/networking/internal/version.go b/networking/internal/version.go index 881057f4..dc266754 100644 --- a/networking/internal/version.go +++ b/networking/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-networking" -const Version = "0.8.0" +const Version = "0.9.0" diff --git a/networking/v1/wire.go b/networking/v1/wire.go index e42f67e8..9fd73deb 100644 --- a/networking/v1/wire.go +++ b/networking/v1/wire.go @@ -135,6 +135,30 @@ func accountIpAccessListFromWire(w *accountIpAccessListWire) (*AccountIpAccessLi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountIpAccessList) MarshalJSON() ([]byte, error) { + w, err := accountIpAccessListToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountIpAccessList) UnmarshalJSON(data []byte) error { + var w accountIpAccessListWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountIpAccessListFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountIpAccessListTypeWire struct { } @@ -152,6 +176,30 @@ func accountIpAccessListTypeFromWire(w *accountIpAccessListTypeWire) (*AccountIp return &AccountIpAccessListType{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountIpAccessListType) MarshalJSON() ([]byte, error) { + w, err := accountIpAccessListTypeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountIpAccessListType) UnmarshalJSON(data []byte) error { + var w accountIpAccessListTypeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountIpAccessListTypeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountNetworkPolicyWire struct { NetworkPolicyId *string `json:"network_policy_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -210,6 +258,30 @@ func accountNetworkPolicyFromWire(w *accountNetworkPolicyWire) (*AccountNetworkP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountNetworkPolicy) MarshalJSON() ([]byte, error) { + w, err := accountNetworkPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountNetworkPolicy) UnmarshalJSON(data []byte) error { + var w accountNetworkPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountNetworkPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type apiErrorWire struct { ErrorCode ErrorCode `json:"error_code,omitempty"` Message *string `json:"message,omitempty"` @@ -241,6 +313,30 @@ func apiErrorFromWire(w *apiErrorWire) (*ApiError, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApiError) MarshalJSON() ([]byte, error) { + w, err := apiErrorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApiError) UnmarshalJSON(data []byte) error { + var w apiErrorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := apiErrorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type awsVpcEndpointInfoWire struct { AwsVpcEndpointId *string `json:"aws_vpc_endpoint_id,omitempty"` AwsEndpointServiceId *string `json:"aws_endpoint_service_id,omitempty"` @@ -269,6 +365,30 @@ func awsVpcEndpointInfoFromWire(w *awsVpcEndpointInfoWire) (*AwsVpcEndpointInfo, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AwsVpcEndpointInfo) MarshalJSON() ([]byte, error) { + w, err := awsVpcEndpointInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AwsVpcEndpointInfo) UnmarshalJSON(data []byte) error { + var w awsVpcEndpointInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := awsVpcEndpointInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type azurePrivateEndpointInfoWire struct { PrivateEndpointName *string `json:"private_endpoint_name,omitempty"` PrivateEndpointResourceGuid *string `json:"private_endpoint_resource_guid,omitempty"` @@ -300,6 +420,30 @@ func azurePrivateEndpointInfoFromWire(w *azurePrivateEndpointInfoWire) (*AzurePr }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AzurePrivateEndpointInfo) MarshalJSON() ([]byte, error) { + w, err := azurePrivateEndpointInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AzurePrivateEndpointInfo) UnmarshalJSON(data []byte) error { + var w azurePrivateEndpointInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := azurePrivateEndpointInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAccountIpAccessListRequestWire struct { AccountId *string `json:"account_id,omitempty"` Label *string `json:"label,omitempty"` @@ -331,6 +475,30 @@ func createAccountIpAccessListRequestFromWire(w *createAccountIpAccessListReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAccountIpAccessListRequest) MarshalJSON() ([]byte, error) { + w, err := createAccountIpAccessListRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAccountIpAccessListRequest) UnmarshalJSON(data []byte) error { + var w createAccountIpAccessListRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAccountIpAccessListRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAccountIpAccessListResponseWire struct { IpAccessList *accountIpAccessListWire `json:"ip_access_list,omitempty"` } @@ -361,6 +529,30 @@ func createAccountIpAccessListResponseFromWire(w *createAccountIpAccessListRespo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAccountIpAccessListResponse) MarshalJSON() ([]byte, error) { + w, err := createAccountIpAccessListResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAccountIpAccessListResponse) UnmarshalJSON(data []byte) error { + var w createAccountIpAccessListResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAccountIpAccessListResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createEndpointRequestWire struct { Parent *string `json:"parent,omitempty"` Endpoint *endpointWire `json:"endpoint,omitempty"` @@ -394,6 +586,30 @@ func createEndpointRequestFromWire(w *createEndpointRequestWire) (*CreateEndpoin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := createEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateEndpointRequest) UnmarshalJSON(data []byte) error { + var w createEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createIpAccessListRequestWire struct { Label *string `json:"label,omitempty"` ListType IpAccessListType `json:"list_type,omitempty"` @@ -422,6 +638,30 @@ func createIpAccessListRequestFromWire(w *createIpAccessListRequestWire) (*Creat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateIpAccessListRequest) MarshalJSON() ([]byte, error) { + w, err := createIpAccessListRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateIpAccessListRequest) UnmarshalJSON(data []byte) error { + var w createIpAccessListRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createIpAccessListRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createIpAccessListResponseWire struct { IpAccessList *ipAccessListWire `json:"ip_access_list,omitempty"` } @@ -452,6 +692,30 @@ func createIpAccessListResponseFromWire(w *createIpAccessListResponseWire) (*Cre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateIpAccessListResponse) MarshalJSON() ([]byte, error) { + w, err := createIpAccessListResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateIpAccessListResponse) UnmarshalJSON(data []byte) error { + var w createIpAccessListResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createIpAccessListResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createNccPrivateEndpointRuleRequestWire struct { NetworkConnectivityConfigId *string `json:"network_connectivity_config_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -488,6 +752,30 @@ func createNccPrivateEndpointRuleRequestFromWire(w *createNccPrivateEndpointRule }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateNccPrivateEndpointRuleRequest) MarshalJSON() ([]byte, error) { + w, err := createNccPrivateEndpointRuleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateNccPrivateEndpointRuleRequest) UnmarshalJSON(data []byte) error { + var w createNccPrivateEndpointRuleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createNccPrivateEndpointRuleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createNetworkConnectivityConfigRequestWire struct { AccountId *string `json:"account_id,omitempty"` NetworkConnectivityConfig *createNetworkConnectivityConfigurationWire `json:"network_connectivity_config,omitempty"` @@ -521,6 +809,30 @@ func createNetworkConnectivityConfigRequestFromWire(w *createNetworkConnectivity }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateNetworkConnectivityConfigRequest) MarshalJSON() ([]byte, error) { + w, err := createNetworkConnectivityConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateNetworkConnectivityConfigRequest) UnmarshalJSON(data []byte) error { + var w createNetworkConnectivityConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createNetworkConnectivityConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createNetworkConnectivityConfigurationWire struct { NetworkConnectivityConfigId *string `json:"network_connectivity_config_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -585,6 +897,30 @@ func createNetworkConnectivityConfigurationFromWire(w *createNetworkConnectivity }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateNetworkConnectivityConfiguration) MarshalJSON() ([]byte, error) { + w, err := createNetworkConnectivityConfigurationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateNetworkConnectivityConfiguration) UnmarshalJSON(data []byte) error { + var w createNetworkConnectivityConfigurationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createNetworkConnectivityConfigurationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createNetworkPolicyRequestWire struct { AccountId *string `json:"account_id,omitempty"` NetworkPolicy *accountNetworkPolicyWire `json:"network_policy,omitempty"` @@ -618,6 +954,30 @@ func createNetworkPolicyRequestFromWire(w *createNetworkPolicyRequestWire) (*Cre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateNetworkPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := createNetworkPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateNetworkPolicyRequest) UnmarshalJSON(data []byte) error { + var w createNetworkPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createNetworkPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createNetworkRequestWire struct { AccountId *string `json:"account_id,omitempty"` NetworkName *string `json:"network_name,omitempty"` @@ -674,6 +1034,30 @@ func createNetworkRequestFromWire(w *createNetworkRequestWire) (*CreateNetworkRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateNetworkRequest) MarshalJSON() ([]byte, error) { + w, err := createNetworkRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateNetworkRequest) UnmarshalJSON(data []byte) error { + var w createNetworkRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createNetworkRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createPrivateAccessSettingsRequestWire struct { AccountId *string `json:"account_id,omitempty"` PrivateAccessSettingsName *string `json:"private_access_settings_name,omitempty"` @@ -711,6 +1095,30 @@ func createPrivateAccessSettingsRequestFromWire(w *createPrivateAccessSettingsRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreatePrivateAccessSettingsRequest) MarshalJSON() ([]byte, error) { + w, err := createPrivateAccessSettingsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreatePrivateAccessSettingsRequest) UnmarshalJSON(data []byte) error { + var w createPrivateAccessSettingsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createPrivateAccessSettingsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createPrivateEndpointRuleWire struct { RuleId *string `json:"rule_id,omitempty"` NetworkConnectivityConfigId *string `json:"network_connectivity_config_id,omitempty"` @@ -838,6 +1246,30 @@ func createPrivateEndpointRuleFromWire(w *createPrivateEndpointRuleWire) (*Creat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreatePrivateEndpointRule) MarshalJSON() ([]byte, error) { + w, err := createPrivateEndpointRuleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreatePrivateEndpointRule) UnmarshalJSON(data []byte) error { + var w createPrivateEndpointRuleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createPrivateEndpointRuleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createPrivateNetworkGatewayRequestWire struct { Parent *string `json:"parent,omitempty"` PrivateNetworkGateway *privateNetworkGatewayWire `json:"private_network_gateway,omitempty"` @@ -874,6 +1306,30 @@ func createPrivateNetworkGatewayRequestFromWire(w *createPrivateNetworkGatewayRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreatePrivateNetworkGatewayRequest) MarshalJSON() ([]byte, error) { + w, err := createPrivateNetworkGatewayRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreatePrivateNetworkGatewayRequest) UnmarshalJSON(data []byte) error { + var w createPrivateNetworkGatewayRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createPrivateNetworkGatewayRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createVpcEndpointRequestWire struct { AccountId *string `json:"account_id,omitempty"` VpcEndpointName *string `json:"vpc_endpoint_name,omitempty"` @@ -938,6 +1394,30 @@ func createVpcEndpointRequestFromWire(w *createVpcEndpointRequestWire) (*CreateV }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateVpcEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := createVpcEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateVpcEndpointRequest) UnmarshalJSON(data []byte) error { + var w createVpcEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createVpcEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type customerFacingNetworkConnectivityConfigEgressConfigWire struct { DefaultRules *networkConnectivityConfigEgressConfig_DefaultRuleWire `json:"default_rules,omitempty"` TargetRules *customerFacingNetworkConnectivityConfigEgressConfig_CustomerFacingTargetRuleWire `json:"target_rules,omitempty"` @@ -979,6 +1459,30 @@ func customerFacingNetworkConnectivityConfigEgressConfigFromWire(w *customerFaci }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CustomerFacingNetworkConnectivityConfigEgressConfig) MarshalJSON() ([]byte, error) { + w, err := customerFacingNetworkConnectivityConfigEgressConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CustomerFacingNetworkConnectivityConfigEgressConfig) UnmarshalJSON(data []byte) error { + var w customerFacingNetworkConnectivityConfigEgressConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := customerFacingNetworkConnectivityConfigEgressConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type customerFacingNetworkConnectivityConfigEgressConfig_CustomerFacingTargetRuleWire struct { AzurePrivateEndpointRules []networkConnectivityConfigAzurePrivateEndpointRuleWire `json:"azure_private_endpoint_rules,omitempty"` AwsPrivateEndpointRules []networkConnectivityConfigAwsPrivateEndpointRuleWire `json:"aws_private_endpoint_rules,omitempty"` @@ -1020,10 +1524,34 @@ func customerFacingNetworkConnectivityConfigEgressConfig_CustomerFacingTargetRul }, nil } -type deleteAccountIpAccessListRequestWire struct { - AccountId *string `json:"account_id,omitempty"` - ListId *string `json:"list_id,omitempty"` -} +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CustomerFacingNetworkConnectivityConfigEgressConfig_CustomerFacingTargetRule) MarshalJSON() ([]byte, error) { + w, err := customerFacingNetworkConnectivityConfigEgressConfig_CustomerFacingTargetRuleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CustomerFacingNetworkConnectivityConfigEgressConfig_CustomerFacingTargetRule) UnmarshalJSON(data []byte) error { + var w customerFacingNetworkConnectivityConfigEgressConfig_CustomerFacingTargetRuleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := customerFacingNetworkConnectivityConfigEgressConfig_CustomerFacingTargetRuleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type deleteAccountIpAccessListRequestWire struct { + AccountId *string `json:"account_id,omitempty"` + ListId *string `json:"list_id,omitempty"` +} func deleteAccountIpAccessListRequestToWire(v *DeleteAccountIpAccessListRequest) (*deleteAccountIpAccessListRequestWire, error) { if v == nil { @@ -1045,6 +1573,30 @@ func deleteAccountIpAccessListRequestFromWire(w *deleteAccountIpAccessListReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteAccountIpAccessListRequest) MarshalJSON() ([]byte, error) { + w, err := deleteAccountIpAccessListRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteAccountIpAccessListRequest) UnmarshalJSON(data []byte) error { + var w deleteAccountIpAccessListRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteAccountIpAccessListRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteAccountIpAccessListResponseWire struct { } @@ -1062,6 +1614,30 @@ func deleteAccountIpAccessListResponseFromWire(w *deleteAccountIpAccessListRespo return &DeleteAccountIpAccessListResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteAccountIpAccessListResponse) MarshalJSON() ([]byte, error) { + w, err := deleteAccountIpAccessListResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteAccountIpAccessListResponse) UnmarshalJSON(data []byte) error { + var w deleteAccountIpAccessListResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteAccountIpAccessListResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteEndpointRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1084,6 +1660,30 @@ func deleteEndpointRequestFromWire(w *deleteEndpointRequestWire) (*DeleteEndpoin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := deleteEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteEndpointRequest) UnmarshalJSON(data []byte) error { + var w deleteEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteIpAccessListRequestWire struct { ListId *string `json:"list_id,omitempty"` } @@ -1106,6 +1706,30 @@ func deleteIpAccessListRequestFromWire(w *deleteIpAccessListRequestWire) (*Delet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteIpAccessListRequest) MarshalJSON() ([]byte, error) { + w, err := deleteIpAccessListRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteIpAccessListRequest) UnmarshalJSON(data []byte) error { + var w deleteIpAccessListRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteIpAccessListRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteIpAccessListResponseWire struct { } @@ -1123,6 +1747,30 @@ func deleteIpAccessListResponseFromWire(w *deleteIpAccessListResponseWire) (*Del return &DeleteIpAccessListResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteIpAccessListResponse) MarshalJSON() ([]byte, error) { + w, err := deleteIpAccessListResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteIpAccessListResponse) UnmarshalJSON(data []byte) error { + var w deleteIpAccessListResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteIpAccessListResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteNccPrivateEndpointRuleRequestWire struct { AccountId *string `json:"account_id,omitempty"` NetworkConnectivityConfigId *string `json:"network_connectivity_config_id,omitempty"` @@ -1151,6 +1799,30 @@ func deleteNccPrivateEndpointRuleRequestFromWire(w *deleteNccPrivateEndpointRule }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteNccPrivateEndpointRuleRequest) MarshalJSON() ([]byte, error) { + w, err := deleteNccPrivateEndpointRuleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteNccPrivateEndpointRuleRequest) UnmarshalJSON(data []byte) error { + var w deleteNccPrivateEndpointRuleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteNccPrivateEndpointRuleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteNetworkConnectivityConfigRequestWire struct { AccountId *string `json:"account_id,omitempty"` NetworkConnectivityConfigId *string `json:"network_connectivity_config_id,omitempty"` @@ -1176,6 +1848,30 @@ func deleteNetworkConnectivityConfigRequestFromWire(w *deleteNetworkConnectivity }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteNetworkConnectivityConfigRequest) MarshalJSON() ([]byte, error) { + w, err := deleteNetworkConnectivityConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteNetworkConnectivityConfigRequest) UnmarshalJSON(data []byte) error { + var w deleteNetworkConnectivityConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteNetworkConnectivityConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteNetworkPolicyRequestWire struct { NetworkPolicyId *string `json:"network_policy_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -1201,6 +1897,30 @@ func deleteNetworkPolicyRequestFromWire(w *deleteNetworkPolicyRequestWire) (*Del }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteNetworkPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := deleteNetworkPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteNetworkPolicyRequest) UnmarshalJSON(data []byte) error { + var w deleteNetworkPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteNetworkPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteNetworkRequestWire struct { NetworkId *string `json:"network_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -1226,6 +1946,30 @@ func deleteNetworkRequestFromWire(w *deleteNetworkRequestWire) (*DeleteNetworkRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteNetworkRequest) MarshalJSON() ([]byte, error) { + w, err := deleteNetworkRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteNetworkRequest) UnmarshalJSON(data []byte) error { + var w deleteNetworkRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteNetworkRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deletePrivateAccessSettingsRequestWire struct { PrivateAccessSettingsId *string `json:"private_access_settings_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -1251,6 +1995,30 @@ func deletePrivateAccessSettingsRequestFromWire(w *deletePrivateAccessSettingsRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeletePrivateAccessSettingsRequest) MarshalJSON() ([]byte, error) { + w, err := deletePrivateAccessSettingsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeletePrivateAccessSettingsRequest) UnmarshalJSON(data []byte) error { + var w deletePrivateAccessSettingsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deletePrivateAccessSettingsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deletePrivateNetworkGatewayRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1273,6 +2041,30 @@ func deletePrivateNetworkGatewayRequestFromWire(w *deletePrivateNetworkGatewayRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeletePrivateNetworkGatewayRequest) MarshalJSON() ([]byte, error) { + w, err := deletePrivateNetworkGatewayRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeletePrivateNetworkGatewayRequest) UnmarshalJSON(data []byte) error { + var w deletePrivateNetworkGatewayRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deletePrivateNetworkGatewayRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteVpcEndpointRequestWire struct { VpcEndpointId *string `json:"vpc_endpoint_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -1298,6 +2090,30 @@ func deleteVpcEndpointRequestFromWire(w *deleteVpcEndpointRequestWire) (*DeleteV }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteVpcEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := deleteVpcEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteVpcEndpointRequest) UnmarshalJSON(data []byte) error { + var w deleteVpcEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteVpcEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type egressNetworkPolicyWire struct { NetworkAccess *egressNetworkPolicy_NetworkAccessPolicyWire `json:"network_access,omitempty"` } @@ -1328,6 +2144,30 @@ func egressNetworkPolicyFromWire(w *egressNetworkPolicyWire) (*EgressNetworkPoli }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EgressNetworkPolicy) MarshalJSON() ([]byte, error) { + w, err := egressNetworkPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EgressNetworkPolicy) UnmarshalJSON(data []byte) error { + var w egressNetworkPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := egressNetworkPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type egressNetworkPolicy_NetworkAccessPolicyWire struct { RestrictionMode EgressNetworkPolicy_NetworkAccessPolicy_RestrictionMode `json:"restriction_mode,omitempty"` AllowedInternetDestinations []egressNetworkPolicy_NetworkAccessPolicy_InternetDestinationWire `json:"allowed_internet_destinations,omitempty"` @@ -1405,6 +2245,30 @@ func egressNetworkPolicy_NetworkAccessPolicyFromWire(w *egressNetworkPolicy_Netw }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EgressNetworkPolicy_NetworkAccessPolicy) MarshalJSON() ([]byte, error) { + w, err := egressNetworkPolicy_NetworkAccessPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EgressNetworkPolicy_NetworkAccessPolicy) UnmarshalJSON(data []byte) error { + var w egressNetworkPolicy_NetworkAccessPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := egressNetworkPolicy_NetworkAccessPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type egressNetworkPolicy_NetworkAccessPolicy_DatabricksDestinationWire struct { WorkspaceIds []wireInt64 `json:"workspace_ids,omitempty"` } @@ -1435,6 +2299,30 @@ func egressNetworkPolicy_NetworkAccessPolicy_DatabricksDestinationFromWire(w *eg }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EgressNetworkPolicy_NetworkAccessPolicy_DatabricksDestination) MarshalJSON() ([]byte, error) { + w, err := egressNetworkPolicy_NetworkAccessPolicy_DatabricksDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EgressNetworkPolicy_NetworkAccessPolicy_DatabricksDestination) UnmarshalJSON(data []byte) error { + var w egressNetworkPolicy_NetworkAccessPolicy_DatabricksDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := egressNetworkPolicy_NetworkAccessPolicy_DatabricksDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type egressNetworkPolicy_NetworkAccessPolicy_InternetDestinationWire struct { Destination *string `json:"destination,omitempty"` InternetDestinationType EgressNetworkPolicy_NetworkAccessPolicy_InternetDestination_InternetDestinationType `json:"internet_destination_type,omitempty"` @@ -1460,6 +2348,30 @@ func egressNetworkPolicy_NetworkAccessPolicy_InternetDestinationFromWire(w *egre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EgressNetworkPolicy_NetworkAccessPolicy_InternetDestination) MarshalJSON() ([]byte, error) { + w, err := egressNetworkPolicy_NetworkAccessPolicy_InternetDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EgressNetworkPolicy_NetworkAccessPolicy_InternetDestination) UnmarshalJSON(data []byte) error { + var w egressNetworkPolicy_NetworkAccessPolicy_InternetDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := egressNetworkPolicy_NetworkAccessPolicy_InternetDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type egressNetworkPolicy_NetworkAccessPolicy_PolicyEnforcementWire struct { EnforcementMode EgressNetworkPolicy_NetworkAccessPolicy_PolicyEnforcement_EnforcementMode `json:"enforcement_mode,omitempty"` DryRunModeProductFilter []EgressNetworkPolicy_NetworkAccessPolicy_PolicyEnforcement_DryRunModeProductFilter `json:"dry_run_mode_product_filter,omitempty"` @@ -1485,6 +2397,30 @@ func egressNetworkPolicy_NetworkAccessPolicy_PolicyEnforcementFromWire(w *egress }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EgressNetworkPolicy_NetworkAccessPolicy_PolicyEnforcement) MarshalJSON() ([]byte, error) { + w, err := egressNetworkPolicy_NetworkAccessPolicy_PolicyEnforcementToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EgressNetworkPolicy_NetworkAccessPolicy_PolicyEnforcement) UnmarshalJSON(data []byte) error { + var w egressNetworkPolicy_NetworkAccessPolicy_PolicyEnforcementWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := egressNetworkPolicy_NetworkAccessPolicy_PolicyEnforcementFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type egressNetworkPolicy_NetworkAccessPolicy_StorageDestinationWire struct { BucketName *string `json:"bucket_name,omitempty"` Region *string `json:"region,omitempty"` @@ -1519,6 +2455,30 @@ func egressNetworkPolicy_NetworkAccessPolicy_StorageDestinationFromWire(w *egres }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EgressNetworkPolicy_NetworkAccessPolicy_StorageDestination) MarshalJSON() ([]byte, error) { + w, err := egressNetworkPolicy_NetworkAccessPolicy_StorageDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EgressNetworkPolicy_NetworkAccessPolicy_StorageDestination) UnmarshalJSON(data []byte) error { + var w egressNetworkPolicy_NetworkAccessPolicy_StorageDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := egressNetworkPolicy_NetworkAccessPolicy_StorageDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointWire struct { Name *string `json:"name,omitempty"` EndpointId *string `json:"endpoint_id,omitempty"` @@ -1635,6 +2595,30 @@ func endpointFromWire(w *endpointWire) (*Endpoint, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Endpoint) MarshalJSON() ([]byte, error) { + w, err := endpointToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Endpoint) UnmarshalJSON(data []byte) error { + var w endpointWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointUseCaseWire struct { } @@ -1652,6 +2636,30 @@ func endpointUseCaseFromWire(w *endpointUseCaseWire) (*EndpointUseCase, error) { return &EndpointUseCase{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointUseCase) MarshalJSON() ([]byte, error) { + w, err := endpointUseCaseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointUseCase) UnmarshalJSON(data []byte) error { + var w endpointUseCaseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointUseCaseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gcpEndpointWire struct { PscEndpointUri *string `json:"psc_endpoint_uri,omitempty"` ServiceAttachment *string `json:"service_attachment,omitempty"` @@ -1731,6 +2739,30 @@ func gcpEndpointFromWire(w *gcpEndpointWire) (*GcpEndpoint, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GcpEndpoint) MarshalJSON() ([]byte, error) { + w, err := gcpEndpointToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GcpEndpoint) UnmarshalJSON(data []byte) error { + var w gcpEndpointWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gcpEndpointFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gcpNetworkInfoWire struct { NetworkProjectId *string `json:"network_project_id,omitempty"` VpcId *string `json:"vpc_id,omitempty"` @@ -1768,6 +2800,30 @@ func gcpNetworkInfoFromWire(w *gcpNetworkInfoWire) (*GcpNetworkInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GcpNetworkInfo) MarshalJSON() ([]byte, error) { + w, err := gcpNetworkInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GcpNetworkInfo) UnmarshalJSON(data []byte) error { + var w gcpNetworkInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gcpNetworkInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gcpPscEndpointInfoWire struct { PscConnectionId *string `json:"psc_connection_id,omitempty"` ProjectId *string `json:"project_id,omitempty"` @@ -1802,6 +2858,30 @@ func gcpPscEndpointInfoFromWire(w *gcpPscEndpointInfoWire) (*GcpPscEndpointInfo, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GcpPscEndpointInfo) MarshalJSON() ([]byte, error) { + w, err := gcpPscEndpointInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GcpPscEndpointInfo) UnmarshalJSON(data []byte) error { + var w gcpPscEndpointInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gcpPscEndpointInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gcpVpcEndpointInfoWire struct { PscConnectionId *string `json:"psc_connection_id,omitempty"` ProjectId *string `json:"project_id,omitempty"` @@ -1836,6 +2916,30 @@ func gcpVpcEndpointInfoFromWire(w *gcpVpcEndpointInfoWire) (*GcpVpcEndpointInfo, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GcpVpcEndpointInfo) MarshalJSON() ([]byte, error) { + w, err := gcpVpcEndpointInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GcpVpcEndpointInfo) UnmarshalJSON(data []byte) error { + var w gcpVpcEndpointInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gcpVpcEndpointInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAccountIpAccessListRequestWire struct { AccountId *string `json:"account_id,omitempty"` ListId *string `json:"list_id,omitempty"` @@ -1861,6 +2965,30 @@ func getAccountIpAccessListRequestFromWire(w *getAccountIpAccessListRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAccountIpAccessListRequest) MarshalJSON() ([]byte, error) { + w, err := getAccountIpAccessListRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAccountIpAccessListRequest) UnmarshalJSON(data []byte) error { + var w getAccountIpAccessListRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAccountIpAccessListRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAccountIpAccessListResponseWire struct { IpAccessList *accountIpAccessListWire `json:"ip_access_list,omitempty"` } @@ -1891,6 +3019,30 @@ func getAccountIpAccessListResponseFromWire(w *getAccountIpAccessListResponseWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAccountIpAccessListResponse) MarshalJSON() ([]byte, error) { + w, err := getAccountIpAccessListResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAccountIpAccessListResponse) UnmarshalJSON(data []byte) error { + var w getAccountIpAccessListResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAccountIpAccessListResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getEndpointRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1913,6 +3065,30 @@ func getEndpointRequestFromWire(w *getEndpointRequestWire) (*GetEndpointRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := getEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetEndpointRequest) UnmarshalJSON(data []byte) error { + var w getEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getIpAccessListRequestWire struct { ListId *string `json:"list_id,omitempty"` } @@ -1935,6 +3111,30 @@ func getIpAccessListRequestFromWire(w *getIpAccessListRequestWire) (*GetIpAccess }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetIpAccessListRequest) MarshalJSON() ([]byte, error) { + w, err := getIpAccessListRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetIpAccessListRequest) UnmarshalJSON(data []byte) error { + var w getIpAccessListRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getIpAccessListRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getIpAccessListResponseWire struct { IpAccessList *ipAccessListWire `json:"ip_access_list,omitempty"` } @@ -1965,6 +3165,30 @@ func getIpAccessListResponseFromWire(w *getIpAccessListResponseWire) (*GetIpAcce }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetIpAccessListResponse) MarshalJSON() ([]byte, error) { + w, err := getIpAccessListResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetIpAccessListResponse) UnmarshalJSON(data []byte) error { + var w getIpAccessListResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getIpAccessListResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getNccPrivateEndpointRuleRequestWire struct { AccountId *string `json:"account_id,omitempty"` NetworkConnectivityConfigId *string `json:"network_connectivity_config_id,omitempty"` @@ -1993,6 +3217,30 @@ func getNccPrivateEndpointRuleRequestFromWire(w *getNccPrivateEndpointRuleReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetNccPrivateEndpointRuleRequest) MarshalJSON() ([]byte, error) { + w, err := getNccPrivateEndpointRuleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetNccPrivateEndpointRuleRequest) UnmarshalJSON(data []byte) error { + var w getNccPrivateEndpointRuleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getNccPrivateEndpointRuleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getNetworkConnectivityConfigRequestWire struct { AccountId *string `json:"account_id,omitempty"` NetworkConnectivityConfigId *string `json:"network_connectivity_config_id,omitempty"` @@ -2018,6 +3266,30 @@ func getNetworkConnectivityConfigRequestFromWire(w *getNetworkConnectivityConfig }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetNetworkConnectivityConfigRequest) MarshalJSON() ([]byte, error) { + w, err := getNetworkConnectivityConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetNetworkConnectivityConfigRequest) UnmarshalJSON(data []byte) error { + var w getNetworkConnectivityConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getNetworkConnectivityConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getNetworkPolicyRequestWire struct { NetworkPolicyId *string `json:"network_policy_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -2043,6 +3315,30 @@ func getNetworkPolicyRequestFromWire(w *getNetworkPolicyRequestWire) (*GetNetwor }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetNetworkPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := getNetworkPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetNetworkPolicyRequest) UnmarshalJSON(data []byte) error { + var w getNetworkPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getNetworkPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getNetworkRequestWire struct { NetworkId *string `json:"network_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -2068,6 +3364,30 @@ func getNetworkRequestFromWire(w *getNetworkRequestWire) (*GetNetworkRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetNetworkRequest) MarshalJSON() ([]byte, error) { + w, err := getNetworkRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetNetworkRequest) UnmarshalJSON(data []byte) error { + var w getNetworkRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getNetworkRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getOperationRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2090,6 +3410,30 @@ func getOperationRequestFromWire(w *getOperationRequestWire) (*GetOperationReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetOperationRequest) MarshalJSON() ([]byte, error) { + w, err := getOperationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetOperationRequest) UnmarshalJSON(data []byte) error { + var w getOperationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getOperationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPrivateAccessSettingsRequestWire struct { PrivateAccessSettingsId *string `json:"private_access_settings_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -2115,6 +3459,30 @@ func getPrivateAccessSettingsRequestFromWire(w *getPrivateAccessSettingsRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPrivateAccessSettingsRequest) MarshalJSON() ([]byte, error) { + w, err := getPrivateAccessSettingsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPrivateAccessSettingsRequest) UnmarshalJSON(data []byte) error { + var w getPrivateAccessSettingsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPrivateAccessSettingsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPrivateNetworkGatewayRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2137,6 +3505,30 @@ func getPrivateNetworkGatewayRequestFromWire(w *getPrivateNetworkGatewayRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPrivateNetworkGatewayRequest) MarshalJSON() ([]byte, error) { + w, err := getPrivateNetworkGatewayRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPrivateNetworkGatewayRequest) UnmarshalJSON(data []byte) error { + var w getPrivateNetworkGatewayRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPrivateNetworkGatewayRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getVpcEndpointRequestWire struct { VpcEndpointId *string `json:"vpc_endpoint_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -2162,6 +3554,30 @@ func getVpcEndpointRequestFromWire(w *getVpcEndpointRequestWire) (*GetVpcEndpoin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetVpcEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := getVpcEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetVpcEndpointRequest) UnmarshalJSON(data []byte) error { + var w getVpcEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getVpcEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getWorkspaceNetworkOptionRequestWire struct { AccountId *string `json:"account_id,omitempty"` WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` @@ -2195,6 +3611,30 @@ func getWorkspaceNetworkOptionRequestFromWire(w *getWorkspaceNetworkOptionReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetWorkspaceNetworkOptionRequest) MarshalJSON() ([]byte, error) { + w, err := getWorkspaceNetworkOptionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetWorkspaceNetworkOptionRequest) UnmarshalJSON(data []byte) error { + var w getWorkspaceNetworkOptionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getWorkspaceNetworkOptionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type googleApiEndpointsWire struct { Endpoints []string `json:"endpoints,omitempty"` } @@ -2217,6 +3657,30 @@ func googleApiEndpointsFromWire(w *googleApiEndpointsWire) (*GoogleApiEndpoints, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GoogleApiEndpoints) MarshalJSON() ([]byte, error) { + w, err := googleApiEndpointsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GoogleApiEndpoints) UnmarshalJSON(data []byte) error { + var w googleApiEndpointsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := googleApiEndpointsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicyWire struct { PublicAccess *ingressNetworkPolicy_PublicAccessWire `json:"public_access,omitempty"` PrivateAccess *ingressNetworkPolicy_PrivateAccessWire `json:"private_access,omitempty"` @@ -2269,6 +3733,30 @@ func ingressNetworkPolicyFromWire(w *ingressNetworkPolicyWire) (*IngressNetworkP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_AccountApiDestinationWire struct { Scopes []string `json:"scopes,omitempty"` ScopeQualifier IngressNetworkPolicy_ApiScopeQualifier `json:"scope_qualifier,omitempty"` @@ -2294,6 +3782,30 @@ func ingressNetworkPolicy_AccountApiDestinationFromWire(w *ingressNetworkPolicy_ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_AccountApiDestination) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_AccountApiDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_AccountApiDestination) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_AccountApiDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_AccountApiDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_AccountDatabricksOneDestinationWire struct { AllDestinations *bool `json:"all_destinations,omitempty"` } @@ -2316,6 +3828,30 @@ func ingressNetworkPolicy_AccountDatabricksOneDestinationFromWire(w *ingressNetw }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_AccountDatabricksOneDestination) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_AccountDatabricksOneDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_AccountDatabricksOneDestination) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_AccountDatabricksOneDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_AccountDatabricksOneDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_AccountUiDestinationWire struct { AllDestinations *bool `json:"all_destinations,omitempty"` } @@ -2338,6 +3874,30 @@ func ingressNetworkPolicy_AccountUiDestinationFromWire(w *ingressNetworkPolicy_A }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_AccountUiDestination) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_AccountUiDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_AccountUiDestination) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_AccountUiDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_AccountUiDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_AppsRuntimeDestinationWire struct { AllDestinations *bool `json:"all_destinations,omitempty"` } @@ -2360,6 +3920,30 @@ func ingressNetworkPolicy_AppsRuntimeDestinationFromWire(w *ingressNetworkPolicy }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_AppsRuntimeDestination) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_AppsRuntimeDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_AppsRuntimeDestination) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_AppsRuntimeDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_AppsRuntimeDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_AuthenticationWire struct { IdentityType IngressNetworkPolicy_Authentication_IdentityType `json:"identity_type,omitempty"` Identities []ingressNetworkPolicy_AuthenticationIdentityWire `json:"identities,omitempty"` @@ -2393,6 +3977,30 @@ func ingressNetworkPolicy_AuthenticationFromWire(w *ingressNetworkPolicy_Authent }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_Authentication) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_AuthenticationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_Authentication) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_AuthenticationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_AuthenticationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_AuthenticationIdentityWire struct { PrincipalType IngressNetworkPolicy_AuthenticationIdentity_PrincipalType `json:"principal_type,omitempty"` PrincipalId *wireInt64 `json:"principal_id,omitempty"` @@ -2426,6 +4034,30 @@ func ingressNetworkPolicy_AuthenticationIdentityFromWire(w *ingressNetworkPolicy }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_AuthenticationIdentity) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_AuthenticationIdentityToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_AuthenticationIdentity) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_AuthenticationIdentityWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_AuthenticationIdentityFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_CrossWorkspaceAccessWire struct { RestrictionMode IngressNetworkPolicy_CrossWorkspaceAccess_RestrictionMode `json:"restriction_mode,omitempty"` DenyRules []ingressNetworkPolicy_CrossWorkspaceIngressRuleWire `json:"deny_rules,omitempty"` @@ -2470,6 +4102,30 @@ func ingressNetworkPolicy_CrossWorkspaceAccessFromWire(w *ingressNetworkPolicy_C }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_CrossWorkspaceAccess) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_CrossWorkspaceAccessToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_CrossWorkspaceAccess) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_CrossWorkspaceAccessWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_CrossWorkspaceAccessFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_CrossWorkspaceIngressRuleWire struct { Origin *ingressNetworkPolicy_CrossWorkspaceRequestOriginWire `json:"origin,omitempty"` Destination *ingressNetworkPolicy_RequestDestinationWire `json:"destination,omitempty"` @@ -2525,6 +4181,30 @@ func ingressNetworkPolicy_CrossWorkspaceIngressRuleFromWire(w *ingressNetworkPol }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_CrossWorkspaceIngressRule) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_CrossWorkspaceIngressRuleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_CrossWorkspaceIngressRule) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_CrossWorkspaceIngressRuleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_CrossWorkspaceIngressRuleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_CrossWorkspaceRequestOriginWire struct { AllSourceWorkspaces *bool `json:"all_source_workspaces,omitempty"` SelectedWorkspaces *ingressNetworkPolicy_WorkspaceIdListWire `json:"selected_workspaces,omitempty"` @@ -2589,6 +4269,30 @@ func ingressNetworkPolicy_CrossWorkspaceRequestOriginFromWire(w *ingressNetworkP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_CrossWorkspaceRequestOrigin) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_CrossWorkspaceRequestOriginToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_CrossWorkspaceRequestOrigin) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_CrossWorkspaceRequestOriginWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_CrossWorkspaceRequestOriginFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_EndpointsWire struct { EndpointIds []string `json:"endpoint_ids,omitempty"` } @@ -2611,6 +4315,30 @@ func ingressNetworkPolicy_EndpointsFromWire(w *ingressNetworkPolicy_EndpointsWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_Endpoints) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_EndpointsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_Endpoints) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_EndpointsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_EndpointsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_IpRangesWire struct { IpRanges []string `json:"ip_ranges,omitempty"` } @@ -2633,6 +4361,30 @@ func ingressNetworkPolicy_IpRangesFromWire(w *ingressNetworkPolicy_IpRangesWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_IpRanges) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_IpRangesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_IpRanges) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_IpRangesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_IpRangesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_LakebaseRuntimeDestinationWire struct { AllDestinations *bool `json:"all_destinations,omitempty"` } @@ -2655,6 +4407,30 @@ func ingressNetworkPolicy_LakebaseRuntimeDestinationFromWire(w *ingressNetworkPo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_LakebaseRuntimeDestination) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_LakebaseRuntimeDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_LakebaseRuntimeDestination) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_LakebaseRuntimeDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_LakebaseRuntimeDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_PrivateAccessWire struct { RestrictionMode IngressNetworkPolicy_PrivateAccess_RestrictionMode `json:"restriction_mode,omitempty"` DenyRules []ingressNetworkPolicy_PrivateIngressRuleWire `json:"deny_rules,omitempty"` @@ -2699,6 +4475,30 @@ func ingressNetworkPolicy_PrivateAccessFromWire(w *ingressNetworkPolicy_PrivateA }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_PrivateAccess) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_PrivateAccessToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_PrivateAccess) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_PrivateAccessWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_PrivateAccessFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_PrivateIngressRuleWire struct { Origin *ingressNetworkPolicy_PrivateRequestOriginWire `json:"origin,omitempty"` Destination *ingressNetworkPolicy_RequestDestinationWire `json:"destination,omitempty"` @@ -2754,6 +4554,30 @@ func ingressNetworkPolicy_PrivateIngressRuleFromWire(w *ingressNetworkPolicy_Pri }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_PrivateIngressRule) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_PrivateIngressRuleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_PrivateIngressRule) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_PrivateIngressRuleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_PrivateIngressRuleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_PrivateRequestOriginWire struct { Endpoints *ingressNetworkPolicy_EndpointsWire `json:"endpoints,omitempty"` AllRegisteredEndpoints *bool `json:"all_registered_endpoints,omitempty"` @@ -2842,6 +4666,30 @@ func ingressNetworkPolicy_PrivateRequestOriginFromWire(w *ingressNetworkPolicy_P }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_PrivateRequestOrigin) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_PrivateRequestOriginToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_PrivateRequestOrigin) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_PrivateRequestOriginWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_PrivateRequestOriginFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_PublicAccessWire struct { RestrictionMode IngressNetworkPolicy_PublicAccess_RestrictionMode `json:"restriction_mode,omitempty"` DenyRules []ingressNetworkPolicy_PublicIngressRuleWire `json:"deny_rules,omitempty"` @@ -2886,6 +4734,30 @@ func ingressNetworkPolicy_PublicAccessFromWire(w *ingressNetworkPolicy_PublicAcc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_PublicAccess) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_PublicAccessToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_PublicAccess) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_PublicAccessWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_PublicAccessFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_PublicIngressRuleWire struct { Origin *ingressNetworkPolicy_PublicRequestOriginWire `json:"origin,omitempty"` Destination *ingressNetworkPolicy_RequestDestinationWire `json:"destination,omitempty"` @@ -2941,6 +4813,30 @@ func ingressNetworkPolicy_PublicIngressRuleFromWire(w *ingressNetworkPolicy_Publ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_PublicIngressRule) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_PublicIngressRuleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_PublicIngressRule) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_PublicIngressRuleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_PublicIngressRuleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_PublicRequestOriginWire struct { AllIpRanges *bool `json:"all_ip_ranges,omitempty"` IncludedIpRanges *ingressNetworkPolicy_IpRangesWire `json:"included_ip_ranges,omitempty"` @@ -3025,6 +4921,30 @@ func ingressNetworkPolicy_PublicRequestOriginFromWire(w *ingressNetworkPolicy_Pu }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_PublicRequestOrigin) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_PublicRequestOriginToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_PublicRequestOrigin) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_PublicRequestOriginWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_PublicRequestOriginFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_RequestDestinationWire struct { AllDestinations *bool `json:"all_destinations,omitempty"` WorkspaceUi *ingressNetworkPolicy_WorkspaceUiDestinationWire `json:"workspace_ui,omitempty"` @@ -3124,6 +5044,30 @@ func ingressNetworkPolicy_RequestDestinationFromWire(w *ingressNetworkPolicy_Req }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_RequestDestination) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_RequestDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_RequestDestination) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_RequestDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_RequestDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_WorkspaceApiDestinationWire struct { Scopes []string `json:"scopes,omitempty"` ScopeQualifier IngressNetworkPolicy_ApiScopeQualifier `json:"scope_qualifier,omitempty"` @@ -3145,11 +5089,35 @@ func ingressNetworkPolicy_WorkspaceApiDestinationFromWire(w *ingressNetworkPolic if w == nil { return nil, nil } - return &IngressNetworkPolicy_WorkspaceApiDestination{ - Scopes: w.Scopes, - ScopeQualifier: w.ScopeQualifier, - ExcludedScopes: w.ExcludedScopes, - }, nil + return &IngressNetworkPolicy_WorkspaceApiDestination{ + Scopes: w.Scopes, + ScopeQualifier: w.ScopeQualifier, + ExcludedScopes: w.ExcludedScopes, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_WorkspaceApiDestination) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_WorkspaceApiDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_WorkspaceApiDestination) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_WorkspaceApiDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_WorkspaceApiDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil } type ingressNetworkPolicy_WorkspaceIdListWire struct { @@ -3182,6 +5150,30 @@ func ingressNetworkPolicy_WorkspaceIdListFromWire(w *ingressNetworkPolicy_Worksp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_WorkspaceIdList) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_WorkspaceIdListToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_WorkspaceIdList) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_WorkspaceIdListWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_WorkspaceIdListFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingressNetworkPolicy_WorkspaceUiDestinationWire struct { AllDestinations *bool `json:"all_destinations,omitempty"` } @@ -3204,6 +5196,30 @@ func ingressNetworkPolicy_WorkspaceUiDestinationFromWire(w *ingressNetworkPolicy }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngressNetworkPolicy_WorkspaceUiDestination) MarshalJSON() ([]byte, error) { + w, err := ingressNetworkPolicy_WorkspaceUiDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngressNetworkPolicy_WorkspaceUiDestination) UnmarshalJSON(data []byte) error { + var w ingressNetworkPolicy_WorkspaceUiDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingressNetworkPolicy_WorkspaceUiDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ipAccessListWire struct { ListId *string `json:"list_id,omitempty"` Label *string `json:"label,omitempty"` @@ -3285,6 +5301,30 @@ func ipAccessListFromWire(w *ipAccessListWire) (*IpAccessList, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IpAccessList) MarshalJSON() ([]byte, error) { + w, err := ipAccessListToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IpAccessList) UnmarshalJSON(data []byte) error { + var w ipAccessListWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ipAccessListFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAccountIpAccessListsRequestWire struct { AccountId *string `json:"account_id,omitempty"` } @@ -3307,6 +5347,30 @@ func listAccountIpAccessListsRequestFromWire(w *listAccountIpAccessListsRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAccountIpAccessListsRequest) MarshalJSON() ([]byte, error) { + w, err := listAccountIpAccessListsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAccountIpAccessListsRequest) UnmarshalJSON(data []byte) error { + var w listAccountIpAccessListsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAccountIpAccessListsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAccountIpAccessListsResponseWire struct { IpAccessLists []accountIpAccessListWire `json:"ip_access_lists,omitempty"` } @@ -3337,6 +5401,30 @@ func listAccountIpAccessListsResponseFromWire(w *listAccountIpAccessListsRespons }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAccountIpAccessListsResponse) MarshalJSON() ([]byte, error) { + w, err := listAccountIpAccessListsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAccountIpAccessListsResponse) UnmarshalJSON(data []byte) error { + var w listAccountIpAccessListsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAccountIpAccessListsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listEndpointsRequestWire struct { Parent *string `json:"parent,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -3365,6 +5453,30 @@ func listEndpointsRequestFromWire(w *listEndpointsRequestWire) (*ListEndpointsRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListEndpointsRequest) MarshalJSON() ([]byte, error) { + w, err := listEndpointsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListEndpointsRequest) UnmarshalJSON(data []byte) error { + var w listEndpointsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listEndpointsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listEndpointsResponseWire struct { Items []endpointWire `json:"items,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3398,6 +5510,30 @@ func listEndpointsResponseFromWire(w *listEndpointsResponseWire) (*ListEndpoints }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListEndpointsResponse) MarshalJSON() ([]byte, error) { + w, err := listEndpointsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListEndpointsResponse) UnmarshalJSON(data []byte) error { + var w listEndpointsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listEndpointsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listIpAccessListsWire struct { } @@ -3415,6 +5551,30 @@ func listIpAccessListsFromWire(w *listIpAccessListsWire) (*ListIpAccessLists, er return &ListIpAccessLists{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListIpAccessLists) MarshalJSON() ([]byte, error) { + w, err := listIpAccessListsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListIpAccessLists) UnmarshalJSON(data []byte) error { + var w listIpAccessListsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listIpAccessListsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listIpAccessListsResponseWire struct { IpAccessLists []ipAccessListWire `json:"ip_access_lists,omitempty"` } @@ -3445,6 +5605,30 @@ func listIpAccessListsResponseFromWire(w *listIpAccessListsResponseWire) (*ListI }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListIpAccessListsResponse) MarshalJSON() ([]byte, error) { + w, err := listIpAccessListsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListIpAccessListsResponse) UnmarshalJSON(data []byte) error { + var w listIpAccessListsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listIpAccessListsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listNccPrivateEndpointRulesRequestWire struct { AccountId *string `json:"account_id,omitempty"` NetworkConnectivityConfigId *string `json:"network_connectivity_config_id,omitempty"` @@ -3473,6 +5657,30 @@ func listNccPrivateEndpointRulesRequestFromWire(w *listNccPrivateEndpointRulesRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListNccPrivateEndpointRulesRequest) MarshalJSON() ([]byte, error) { + w, err := listNccPrivateEndpointRulesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListNccPrivateEndpointRulesRequest) UnmarshalJSON(data []byte) error { + var w listNccPrivateEndpointRulesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listNccPrivateEndpointRulesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listNccPrivateEndpointRulesResponseWire struct { Items []nccPrivateEndpointRuleWire `json:"items,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3506,6 +5714,30 @@ func listNccPrivateEndpointRulesResponseFromWire(w *listNccPrivateEndpointRulesR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListNccPrivateEndpointRulesResponse) MarshalJSON() ([]byte, error) { + w, err := listNccPrivateEndpointRulesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListNccPrivateEndpointRulesResponse) UnmarshalJSON(data []byte) error { + var w listNccPrivateEndpointRulesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listNccPrivateEndpointRulesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listNetworkConnectivityConfigsRequestWire struct { AccountId *string `json:"account_id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -3531,6 +5763,30 @@ func listNetworkConnectivityConfigsRequestFromWire(w *listNetworkConnectivityCon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListNetworkConnectivityConfigsRequest) MarshalJSON() ([]byte, error) { + w, err := listNetworkConnectivityConfigsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListNetworkConnectivityConfigsRequest) UnmarshalJSON(data []byte) error { + var w listNetworkConnectivityConfigsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listNetworkConnectivityConfigsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listNetworkConnectivityConfigsResponseWire struct { Items []networkConnectivityConfigWire `json:"items,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3564,6 +5820,30 @@ func listNetworkConnectivityConfigsResponseFromWire(w *listNetworkConnectivityCo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListNetworkConnectivityConfigsResponse) MarshalJSON() ([]byte, error) { + w, err := listNetworkConnectivityConfigsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListNetworkConnectivityConfigsResponse) UnmarshalJSON(data []byte) error { + var w listNetworkConnectivityConfigsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listNetworkConnectivityConfigsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listNetworkPoliciesRequestWire struct { AccountId *string `json:"account_id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -3589,6 +5869,30 @@ func listNetworkPoliciesRequestFromWire(w *listNetworkPoliciesRequestWire) (*Lis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListNetworkPoliciesRequest) MarshalJSON() ([]byte, error) { + w, err := listNetworkPoliciesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListNetworkPoliciesRequest) UnmarshalJSON(data []byte) error { + var w listNetworkPoliciesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listNetworkPoliciesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listNetworkPoliciesResponseWire struct { Items []accountNetworkPolicyWire `json:"items,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3622,6 +5926,30 @@ func listNetworkPoliciesResponseFromWire(w *listNetworkPoliciesResponseWire) (*L }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListNetworkPoliciesResponse) MarshalJSON() ([]byte, error) { + w, err := listNetworkPoliciesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListNetworkPoliciesResponse) UnmarshalJSON(data []byte) error { + var w listNetworkPoliciesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listNetworkPoliciesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listNetworkRequestWire struct { AccountId *string `json:"account_id,omitempty"` } @@ -3644,6 +5972,30 @@ func listNetworkRequestFromWire(w *listNetworkRequestWire) (*ListNetworkRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListNetworkRequest) MarshalJSON() ([]byte, error) { + w, err := listNetworkRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListNetworkRequest) UnmarshalJSON(data []byte) error { + var w listNetworkRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listNetworkRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listNetworkResponseWire struct { Networks []networkWire `json:"networks,omitempty"` } @@ -3674,6 +6026,30 @@ func listNetworkResponseFromWire(w *listNetworkResponseWire) (*ListNetworkRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListNetworkResponse) MarshalJSON() ([]byte, error) { + w, err := listNetworkResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListNetworkResponse) UnmarshalJSON(data []byte) error { + var w listNetworkResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listNetworkResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPrivateAccessSettingsRequestWire struct { AccountId *string `json:"account_id,omitempty"` } @@ -3696,6 +6072,30 @@ func listPrivateAccessSettingsRequestFromWire(w *listPrivateAccessSettingsReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPrivateAccessSettingsRequest) MarshalJSON() ([]byte, error) { + w, err := listPrivateAccessSettingsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPrivateAccessSettingsRequest) UnmarshalJSON(data []byte) error { + var w listPrivateAccessSettingsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPrivateAccessSettingsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPrivateAccessSettingsResponseWire struct { PrivateAccessSettings []privateAccessSettingsWire `json:"private_access_settings,omitempty"` } @@ -3726,6 +6126,30 @@ func listPrivateAccessSettingsResponseFromWire(w *listPrivateAccessSettingsRespo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPrivateAccessSettingsResponse) MarshalJSON() ([]byte, error) { + w, err := listPrivateAccessSettingsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPrivateAccessSettingsResponse) UnmarshalJSON(data []byte) error { + var w listPrivateAccessSettingsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPrivateAccessSettingsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPrivateNetworkGatewaysRequestWire struct { Parent *string `json:"parent,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -3751,6 +6175,30 @@ func listPrivateNetworkGatewaysRequestFromWire(w *listPrivateNetworkGatewaysRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPrivateNetworkGatewaysRequest) MarshalJSON() ([]byte, error) { + w, err := listPrivateNetworkGatewaysRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPrivateNetworkGatewaysRequest) UnmarshalJSON(data []byte) error { + var w listPrivateNetworkGatewaysRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPrivateNetworkGatewaysRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPrivateNetworkGatewaysResponseWire struct { PrivateNetworkGateways []privateNetworkGatewayWire `json:"private_network_gateways,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3784,6 +6232,30 @@ func listPrivateNetworkGatewaysResponseFromWire(w *listPrivateNetworkGatewaysRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPrivateNetworkGatewaysResponse) MarshalJSON() ([]byte, error) { + w, err := listPrivateNetworkGatewaysResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPrivateNetworkGatewaysResponse) UnmarshalJSON(data []byte) error { + var w listPrivateNetworkGatewaysResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPrivateNetworkGatewaysResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listVpcEndpointRequestWire struct { AccountId *string `json:"account_id,omitempty"` } @@ -3806,6 +6278,30 @@ func listVpcEndpointRequestFromWire(w *listVpcEndpointRequestWire) (*ListVpcEndp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListVpcEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := listVpcEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListVpcEndpointRequest) UnmarshalJSON(data []byte) error { + var w listVpcEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listVpcEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listVpcEndpointResponseWire struct { VpcEndpoints []vpcEndpointWire `json:"vpc_endpoints,omitempty"` } @@ -3836,6 +6332,30 @@ func listVpcEndpointResponseFromWire(w *listVpcEndpointResponseWire) (*ListVpcEn }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListVpcEndpointResponse) MarshalJSON() ([]byte, error) { + w, err := listVpcEndpointResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListVpcEndpointResponse) UnmarshalJSON(data []byte) error { + var w listVpcEndpointResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listVpcEndpointResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type nccPrivateEndpointRuleWire struct { RuleId *string `json:"rule_id,omitempty"` NetworkConnectivityConfigId *string `json:"network_connectivity_config_id,omitempty"` @@ -3963,6 +6483,30 @@ func nccPrivateEndpointRuleFromWire(w *nccPrivateEndpointRuleWire) (*NccPrivateE }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NccPrivateEndpointRule) MarshalJSON() ([]byte, error) { + w, err := nccPrivateEndpointRuleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NccPrivateEndpointRule) UnmarshalJSON(data []byte) error { + var w nccPrivateEndpointRuleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := nccPrivateEndpointRuleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type networkWire struct { NetworkId *string `json:"network_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -4091,6 +6635,30 @@ func networkFromWire(w *networkWire) (*Network, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Network) MarshalJSON() ([]byte, error) { + w, err := networkToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Network) UnmarshalJSON(data []byte) error { + var w networkWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := networkFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type networkConnectivityConfigWire struct { NetworkConnectivityConfigId *string `json:"network_connectivity_config_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -4166,6 +6734,30 @@ func networkConnectivityConfigFromWire(w *networkConnectivityConfigWire) (*Netwo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NetworkConnectivityConfig) MarshalJSON() ([]byte, error) { + w, err := networkConnectivityConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NetworkConnectivityConfig) UnmarshalJSON(data []byte) error { + var w networkConnectivityConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := networkConnectivityConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type networkConnectivityConfigAwsPrivateEndpointRuleWire struct { RuleId *string `json:"rule_id,omitempty"` NetworkConnectivityConfigId *string `json:"network_connectivity_config_id,omitempty"` @@ -4251,6 +6843,30 @@ func networkConnectivityConfigAwsPrivateEndpointRuleFromWire(w *networkConnectiv }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NetworkConnectivityConfigAwsPrivateEndpointRule) MarshalJSON() ([]byte, error) { + w, err := networkConnectivityConfigAwsPrivateEndpointRuleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NetworkConnectivityConfigAwsPrivateEndpointRule) UnmarshalJSON(data []byte) error { + var w networkConnectivityConfigAwsPrivateEndpointRuleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := networkConnectivityConfigAwsPrivateEndpointRuleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type networkConnectivityConfigAzurePrivateEndpointRuleWire struct { RuleId *string `json:"rule_id,omitempty"` NetworkConnectivityConfigId *string `json:"network_connectivity_config_id,omitempty"` @@ -4330,6 +6946,30 @@ func networkConnectivityConfigAzurePrivateEndpointRuleFromWire(w *networkConnect }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NetworkConnectivityConfigAzurePrivateEndpointRule) MarshalJSON() ([]byte, error) { + w, err := networkConnectivityConfigAzurePrivateEndpointRuleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NetworkConnectivityConfigAzurePrivateEndpointRule) UnmarshalJSON(data []byte) error { + var w networkConnectivityConfigAzurePrivateEndpointRuleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := networkConnectivityConfigAzurePrivateEndpointRuleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type networkConnectivityConfigEgressConfigWire struct { } @@ -4347,6 +6987,30 @@ func networkConnectivityConfigEgressConfigFromWire(w *networkConnectivityConfigE return &NetworkConnectivityConfigEgressConfig{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NetworkConnectivityConfigEgressConfig) MarshalJSON() ([]byte, error) { + w, err := networkConnectivityConfigEgressConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NetworkConnectivityConfigEgressConfig) UnmarshalJSON(data []byte) error { + var w networkConnectivityConfigEgressConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := networkConnectivityConfigEgressConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type networkConnectivityConfigEgressConfig_DefaultRuleWire struct { AzureServiceEndpointRule *networkConnectivityConfigEgressConfig_DefaultRule_AzureServiceEndpointRuleWire `json:"azure_service_endpoint_rule,omitempty"` AwsStableIpRule *networkConnectivityConfigEgressConfig_DefaultRule_AwsStableIpRuleWire `json:"aws_stable_ip_rule,omitempty"` @@ -4388,6 +7052,30 @@ func networkConnectivityConfigEgressConfig_DefaultRuleFromWire(w *networkConnect }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NetworkConnectivityConfigEgressConfig_DefaultRule) MarshalJSON() ([]byte, error) { + w, err := networkConnectivityConfigEgressConfig_DefaultRuleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NetworkConnectivityConfigEgressConfig_DefaultRule) UnmarshalJSON(data []byte) error { + var w networkConnectivityConfigEgressConfig_DefaultRuleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := networkConnectivityConfigEgressConfig_DefaultRuleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type networkConnectivityConfigEgressConfig_DefaultRule_AwsStableIpRuleWire struct { CidrBlocks []string `json:"cidr_blocks,omitempty"` } @@ -4410,6 +7098,30 @@ func networkConnectivityConfigEgressConfig_DefaultRule_AwsStableIpRuleFromWire(w }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NetworkConnectivityConfigEgressConfig_DefaultRule_AwsStableIpRule) MarshalJSON() ([]byte, error) { + w, err := networkConnectivityConfigEgressConfig_DefaultRule_AwsStableIpRuleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NetworkConnectivityConfigEgressConfig_DefaultRule_AwsStableIpRule) UnmarshalJSON(data []byte) error { + var w networkConnectivityConfigEgressConfig_DefaultRule_AwsStableIpRuleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := networkConnectivityConfigEgressConfig_DefaultRule_AwsStableIpRuleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type networkConnectivityConfigEgressConfig_DefaultRule_AzureServiceEndpointRuleWire struct { TargetRegion *string `json:"target_region,omitempty"` TargetServices []EgressResourceType `json:"target_services,omitempty"` @@ -4438,6 +7150,30 @@ func networkConnectivityConfigEgressConfig_DefaultRule_AzureServiceEndpointRuleF }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NetworkConnectivityConfigEgressConfig_DefaultRule_AzureServiceEndpointRule) MarshalJSON() ([]byte, error) { + w, err := networkConnectivityConfigEgressConfig_DefaultRule_AzureServiceEndpointRuleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NetworkConnectivityConfigEgressConfig_DefaultRule_AzureServiceEndpointRule) UnmarshalJSON(data []byte) error { + var w networkConnectivityConfigEgressConfig_DefaultRule_AzureServiceEndpointRuleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := networkConnectivityConfigEgressConfig_DefaultRule_AzureServiceEndpointRuleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type networkHealthWire struct { ErrorType *string `json:"error_type,omitempty"` ErrorMessage *string `json:"error_message,omitempty"` @@ -4463,6 +7199,30 @@ func networkHealthFromWire(w *networkHealthWire) (*NetworkHealth, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NetworkHealth) MarshalJSON() ([]byte, error) { + w, err := networkHealthToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NetworkHealth) UnmarshalJSON(data []byte) error { + var w networkHealthWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := networkHealthFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type networkVpcEndpointsWire struct { RestApi []string `json:"rest_api,omitempty"` DataplaneRelay []string `json:"dataplane_relay,omitempty"` @@ -4488,6 +7248,30 @@ func networkVpcEndpointsFromWire(w *networkVpcEndpointsWire) (*NetworkVpcEndpoin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NetworkVpcEndpoints) MarshalJSON() ([]byte, error) { + w, err := networkVpcEndpointsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NetworkVpcEndpoints) UnmarshalJSON(data []byte) error { + var w networkVpcEndpointsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := networkVpcEndpointsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type networkWarningWire struct { WarningType *string `json:"warning_type,omitempty"` WarningMessage *string `json:"warning_message,omitempty"` @@ -4513,6 +7297,30 @@ func networkWarningFromWire(w *networkWarningWire) (*NetworkWarning, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NetworkWarning) MarshalJSON() ([]byte, error) { + w, err := networkWarningToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NetworkWarning) UnmarshalJSON(data []byte) error { + var w networkWarningWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := networkWarningFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type operationWire struct { Name *string `json:"name,omitempty"` Metadata json.RawMessage `json:"metadata,omitempty"` @@ -4586,6 +7394,30 @@ func operationFromWire(w *operationWire) (*Operation, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Operation) MarshalJSON() ([]byte, error) { + w, err := operationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Operation) UnmarshalJSON(data []byte) error { + var w operationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := operationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type privateAccessSettingsWire struct { PrivateAccessSettingsId *string `json:"private_access_settings_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -4626,6 +7458,30 @@ func privateAccessSettingsFromWire(w *privateAccessSettingsWire) (*PrivateAccess }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PrivateAccessSettings) MarshalJSON() ([]byte, error) { + w, err := privateAccessSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PrivateAccessSettings) UnmarshalJSON(data []byte) error { + var w privateAccessSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := privateAccessSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type privateNetworkGatewayWire struct { Name *string `json:"name,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -4744,6 +7600,30 @@ func privateNetworkGatewayFromWire(w *privateNetworkGatewayWire) (*PrivateNetwor }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PrivateNetworkGateway) MarshalJSON() ([]byte, error) { + w, err := privateNetworkGatewayToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PrivateNetworkGateway) UnmarshalJSON(data []byte) error { + var w privateNetworkGatewayWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := privateNetworkGatewayFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type privateNetworkGateway_AwsCloudConnectionWire struct { GatewaySubnets []privateNetworkGateway_AwsCloudConnection_AwsGatewaySubnetWire `json:"gateway_subnets,omitempty"` CrossAccountRole *privateNetworkGateway_AwsCloudConnection_CrossAccountRoleWire `json:"cross_account_role,omitempty"` @@ -4788,6 +7668,30 @@ func privateNetworkGateway_AwsCloudConnectionFromWire(w *privateNetworkGateway_A }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PrivateNetworkGateway_AwsCloudConnection) MarshalJSON() ([]byte, error) { + w, err := privateNetworkGateway_AwsCloudConnectionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PrivateNetworkGateway_AwsCloudConnection) UnmarshalJSON(data []byte) error { + var w privateNetworkGateway_AwsCloudConnectionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := privateNetworkGateway_AwsCloudConnectionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type privateNetworkGateway_AwsCloudConnection_AwsGatewaySubnetWire struct { SubnetId *string `json:"subnet_id,omitempty"` } @@ -4810,6 +7714,30 @@ func privateNetworkGateway_AwsCloudConnection_AwsGatewaySubnetFromWire(w *privat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PrivateNetworkGateway_AwsCloudConnection_AwsGatewaySubnet) MarshalJSON() ([]byte, error) { + w, err := privateNetworkGateway_AwsCloudConnection_AwsGatewaySubnetToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PrivateNetworkGateway_AwsCloudConnection_AwsGatewaySubnet) UnmarshalJSON(data []byte) error { + var w privateNetworkGateway_AwsCloudConnection_AwsGatewaySubnetWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := privateNetworkGateway_AwsCloudConnection_AwsGatewaySubnetFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type privateNetworkGateway_AwsCloudConnection_CrossAccountRoleWire struct { RoleArn *string `json:"role_arn,omitempty"` } @@ -4832,6 +7760,30 @@ func privateNetworkGateway_AwsCloudConnection_CrossAccountRoleFromWire(w *privat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PrivateNetworkGateway_AwsCloudConnection_CrossAccountRole) MarshalJSON() ([]byte, error) { + w, err := privateNetworkGateway_AwsCloudConnection_CrossAccountRoleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PrivateNetworkGateway_AwsCloudConnection_CrossAccountRole) UnmarshalJSON(data []byte) error { + var w privateNetworkGateway_AwsCloudConnection_CrossAccountRoleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := privateNetworkGateway_AwsCloudConnection_CrossAccountRoleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type privateNetworkGateway_AzureCloudConnectionWire struct { GatewaySubnet *privateNetworkGateway_AzureCloudConnection_AzureGatewaySubnetWire `json:"gateway_subnet,omitempty"` } @@ -4857,9 +7809,33 @@ func privateNetworkGateway_AzureCloudConnectionFromWire(w *privateNetworkGateway if err != nil { return nil, fmt.Errorf("%s: %w", "PrivateNetworkGateway_AzureCloudConnection.GatewaySubnet", err) } - return &PrivateNetworkGateway_AzureCloudConnection{ - GatewaySubnet: gatewaySubnetPublicValue, - }, nil + return &PrivateNetworkGateway_AzureCloudConnection{ + GatewaySubnet: gatewaySubnetPublicValue, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PrivateNetworkGateway_AzureCloudConnection) MarshalJSON() ([]byte, error) { + w, err := privateNetworkGateway_AzureCloudConnectionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PrivateNetworkGateway_AzureCloudConnection) UnmarshalJSON(data []byte) error { + var w privateNetworkGateway_AzureCloudConnectionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := privateNetworkGateway_AzureCloudConnectionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil } type privateNetworkGateway_AzureCloudConnection_AzureGatewaySubnetWire struct { @@ -4884,6 +7860,30 @@ func privateNetworkGateway_AzureCloudConnection_AzureGatewaySubnetFromWire(w *pr }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PrivateNetworkGateway_AzureCloudConnection_AzureGatewaySubnet) MarshalJSON() ([]byte, error) { + w, err := privateNetworkGateway_AzureCloudConnection_AzureGatewaySubnetToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PrivateNetworkGateway_AzureCloudConnection_AzureGatewaySubnet) UnmarshalJSON(data []byte) error { + var w privateNetworkGateway_AzureCloudConnection_AzureGatewaySubnetWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := privateNetworkGateway_AzureCloudConnection_AzureGatewaySubnetFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type privateNetworkGateway_DestinationWire struct { DestinationType PrivateNetworkGateway_Destination_DestinationType `json:"destination_type,omitempty"` Value *string `json:"value,omitempty"` @@ -4909,6 +7909,30 @@ func privateNetworkGateway_DestinationFromWire(w *privateNetworkGateway_Destinat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PrivateNetworkGateway_Destination) MarshalJSON() ([]byte, error) { + w, err := privateNetworkGateway_DestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PrivateNetworkGateway_Destination) UnmarshalJSON(data []byte) error { + var w privateNetworkGateway_DestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := privateNetworkGateway_DestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type privateNetworkGateway_PrivateDnsResolverWire struct { ResolverType PrivateNetworkGateway_PrivateDnsResolver_ResolverType `json:"resolver_type,omitempty"` Value *string `json:"value,omitempty"` @@ -4934,6 +7958,30 @@ func privateNetworkGateway_PrivateDnsResolverFromWire(w *privateNetworkGateway_P }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PrivateNetworkGateway_PrivateDnsResolver) MarshalJSON() ([]byte, error) { + w, err := privateNetworkGateway_PrivateDnsResolverToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PrivateNetworkGateway_PrivateDnsResolver) UnmarshalJSON(data []byte) error { + var w privateNetworkGateway_PrivateDnsResolverWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := privateNetworkGateway_PrivateDnsResolverFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type privateNetworkGatewayOperationMetadataWire struct { OperationType PrivateNetworkGatewayOperationMetadata_OperationType `json:"operation_type,omitempty"` } @@ -4956,6 +8004,30 @@ func privateNetworkGatewayOperationMetadataFromWire(w *privateNetworkGatewayOper }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PrivateNetworkGatewayOperationMetadata) MarshalJSON() ([]byte, error) { + w, err := privateNetworkGatewayOperationMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PrivateNetworkGatewayOperationMetadata) UnmarshalJSON(data []byte) error { + var w privateNetworkGatewayOperationMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := privateNetworkGatewayOperationMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type replaceAccountIpAccessListRequestWire struct { AccountId *string `json:"account_id,omitempty"` ListId *string `json:"list_id,omitempty"` @@ -4993,6 +8065,30 @@ func replaceAccountIpAccessListRequestFromWire(w *replaceAccountIpAccessListRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ReplaceAccountIpAccessListRequest) MarshalJSON() ([]byte, error) { + w, err := replaceAccountIpAccessListRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ReplaceAccountIpAccessListRequest) UnmarshalJSON(data []byte) error { + var w replaceAccountIpAccessListRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := replaceAccountIpAccessListRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type replaceAccountIpAccessListResponseWire struct { IpAccessList *accountIpAccessListWire `json:"ip_access_list,omitempty"` } @@ -5023,6 +8119,30 @@ func replaceAccountIpAccessListResponseFromWire(w *replaceAccountIpAccessListRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ReplaceAccountIpAccessListResponse) MarshalJSON() ([]byte, error) { + w, err := replaceAccountIpAccessListResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ReplaceAccountIpAccessListResponse) UnmarshalJSON(data []byte) error { + var w replaceAccountIpAccessListResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := replaceAccountIpAccessListResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type replaceIpAccessListRequestWire struct { ListId *string `json:"list_id,omitempty"` Label *string `json:"label,omitempty"` @@ -5057,6 +8177,30 @@ func replaceIpAccessListRequestFromWire(w *replaceIpAccessListRequestWire) (*Rep }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ReplaceIpAccessListRequest) MarshalJSON() ([]byte, error) { + w, err := replaceIpAccessListRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ReplaceIpAccessListRequest) UnmarshalJSON(data []byte) error { + var w replaceIpAccessListRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := replaceIpAccessListRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type replaceIpAccessListResponseWire struct { IpAccessList *ipAccessListWire `json:"ip_access_list,omitempty"` } @@ -5087,6 +8231,30 @@ func replaceIpAccessListResponseFromWire(w *replaceIpAccessListResponseWire) (*R }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ReplaceIpAccessListResponse) MarshalJSON() ([]byte, error) { + w, err := replaceIpAccessListResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ReplaceIpAccessListResponse) UnmarshalJSON(data []byte) error { + var w replaceIpAccessListResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := replaceIpAccessListResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateAccountIpAccessListRequestWire struct { AccountId *string `json:"account_id,omitempty"` ListId *string `json:"list_id,omitempty"` @@ -5124,6 +8292,30 @@ func updateAccountIpAccessListRequestFromWire(w *updateAccountIpAccessListReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateAccountIpAccessListRequest) MarshalJSON() ([]byte, error) { + w, err := updateAccountIpAccessListRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateAccountIpAccessListRequest) UnmarshalJSON(data []byte) error { + var w updateAccountIpAccessListRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateAccountIpAccessListRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateAccountIpAccessListResponseWire struct { IpAccessList *accountIpAccessListWire `json:"ip_access_list,omitempty"` } @@ -5154,6 +8346,30 @@ func updateAccountIpAccessListResponseFromWire(w *updateAccountIpAccessListRespo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateAccountIpAccessListResponse) MarshalJSON() ([]byte, error) { + w, err := updateAccountIpAccessListResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateAccountIpAccessListResponse) UnmarshalJSON(data []byte) error { + var w updateAccountIpAccessListResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateAccountIpAccessListResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateIpAccessListRequestWire struct { ListId *string `json:"list_id,omitempty"` Label *string `json:"label,omitempty"` @@ -5188,6 +8404,30 @@ func updateIpAccessListRequestFromWire(w *updateIpAccessListRequestWire) (*Updat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateIpAccessListRequest) MarshalJSON() ([]byte, error) { + w, err := updateIpAccessListRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateIpAccessListRequest) UnmarshalJSON(data []byte) error { + var w updateIpAccessListRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateIpAccessListRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateIpAccessListResponseWire struct { IpAccessList *ipAccessListWire `json:"ip_access_list,omitempty"` } @@ -5218,6 +8458,30 @@ func updateIpAccessListResponseFromWire(w *updateIpAccessListResponseWire) (*Upd }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateIpAccessListResponse) MarshalJSON() ([]byte, error) { + w, err := updateIpAccessListResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateIpAccessListResponse) UnmarshalJSON(data []byte) error { + var w updateIpAccessListResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateIpAccessListResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateNccPrivateEndpointRuleRequestWire struct { NetworkConnectivityConfigId *string `json:"network_connectivity_config_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -5260,6 +8524,30 @@ func updateNccPrivateEndpointRuleRequestFromWire(w *updateNccPrivateEndpointRule }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateNccPrivateEndpointRuleRequest) MarshalJSON() ([]byte, error) { + w, err := updateNccPrivateEndpointRuleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateNccPrivateEndpointRuleRequest) UnmarshalJSON(data []byte) error { + var w updateNccPrivateEndpointRuleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateNccPrivateEndpointRuleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateNetworkConnectivityConfigRequestWire struct { AccountId *string `json:"account_id,omitempty"` NetworkConnectivityConfigId *string `json:"network_connectivity_config_id,omitempty"` @@ -5299,6 +8587,30 @@ func updateNetworkConnectivityConfigRequestFromWire(w *updateNetworkConnectivity }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateNetworkConnectivityConfigRequest) MarshalJSON() ([]byte, error) { + w, err := updateNetworkConnectivityConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateNetworkConnectivityConfigRequest) UnmarshalJSON(data []byte) error { + var w updateNetworkConnectivityConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateNetworkConnectivityConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateNetworkPolicyRequestWire struct { NetworkPolicyId *string `json:"network_policy_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -5335,6 +8647,30 @@ func updateNetworkPolicyRequestFromWire(w *updateNetworkPolicyRequestWire) (*Upd }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateNetworkPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := updateNetworkPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateNetworkPolicyRequest) UnmarshalJSON(data []byte) error { + var w updateNetworkPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateNetworkPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updatePrivateAccessSettingsRequestWire struct { CustomerFacingPrivateAccessSettings *privateAccessSettingsWire `json:"customer_facing_private_access_settings,omitempty"` } @@ -5365,6 +8701,30 @@ func updatePrivateAccessSettingsRequestFromWire(w *updatePrivateAccessSettingsRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdatePrivateAccessSettingsRequest) MarshalJSON() ([]byte, error) { + w, err := updatePrivateAccessSettingsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdatePrivateAccessSettingsRequest) UnmarshalJSON(data []byte) error { + var w updatePrivateAccessSettingsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updatePrivateAccessSettingsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updatePrivateEndpointRuleWire struct { RuleId *string `json:"rule_id,omitempty"` NetworkConnectivityConfigId *string `json:"network_connectivity_config_id,omitempty"` @@ -5492,6 +8852,30 @@ func updatePrivateEndpointRuleFromWire(w *updatePrivateEndpointRuleWire) (*Updat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdatePrivateEndpointRule) MarshalJSON() ([]byte, error) { + w, err := updatePrivateEndpointRuleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdatePrivateEndpointRule) UnmarshalJSON(data []byte) error { + var w updatePrivateEndpointRuleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updatePrivateEndpointRuleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updatePrivateNetworkGatewayRequestWire struct { PrivateNetworkGateway *privateNetworkGatewayWire `json:"private_network_gateway,omitempty"` UpdateMask *types.FieldMask[PrivateNetworkGateway] `json:"update_mask,omitempty"` @@ -5525,6 +8909,30 @@ func updatePrivateNetworkGatewayRequestFromWire(w *updatePrivateNetworkGatewayRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdatePrivateNetworkGatewayRequest) MarshalJSON() ([]byte, error) { + w, err := updatePrivateNetworkGatewayRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdatePrivateNetworkGatewayRequest) UnmarshalJSON(data []byte) error { + var w updatePrivateNetworkGatewayRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updatePrivateNetworkGatewayRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateWorkspaceNetworkOptionRequestWire struct { AccountId *string `json:"account_id,omitempty"` WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` @@ -5569,6 +8977,30 @@ func updateWorkspaceNetworkOptionRequestFromWire(w *updateWorkspaceNetworkOption }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateWorkspaceNetworkOptionRequest) MarshalJSON() ([]byte, error) { + w, err := updateWorkspaceNetworkOptionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateWorkspaceNetworkOptionRequest) UnmarshalJSON(data []byte) error { + var w updateWorkspaceNetworkOptionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateWorkspaceNetworkOptionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type vpcEndpointWire struct { VpcEndpointId *string `json:"vpc_endpoint_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -5648,6 +9080,30 @@ func vpcEndpointFromWire(w *vpcEndpointWire) (*VpcEndpoint, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v VpcEndpoint) MarshalJSON() ([]byte, error) { + w, err := vpcEndpointToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *VpcEndpoint) UnmarshalJSON(data []byte) error { + var w vpcEndpointWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := vpcEndpointFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type workspaceNetworkOptionWire struct { NetworkPolicyId *string `json:"network_policy_id,omitempty"` WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` @@ -5681,6 +9137,30 @@ func workspaceNetworkOptionFromWire(w *workspaceNetworkOptionWire) (*WorkspaceNe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WorkspaceNetworkOption) MarshalJSON() ([]byte, error) { + w, err := workspaceNetworkOptionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WorkspaceNetworkOption) UnmarshalJSON(data []byte) error { + var w workspaceNetworkOptionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := workspaceNetworkOptionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/notificationdestinations/CHANGELOG.md b/notificationdestinations/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/notificationdestinations/CHANGELOG.md +++ b/notificationdestinations/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/notificationdestinations/internal/version.go b/notificationdestinations/internal/version.go index 292199c5..4fa77dd3 100644 --- a/notificationdestinations/internal/version.go +++ b/notificationdestinations/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-notificationdestinations" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/notificationdestinations/v1/wire.go b/notificationdestinations/v1/wire.go index 41583600..b312f488 100644 --- a/notificationdestinations/v1/wire.go +++ b/notificationdestinations/v1/wire.go @@ -224,6 +224,30 @@ func configFromWire(w *configWire) (*Config, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Config) MarshalJSON() ([]byte, error) { + w, err := configToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Config) UnmarshalJSON(data []byte) error { + var w configWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := configFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createNotificationDestinationRequestWire struct { DisplayName *string `json:"display_name,omitempty"` Config *configWire `json:"config,omitempty"` @@ -257,6 +281,30 @@ func createNotificationDestinationRequestFromWire(w *createNotificationDestinati }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateNotificationDestinationRequest) MarshalJSON() ([]byte, error) { + w, err := createNotificationDestinationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateNotificationDestinationRequest) UnmarshalJSON(data []byte) error { + var w createNotificationDestinationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createNotificationDestinationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databricksAppSlackConfigWire struct { TeamId *string `json:"team_id,omitempty"` TeamIdSet *bool `json:"team_id_set,omitempty"` @@ -288,6 +336,30 @@ func databricksAppSlackConfigFromWire(w *databricksAppSlackConfigWire) (*Databri }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatabricksAppSlackConfig) MarshalJSON() ([]byte, error) { + w, err := databricksAppSlackConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatabricksAppSlackConfig) UnmarshalJSON(data []byte) error { + var w databricksAppSlackConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databricksAppSlackConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databricksAppTeamsConfigWire struct { TenantId *string `json:"tenant_id,omitempty"` TenantIdSet *bool `json:"tenant_id_set,omitempty"` @@ -325,6 +397,30 @@ func databricksAppTeamsConfigFromWire(w *databricksAppTeamsConfigWire) (*Databri }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatabricksAppTeamsConfig) MarshalJSON() ([]byte, error) { + w, err := databricksAppTeamsConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatabricksAppTeamsConfig) UnmarshalJSON(data []byte) error { + var w databricksAppTeamsConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databricksAppTeamsConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteNotificationDestinationRequestWire struct { Id *string `json:"id,omitempty"` } @@ -347,6 +443,30 @@ func deleteNotificationDestinationRequestFromWire(w *deleteNotificationDestinati }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteNotificationDestinationRequest) MarshalJSON() ([]byte, error) { + w, err := deleteNotificationDestinationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteNotificationDestinationRequest) UnmarshalJSON(data []byte) error { + var w deleteNotificationDestinationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteNotificationDestinationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type emailConfigWire struct { Addresses []string `json:"addresses,omitempty"` } @@ -369,6 +489,30 @@ func emailConfigFromWire(w *emailConfigWire) (*EmailConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EmailConfig) MarshalJSON() ([]byte, error) { + w, err := emailConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EmailConfig) UnmarshalJSON(data []byte) error { + var w emailConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := emailConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type emptyWire struct { } @@ -386,6 +530,30 @@ func emptyFromWire(w *emptyWire) (*Empty, error) { return &Empty{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Empty) MarshalJSON() ([]byte, error) { + w, err := emptyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Empty) UnmarshalJSON(data []byte) error { + var w emptyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := emptyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genericWebhookConfigWire struct { Url *string `json:"url,omitempty"` UrlSet *bool `json:"url_set,omitempty"` @@ -423,6 +591,30 @@ func genericWebhookConfigFromWire(w *genericWebhookConfigWire) (*GenericWebhookC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenericWebhookConfig) MarshalJSON() ([]byte, error) { + w, err := genericWebhookConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenericWebhookConfig) UnmarshalJSON(data []byte) error { + var w genericWebhookConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genericWebhookConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getNotificationDestinationRequestWire struct { Id *string `json:"id,omitempty"` } @@ -445,6 +637,30 @@ func getNotificationDestinationRequestFromWire(w *getNotificationDestinationRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetNotificationDestinationRequest) MarshalJSON() ([]byte, error) { + w, err := getNotificationDestinationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetNotificationDestinationRequest) UnmarshalJSON(data []byte) error { + var w getNotificationDestinationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getNotificationDestinationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listNotificationDestinationsRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *wireInt64 `json:"page_size,omitempty"` @@ -478,6 +694,30 @@ func listNotificationDestinationsRequestFromWire(w *listNotificationDestinations }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListNotificationDestinationsRequest) MarshalJSON() ([]byte, error) { + w, err := listNotificationDestinationsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListNotificationDestinationsRequest) UnmarshalJSON(data []byte) error { + var w listNotificationDestinationsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listNotificationDestinationsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listNotificationDestinationsResponseWire struct { Results []listNotificationDestinationsResultWire `json:"results,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -511,6 +751,30 @@ func listNotificationDestinationsResponseFromWire(w *listNotificationDestination }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListNotificationDestinationsResponse) MarshalJSON() ([]byte, error) { + w, err := listNotificationDestinationsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListNotificationDestinationsResponse) UnmarshalJSON(data []byte) error { + var w listNotificationDestinationsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listNotificationDestinationsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listNotificationDestinationsResultWire struct { Id *string `json:"id,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -550,6 +814,30 @@ func listNotificationDestinationsResultFromWire(w *listNotificationDestinationsR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListNotificationDestinationsResult) MarshalJSON() ([]byte, error) { + w, err := listNotificationDestinationsResultToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListNotificationDestinationsResult) UnmarshalJSON(data []byte) error { + var w listNotificationDestinationsResultWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listNotificationDestinationsResultFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type microsoftTeamsConfigWire struct { Url *string `json:"url,omitempty"` UrlSet *bool `json:"url_set,omitempty"` @@ -599,6 +887,30 @@ func microsoftTeamsConfigFromWire(w *microsoftTeamsConfigWire) (*MicrosoftTeamsC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MicrosoftTeamsConfig) MarshalJSON() ([]byte, error) { + w, err := microsoftTeamsConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MicrosoftTeamsConfig) UnmarshalJSON(data []byte) error { + var w microsoftTeamsConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := microsoftTeamsConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type notificationDestinationWire struct { Id *string `json:"id,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -638,6 +950,30 @@ func notificationDestinationFromWire(w *notificationDestinationWire) (*Notificat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NotificationDestination) MarshalJSON() ([]byte, error) { + w, err := notificationDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NotificationDestination) UnmarshalJSON(data []byte) error { + var w notificationDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := notificationDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pagerdutyConfigWire struct { IntegrationKey *string `json:"integration_key,omitempty"` IntegrationKeySet *bool `json:"integration_key_set,omitempty"` @@ -663,6 +999,30 @@ func pagerdutyConfigFromWire(w *pagerdutyConfigWire) (*PagerdutyConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PagerdutyConfig) MarshalJSON() ([]byte, error) { + w, err := pagerdutyConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PagerdutyConfig) UnmarshalJSON(data []byte) error { + var w pagerdutyConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pagerdutyConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type slackConfigWire struct { Url *string `json:"url,omitempty"` UrlSet *bool `json:"url_set,omitempty"` @@ -700,6 +1060,30 @@ func slackConfigFromWire(w *slackConfigWire) (*SlackConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SlackConfig) MarshalJSON() ([]byte, error) { + w, err := slackConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SlackConfig) UnmarshalJSON(data []byte) error { + var w slackConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := slackConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateNotificationDestinationRequestWire struct { Id *string `json:"id,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -736,6 +1120,30 @@ func updateNotificationDestinationRequestFromWire(w *updateNotificationDestinati }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateNotificationDestinationRequest) MarshalJSON() ([]byte, error) { + w, err := updateNotificationDestinationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateNotificationDestinationRequest) UnmarshalJSON(data []byte) error { + var w updateNotificationDestinationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateNotificationDestinationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/oauth/CHANGELOG.md b/oauth/CHANGELOG.md index ca91f64c..6714aa07 100644 --- a/oauth/CHANGELOG.md +++ b/oauth/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/oauth/internal/version.go b/oauth/internal/version.go index e3e620c2..430d4321 100644 --- a/oauth/internal/version.go +++ b/oauth/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-oauth" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/oauth/v1/wire.go b/oauth/v1/wire.go index 5de498c0..0dfcda0c 100644 --- a/oauth/v1/wire.go +++ b/oauth/v1/wire.go @@ -100,6 +100,30 @@ func createCustomOAuthAppIntegrationRequestFromWire(w *createCustomOAuthAppInteg }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCustomOAuthAppIntegrationRequest) MarshalJSON() ([]byte, error) { + w, err := createCustomOAuthAppIntegrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCustomOAuthAppIntegrationRequest) UnmarshalJSON(data []byte) error { + var w createCustomOAuthAppIntegrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCustomOAuthAppIntegrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createPublishedOAuthAppIntegrationRequestWire struct { AccountId *string `json:"account_id,omitempty"` AppId *string `json:"app_id,omitempty"` @@ -136,6 +160,30 @@ func createPublishedOAuthAppIntegrationRequestFromWire(w *createPublishedOAuthAp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreatePublishedOAuthAppIntegrationRequest) MarshalJSON() ([]byte, error) { + w, err := createPublishedOAuthAppIntegrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreatePublishedOAuthAppIntegrationRequest) UnmarshalJSON(data []byte) error { + var w createPublishedOAuthAppIntegrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createPublishedOAuthAppIntegrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createPublishedOAuthAppIntegrationResponseWire struct { IntegrationId *string `json:"integration_id,omitempty"` } @@ -158,6 +206,30 @@ func createPublishedOAuthAppIntegrationResponseFromWire(w *createPublishedOAuthA }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreatePublishedOAuthAppIntegrationResponse) MarshalJSON() ([]byte, error) { + w, err := createPublishedOAuthAppIntegrationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreatePublishedOAuthAppIntegrationResponse) UnmarshalJSON(data []byte) error { + var w createPublishedOAuthAppIntegrationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createPublishedOAuthAppIntegrationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type credentialPartitionIdWire struct { WorkspaceId *wireInt64 `json:"workspaceId,omitempty"` } @@ -188,6 +260,30 @@ func credentialPartitionIdFromWire(w *credentialPartitionIdWire) (*CredentialPar }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CredentialPartitionId) MarshalJSON() ([]byte, error) { + w, err := credentialPartitionIdToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CredentialPartitionId) UnmarshalJSON(data []byte) error { + var w credentialPartitionIdWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := credentialPartitionIdFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type customOAuthAppIntegrationWire struct { IntegrationId *string `json:"integration_id,omitempty"` ClientId *string `json:"client_id,omitempty"` @@ -256,6 +352,30 @@ func customOAuthAppIntegrationFromWire(w *customOAuthAppIntegrationWire) (*Custo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CustomOAuthAppIntegration) MarshalJSON() ([]byte, error) { + w, err := customOAuthAppIntegrationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CustomOAuthAppIntegration) UnmarshalJSON(data []byte) error { + var w customOAuthAppIntegrationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := customOAuthAppIntegrationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type customOAuthAppIntegrationSecretWire struct { IntegrationId *string `json:"integration_id,omitempty"` ClientId *string `json:"client_id,omitempty"` @@ -284,6 +404,30 @@ func customOAuthAppIntegrationSecretFromWire(w *customOAuthAppIntegrationSecretW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CustomOAuthAppIntegrationSecret) MarshalJSON() ([]byte, error) { + w, err := customOAuthAppIntegrationSecretToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CustomOAuthAppIntegrationSecret) UnmarshalJSON(data []byte) error { + var w customOAuthAppIntegrationSecretWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := customOAuthAppIntegrationSecretFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCustomOAuthAppIntegrationRequestWire struct { AccountId *string `json:"account_id,omitempty"` IntegrationId *string `json:"integration_id,omitempty"` @@ -309,6 +453,30 @@ func deleteCustomOAuthAppIntegrationRequestFromWire(w *deleteCustomOAuthAppInteg }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCustomOAuthAppIntegrationRequest) MarshalJSON() ([]byte, error) { + w, err := deleteCustomOAuthAppIntegrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCustomOAuthAppIntegrationRequest) UnmarshalJSON(data []byte) error { + var w deleteCustomOAuthAppIntegrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCustomOAuthAppIntegrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCustomOAuthAppIntegrationResponseWire struct { } @@ -326,6 +494,30 @@ func deleteCustomOAuthAppIntegrationResponseFromWire(w *deleteCustomOAuthAppInte return &DeleteCustomOAuthAppIntegrationResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCustomOAuthAppIntegrationResponse) MarshalJSON() ([]byte, error) { + w, err := deleteCustomOAuthAppIntegrationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCustomOAuthAppIntegrationResponse) UnmarshalJSON(data []byte) error { + var w deleteCustomOAuthAppIntegrationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCustomOAuthAppIntegrationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deletePublishedOAuthAppIntegrationRequestWire struct { AccountId *string `json:"account_id,omitempty"` IntegrationId *string `json:"integration_id,omitempty"` @@ -351,6 +543,30 @@ func deletePublishedOAuthAppIntegrationRequestFromWire(w *deletePublishedOAuthAp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeletePublishedOAuthAppIntegrationRequest) MarshalJSON() ([]byte, error) { + w, err := deletePublishedOAuthAppIntegrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeletePublishedOAuthAppIntegrationRequest) UnmarshalJSON(data []byte) error { + var w deletePublishedOAuthAppIntegrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deletePublishedOAuthAppIntegrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deletePublishedOAuthAppIntegrationResponseWire struct { } @@ -368,6 +584,30 @@ func deletePublishedOAuthAppIntegrationResponseFromWire(w *deletePublishedOAuthA return &DeletePublishedOAuthAppIntegrationResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeletePublishedOAuthAppIntegrationResponse) MarshalJSON() ([]byte, error) { + w, err := deletePublishedOAuthAppIntegrationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeletePublishedOAuthAppIntegrationResponse) UnmarshalJSON(data []byte) error { + var w deletePublishedOAuthAppIntegrationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deletePublishedOAuthAppIntegrationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type exchangeTokenWire struct { TokenType ExchangeTokenType `json:"tokenType,omitempty"` Credential *string `json:"credential,omitempty"` @@ -418,6 +658,30 @@ func exchangeTokenFromWire(w *exchangeTokenWire) (*ExchangeToken, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExchangeToken) MarshalJSON() ([]byte, error) { + w, err := exchangeTokenToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExchangeToken) UnmarshalJSON(data []byte) error { + var w exchangeTokenWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := exchangeTokenFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type exchangeTokenExchangeRequestWire struct { PartitionId *credentialPartitionIdWire `json:"partitionId,omitempty"` TokenType []ExchangeTokenType `json:"tokenType,omitempty"` @@ -454,6 +718,30 @@ func exchangeTokenExchangeRequestFromWire(w *exchangeTokenExchangeRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExchangeTokenExchangeRequest) MarshalJSON() ([]byte, error) { + w, err := exchangeTokenExchangeRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExchangeTokenExchangeRequest) UnmarshalJSON(data []byte) error { + var w exchangeTokenExchangeRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := exchangeTokenExchangeRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type exchangeTokenExchangeRequest_ResponseWire struct { Values []exchangeTokenWire `json:"values,omitempty"` } @@ -484,6 +772,30 @@ func exchangeTokenExchangeRequest_ResponseFromWire(w *exchangeTokenExchangeReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExchangeTokenExchangeRequest_Response) MarshalJSON() ([]byte, error) { + w, err := exchangeTokenExchangeRequest_ResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExchangeTokenExchangeRequest_Response) UnmarshalJSON(data []byte) error { + var w exchangeTokenExchangeRequest_ResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := exchangeTokenExchangeRequest_ResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCustomOAuthAppIntegrationRequestWire struct { AccountId *string `json:"account_id,omitempty"` IntegrationId *string `json:"integration_id,omitempty"` @@ -509,6 +821,30 @@ func getCustomOAuthAppIntegrationRequestFromWire(w *getCustomOAuthAppIntegration }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCustomOAuthAppIntegrationRequest) MarshalJSON() ([]byte, error) { + w, err := getCustomOAuthAppIntegrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCustomOAuthAppIntegrationRequest) UnmarshalJSON(data []byte) error { + var w getCustomOAuthAppIntegrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCustomOAuthAppIntegrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPublishedOAuthAppIntegrationRequestWire struct { AccountId *string `json:"account_id,omitempty"` IntegrationId *string `json:"integration_id,omitempty"` @@ -534,6 +870,30 @@ func getPublishedOAuthAppIntegrationRequestFromWire(w *getPublishedOAuthAppInteg }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPublishedOAuthAppIntegrationRequest) MarshalJSON() ([]byte, error) { + w, err := getPublishedOAuthAppIntegrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPublishedOAuthAppIntegrationRequest) UnmarshalJSON(data []byte) error { + var w getPublishedOAuthAppIntegrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPublishedOAuthAppIntegrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCustomOAuthAppIntegrationsRequestWire struct { AccountId *string `json:"account_id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -565,6 +925,30 @@ func listCustomOAuthAppIntegrationsRequestFromWire(w *listCustomOAuthAppIntegrat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCustomOAuthAppIntegrationsRequest) MarshalJSON() ([]byte, error) { + w, err := listCustomOAuthAppIntegrationsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCustomOAuthAppIntegrationsRequest) UnmarshalJSON(data []byte) error { + var w listCustomOAuthAppIntegrationsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCustomOAuthAppIntegrationsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCustomOAuthAppIntegrationsResponseWire struct { Apps []customOAuthAppIntegrationWire `json:"apps,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -598,6 +982,30 @@ func listCustomOAuthAppIntegrationsResponseFromWire(w *listCustomOAuthAppIntegra }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCustomOAuthAppIntegrationsResponse) MarshalJSON() ([]byte, error) { + w, err := listCustomOAuthAppIntegrationsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCustomOAuthAppIntegrationsResponse) UnmarshalJSON(data []byte) error { + var w listCustomOAuthAppIntegrationsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCustomOAuthAppIntegrationsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPublishedOAuthAppIntegrationsRequestWire struct { AccountId *string `json:"account_id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -626,6 +1034,30 @@ func listPublishedOAuthAppIntegrationsRequestFromWire(w *listPublishedOAuthAppIn }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPublishedOAuthAppIntegrationsRequest) MarshalJSON() ([]byte, error) { + w, err := listPublishedOAuthAppIntegrationsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPublishedOAuthAppIntegrationsRequest) UnmarshalJSON(data []byte) error { + var w listPublishedOAuthAppIntegrationsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPublishedOAuthAppIntegrationsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPublishedOAuthAppIntegrationsResponseWire struct { Apps []publishedOAuthAppIntegrationWire `json:"apps,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -659,6 +1091,30 @@ func listPublishedOAuthAppIntegrationsResponseFromWire(w *listPublishedOAuthAppI }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPublishedOAuthAppIntegrationsResponse) MarshalJSON() ([]byte, error) { + w, err := listPublishedOAuthAppIntegrationsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPublishedOAuthAppIntegrationsResponse) UnmarshalJSON(data []byte) error { + var w listPublishedOAuthAppIntegrationsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPublishedOAuthAppIntegrationsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPublishedOAuthAppsRequestWire struct { AccountId *string `json:"account_id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -687,6 +1143,30 @@ func listPublishedOAuthAppsRequestFromWire(w *listPublishedOAuthAppsRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPublishedOAuthAppsRequest) MarshalJSON() ([]byte, error) { + w, err := listPublishedOAuthAppsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPublishedOAuthAppsRequest) UnmarshalJSON(data []byte) error { + var w listPublishedOAuthAppsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPublishedOAuthAppsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPublishedOAuthAppsResponseWire struct { Apps []publishedOAuthAppWire `json:"apps,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -720,6 +1200,30 @@ func listPublishedOAuthAppsResponseFromWire(w *listPublishedOAuthAppsResponseWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPublishedOAuthAppsResponse) MarshalJSON() ([]byte, error) { + w, err := listPublishedOAuthAppsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPublishedOAuthAppsResponse) UnmarshalJSON(data []byte) error { + var w listPublishedOAuthAppsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPublishedOAuthAppsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type publishedOAuthAppWire struct { AppId *string `json:"app_id,omitempty"` ClientId *string `json:"client_id,omitempty"` @@ -760,6 +1264,30 @@ func publishedOAuthAppFromWire(w *publishedOAuthAppWire) (*PublishedOAuthApp, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PublishedOAuthApp) MarshalJSON() ([]byte, error) { + w, err := publishedOAuthAppToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PublishedOAuthApp) UnmarshalJSON(data []byte) error { + var w publishedOAuthAppWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := publishedOAuthAppFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type publishedOAuthAppIntegrationWire struct { AppId *string `json:"app_id,omitempty"` IntegrationId *string `json:"integration_id,omitempty"` @@ -813,6 +1341,30 @@ func publishedOAuthAppIntegrationFromWire(w *publishedOAuthAppIntegrationWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PublishedOAuthAppIntegration) MarshalJSON() ([]byte, error) { + w, err := publishedOAuthAppIntegrationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PublishedOAuthAppIntegration) UnmarshalJSON(data []byte) error { + var w publishedOAuthAppIntegrationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := publishedOAuthAppIntegrationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tokenAccessPolicyWire struct { AccessTokenTtlInMinutes *int `json:"access_token_ttl_in_minutes,omitempty"` RefreshTokenTtlInMinutes *int `json:"refresh_token_ttl_in_minutes,omitempty"` @@ -844,6 +1396,30 @@ func tokenAccessPolicyFromWire(w *tokenAccessPolicyWire) (*TokenAccessPolicy, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TokenAccessPolicy) MarshalJSON() ([]byte, error) { + w, err := tokenAccessPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TokenAccessPolicy) UnmarshalJSON(data []byte) error { + var w tokenAccessPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tokenAccessPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCustomOAuthAppIntegrationRequestWire struct { AccountId *string `json:"account_id,omitempty"` IntegrationId *string `json:"integration_id,omitempty"` @@ -889,6 +1465,30 @@ func updateCustomOAuthAppIntegrationRequestFromWire(w *updateCustomOAuthAppInteg }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCustomOAuthAppIntegrationRequest) MarshalJSON() ([]byte, error) { + w, err := updateCustomOAuthAppIntegrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCustomOAuthAppIntegrationRequest) UnmarshalJSON(data []byte) error { + var w updateCustomOAuthAppIntegrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCustomOAuthAppIntegrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCustomOAuthAppIntegrationResponseWire struct { } @@ -906,6 +1506,30 @@ func updateCustomOAuthAppIntegrationResponseFromWire(w *updateCustomOAuthAppInte return &UpdateCustomOAuthAppIntegrationResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCustomOAuthAppIntegrationResponse) MarshalJSON() ([]byte, error) { + w, err := updateCustomOAuthAppIntegrationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCustomOAuthAppIntegrationResponse) UnmarshalJSON(data []byte) error { + var w updateCustomOAuthAppIntegrationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCustomOAuthAppIntegrationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updatePublishedOAuthAppIntegrationRequestWire struct { AccountId *string `json:"account_id,omitempty"` IntegrationId *string `json:"integration_id,omitempty"` @@ -942,6 +1566,30 @@ func updatePublishedOAuthAppIntegrationRequestFromWire(w *updatePublishedOAuthAp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdatePublishedOAuthAppIntegrationRequest) MarshalJSON() ([]byte, error) { + w, err := updatePublishedOAuthAppIntegrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdatePublishedOAuthAppIntegrationRequest) UnmarshalJSON(data []byte) error { + var w updatePublishedOAuthAppIntegrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updatePublishedOAuthAppIntegrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updatePublishedOAuthAppIntegrationResponseWire struct { } @@ -959,6 +1607,30 @@ func updatePublishedOAuthAppIntegrationResponseFromWire(w *updatePublishedOAuthA return &UpdatePublishedOAuthAppIntegrationResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdatePublishedOAuthAppIntegrationResponse) MarshalJSON() ([]byte, error) { + w, err := updatePublishedOAuthAppIntegrationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdatePublishedOAuthAppIntegrationResponse) UnmarshalJSON(data []byte) error { + var w updatePublishedOAuthAppIntegrationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updatePublishedOAuthAppIntegrationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/pipelines/CHANGELOG.md b/pipelines/CHANGELOG.md index 7d3ff0af..6526f540 100644 --- a/pipelines/CHANGELOG.md +++ b/pipelines/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.12.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.11.0 (2026-11-11) ## Release v0.10.0 (2026-11-10) diff --git a/pipelines/internal/version.go b/pipelines/internal/version.go index 6f0e1ca2..c7e0f36f 100644 --- a/pipelines/internal/version.go +++ b/pipelines/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-pipelines" -const Version = "0.11.0" +const Version = "0.12.0" diff --git a/pipelines/v2/wire.go b/pipelines/v2/wire.go index 0415ef7e..cb4f4c71 100644 --- a/pipelines/v2/wire.go +++ b/pipelines/v2/wire.go @@ -74,6 +74,30 @@ func apiSourceConnectorConfigFromWire(w *apiSourceConnectorConfigWire) (*ApiSour }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApiSourceConnectorConfig) MarshalJSON() ([]byte, error) { + w, err := apiSourceConnectorConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApiSourceConnectorConfig) UnmarshalJSON(data []byte) error { + var w apiSourceConnectorConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := apiSourceConnectorConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type apiSourceConnectorOptionsWire struct { Options map[string]string `json:"options,omitempty"` } @@ -96,6 +120,30 @@ func apiSourceConnectorOptionsFromWire(w *apiSourceConnectorOptionsWire) (*ApiSo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApiSourceConnectorOptions) MarshalJSON() ([]byte, error) { + w, err := apiSourceConnectorOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApiSourceConnectorOptions) UnmarshalJSON(data []byte) error { + var w apiSourceConnectorOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := apiSourceConnectorOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type applyEnvironmentRequestWire struct { PipelineId *string `json:"pipeline_id,omitempty"` } @@ -118,6 +166,30 @@ func applyEnvironmentRequestFromWire(w *applyEnvironmentRequestWire) (*ApplyEnvi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApplyEnvironmentRequest) MarshalJSON() ([]byte, error) { + w, err := applyEnvironmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApplyEnvironmentRequest) UnmarshalJSON(data []byte) error { + var w applyEnvironmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := applyEnvironmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type applyEnvironmentResponseWire struct { } @@ -135,6 +207,30 @@ func applyEnvironmentResponseFromWire(w *applyEnvironmentResponseWire) (*ApplyEn return &ApplyEnvironmentResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApplyEnvironmentResponse) MarshalJSON() ([]byte, error) { + w, err := applyEnvironmentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApplyEnvironmentResponse) UnmarshalJSON(data []byte) error { + var w applyEnvironmentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := applyEnvironmentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type autoFullRefreshPolicyWire struct { Enabled *bool `json:"enabled,omitempty"` MinIntervalHours *int `json:"min_interval_hours,omitempty"` @@ -160,6 +256,30 @@ func autoFullRefreshPolicyFromWire(w *autoFullRefreshPolicyWire) (*AutoFullRefre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AutoFullRefreshPolicy) MarshalJSON() ([]byte, error) { + w, err := autoFullRefreshPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AutoFullRefreshPolicy) UnmarshalJSON(data []byte) error { + var w autoFullRefreshPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := autoFullRefreshPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type avroTransformerOptionsWire struct { Schema *string `json:"schema,omitempty"` SchemaFilePath *string `json:"schema_file_path,omitempty"` @@ -199,6 +319,30 @@ func avroTransformerOptionsFromWire(w *avroTransformerOptionsWire) (*AvroTransfo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AvroTransformerOptions) MarshalJSON() ([]byte, error) { + w, err := avroTransformerOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AvroTransformerOptions) UnmarshalJSON(data []byte) error { + var w avroTransformerOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := avroTransformerOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clonePipelineRequestWire struct { PipelineId *string `json:"pipeline_id,omitempty"` ExpectedLastModified *wireInt64 `json:"expected_last_modified,omitempty"` @@ -416,6 +560,30 @@ func clonePipelineRequestFromWire(w *clonePipelineRequestWire) (*ClonePipelineRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClonePipelineRequest) MarshalJSON() ([]byte, error) { + w, err := clonePipelineRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClonePipelineRequest) UnmarshalJSON(data []byte) error { + var w clonePipelineRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clonePipelineRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clonePipelineResponseWire struct { PipelineId *string `json:"pipeline_id,omitempty"` } @@ -438,6 +606,30 @@ func clonePipelineResponseFromWire(w *clonePipelineResponseWire) (*ClonePipeline }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClonePipelineResponse) MarshalJSON() ([]byte, error) { + w, err := clonePipelineResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClonePipelineResponse) UnmarshalJSON(data []byte) error { + var w clonePipelineResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clonePipelineResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type confluenceConnectorOptionsWire struct { IncludeConfluenceSpaces []string `json:"include_confluence_spaces,omitempty"` } @@ -460,6 +652,30 @@ func confluenceConnectorOptionsFromWire(w *confluenceConnectorOptionsWire) (*Con }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ConfluenceConnectorOptions) MarshalJSON() ([]byte, error) { + w, err := confluenceConnectorOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ConfluenceConnectorOptions) UnmarshalJSON(data []byte) error { + var w confluenceConnectorOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := confluenceConnectorOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type confluentSchemaRegistryOptionsWire struct { Subject *string `json:"subject,omitempty"` } @@ -482,6 +698,30 @@ func confluentSchemaRegistryOptionsFromWire(w *confluentSchemaRegistryOptionsWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ConfluentSchemaRegistryOptions) MarshalJSON() ([]byte, error) { + w, err := confluentSchemaRegistryOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ConfluentSchemaRegistryOptions) UnmarshalJSON(data []byte) error { + var w confluentSchemaRegistryOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := confluentSchemaRegistryOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type connectionParametersWire struct { SourceCatalog *string `json:"source_catalog,omitempty"` } @@ -504,6 +744,30 @@ func connectionParametersFromWire(w *connectionParametersWire) (*ConnectionParam }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ConnectionParameters) MarshalJSON() ([]byte, error) { + w, err := connectionParametersToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ConnectionParameters) UnmarshalJSON(data []byte) error { + var w connectionParametersWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := connectionParametersFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type connectorOptionsWire struct { GoogleAdsOptions *googleAdsOptionsWire `json:"google_ads_options,omitempty"` TiktokAdsOptions *tikTokAdsOptionsWire `json:"tiktok_ads_options,omitempty"` @@ -876,6 +1140,30 @@ func connectorOptionsFromWire(w *connectorOptionsWire) (*ConnectorOptions, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ConnectorOptions) MarshalJSON() ([]byte, error) { + w, err := connectorOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ConnectorOptions) UnmarshalJSON(data []byte) error { + var w connectorOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := connectorOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createPipelineRequestWire struct { AllowDuplicateNames *bool `json:"allow_duplicate_names,omitempty"` DryRun *bool `json:"dry_run,omitempty"` @@ -1093,6 +1381,30 @@ func createPipelineRequestFromWire(w *createPipelineRequestWire) (*CreatePipelin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreatePipelineRequest) MarshalJSON() ([]byte, error) { + w, err := createPipelineRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreatePipelineRequest) UnmarshalJSON(data []byte) error { + var w createPipelineRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createPipelineRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createPipelineResponseWire struct { PipelineId *string `json:"pipeline_id,omitempty"` EffectiveSettings *pipelineSpecWire `json:"effective_settings,omitempty"` @@ -1126,6 +1438,30 @@ func createPipelineResponseFromWire(w *createPipelineResponseWire) (*CreatePipel }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreatePipelineResponse) MarshalJSON() ([]byte, error) { + w, err := createPipelineResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreatePipelineResponse) UnmarshalJSON(data []byte) error { + var w createPipelineResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createPipelineResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cronTriggerWire struct { QuartzCronSchedule *string `json:"quartz_cron_schedule,omitempty"` TimezoneId *string `json:"timezone_id,omitempty"` @@ -1151,6 +1487,30 @@ func cronTriggerFromWire(w *cronTriggerWire) (*CronTrigger, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CronTrigger) MarshalJSON() ([]byte, error) { + w, err := cronTriggerToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CronTrigger) UnmarshalJSON(data []byte) error { + var w cronTriggerWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cronTriggerFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dataPlaneIdWire struct { Instance *string `json:"instance,omitempty"` SeqNo *wireInt64 `json:"seq_no,omitempty"` @@ -1184,6 +1544,30 @@ func dataPlaneIdFromWire(w *dataPlaneIdWire) (*DataPlaneId, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DataPlaneId) MarshalJSON() ([]byte, error) { + w, err := dataPlaneIdToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DataPlaneId) UnmarshalJSON(data []byte) error { + var w dataPlaneIdWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dataPlaneIdFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dataStagingOptionsWire struct { CatalogName *string `json:"catalog_name,omitempty"` SchemaName *string `json:"schema_name,omitempty"` @@ -1212,6 +1596,30 @@ func dataStagingOptionsFromWire(w *dataStagingOptionsWire) (*DataStagingOptions, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DataStagingOptions) MarshalJSON() ([]byte, error) { + w, err := dataStagingOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DataStagingOptions) UnmarshalJSON(data []byte) error { + var w dataStagingOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dataStagingOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deletePipelineRequestWire struct { PipelineId *string `json:"pipeline_id,omitempty"` Force *bool `json:"force,omitempty"` @@ -1240,6 +1648,30 @@ func deletePipelineRequestFromWire(w *deletePipelineRequestWire) (*DeletePipelin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeletePipelineRequest) MarshalJSON() ([]byte, error) { + w, err := deletePipelineRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeletePipelineRequest) UnmarshalJSON(data []byte) error { + var w deletePipelineRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deletePipelineRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deletePipelineResponseWire struct { } @@ -1257,6 +1689,30 @@ func deletePipelineResponseFromWire(w *deletePipelineResponseWire) (*DeletePipel return &DeletePipelineResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeletePipelineResponse) MarshalJSON() ([]byte, error) { + w, err := deletePipelineResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeletePipelineResponse) UnmarshalJSON(data []byte) error { + var w deletePipelineResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deletePipelineResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type editPipelineRequestWire struct { PipelineId *string `json:"pipeline_id,omitempty"` AllowDuplicateNames *bool `json:"allow_duplicate_names,omitempty"` @@ -1485,6 +1941,30 @@ func editPipelineRequestFromWire(w *editPipelineRequestWire) (*EditPipelineReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EditPipelineRequest) MarshalJSON() ([]byte, error) { + w, err := editPipelineRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EditPipelineRequest) UnmarshalJSON(data []byte) error { + var w editPipelineRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := editPipelineRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type editPipelineResponseWire struct { } @@ -1502,6 +1982,30 @@ func editPipelineResponseFromWire(w *editPipelineResponseWire) (*EditPipelineRes return &EditPipelineResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EditPipelineResponse) MarshalJSON() ([]byte, error) { + w, err := editPipelineResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EditPipelineResponse) UnmarshalJSON(data []byte) error { + var w editPipelineResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := editPipelineResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type errorDetailWire struct { Exceptions []serializedExceptionWire `json:"exceptions,omitempty"` Fatal *bool `json:"fatal,omitempty"` @@ -1535,10 +2039,34 @@ func errorDetailFromWire(w *errorDetailWire) (*ErrorDetail, error) { }, nil } -type eventLogSpecWire struct { - Name *string `json:"name,omitempty"` - Schema *string `json:"schema,omitempty"` - Catalog *string `json:"catalog,omitempty"` +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ErrorDetail) MarshalJSON() ([]byte, error) { + w, err := errorDetailToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ErrorDetail) UnmarshalJSON(data []byte) error { + var w errorDetailWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := errorDetailFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type eventLogSpecWire struct { + Name *string `json:"name,omitempty"` + Schema *string `json:"schema,omitempty"` + Catalog *string `json:"catalog,omitempty"` } func eventLogSpecToWire(v *EventLogSpec) (*eventLogSpecWire, error) { @@ -1563,6 +2091,30 @@ func eventLogSpecFromWire(w *eventLogSpecWire) (*EventLogSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EventLogSpec) MarshalJSON() ([]byte, error) { + w, err := eventLogSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EventLogSpec) UnmarshalJSON(data []byte) error { + var w eventLogSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := eventLogSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type fileFilterWire struct { PathFilter *string `json:"path_filter,omitempty"` ModifiedBefore *string `json:"modified_before,omitempty"` @@ -1631,6 +2183,30 @@ func fileFilterFromWire(w *fileFilterWire) (*FileFilter, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FileFilter) MarshalJSON() ([]byte, error) { + w, err := fileFilterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FileFilter) UnmarshalJSON(data []byte) error { + var w fileFilterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := fileFilterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type fileIngestionOptionsWire struct { Format FileIngestionOptions_FileFormat `json:"format,omitempty"` FileFilters []fileFilterWire `json:"file_filters,omitempty"` @@ -1691,6 +2267,30 @@ func fileIngestionOptionsFromWire(w *fileIngestionOptionsWire) (*FileIngestionOp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FileIngestionOptions) MarshalJSON() ([]byte, error) { + w, err := fileIngestionOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FileIngestionOptions) UnmarshalJSON(data []byte) error { + var w fileIngestionOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := fileIngestionOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type filtersWire struct { Include []string `json:"include,omitempty"` Exclude []string `json:"exclude,omitempty"` @@ -1716,6 +2316,30 @@ func filtersFromWire(w *filtersWire) (*Filters, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Filters) MarshalJSON() ([]byte, error) { + w, err := filtersToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Filters) UnmarshalJSON(data []byte) error { + var w filtersWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := filtersFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPipelineRequestWire struct { PipelineId *string `json:"pipeline_id,omitempty"` } @@ -1738,6 +2362,30 @@ func getPipelineRequestFromWire(w *getPipelineRequestWire) (*GetPipelineRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPipelineRequest) MarshalJSON() ([]byte, error) { + w, err := getPipelineRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPipelineRequest) UnmarshalJSON(data []byte) error { + var w getPipelineRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPipelineRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPipelineResponseWire struct { PipelineId *string `json:"pipeline_id,omitempty"` Spec *pipelineSpecWire `json:"spec,omitempty"` @@ -1837,6 +2485,30 @@ func getPipelineResponseFromWire(w *getPipelineResponseWire) (*GetPipelineRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPipelineResponse) MarshalJSON() ([]byte, error) { + w, err := getPipelineResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPipelineResponse) UnmarshalJSON(data []byte) error { + var w getPipelineResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPipelineResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getUpdateRequestWire struct { PipelineId *string `json:"pipeline_id,omitempty"` UpdateId *string `json:"update_id,omitempty"` @@ -1862,6 +2534,30 @@ func getUpdateRequestFromWire(w *getUpdateRequestWire) (*GetUpdateRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetUpdateRequest) MarshalJSON() ([]byte, error) { + w, err := getUpdateRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetUpdateRequest) UnmarshalJSON(data []byte) error { + var w getUpdateRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getUpdateRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getUpdateResponseWire struct { Update *updateInfoWire `json:"update,omitempty"` } @@ -1892,6 +2588,30 @@ func getUpdateResponseFromWire(w *getUpdateResponseWire) (*GetUpdateResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetUpdateResponse) MarshalJSON() ([]byte, error) { + w, err := getUpdateResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetUpdateResponse) UnmarshalJSON(data []byte) error { + var w getUpdateResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getUpdateResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type googleAdsConfigWire struct { ManagerAccountId *string `json:"manager_account_id,omitempty"` } @@ -1914,6 +2634,30 @@ func googleAdsConfigFromWire(w *googleAdsConfigWire) (*GoogleAdsConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GoogleAdsConfig) MarshalJSON() ([]byte, error) { + w, err := googleAdsConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GoogleAdsConfig) UnmarshalJSON(data []byte) error { + var w googleAdsConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := googleAdsConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type googleAdsCustomReportOptionsWire struct { Resource *string `json:"resource,omitempty"` ResourceFields []string `json:"resource_fields,omitempty"` @@ -1945,6 +2689,30 @@ func googleAdsCustomReportOptionsFromWire(w *googleAdsCustomReportOptionsWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GoogleAdsCustomReportOptions) MarshalJSON() ([]byte, error) { + w, err := googleAdsCustomReportOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GoogleAdsCustomReportOptions) UnmarshalJSON(data []byte) error { + var w googleAdsCustomReportOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := googleAdsCustomReportOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type googleAdsOptionsWire struct { ManagerAccountId *string `json:"manager_account_id,omitempty"` LookbackWindowDays *int `json:"lookback_window_days,omitempty"` @@ -1984,6 +2752,30 @@ func googleAdsOptionsFromWire(w *googleAdsOptionsWire) (*GoogleAdsOptions, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GoogleAdsOptions) MarshalJSON() ([]byte, error) { + w, err := googleAdsOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GoogleAdsOptions) UnmarshalJSON(data []byte) error { + var w googleAdsOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := googleAdsOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type googleDriveOptionsWire struct { Url *string `json:"url,omitempty"` EntityType GoogleDriveOptions_GoogleDriveEntityType `json:"entity_type,omitempty"` @@ -2020,6 +2812,30 @@ func googleDriveOptionsFromWire(w *googleDriveOptionsWire) (*GoogleDriveOptions, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GoogleDriveOptions) MarshalJSON() ([]byte, error) { + w, err := googleDriveOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GoogleDriveOptions) UnmarshalJSON(data []byte) error { + var w googleDriveOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := googleDriveOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingestionGatewayPipelineDefinitionWire struct { ConnectionName *string `json:"connection_name,omitempty"` ConnectionId *string `json:"connection_id,omitempty"` @@ -2065,6 +2881,30 @@ func ingestionGatewayPipelineDefinitionFromWire(w *ingestionGatewayPipelineDefin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngestionGatewayPipelineDefinition) MarshalJSON() ([]byte, error) { + w, err := ingestionGatewayPipelineDefinitionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngestionGatewayPipelineDefinition) UnmarshalJSON(data []byte) error { + var w ingestionGatewayPipelineDefinitionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingestionGatewayPipelineDefinitionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingestionPipelineDefinitionWire struct { ConnectionName *string `json:"connection_name,omitempty"` IngestionGatewayId *string `json:"ingestion_gateway_id,omitempty"` @@ -2197,6 +3037,30 @@ func ingestionPipelineDefinitionFromWire(w *ingestionPipelineDefinitionWire) (*I }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngestionPipelineDefinition) MarshalJSON() ([]byte, error) { + w, err := ingestionPipelineDefinitionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngestionPipelineDefinition) UnmarshalJSON(data []byte) error { + var w ingestionPipelineDefinitionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingestionPipelineDefinitionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingestionPipelineDefinition_FanoutOptionsWire struct { FanoutBy *string `json:"fanout_by,omitempty"` Transforms []transformerWire `json:"transforms,omitempty"` @@ -2230,6 +3094,30 @@ func ingestionPipelineDefinition_FanoutOptionsFromWire(w *ingestionPipelineDefin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngestionPipelineDefinition_FanoutOptions) MarshalJSON() ([]byte, error) { + w, err := ingestionPipelineDefinition_FanoutOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngestionPipelineDefinition_FanoutOptions) UnmarshalJSON(data []byte) error { + var w ingestionPipelineDefinition_FanoutOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingestionPipelineDefinition_FanoutOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingestionPipelineDefinition_IngestionConfigWire struct { Schema *ingestionPipelineDefinition_SchemaSpecWire `json:"schema,omitempty"` Table *ingestionPipelineDefinition_TableSpecWire `json:"table,omitempty"` @@ -2322,6 +3210,30 @@ func ingestionPipelineDefinition_IngestionConfigFromWire(w *ingestionPipelineDef }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngestionPipelineDefinition_IngestionConfig) MarshalJSON() ([]byte, error) { + w, err := ingestionPipelineDefinition_IngestionConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngestionPipelineDefinition_IngestionConfig) UnmarshalJSON(data []byte) error { + var w ingestionPipelineDefinition_IngestionConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingestionPipelineDefinition_IngestionConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingestionPipelineDefinition_ReportSpecWire struct { SourceUrl *string `json:"source_url,omitempty"` DestinationCatalog *string `json:"destination_catalog,omitempty"` @@ -2364,6 +3276,30 @@ func ingestionPipelineDefinition_ReportSpecFromWire(w *ingestionPipelineDefiniti }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngestionPipelineDefinition_ReportSpec) MarshalJSON() ([]byte, error) { + w, err := ingestionPipelineDefinition_ReportSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngestionPipelineDefinition_ReportSpec) UnmarshalJSON(data []byte) error { + var w ingestionPipelineDefinition_ReportSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingestionPipelineDefinition_ReportSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingestionPipelineDefinition_SchemaSpecWire struct { SourceCatalog *string `json:"source_catalog,omitempty"` SourceSchema *string `json:"source_schema,omitempty"` @@ -2428,6 +3364,30 @@ func ingestionPipelineDefinition_SchemaSpecFromWire(w *ingestionPipelineDefiniti }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngestionPipelineDefinition_SchemaSpec) MarshalJSON() ([]byte, error) { + w, err := ingestionPipelineDefinition_SchemaSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngestionPipelineDefinition_SchemaSpec) UnmarshalJSON(data []byte) error { + var w ingestionPipelineDefinition_SchemaSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingestionPipelineDefinition_SchemaSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingestionPipelineDefinition_TableSpecWire struct { SourceCatalog *string `json:"source_catalog,omitempty"` SourceSchema *string `json:"source_schema,omitempty"` @@ -2487,6 +3447,30 @@ func ingestionPipelineDefinition_TableSpecFromWire(w *ingestionPipelineDefinitio }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngestionPipelineDefinition_TableSpec) MarshalJSON() ([]byte, error) { + w, err := ingestionPipelineDefinition_TableSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngestionPipelineDefinition_TableSpec) UnmarshalJSON(data []byte) error { + var w ingestionPipelineDefinition_TableSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingestionPipelineDefinition_TableSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingestionPipelineDefinition_TableSpecificConfigWire struct { ScdType ScdType_ScdType `json:"scd_type,omitempty"` PrimaryKeys []string `json:"primary_keys,omitempty"` @@ -2572,6 +3556,30 @@ func ingestionPipelineDefinition_TableSpecificConfigFromWire(w *ingestionPipelin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngestionPipelineDefinition_TableSpecificConfig) MarshalJSON() ([]byte, error) { + w, err := ingestionPipelineDefinition_TableSpecificConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngestionPipelineDefinition_TableSpecificConfig) UnmarshalJSON(data []byte) error { + var w ingestionPipelineDefinition_TableSpecificConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingestionPipelineDefinition_TableSpecificConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingestionPipelineDefinition_TableSpecificConfig_QueryBasedConnectorConfigWire struct { CursorColumns []string `json:"cursor_columns,omitempty"` DeletionCondition *string `json:"deletion_condition,omitempty"` @@ -2608,6 +3616,30 @@ func ingestionPipelineDefinition_TableSpecificConfig_QueryBasedConnectorConfigFr }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngestionPipelineDefinition_TableSpecificConfig_QueryBasedConnectorConfig) MarshalJSON() ([]byte, error) { + w, err := ingestionPipelineDefinition_TableSpecificConfig_QueryBasedConnectorConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngestionPipelineDefinition_TableSpecificConfig_QueryBasedConnectorConfig) UnmarshalJSON(data []byte) error { + var w ingestionPipelineDefinition_TableSpecificConfig_QueryBasedConnectorConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingestionPipelineDefinition_TableSpecificConfig_QueryBasedConnectorConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingestionPipelineDefinition_WorkdayReportParametersWire struct { Incremental *bool `json:"incremental,omitempty"` ReportParameters []ingestionPipelineDefinition_WorkdayReportParameters_QueryKeyValueWire `json:"report_parameters,omitempty"` @@ -2644,6 +3676,30 @@ func ingestionPipelineDefinition_WorkdayReportParametersFromWire(w *ingestionPip }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngestionPipelineDefinition_WorkdayReportParameters) MarshalJSON() ([]byte, error) { + w, err := ingestionPipelineDefinition_WorkdayReportParametersToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngestionPipelineDefinition_WorkdayReportParameters) UnmarshalJSON(data []byte) error { + var w ingestionPipelineDefinition_WorkdayReportParametersWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingestionPipelineDefinition_WorkdayReportParametersFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ingestionPipelineDefinition_WorkdayReportParameters_QueryKeyValueWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -2669,6 +3725,30 @@ func ingestionPipelineDefinition_WorkdayReportParameters_QueryKeyValueFromWire(w }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IngestionPipelineDefinition_WorkdayReportParameters_QueryKeyValue) MarshalJSON() ([]byte, error) { + w, err := ingestionPipelineDefinition_WorkdayReportParameters_QueryKeyValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IngestionPipelineDefinition_WorkdayReportParameters_QueryKeyValue) UnmarshalJSON(data []byte) error { + var w ingestionPipelineDefinition_WorkdayReportParameters_QueryKeyValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ingestionPipelineDefinition_WorkdayReportParameters_QueryKeyValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jiraConnectorOptionsWire struct { IncludeJiraSpaces []string `json:"include_jira_spaces,omitempty"` } @@ -2691,6 +3771,30 @@ func jiraConnectorOptionsFromWire(w *jiraConnectorOptionsWire) (*JiraConnectorOp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JiraConnectorOptions) MarshalJSON() ([]byte, error) { + w, err := jiraConnectorOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JiraConnectorOptions) UnmarshalJSON(data []byte) error { + var w jiraConnectorOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jiraConnectorOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type jsonTransformerOptionsWire struct { AsVariant *bool `json:"as_variant,omitempty"` Schema *string `json:"schema,omitempty"` @@ -2725,6 +3829,30 @@ func jsonTransformerOptionsFromWire(w *jsonTransformerOptionsWire) (*JsonTransfo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v JsonTransformerOptions) MarshalJSON() ([]byte, error) { + w, err := jsonTransformerOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *JsonTransformerOptions) UnmarshalJSON(data []byte) error { + var w jsonTransformerOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := jsonTransformerOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type kafkaOptionsWire struct { Topics []string `json:"topics,omitempty"` TopicPattern *string `json:"topic_pattern,omitempty"` @@ -2789,6 +3917,30 @@ func kafkaOptionsFromWire(w *kafkaOptionsWire) (*KafkaOptions, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v KafkaOptions) MarshalJSON() ([]byte, error) { + w, err := kafkaOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *KafkaOptions) UnmarshalJSON(data []byte) error { + var w kafkaOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := kafkaOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type linkedInAdsOptionsWire struct { SyncStartDate *string `json:"sync_start_date,omitempty"` LookbackWindowDays *int `json:"lookback_window_days,omitempty"` @@ -2825,6 +3977,30 @@ func linkedInAdsOptionsFromWire(w *linkedInAdsOptionsWire) (*LinkedInAdsOptions, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LinkedInAdsOptions) MarshalJSON() ([]byte, error) { + w, err := linkedInAdsOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LinkedInAdsOptions) UnmarshalJSON(data []byte) error { + var w linkedInAdsOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := linkedInAdsOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type linkedInAdsOptions_LinkedInAdsCustomReportOptionsWire struct { Finder LinkedInAdsOptions_LinkedInAdsCustomReportOptions_LinkedInAdsFinder `json:"finder,omitempty"` EntityGranularity []LinkedInAdsOptions_LinkedInAdsCustomReportOptions_LinkedInAdsEntityGranularity `json:"entity_granularity,omitempty"` @@ -2856,6 +4032,30 @@ func linkedInAdsOptions_LinkedInAdsCustomReportOptionsFromWire(w *linkedInAdsOpt }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LinkedInAdsOptions_LinkedInAdsCustomReportOptions) MarshalJSON() ([]byte, error) { + w, err := linkedInAdsOptions_LinkedInAdsCustomReportOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LinkedInAdsOptions_LinkedInAdsCustomReportOptions) UnmarshalJSON(data []byte) error { + var w linkedInAdsOptions_LinkedInAdsCustomReportOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := linkedInAdsOptions_LinkedInAdsCustomReportOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPipelineEventsRequestWire struct { PipelineId *string `json:"pipeline_id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -2890,6 +4090,30 @@ func listPipelineEventsRequestFromWire(w *listPipelineEventsRequestWire) (*ListP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPipelineEventsRequest) MarshalJSON() ([]byte, error) { + w, err := listPipelineEventsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPipelineEventsRequest) UnmarshalJSON(data []byte) error { + var w listPipelineEventsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPipelineEventsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPipelineEventsResponseWire struct { Events []pipelineEventWire `json:"events,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2926,6 +4150,30 @@ func listPipelineEventsResponseFromWire(w *listPipelineEventsResponseWire) (*Lis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPipelineEventsResponse) MarshalJSON() ([]byte, error) { + w, err := listPipelineEventsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPipelineEventsResponse) UnmarshalJSON(data []byte) error { + var w listPipelineEventsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPipelineEventsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPipelinesRequestWire struct { PageToken *string `json:"page_token,omitempty"` MaxResults *int `json:"max_results,omitempty"` @@ -2957,6 +4205,30 @@ func listPipelinesRequestFromWire(w *listPipelinesRequestWire) (*ListPipelinesRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPipelinesRequest) MarshalJSON() ([]byte, error) { + w, err := listPipelinesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPipelinesRequest) UnmarshalJSON(data []byte) error { + var w listPipelinesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPipelinesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPipelinesResponseWire struct { Statuses []pipelineStateInfoWire `json:"statuses,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2990,6 +4262,30 @@ func listPipelinesResponseFromWire(w *listPipelinesResponseWire) (*ListPipelines }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPipelinesResponse) MarshalJSON() ([]byte, error) { + w, err := listPipelinesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPipelinesResponse) UnmarshalJSON(data []byte) error { + var w listPipelinesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPipelinesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listUpdatesRequestWire struct { PipelineId *string `json:"pipeline_id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -3021,6 +4317,30 @@ func listUpdatesRequestFromWire(w *listUpdatesRequestWire) (*ListUpdatesRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListUpdatesRequest) MarshalJSON() ([]byte, error) { + w, err := listUpdatesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListUpdatesRequest) UnmarshalJSON(data []byte) error { + var w listUpdatesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listUpdatesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listUpdatesResponseWire struct { Updates []updateInfoWire `json:"updates,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3057,6 +4377,30 @@ func listUpdatesResponseFromWire(w *listUpdatesResponseWire) (*ListUpdatesRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListUpdatesResponse) MarshalJSON() ([]byte, error) { + w, err := listUpdatesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListUpdatesResponse) UnmarshalJSON(data []byte) error { + var w listUpdatesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listUpdatesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type manualTriggerWire struct { } @@ -3074,6 +4418,30 @@ func manualTriggerFromWire(w *manualTriggerWire) (*ManualTrigger, error) { return &ManualTrigger{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ManualTrigger) MarshalJSON() ([]byte, error) { + w, err := manualTriggerToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ManualTrigger) UnmarshalJSON(data []byte) error { + var w manualTriggerWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := manualTriggerFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type marketoOptionsWire struct { SyncStartDate *string `json:"sync_start_date,omitempty"` } @@ -3096,6 +4464,30 @@ func marketoOptionsFromWire(w *marketoOptionsWire) (*MarketoOptions, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MarketoOptions) MarshalJSON() ([]byte, error) { + w, err := marketoOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MarketoOptions) UnmarshalJSON(data []byte) error { + var w marketoOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := marketoOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type metaMarketingOptionsWire struct { Level *string `json:"level,omitempty"` Breakdowns []string `json:"breakdowns,omitempty"` @@ -3150,6 +4542,30 @@ func metaMarketingOptionsFromWire(w *metaMarketingOptionsWire) (*MetaMarketingOp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MetaMarketingOptions) MarshalJSON() ([]byte, error) { + w, err := metaMarketingOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MetaMarketingOptions) UnmarshalJSON(data []byte) error { + var w metaMarketingOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := metaMarketingOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type metaMarketingOptions_MetaMarketingCustomReportOptionsWire struct { Level *string `json:"level,omitempty"` Breakdowns []string `json:"breakdowns,omitempty"` @@ -3187,6 +4603,30 @@ func metaMarketingOptions_MetaMarketingCustomReportOptionsFromWire(w *metaMarket }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MetaMarketingOptions_MetaMarketingCustomReportOptions) MarshalJSON() ([]byte, error) { + w, err := metaMarketingOptions_MetaMarketingCustomReportOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MetaMarketingOptions_MetaMarketingCustomReportOptions) UnmarshalJSON(data []byte) error { + var w metaMarketingOptions_MetaMarketingCustomReportOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := metaMarketingOptions_MetaMarketingCustomReportOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type notebookLibraryWire struct { Path *string `json:"path,omitempty"` } @@ -3209,6 +4649,30 @@ func notebookLibraryFromWire(w *notebookLibraryWire) (*NotebookLibrary, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NotebookLibrary) MarshalJSON() ([]byte, error) { + w, err := notebookLibraryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NotebookLibrary) UnmarshalJSON(data []byte) error { + var w notebookLibraryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := notebookLibraryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type notificationsWire struct { EmailRecipients []string `json:"email_recipients,omitempty"` Alerts []string `json:"alerts,omitempty"` @@ -3234,6 +4698,30 @@ func notificationsFromWire(w *notificationsWire) (*Notifications, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Notifications) MarshalJSON() ([]byte, error) { + w, err := notificationsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Notifications) UnmarshalJSON(data []byte) error { + var w notificationsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := notificationsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type oneDriveOptionsWire struct { Url *string `json:"url,omitempty"` EntityType OneDriveOptions_OneDriveEntityType `json:"entity_type,omitempty"` @@ -3270,6 +4758,30 @@ func oneDriveOptionsFromWire(w *oneDriveOptionsWire) (*OneDriveOptions, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OneDriveOptions) MarshalJSON() ([]byte, error) { + w, err := oneDriveOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OneDriveOptions) UnmarshalJSON(data []byte) error { + var w oneDriveOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := oneDriveOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type operationTimeWindowWire struct { StartHour *int `json:"start_hour,omitempty"` DaysOfWeek []DayOfWeek `json:"days_of_week,omitempty"` @@ -3298,6 +4810,30 @@ func operationTimeWindowFromWire(w *operationTimeWindowWire) (*OperationTimeWind }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OperationTimeWindow) MarshalJSON() ([]byte, error) { + w, err := operationTimeWindowToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OperationTimeWindow) UnmarshalJSON(data []byte) error { + var w operationTimeWindowWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := operationTimeWindowFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type originWire struct { Cloud *string `json:"cloud,omitempty"` Region *string `json:"region,omitempty"` @@ -3399,6 +4935,30 @@ func originFromWire(w *originWire) (*Origin, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Origin) MarshalJSON() ([]byte, error) { + w, err := originToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Origin) UnmarshalJSON(data []byte) error { + var w originWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := originFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type outlookOptionsWire struct { FolderFilter []string `json:"folder_filter,omitempty"` SenderFilter []string `json:"sender_filter,omitempty"` @@ -3448,6 +5008,30 @@ func outlookOptionsFromWire(w *outlookOptionsWire) (*OutlookOptions, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OutlookOptions) MarshalJSON() ([]byte, error) { + w, err := outlookOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OutlookOptions) UnmarshalJSON(data []byte) error { + var w outlookOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := outlookOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pathPatternWire struct { Include *string `json:"include,omitempty"` } @@ -3470,6 +5054,30 @@ func pathPatternFromWire(w *pathPatternWire) (*PathPattern, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PathPattern) MarshalJSON() ([]byte, error) { + w, err := pathPatternToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PathPattern) UnmarshalJSON(data []byte) error { + var w pathPatternWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pathPatternFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelineClusterWire struct { Label *string `json:"label,omitempty"` ApplyPolicyDefaultValues *bool `json:"apply_policy_default_values,omitempty"` @@ -3625,6 +5233,30 @@ func pipelineClusterFromWire(w *pipelineClusterWire) (*PipelineCluster, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelineCluster) MarshalJSON() ([]byte, error) { + w, err := pipelineClusterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelineCluster) UnmarshalJSON(data []byte) error { + var w pipelineClusterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelineClusterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelineDeploymentWire struct { Kind DeploymentKind `json:"kind,omitempty"` MetadataFilePath *string `json:"metadata_file_path,omitempty"` @@ -3656,6 +5288,30 @@ func pipelineDeploymentFromWire(w *pipelineDeploymentWire) (*PipelineDeployment, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelineDeployment) MarshalJSON() ([]byte, error) { + w, err := pipelineDeploymentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelineDeployment) UnmarshalJSON(data []byte) error { + var w pipelineDeploymentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelineDeploymentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelineEventWire struct { Id *string `json:"id,omitempty"` Sequence *sequencingWire `json:"sequence,omitempty"` @@ -3737,6 +5393,30 @@ func pipelineEventFromWire(w *pipelineEventWire) (*PipelineEvent, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelineEvent) MarshalJSON() ([]byte, error) { + w, err := pipelineEventToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelineEvent) UnmarshalJSON(data []byte) error { + var w pipelineEventWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelineEventFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelineLibraryWire struct { Jar *string `json:"jar,omitempty"` Maven *pipelinesMavenLibraryWire `json:"maven,omitempty"` @@ -3873,6 +5553,30 @@ func pipelineLibraryFromWire(w *pipelineLibraryWire) (*PipelineLibrary, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelineLibrary) MarshalJSON() ([]byte, error) { + w, err := pipelineLibraryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelineLibrary) UnmarshalJSON(data []byte) error { + var w pipelineLibraryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelineLibraryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelineSpecWire struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -4070,6 +5774,30 @@ func pipelineSpecFromWire(w *pipelineSpecWire) (*PipelineSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelineSpec) MarshalJSON() ([]byte, error) { + w, err := pipelineSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelineSpec) UnmarshalJSON(data []byte) error { + var w pipelineSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelineSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelineStateWire struct { } @@ -4087,6 +5815,30 @@ func pipelineStateFromWire(w *pipelineStateWire) (*PipelineState, error) { return &PipelineState{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelineState) MarshalJSON() ([]byte, error) { + w, err := pipelineStateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelineState) UnmarshalJSON(data []byte) error { + var w pipelineStateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelineStateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelineStateInfoWire struct { PipelineId *string `json:"pipeline_id,omitempty"` State PipelineState_PipelineState `json:"state,omitempty"` @@ -4138,6 +5890,30 @@ func pipelineStateInfoFromWire(w *pipelineStateInfoWire) (*PipelineStateInfo, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelineStateInfo) MarshalJSON() ([]byte, error) { + w, err := pipelineStateInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelineStateInfo) UnmarshalJSON(data []byte) error { + var w pipelineStateInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelineStateInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelineTriggerWire struct { Manual *manualTriggerWire `json:"manual,omitempty"` Cron *cronTriggerWire `json:"cron,omitempty"` @@ -4205,9 +5981,33 @@ func pipelineTriggerFromWire(w *pipelineTriggerWire) (*PipelineTrigger, error) { } triggerSelection = &PipelineTrigger_Trigger_Cron{Cron: *triggerCronConverted} } - return &PipelineTrigger{ - Trigger: triggerSelection, - }, nil + return &PipelineTrigger{ + Trigger: triggerSelection, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelineTrigger) MarshalJSON() ([]byte, error) { + w, err := pipelineTriggerToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelineTrigger) UnmarshalJSON(data []byte) error { + var w pipelineTriggerWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelineTriggerFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil } type pipelinesAutoScaleWire struct { @@ -4238,6 +6038,30 @@ func pipelinesAutoScaleFromWire(w *pipelinesAutoScaleWire) (*PipelinesAutoScale, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelinesAutoScale) MarshalJSON() ([]byte, error) { + w, err := pipelinesAutoScaleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelinesAutoScale) UnmarshalJSON(data []byte) error { + var w pipelinesAutoScaleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelinesAutoScaleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelinesAwsAttributesWire struct { FirstOnDemand *int `json:"first_on_demand,omitempty"` Availability PipelinesAwsAvailability `json:"availability,omitempty"` @@ -4287,6 +6111,30 @@ func pipelinesAwsAttributesFromWire(w *pipelinesAwsAttributesWire) (*PipelinesAw }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelinesAwsAttributes) MarshalJSON() ([]byte, error) { + w, err := pipelinesAwsAttributesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelinesAwsAttributes) UnmarshalJSON(data []byte) error { + var w pipelinesAwsAttributesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelinesAwsAttributesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelinesAzureAttributesWire struct { FirstOnDemand *int `json:"first_on_demand,omitempty"` Availability PipelinesAzureAvailability `json:"availability,omitempty"` @@ -4315,6 +6163,30 @@ func pipelinesAzureAttributesFromWire(w *pipelinesAzureAttributesWire) (*Pipelin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelinesAzureAttributes) MarshalJSON() ([]byte, error) { + w, err := pipelinesAzureAttributesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelinesAzureAttributes) UnmarshalJSON(data []byte) error { + var w pipelinesAzureAttributesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelinesAzureAttributesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelinesClusterLogConfWire struct { Dbfs *pipelinesDbfsStorageInfoWire `json:"dbfs,omitempty"` } @@ -4367,6 +6239,30 @@ func pipelinesClusterLogConfFromWire(w *pipelinesClusterLogConfWire) (*Pipelines }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelinesClusterLogConf) MarshalJSON() ([]byte, error) { + w, err := pipelinesClusterLogConfToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelinesClusterLogConf) UnmarshalJSON(data []byte) error { + var w pipelinesClusterLogConfWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelinesClusterLogConfFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelinesDbfsStorageInfoWire struct { Destination *string `json:"destination,omitempty"` } @@ -4389,6 +6285,30 @@ func pipelinesDbfsStorageInfoFromWire(w *pipelinesDbfsStorageInfoWire) (*Pipelin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelinesDbfsStorageInfo) MarshalJSON() ([]byte, error) { + w, err := pipelinesDbfsStorageInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelinesDbfsStorageInfo) UnmarshalJSON(data []byte) error { + var w pipelinesDbfsStorageInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelinesDbfsStorageInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelinesEnvironmentWire struct { Dependencies []string `json:"dependencies,omitempty"` EnvironmentVersion *string `json:"environment_version,omitempty"` @@ -4414,6 +6334,30 @@ func pipelinesEnvironmentFromWire(w *pipelinesEnvironmentWire) (*PipelinesEnviro }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelinesEnvironment) MarshalJSON() ([]byte, error) { + w, err := pipelinesEnvironmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelinesEnvironment) UnmarshalJSON(data []byte) error { + var w pipelinesEnvironmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelinesEnvironmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelinesGcpAttributesWire struct { GoogleServiceAccount *string `json:"google_service_account,omitempty"` BootDiskSize *int `json:"boot_disk_size,omitempty"` @@ -4448,6 +6392,30 @@ func pipelinesGcpAttributesFromWire(w *pipelinesGcpAttributesWire) (*PipelinesGc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelinesGcpAttributes) MarshalJSON() ([]byte, error) { + w, err := pipelinesGcpAttributesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelinesGcpAttributes) UnmarshalJSON(data []byte) error { + var w pipelinesGcpAttributesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelinesGcpAttributesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelinesInitScriptInfoWire struct { Dbfs *pipelinesDbfsStorageInfoWire `json:"dbfs,omitempty"` S3 *pipelinesS3StorageInfoWire `json:"s3,omitempty"` @@ -4520,6 +6488,30 @@ func pipelinesInitScriptInfoFromWire(w *pipelinesInitScriptInfoWire) (*Pipelines }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelinesInitScriptInfo) MarshalJSON() ([]byte, error) { + w, err := pipelinesInitScriptInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelinesInitScriptInfo) UnmarshalJSON(data []byte) error { + var w pipelinesInitScriptInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelinesInitScriptInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelinesJobRunAsWire struct { UserName *string `json:"user_name,omitempty"` ServicePrincipalName *string `json:"service_principal_name,omitempty"` @@ -4588,6 +6580,30 @@ func pipelinesJobRunAsFromWire(w *pipelinesJobRunAsWire) (*PipelinesJobRunAs, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelinesJobRunAs) MarshalJSON() ([]byte, error) { + w, err := pipelinesJobRunAsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelinesJobRunAs) UnmarshalJSON(data []byte) error { + var w pipelinesJobRunAsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelinesJobRunAsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelinesMavenLibraryWire struct { Coordinates *string `json:"coordinates,omitempty"` Repo *string `json:"repo,omitempty"` @@ -4616,6 +6632,30 @@ func pipelinesMavenLibraryFromWire(w *pipelinesMavenLibraryWire) (*PipelinesMave }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelinesMavenLibrary) MarshalJSON() ([]byte, error) { + w, err := pipelinesMavenLibraryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelinesMavenLibrary) UnmarshalJSON(data []byte) error { + var w pipelinesMavenLibraryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelinesMavenLibraryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelinesS3StorageInfoWire struct { Destination *string `json:"destination,omitempty"` Region *string `json:"region,omitempty"` @@ -4656,6 +6696,30 @@ func pipelinesS3StorageInfoFromWire(w *pipelinesS3StorageInfoWire) (*PipelinesS3 }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelinesS3StorageInfo) MarshalJSON() ([]byte, error) { + w, err := pipelinesS3StorageInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelinesS3StorageInfo) UnmarshalJSON(data []byte) error { + var w pipelinesS3StorageInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelinesS3StorageInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type postgresCatalogConfigWire struct { SlotConfig *postgresSlotConfigWire `json:"slot_config,omitempty"` } @@ -4686,6 +6750,30 @@ func postgresCatalogConfigFromWire(w *postgresCatalogConfigWire) (*PostgresCatal }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PostgresCatalogConfig) MarshalJSON() ([]byte, error) { + w, err := postgresCatalogConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PostgresCatalogConfig) UnmarshalJSON(data []byte) error { + var w postgresCatalogConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := postgresCatalogConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type postgresSlotConfigWire struct { SlotName *string `json:"slot_name,omitempty"` PublicationName *string `json:"publication_name,omitempty"` @@ -4711,6 +6799,30 @@ func postgresSlotConfigFromWire(w *postgresSlotConfigWire) (*PostgresSlotConfig, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PostgresSlotConfig) MarshalJSON() ([]byte, error) { + w, err := postgresSlotConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PostgresSlotConfig) UnmarshalJSON(data []byte) error { + var w postgresSlotConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := postgresSlotConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type protobufTransformerOptionsWire struct { DescFilePath *string `json:"desc_file_path,omitempty"` MessageName *string `json:"message_name,omitempty"` @@ -4753,6 +6865,30 @@ func protobufTransformerOptionsFromWire(w *protobufTransformerOptionsWire) (*Pro }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProtobufTransformerOptions) MarshalJSON() ([]byte, error) { + w, err := protobufTransformerOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProtobufTransformerOptions) UnmarshalJSON(data []byte) error { + var w protobufTransformerOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := protobufTransformerOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rabbitmqOptionsWire struct { Queue *string `json:"queue,omitempty"` } @@ -4775,6 +6911,30 @@ func rabbitmqOptionsFromWire(w *rabbitmqOptionsWire) (*RabbitmqOptions, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RabbitmqOptions) MarshalJSON() ([]byte, error) { + w, err := rabbitmqOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RabbitmqOptions) UnmarshalJSON(data []byte) error { + var w rabbitmqOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rabbitmqOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type redditAdsOptionsWire struct { SyncStartDate *string `json:"sync_start_date,omitempty"` LookbackWindowDays *int `json:"lookback_window_days,omitempty"` @@ -4811,6 +6971,30 @@ func redditAdsOptionsFromWire(w *redditAdsOptionsWire) (*RedditAdsOptions, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RedditAdsOptions) MarshalJSON() ([]byte, error) { + w, err := redditAdsOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RedditAdsOptions) UnmarshalJSON(data []byte) error { + var w redditAdsOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := redditAdsOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type redditAdsOptions_RedditAdsCustomReportOptionsWire struct { Fields []string `json:"fields,omitempty"` Breakdowns []string `json:"breakdowns,omitempty"` @@ -4836,6 +7020,30 @@ func redditAdsOptions_RedditAdsCustomReportOptionsFromWire(w *redditAdsOptions_R }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RedditAdsOptions_RedditAdsCustomReportOptions) MarshalJSON() ([]byte, error) { + w, err := redditAdsOptions_RedditAdsCustomReportOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RedditAdsOptions_RedditAdsCustomReportOptions) UnmarshalJSON(data []byte) error { + var w redditAdsOptions_RedditAdsCustomReportOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := redditAdsOptions_RedditAdsCustomReportOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type replaceWhereOverrideWire struct { FlowName *string `json:"flow_name,omitempty"` PredicateOverride *string `json:"predicate_override,omitempty"` @@ -4861,6 +7069,30 @@ func replaceWhereOverrideFromWire(w *replaceWhereOverrideWire) (*ReplaceWhereOve }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ReplaceWhereOverride) MarshalJSON() ([]byte, error) { + w, err := replaceWhereOverrideToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ReplaceWhereOverride) UnmarshalJSON(data []byte) error { + var w replaceWhereOverrideWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := replaceWhereOverrideFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type restartWindowWire struct { StartHour *int `json:"start_hour,omitempty"` DaysOfWeek []DayOfWeek `json:"days_of_week,omitempty"` @@ -4889,6 +7121,30 @@ func restartWindowFromWire(w *restartWindowWire) (*RestartWindow, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RestartWindow) MarshalJSON() ([]byte, error) { + w, err := restartWindowToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RestartWindow) UnmarshalJSON(data []byte) error { + var w restartWindowWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := restartWindowFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rewindDatasetSpecWire struct { Identifier *string `json:"identifier,omitempty"` Cascade *bool `json:"cascade,omitempty"` @@ -4917,6 +7173,30 @@ func rewindDatasetSpecFromWire(w *rewindDatasetSpecWire) (*RewindDatasetSpec, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RewindDatasetSpec) MarshalJSON() ([]byte, error) { + w, err := rewindDatasetSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RewindDatasetSpec) UnmarshalJSON(data []byte) error { + var w rewindDatasetSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rewindDatasetSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rewindSpecWire struct { RewindTimestamp *string `json:"rewind_timestamp,omitempty"` DryRun *bool `json:"dry_run,omitempty"` @@ -4953,6 +7233,30 @@ func rewindSpecFromWire(w *rewindSpecWire) (*RewindSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RewindSpec) MarshalJSON() ([]byte, error) { + w, err := rewindSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RewindSpec) UnmarshalJSON(data []byte) error { + var w rewindSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rewindSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type scdTypeWire struct { } @@ -4970,6 +7274,30 @@ func scdTypeFromWire(w *scdTypeWire) (*ScdType, error) { return &ScdType{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ScdType) MarshalJSON() ([]byte, error) { + w, err := scdTypeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ScdType) UnmarshalJSON(data []byte) error { + var w scdTypeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := scdTypeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type schemaRegistryConfigWire struct { ConfluentOptions *confluentSchemaRegistryOptionsWire `json:"confluent_options,omitempty"` ProtobufMessageName *string `json:"protobuf_message_name,omitempty"` @@ -5006,6 +7334,30 @@ func schemaRegistryConfigFromWire(w *schemaRegistryConfigWire) (*SchemaRegistryC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SchemaRegistryConfig) MarshalJSON() ([]byte, error) { + w, err := schemaRegistryConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SchemaRegistryConfig) UnmarshalJSON(data []byte) error { + var w schemaRegistryConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := schemaRegistryConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sequencingWire struct { DataPlaneId *dataPlaneIdWire `json:"data_plane_id,omitempty"` ControlPlaneSeqNo *wireInt64 `json:"control_plane_seq_no,omitempty"` @@ -5047,6 +7399,30 @@ func sequencingFromWire(w *sequencingWire) (*Sequencing, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Sequencing) MarshalJSON() ([]byte, error) { + w, err := sequencingToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Sequencing) UnmarshalJSON(data []byte) error { + var w sequencingWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sequencingFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type serializedExceptionWire struct { ClassName *string `json:"class_name,omitempty"` Message *string `json:"message,omitempty"` @@ -5083,6 +7459,30 @@ func serializedExceptionFromWire(w *serializedExceptionWire) (*SerializedExcepti }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SerializedException) MarshalJSON() ([]byte, error) { + w, err := serializedExceptionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SerializedException) UnmarshalJSON(data []byte) error { + var w serializedExceptionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := serializedExceptionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sharepointOptionsWire struct { Url *string `json:"url,omitempty"` EntityType SharepointOptions_SharepointEntityType `json:"entity_type,omitempty"` @@ -5119,6 +7519,30 @@ func sharepointOptionsFromWire(w *sharepointOptionsWire) (*SharepointOptions, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SharepointOptions) MarshalJSON() ([]byte, error) { + w, err := sharepointOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SharepointOptions) UnmarshalJSON(data []byte) error { + var w sharepointOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sharepointOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type smartsheetOptionsWire struct { EnforceSchema *bool `json:"enforce_schema,omitempty"` } @@ -5141,6 +7565,30 @@ func smartsheetOptionsFromWire(w *smartsheetOptionsWire) (*SmartsheetOptions, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SmartsheetOptions) MarshalJSON() ([]byte, error) { + w, err := smartsheetOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SmartsheetOptions) UnmarshalJSON(data []byte) error { + var w smartsheetOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := smartsheetOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sourceCatalogConfigWire struct { SourceCatalog *string `json:"source_catalog,omitempty"` Postgres *postgresCatalogConfigWire `json:"postgres,omitempty"` @@ -5196,6 +7644,30 @@ func sourceCatalogConfigFromWire(w *sourceCatalogConfigWire) (*SourceCatalogConf }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SourceCatalogConfig) MarshalJSON() ([]byte, error) { + w, err := sourceCatalogConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SourceCatalogConfig) UnmarshalJSON(data []byte) error { + var w sourceCatalogConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sourceCatalogConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sourceConfigWire struct { Catalog *sourceCatalogConfigWire `json:"catalog,omitempty"` GoogleAdsConfig *googleAdsConfigWire `json:"google_ads_config,omitempty"` @@ -5279,6 +7751,30 @@ func sourceConfigFromWire(w *sourceConfigWire) (*SourceConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SourceConfig) MarshalJSON() ([]byte, error) { + w, err := sourceConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SourceConfig) UnmarshalJSON(data []byte) error { + var w sourceConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sourceConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type stackFrameWire struct { DeclaringClass *string `json:"declaring_class,omitempty"` MethodName *string `json:"method_name,omitempty"` @@ -5310,6 +7806,30 @@ func stackFrameFromWire(w *stackFrameWire) (*StackFrame, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StackFrame) MarshalJSON() ([]byte, error) { + w, err := stackFrameToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StackFrame) UnmarshalJSON(data []byte) error { + var w stackFrameWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := stackFrameFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type startUpdateRequestWire struct { PipelineId *string `json:"pipeline_id,omitempty"` FullRefresh *bool `json:"full_refresh,omitempty"` @@ -5384,6 +7904,30 @@ func startUpdateRequestFromWire(w *startUpdateRequestWire) (*StartUpdateRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StartUpdateRequest) MarshalJSON() ([]byte, error) { + w, err := startUpdateRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StartUpdateRequest) UnmarshalJSON(data []byte) error { + var w startUpdateRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := startUpdateRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type startUpdateResponseWire struct { UpdateId *string `json:"update_id,omitempty"` } @@ -5406,6 +7950,30 @@ func startUpdateResponseFromWire(w *startUpdateResponseWire) (*StartUpdateRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StartUpdateResponse) MarshalJSON() ([]byte, error) { + w, err := startUpdateResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StartUpdateResponse) UnmarshalJSON(data []byte) error { + var w startUpdateResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := startUpdateResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type stopPipelineRequestWire struct { PipelineId *string `json:"pipeline_id,omitempty"` } @@ -5428,6 +7996,30 @@ func stopPipelineRequestFromWire(w *stopPipelineRequestWire) (*StopPipelineReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StopPipelineRequest) MarshalJSON() ([]byte, error) { + w, err := stopPipelineRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StopPipelineRequest) UnmarshalJSON(data []byte) error { + var w stopPipelineRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := stopPipelineRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type stopPipelineResponseWire struct { } @@ -5445,6 +8037,30 @@ func stopPipelineResponseFromWire(w *stopPipelineResponseWire) (*StopPipelineRes return &StopPipelineResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StopPipelineResponse) MarshalJSON() ([]byte, error) { + w, err := stopPipelineResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StopPipelineResponse) UnmarshalJSON(data []byte) error { + var w stopPipelineResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := stopPipelineResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tikTokAdsOptionsWire struct { LookbackWindowDays *int `json:"lookback_window_days,omitempty"` SyncStartDate *string `json:"sync_start_date,omitempty"` @@ -5496,6 +8112,30 @@ func tikTokAdsOptionsFromWire(w *tikTokAdsOptionsWire) (*TikTokAdsOptions, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TikTokAdsOptions) MarshalJSON() ([]byte, error) { + w, err := tikTokAdsOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TikTokAdsOptions) UnmarshalJSON(data []byte) error { + var w tikTokAdsOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tikTokAdsOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tikTokAdsOptions_TikTokAdsCustomReportOptionsWire struct { Dimensions []string `json:"dimensions,omitempty"` Metrics []string `json:"metrics,omitempty"` @@ -5530,6 +8170,30 @@ func tikTokAdsOptions_TikTokAdsCustomReportOptionsFromWire(w *tikTokAdsOptions_T }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TikTokAdsOptions_TikTokAdsCustomReportOptions) MarshalJSON() ([]byte, error) { + w, err := tikTokAdsOptions_TikTokAdsCustomReportOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TikTokAdsOptions_TikTokAdsCustomReportOptions) UnmarshalJSON(data []byte) error { + var w tikTokAdsOptions_TikTokAdsCustomReportOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tikTokAdsOptions_TikTokAdsCustomReportOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type transformerWire struct { Format Transformer_Format `json:"format,omitempty"` JsonOptions *jsonTransformerOptionsWire `json:"json_options,omitempty"` @@ -5631,6 +8295,30 @@ func transformerFromWire(w *transformerWire) (*Transformer, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Transformer) MarshalJSON() ([]byte, error) { + w, err := transformerToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Transformer) UnmarshalJSON(data []byte) error { + var w transformerWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := transformerFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type truncationWire struct { TruncatedFields []truncation_TruncationDetailWire `json:"truncated_fields,omitempty"` } @@ -5661,6 +8349,30 @@ func truncationFromWire(w *truncationWire) (*Truncation, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Truncation) MarshalJSON() ([]byte, error) { + w, err := truncationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Truncation) UnmarshalJSON(data []byte) error { + var w truncationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := truncationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type truncation_TruncationDetailWire struct { FieldName *string `json:"field_name,omitempty"` } @@ -5683,6 +8395,30 @@ func truncation_TruncationDetailFromWire(w *truncation_TruncationDetailWire) (*T }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Truncation_TruncationDetail) MarshalJSON() ([]byte, error) { + w, err := truncation_TruncationDetailToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Truncation_TruncationDetail) UnmarshalJSON(data []byte) error { + var w truncation_TruncationDetailWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := truncation_TruncationDetailFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateInfoWire struct { PipelineId *string `json:"pipeline_id,omitempty"` UpdateId *string `json:"update_id,omitempty"` @@ -5763,6 +8499,30 @@ func updateInfoFromWire(w *updateInfoWire) (*UpdateInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateInfo) MarshalJSON() ([]byte, error) { + w, err := updateInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateInfo) UnmarshalJSON(data []byte) error { + var w updateInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateStateInfoWire struct { UpdateId *string `json:"update_id,omitempty"` State UpdateState `json:"state,omitempty"` @@ -5791,6 +8551,30 @@ func updateStateInfoFromWire(w *updateStateInfoWire) (*UpdateStateInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateStateInfo) MarshalJSON() ([]byte, error) { + w, err := updateStateInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateStateInfo) UnmarshalJSON(data []byte) error { + var w updateStateInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateStateInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type zendeskSupportOptionsWire struct { StartDate *string `json:"start_date,omitempty"` } @@ -5813,6 +8597,30 @@ func zendeskSupportOptionsFromWire(w *zendeskSupportOptionsWire) (*ZendeskSuppor }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ZendeskSupportOptions) MarshalJSON() ([]byte, error) { + w, err := zendeskSupportOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ZendeskSupportOptions) UnmarshalJSON(data []byte) error { + var w zendeskSupportOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := zendeskSupportOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/policyfamilies/CHANGELOG.md b/policyfamilies/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/policyfamilies/CHANGELOG.md +++ b/policyfamilies/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/policyfamilies/internal/version.go b/policyfamilies/internal/version.go index ed069125..4ca40092 100644 --- a/policyfamilies/internal/version.go +++ b/policyfamilies/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-policyfamilies" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/policyfamilies/v2/wire.go b/policyfamilies/v2/wire.go index 323f3907..ec3bb412 100644 --- a/policyfamilies/v2/wire.go +++ b/policyfamilies/v2/wire.go @@ -85,6 +85,30 @@ func getPolicyFamilyRequestFromWire(w *getPolicyFamilyRequestWire) (*GetPolicyFa }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPolicyFamilyRequest) MarshalJSON() ([]byte, error) { + w, err := getPolicyFamilyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPolicyFamilyRequest) UnmarshalJSON(data []byte) error { + var w getPolicyFamilyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPolicyFamilyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPolicyFamiliesRequestWire struct { MaxResults *wireInt64 `json:"max_results,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -118,6 +142,30 @@ func listPolicyFamiliesRequestFromWire(w *listPolicyFamiliesRequestWire) (*ListP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPolicyFamiliesRequest) MarshalJSON() ([]byte, error) { + w, err := listPolicyFamiliesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPolicyFamiliesRequest) UnmarshalJSON(data []byte) error { + var w listPolicyFamiliesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPolicyFamiliesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPolicyFamiliesResponseWire struct { PolicyFamilies []policyFamilyWire `json:"policy_families,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -151,6 +199,30 @@ func listPolicyFamiliesResponseFromWire(w *listPolicyFamiliesResponseWire) (*Lis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPolicyFamiliesResponse) MarshalJSON() ([]byte, error) { + w, err := listPolicyFamiliesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPolicyFamiliesResponse) UnmarshalJSON(data []byte) error { + var w listPolicyFamiliesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPolicyFamiliesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type policyFamilyWire struct { PolicyFamilyId *string `json:"policy_family_id,omitempty"` Name *string `json:"name,omitempty"` @@ -182,6 +254,30 @@ func policyFamilyFromWire(w *policyFamilyWire) (*PolicyFamily, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PolicyFamily) MarshalJSON() ([]byte, error) { + w, err := policyFamilyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PolicyFamily) UnmarshalJSON(data []byte) error { + var w policyFamilyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := policyFamilyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/postgres/CHANGELOG.md b/postgres/CHANGELOG.md index cb75e97f..7e532780 100644 --- a/postgres/CHANGELOG.md +++ b/postgres/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.11.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.10.0 (2026-11-11) ## Release v0.9.0 (2026-11-10) diff --git a/postgres/internal/version.go b/postgres/internal/version.go index 8752c853..4e68fa1f 100644 --- a/postgres/internal/version.go +++ b/postgres/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-postgres" -const Version = "0.10.0" +const Version = "0.11.0" diff --git a/postgres/v1/model.go b/postgres/v1/model.go index 1cb36a7c..2887edc4 100644 --- a/postgres/v1/model.go +++ b/postgres/v1/model.go @@ -1151,8 +1151,8 @@ type CreateDatabaseRequest struct { // The Branch where this Database will be created. Format: // projects/{project_id}/branches/{branch_id} Parent *string - // The ID to use for the Database, which will become the final component of the - // database's resource name. This ID becomes the database name in postgres. + // The ID used to identify and manage the Database resource through the API. The + // Postgres database name is specified in `spec.postgres_database`. // // This value should be 4-63 characters, and only use characters available in // DNS names, as defined by RFC-1123 @@ -1208,8 +1208,8 @@ type CreateRoleRequest struct { // The Branch where this Role is created. Format: // projects/{project_id}/branches/{branch_id} Parent *string - // The ID to use for the Role, which will become the final component of the - // role's resource name. This ID becomes the role in Postgres. + // The ID used to identify and manage the Role resource through the API. The + // Postgres role name is specified in `spec.postgres_role`. // // This value should be 4-63 characters, and valid characters are lowercase // letters, numbers, and hyphens, as defined by RFC 1123. @@ -1373,7 +1373,7 @@ type Database_DatabaseSpec struct { // // To change the owner, pass valid existing Role name when updating the Database // - // A database always has an owner. + // Required when creating the Database. Role *string `fieldmask:"role"` // The name of the Postgres database. // @@ -1466,6 +1466,10 @@ type DeleteDatabaseRequest struct { type DeleteEndpointRequest struct { // The full resource path of the endpoint to delete. Format: // projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id} + // + // Read-write endpoints currently cannot be deleted directly. Their deletion is + // managed by the parent branch. To avoid compute costs, set `disabled` to + // `true` on the endpoint. Name *string } @@ -2404,21 +2408,17 @@ type Role_Attributes struct { } type Role_RoleSpec struct { - // An enum value for a standard role that this role is a member of. + // An enum value for a standard role that this role is a member of. When + // selected in update_mask, this field replaces all existing memberships. An + // empty or omitted list clears all memberships, including DATABRICKS_SUPERUSER. MembershipRoles []Role_MembershipRole `fieldmask:"membership_roles"` - // The type of role. When specifying a managed-identity, the chosen role_id must - // be a valid: + // The type of role. When specifying a managed-identity, the chosen + // postgres_role must be a valid: // // * application ID for SERVICE_PRINCIPAL * user email for USER * group name for // GROUP // - // This field is set when the role is created and cannot be changed. When - // replacing an existing role with replace_existing=true, omit this field or - // supply its current value. A differing value returns INVALID_PARAMETER_VALUE - // and rejects the entire request, including changes to mutable fields. With `*` - // or masks containing only mutable fields, supplied values are ignored. - // Including this field as an explicit path in update_mask returns - // INVALID_PARAMETER_VALUE. + // This value cannot be changed after creation. IdentityType Role_IdentityType `fieldmask:"identity_type"` // The desired API-exposed Postgres role attribute to associate with the role. // Optional. @@ -2432,9 +2432,9 @@ type Role_RoleSpec struct { // static password exists for roles using this method. * // PG_PASSWORD_SCRAM_SHA_256: the role authenticates with a Postgres password // verified server-side using the SCRAM-SHA-256 mechanism. Lakebase generates a - // password for the role. * NO_LOGIN: the role cannot open a Postgres session at - // all. Useful for roles that exist only to own objects or to aggregate - // privileges that are then granted to other, loginable roles. + // password for the role. + // + // NO_LOGIN is not currently supported for Role creation. // // If auth_method is left unspecified, a meaningful authentication method is // derived from the identity_type: * For the managed identities, OAUTH is used. @@ -2444,13 +2444,7 @@ type Role_RoleSpec struct { // NOTE: for the identity type GROUP, LAKEBASE_OAUTH_V1 is the // default auth method (group can login as well). // - // This field is set when the role is created and cannot be changed. When - // replacing an existing role with replace_existing=true, omit this field or - // supply its current value. A differing value returns INVALID_PARAMETER_VALUE - // and rejects the entire request, including changes to mutable fields. With `*` - // or masks containing only mutable fields, supplied values are ignored. - // Including this field as an explicit path in update_mask returns - // INVALID_PARAMETER_VALUE. + // This value cannot be changed after creation. AuthMethod Role_AuthMethod `fieldmask:"auth_method"` // The name of the Postgres role. // @@ -2465,13 +2459,7 @@ type Role_RoleSpec struct { // 1. user email for IdentityType.USER 2. app ID for // IdentityType.SERVICE_PRINCIPAL 2. group name for IdentityType.GROUP // - // This field is set when the role is created and cannot be changed. When - // replacing an existing role with replace_existing=true, omit this field or - // supply its current value. A differing value returns INVALID_PARAMETER_VALUE - // and rejects the entire request, including changes to mutable fields. With `*` - // or masks containing only mutable fields, supplied values are ignored. - // Including this field as an explicit path in update_mask returns - // INVALID_PARAMETER_VALUE. + // This value cannot be changed after creation. PostgresRole *string `fieldmask:"postgres_role"` } diff --git a/postgres/v1/wire.go b/postgres/v1/wire.go index 702e94d3..f973b10b 100644 --- a/postgres/v1/wire.go +++ b/postgres/v1/wire.go @@ -76,6 +76,30 @@ func acknowledgeAssessmentWarningsRequestFromWire(w *acknowledgeAssessmentWarnin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AcknowledgeAssessmentWarningsRequest) MarshalJSON() ([]byte, error) { + w, err := acknowledgeAssessmentWarningsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AcknowledgeAssessmentWarningsRequest) UnmarshalJSON(data []byte) error { + var w acknowledgeAssessmentWarningsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := acknowledgeAssessmentWarningsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type acknowledgeAssessmentWarningsResponseWire struct { Assessment *assessmentWire `json:"assessment,omitempty"` } @@ -106,6 +130,30 @@ func acknowledgeAssessmentWarningsResponseFromWire(w *acknowledgeAssessmentWarni }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AcknowledgeAssessmentWarningsResponse) MarshalJSON() ([]byte, error) { + w, err := acknowledgeAssessmentWarningsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AcknowledgeAssessmentWarningsResponse) UnmarshalJSON(data []byte) error { + var w acknowledgeAssessmentWarningsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := acknowledgeAssessmentWarningsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type apiErrorWire struct { ErrorCode ErrorCode `json:"error_code,omitempty"` Message *string `json:"message,omitempty"` @@ -137,6 +185,30 @@ func apiErrorFromWire(w *apiErrorWire) (*ApiError, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ApiError) MarshalJSON() ([]byte, error) { + w, err := apiErrorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ApiError) UnmarshalJSON(data []byte) error { + var w apiErrorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := apiErrorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type assessMigrationRequestWire struct { Name *string `json:"name,omitempty"` } @@ -159,6 +231,30 @@ func assessMigrationRequestFromWire(w *assessMigrationRequestWire) (*AssessMigra }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AssessMigrationRequest) MarshalJSON() ([]byte, error) { + w, err := assessMigrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AssessMigrationRequest) UnmarshalJSON(data []byte) error { + var w assessMigrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := assessMigrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type assessMigrationResponseWire struct { Assessment *assessmentWire `json:"assessment,omitempty"` } @@ -189,6 +285,30 @@ func assessMigrationResponseFromWire(w *assessMigrationResponseWire) (*AssessMig }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AssessMigrationResponse) MarshalJSON() ([]byte, error) { + w, err := assessMigrationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AssessMigrationResponse) UnmarshalJSON(data []byte) error { + var w assessMigrationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := assessMigrationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type assessmentWire struct { Name *string `json:"name,omitempty"` State AssessmentState `json:"state,omitempty"` @@ -234,6 +354,30 @@ func assessmentFromWire(w *assessmentWire) (*Assessment, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Assessment) MarshalJSON() ([]byte, error) { + w, err := assessmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Assessment) UnmarshalJSON(data []byte) error { + var w assessmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := assessmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type assessmentCheckWire struct { CheckId *string `json:"check_id,omitempty"` Verdict AssessmentCheckVerdict `json:"verdict,omitempty"` @@ -279,6 +423,30 @@ func assessmentCheckFromWire(w *assessmentCheckWire) (*AssessmentCheck, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AssessmentCheck) MarshalJSON() ([]byte, error) { + w, err := assessmentCheckToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AssessmentCheck) UnmarshalJSON(data []byte) error { + var w assessmentCheckWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := assessmentCheckFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type assessmentCheckDetailsWire struct { DatabaseSize *databaseSizeDetailsWire `json:"database_size,omitempty"` LongTransaction *longTransactionDetailsWire `json:"long_transaction,omitempty"` @@ -351,6 +519,30 @@ func assessmentCheckDetailsFromWire(w *assessmentCheckDetailsWire) (*AssessmentC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AssessmentCheckDetails) MarshalJSON() ([]byte, error) { + w, err := assessmentCheckDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AssessmentCheckDetails) UnmarshalJSON(data []byte) error { + var w assessmentCheckDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := assessmentCheckDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type branchWire struct { Name *string `json:"name,omitempty"` Uid *string `json:"uid,omitempty"` @@ -410,6 +602,30 @@ func branchFromWire(w *branchWire) (*Branch, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Branch) MarshalJSON() ([]byte, error) { + w, err := branchToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Branch) UnmarshalJSON(data []byte) error { + var w branchWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := branchFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type branchOperationMetadataWire struct { } @@ -427,6 +643,30 @@ func branchOperationMetadataFromWire(w *branchOperationMetadataWire) (*BranchOpe return &BranchOperationMetadata{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BranchOperationMetadata) MarshalJSON() ([]byte, error) { + w, err := branchOperationMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BranchOperationMetadata) UnmarshalJSON(data []byte) error { + var w branchOperationMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := branchOperationMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type branchSpecWire struct { SourceBranch *string `json:"source_branch,omitempty"` SourceBranchLsn *string `json:"source_branch_lsn,omitempty"` @@ -510,6 +750,30 @@ func branchSpecFromWire(w *branchSpecWire) (*BranchSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BranchSpec) MarshalJSON() ([]byte, error) { + w, err := branchSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BranchSpec) UnmarshalJSON(data []byte) error { + var w branchSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := branchSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type branchStatusWire struct { SourceBranch *string `json:"source_branch,omitempty"` SourceBranchLsn *string `json:"source_branch_lsn,omitempty"` @@ -579,6 +843,30 @@ func branchStatusFromWire(w *branchStatusWire) (*BranchStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BranchStatus) MarshalJSON() ([]byte, error) { + w, err := branchStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BranchStatus) UnmarshalJSON(data []byte) error { + var w branchStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := branchStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type catalogWire struct { Name *string `json:"name,omitempty"` Uid *string `json:"uid,omitempty"` @@ -635,6 +923,30 @@ func catalogFromWire(w *catalogWire) (*Catalog, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Catalog) MarshalJSON() ([]byte, error) { + w, err := catalogToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Catalog) UnmarshalJSON(data []byte) error { + var w catalogWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := catalogFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type catalog_CatalogSpecWire struct { PostgresDatabase *string `json:"postgres_database,omitempty"` CreateDatabaseIfMissing *bool `json:"create_database_if_missing,omitempty"` @@ -663,6 +975,30 @@ func catalog_CatalogSpecFromWire(w *catalog_CatalogSpecWire) (*Catalog_CatalogSp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Catalog_CatalogSpec) MarshalJSON() ([]byte, error) { + w, err := catalog_CatalogSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Catalog_CatalogSpec) UnmarshalJSON(data []byte) error { + var w catalog_CatalogSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := catalog_CatalogSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type catalog_CatalogStatusWire struct { PostgresDatabase *string `json:"postgres_database,omitempty"` Project *string `json:"project,omitempty"` @@ -691,6 +1027,30 @@ func catalog_CatalogStatusFromWire(w *catalog_CatalogStatusWire) (*Catalog_Catal }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Catalog_CatalogStatus) MarshalJSON() ([]byte, error) { + w, err := catalog_CatalogStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Catalog_CatalogStatus) UnmarshalJSON(data []byte) error { + var w catalog_CatalogStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := catalog_CatalogStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type catalogOperationMetadataWire struct { } @@ -708,6 +1068,30 @@ func catalogOperationMetadataFromWire(w *catalogOperationMetadataWire) (*Catalog return &CatalogOperationMetadata{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CatalogOperationMetadata) MarshalJSON() ([]byte, error) { + w, err := catalogOperationMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CatalogOperationMetadata) UnmarshalJSON(data []byte) error { + var w catalogOperationMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := catalogOperationMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cdfConfigWire struct { Name *string `json:"name,omitempty"` Catalog *string `json:"catalog,omitempty"` @@ -748,6 +1132,30 @@ func cdfConfigFromWire(w *cdfConfigWire) (*CdfConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CdfConfig) MarshalJSON() ([]byte, error) { + w, err := cdfConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CdfConfig) UnmarshalJSON(data []byte) error { + var w cdfConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cdfConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cdfConfigOperationMetadataWire struct { } @@ -765,6 +1173,30 @@ func cdfConfigOperationMetadataFromWire(w *cdfConfigOperationMetadataWire) (*Cdf return &CdfConfigOperationMetadata{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CdfConfigOperationMetadata) MarshalJSON() ([]byte, error) { + w, err := cdfConfigOperationMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CdfConfigOperationMetadata) UnmarshalJSON(data []byte) error { + var w cdfConfigOperationMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cdfConfigOperationMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cdfStatusWire struct { Name *string `json:"name,omitempty"` PostgresTable *string `json:"postgres_table,omitempty"` @@ -808,6 +1240,30 @@ func cdfStatusFromWire(w *cdfStatusWire) (*CdfStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CdfStatus) MarshalJSON() ([]byte, error) { + w, err := cdfStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CdfStatus) UnmarshalJSON(data []byte) error { + var w cdfStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cdfStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createBranchRequestWire struct { Parent *string `json:"parent,omitempty"` BranchId *string `json:"branch_id,omitempty"` @@ -847,6 +1303,30 @@ func createBranchRequestFromWire(w *createBranchRequestWire) (*CreateBranchReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateBranchRequest) MarshalJSON() ([]byte, error) { + w, err := createBranchRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateBranchRequest) UnmarshalJSON(data []byte) error { + var w createBranchRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createBranchRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCatalogRequestWire struct { CatalogId *string `json:"catalog_id,omitempty"` Catalog *catalogWire `json:"catalog,omitempty"` @@ -880,6 +1360,30 @@ func createCatalogRequestFromWire(w *createCatalogRequestWire) (*CreateCatalogRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCatalogRequest) MarshalJSON() ([]byte, error) { + w, err := createCatalogRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCatalogRequest) UnmarshalJSON(data []byte) error { + var w createCatalogRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCatalogRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCdfConfigRequestWire struct { Parent *string `json:"parent,omitempty"` CdfConfig *cdfConfigWire `json:"cdf_config,omitempty"` @@ -916,10 +1420,34 @@ func createCdfConfigRequestFromWire(w *createCdfConfigRequestWire) (*CreateCdfCo }, nil } -type createDataApiRequestWire struct { - Parent *string `json:"parent,omitempty"` - DataApi *dataApiWire `json:"data_api,omitempty"` -} +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCdfConfigRequest) MarshalJSON() ([]byte, error) { + w, err := createCdfConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCdfConfigRequest) UnmarshalJSON(data []byte) error { + var w createCdfConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCdfConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type createDataApiRequestWire struct { + Parent *string `json:"parent,omitempty"` + DataApi *dataApiWire `json:"data_api,omitempty"` +} func createDataApiRequestToWire(v *CreateDataApiRequest) (*createDataApiRequestWire, error) { if v == nil { @@ -949,6 +1477,30 @@ func createDataApiRequestFromWire(w *createDataApiRequestWire) (*CreateDataApiRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateDataApiRequest) MarshalJSON() ([]byte, error) { + w, err := createDataApiRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateDataApiRequest) UnmarshalJSON(data []byte) error { + var w createDataApiRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createDataApiRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createDatabaseRequestWire struct { Parent *string `json:"parent,omitempty"` DatabaseId *string `json:"database_id,omitempty"` @@ -988,6 +1540,30 @@ func createDatabaseRequestFromWire(w *createDatabaseRequestWire) (*CreateDatabas }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateDatabaseRequest) MarshalJSON() ([]byte, error) { + w, err := createDatabaseRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateDatabaseRequest) UnmarshalJSON(data []byte) error { + var w createDatabaseRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createDatabaseRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createEndpointRequestWire struct { Parent *string `json:"parent,omitempty"` EndpointId *string `json:"endpoint_id,omitempty"` @@ -1027,6 +1603,30 @@ func createEndpointRequestFromWire(w *createEndpointRequestWire) (*CreateEndpoin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := createEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateEndpointRequest) UnmarshalJSON(data []byte) error { + var w createEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createMigrationRequestWire struct { MigrationId *string `json:"migration_id,omitempty"` Migration *migrationWire `json:"migration,omitempty"` @@ -1060,6 +1660,30 @@ func createMigrationRequestFromWire(w *createMigrationRequestWire) (*CreateMigra }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateMigrationRequest) MarshalJSON() ([]byte, error) { + w, err := createMigrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateMigrationRequest) UnmarshalJSON(data []byte) error { + var w createMigrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createMigrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createProjectRequestWire struct { ProjectId *string `json:"project_id,omitempty"` Project *projectWire `json:"project,omitempty"` @@ -1093,6 +1717,30 @@ func createProjectRequestFromWire(w *createProjectRequestWire) (*CreateProjectRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateProjectRequest) MarshalJSON() ([]byte, error) { + w, err := createProjectRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateProjectRequest) UnmarshalJSON(data []byte) error { + var w createProjectRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createProjectRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createRoleRequestWire struct { Parent *string `json:"parent,omitempty"` RoleId *string `json:"role_id,omitempty"` @@ -1132,6 +1780,30 @@ func createRoleRequestFromWire(w *createRoleRequestWire) (*CreateRoleRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateRoleRequest) MarshalJSON() ([]byte, error) { + w, err := createRoleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateRoleRequest) UnmarshalJSON(data []byte) error { + var w createRoleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createRoleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createSnapshotRequestWire struct { Parent *string `json:"parent,omitempty"` Snapshot *snapshotWire `json:"snapshot,omitempty"` @@ -1168,6 +1840,30 @@ func createSnapshotRequestFromWire(w *createSnapshotRequestWire) (*CreateSnapsho }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateSnapshotRequest) MarshalJSON() ([]byte, error) { + w, err := createSnapshotRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateSnapshotRequest) UnmarshalJSON(data []byte) error { + var w createSnapshotRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createSnapshotRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createSyncedTableRequestWire struct { SyncedTableId *string `json:"synced_table_id,omitempty"` SyncedTable *syncedTableWire `json:"synced_table,omitempty"` @@ -1201,6 +1897,30 @@ func createSyncedTableRequestFromWire(w *createSyncedTableRequestWire) (*CreateS }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateSyncedTableRequest) MarshalJSON() ([]byte, error) { + w, err := createSyncedTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateSyncedTableRequest) UnmarshalJSON(data []byte) error { + var w createSyncedTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createSyncedTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dailyScheduleWire struct { Hour *int `json:"hour,omitempty"` } @@ -1223,6 +1943,30 @@ func dailyScheduleFromWire(w *dailyScheduleWire) (*DailySchedule, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DailySchedule) MarshalJSON() ([]byte, error) { + w, err := dailyScheduleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DailySchedule) UnmarshalJSON(data []byte) error { + var w dailyScheduleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dailyScheduleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dataApiWire struct { Name *string `json:"name,omitempty"` Parent *string `json:"parent,omitempty"` @@ -1276,6 +2020,30 @@ func dataApiFromWire(w *dataApiWire) (*DataApi, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DataApi) MarshalJSON() ([]byte, error) { + w, err := dataApiToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DataApi) UnmarshalJSON(data []byte) error { + var w dataApiWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dataApiFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dataApi_DataApiSpecWire struct { DbAggregatesEnabled *bool `json:"db_aggregates_enabled,omitempty"` DbExtraSearchPath []string `json:"db_extra_search_path,omitempty"` @@ -1322,6 +2090,30 @@ func dataApi_DataApiSpecFromWire(w *dataApi_DataApiSpecWire) (*DataApi_DataApiSp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DataApi_DataApiSpec) MarshalJSON() ([]byte, error) { + w, err := dataApi_DataApiSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DataApi_DataApiSpec) UnmarshalJSON(data []byte) error { + var w dataApi_DataApiSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dataApi_DataApiSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dataApi_DataApiStatusWire struct { DbAggregatesEnabled *bool `json:"db_aggregates_enabled,omitempty"` DbExtraSearchPath []string `json:"db_extra_search_path,omitempty"` @@ -1374,6 +2166,30 @@ func dataApi_DataApiStatusFromWire(w *dataApi_DataApiStatusWire) (*DataApi_DataA }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DataApi_DataApiStatus) MarshalJSON() ([]byte, error) { + w, err := dataApi_DataApiStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DataApi_DataApiStatus) UnmarshalJSON(data []byte) error { + var w dataApi_DataApiStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dataApi_DataApiStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dataApiOperationMetadataWire struct { } @@ -1391,6 +2207,30 @@ func dataApiOperationMetadataFromWire(w *dataApiOperationMetadataWire) (*DataApi return &DataApiOperationMetadata{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DataApiOperationMetadata) MarshalJSON() ([]byte, error) { + w, err := dataApiOperationMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DataApiOperationMetadata) UnmarshalJSON(data []byte) error { + var w dataApiOperationMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dataApiOperationMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databaseWire struct { Name *string `json:"name,omitempty"` Parent *string `json:"parent,omitempty"` @@ -1447,6 +2287,30 @@ func databaseFromWire(w *databaseWire) (*Database, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Database) MarshalJSON() ([]byte, error) { + w, err := databaseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Database) UnmarshalJSON(data []byte) error { + var w databaseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databaseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type database_DatabaseSpecWire struct { Role *string `json:"role,omitempty"` PostgresDatabase *string `json:"postgres_database,omitempty"` @@ -1472,6 +2336,30 @@ func database_DatabaseSpecFromWire(w *database_DatabaseSpecWire) (*Database_Data }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Database_DatabaseSpec) MarshalJSON() ([]byte, error) { + w, err := database_DatabaseSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Database_DatabaseSpec) UnmarshalJSON(data []byte) error { + var w database_DatabaseSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := database_DatabaseSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type database_DatabaseStatusWire struct { Role *string `json:"role,omitempty"` PostgresDatabase *string `json:"postgres_database,omitempty"` @@ -1500,6 +2388,30 @@ func database_DatabaseStatusFromWire(w *database_DatabaseStatusWire) (*Database_ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Database_DatabaseStatus) MarshalJSON() ([]byte, error) { + w, err := database_DatabaseStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Database_DatabaseStatus) UnmarshalJSON(data []byte) error { + var w database_DatabaseStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := database_DatabaseStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databaseCredentialWire struct { Token *string `json:"token,omitempty"` ExpireTime *types.Time `json:"expire_time,omitempty"` @@ -1525,6 +2437,30 @@ func databaseCredentialFromWire(w *databaseCredentialWire) (*DatabaseCredential, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatabaseCredential) MarshalJSON() ([]byte, error) { + w, err := databaseCredentialToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatabaseCredential) UnmarshalJSON(data []byte) error { + var w databaseCredentialWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databaseCredentialFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databaseMappingWire struct { SourceDatabase *string `json:"source_database,omitempty"` TargetDatabase *string `json:"target_database,omitempty"` @@ -1553,6 +2489,30 @@ func databaseMappingFromWire(w *databaseMappingWire) (*DatabaseMapping, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatabaseMapping) MarshalJSON() ([]byte, error) { + w, err := databaseMappingToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatabaseMapping) UnmarshalJSON(data []byte) error { + var w databaseMappingWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databaseMappingFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databaseOperationMetadataWire struct { } @@ -1570,6 +2530,30 @@ func databaseOperationMetadataFromWire(w *databaseOperationMetadataWire) (*Datab return &DatabaseOperationMetadata{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatabaseOperationMetadata) MarshalJSON() ([]byte, error) { + w, err := databaseOperationMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatabaseOperationMetadata) UnmarshalJSON(data []byte) error { + var w databaseOperationMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databaseOperationMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databaseSizeDetailsWire struct { SizeBytes *wireInt64 `json:"size_bytes,omitempty"` } @@ -1600,6 +2584,30 @@ func databaseSizeDetailsFromWire(w *databaseSizeDetailsWire) (*DatabaseSizeDetai }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatabaseSizeDetails) MarshalJSON() ([]byte, error) { + w, err := databaseSizeDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatabaseSizeDetails) UnmarshalJSON(data []byte) error { + var w databaseSizeDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databaseSizeDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteBranchRequestWire struct { Name *string `json:"name,omitempty"` Purge *bool `json:"purge,omitempty"` @@ -1625,6 +2633,30 @@ func deleteBranchRequestFromWire(w *deleteBranchRequestWire) (*DeleteBranchReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteBranchRequest) MarshalJSON() ([]byte, error) { + w, err := deleteBranchRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteBranchRequest) UnmarshalJSON(data []byte) error { + var w deleteBranchRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteBranchRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCatalogRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1647,6 +2679,30 @@ func deleteCatalogRequestFromWire(w *deleteCatalogRequestWire) (*DeleteCatalogRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCatalogRequest) MarshalJSON() ([]byte, error) { + w, err := deleteCatalogRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCatalogRequest) UnmarshalJSON(data []byte) error { + var w deleteCatalogRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCatalogRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCdfConfigRequestWire struct { Name *string `json:"name,omitempty"` Force *bool `json:"force,omitempty"` @@ -1672,6 +2728,30 @@ func deleteCdfConfigRequestFromWire(w *deleteCdfConfigRequestWire) (*DeleteCdfCo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCdfConfigRequest) MarshalJSON() ([]byte, error) { + w, err := deleteCdfConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCdfConfigRequest) UnmarshalJSON(data []byte) error { + var w deleteCdfConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCdfConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteDataApiRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1694,6 +2774,30 @@ func deleteDataApiRequestFromWire(w *deleteDataApiRequestWire) (*DeleteDataApiRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteDataApiRequest) MarshalJSON() ([]byte, error) { + w, err := deleteDataApiRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteDataApiRequest) UnmarshalJSON(data []byte) error { + var w deleteDataApiRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteDataApiRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteDatabaseRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1716,6 +2820,30 @@ func deleteDatabaseRequestFromWire(w *deleteDatabaseRequestWire) (*DeleteDatabas }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteDatabaseRequest) MarshalJSON() ([]byte, error) { + w, err := deleteDatabaseRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteDatabaseRequest) UnmarshalJSON(data []byte) error { + var w deleteDatabaseRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteDatabaseRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteEndpointRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1738,6 +2866,30 @@ func deleteEndpointRequestFromWire(w *deleteEndpointRequestWire) (*DeleteEndpoin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := deleteEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteEndpointRequest) UnmarshalJSON(data []byte) error { + var w deleteEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteMigrationRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1760,6 +2912,30 @@ func deleteMigrationRequestFromWire(w *deleteMigrationRequestWire) (*DeleteMigra }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteMigrationRequest) MarshalJSON() ([]byte, error) { + w, err := deleteMigrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteMigrationRequest) UnmarshalJSON(data []byte) error { + var w deleteMigrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteMigrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteProjectRequestWire struct { Name *string `json:"name,omitempty"` Purge *bool `json:"purge,omitempty"` @@ -1785,6 +2961,30 @@ func deleteProjectRequestFromWire(w *deleteProjectRequestWire) (*DeleteProjectRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteProjectRequest) MarshalJSON() ([]byte, error) { + w, err := deleteProjectRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteProjectRequest) UnmarshalJSON(data []byte) error { + var w deleteProjectRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteProjectRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRoleRequestWire struct { Name *string `json:"name,omitempty"` ReassignOwnedTo *string `json:"reassign_owned_to,omitempty"` @@ -1810,6 +3010,30 @@ func deleteRoleRequestFromWire(w *deleteRoleRequestWire) (*DeleteRoleRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRoleRequest) MarshalJSON() ([]byte, error) { + w, err := deleteRoleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRoleRequest) UnmarshalJSON(data []byte) error { + var w deleteRoleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRoleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteSnapshotRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1832,6 +3056,30 @@ func deleteSnapshotRequestFromWire(w *deleteSnapshotRequestWire) (*DeleteSnapsho }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteSnapshotRequest) MarshalJSON() ([]byte, error) { + w, err := deleteSnapshotRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteSnapshotRequest) UnmarshalJSON(data []byte) error { + var w deleteSnapshotRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteSnapshotRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteSyncedTableRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1854,6 +3102,30 @@ func deleteSyncedTableRequestFromWire(w *deleteSyncedTableRequestWire) (*DeleteS }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteSyncedTableRequest) MarshalJSON() ([]byte, error) { + w, err := deleteSyncedTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteSyncedTableRequest) UnmarshalJSON(data []byte) error { + var w deleteSyncedTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteSyncedTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deltaTableSyncInfoWire struct { DeltaCommitVersion *wireInt64 `json:"delta_commit_version,omitempty"` DeltaCommitTime *types.Time `json:"delta_commit_time,omitempty"` @@ -1887,6 +3159,30 @@ func deltaTableSyncInfoFromWire(w *deltaTableSyncInfoWire) (*DeltaTableSyncInfo, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeltaTableSyncInfo) MarshalJSON() ([]byte, error) { + w, err := deltaTableSyncInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeltaTableSyncInfo) UnmarshalJSON(data []byte) error { + var w deltaTableSyncInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deltaTableSyncInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointWire struct { Name *string `json:"name,omitempty"` Uid *string `json:"uid,omitempty"` @@ -1946,6 +3242,30 @@ func endpointFromWire(w *endpointWire) (*Endpoint, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Endpoint) MarshalJSON() ([]byte, error) { + w, err := endpointToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Endpoint) UnmarshalJSON(data []byte) error { + var w endpointWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointGroupSpecWire struct { Min *int `json:"min,omitempty"` Max *int `json:"max,omitempty"` @@ -1974,6 +3294,30 @@ func endpointGroupSpecFromWire(w *endpointGroupSpecWire) (*EndpointGroupSpec, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointGroupSpec) MarshalJSON() ([]byte, error) { + w, err := endpointGroupSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointGroupSpec) UnmarshalJSON(data []byte) error { + var w endpointGroupSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointGroupSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointGroupStatusWire struct { Min *int `json:"min,omitempty"` Max *int `json:"max,omitempty"` @@ -2002,6 +3346,30 @@ func endpointGroupStatusFromWire(w *endpointGroupStatusWire) (*EndpointGroupStat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointGroupStatus) MarshalJSON() ([]byte, error) { + w, err := endpointGroupStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointGroupStatus) UnmarshalJSON(data []byte) error { + var w endpointGroupStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointGroupStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointHostsWire struct { Host *string `json:"host,omitempty"` ReadOnlyHost *string `json:"read_only_host,omitempty"` @@ -2033,6 +3401,30 @@ func endpointHostsFromWire(w *endpointHostsWire) (*EndpointHosts, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointHosts) MarshalJSON() ([]byte, error) { + w, err := endpointHostsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointHosts) UnmarshalJSON(data []byte) error { + var w endpointHostsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointHostsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointOperationMetadataWire struct { } @@ -2050,6 +3442,30 @@ func endpointOperationMetadataFromWire(w *endpointOperationMetadataWire) (*Endpo return &EndpointOperationMetadata{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointOperationMetadata) MarshalJSON() ([]byte, error) { + w, err := endpointOperationMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointOperationMetadata) UnmarshalJSON(data []byte) error { + var w endpointOperationMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointOperationMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointSettingsWire struct { PgSettings map[string]string `json:"pg_settings,omitempty"` } @@ -2072,6 +3488,30 @@ func endpointSettingsFromWire(w *endpointSettingsWire) (*EndpointSettings, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointSettings) MarshalJSON() ([]byte, error) { + w, err := endpointSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointSettings) UnmarshalJSON(data []byte) error { + var w endpointSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointSpecWire struct { EndpointType EndpointType `json:"endpoint_type,omitempty"` AutoscalingLimitMinCu *float64 `json:"autoscaling_limit_min_cu,omitempty"` @@ -2162,6 +3602,30 @@ func endpointSpecFromWire(w *endpointSpecWire) (*EndpointSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointSpec) MarshalJSON() ([]byte, error) { + w, err := endpointSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointSpec) UnmarshalJSON(data []byte) error { + var w endpointSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointStatusWire struct { EndpointType EndpointType `json:"endpoint_type,omitempty"` Hosts *endpointHostsWire `json:"hosts,omitempty"` @@ -2241,6 +3705,30 @@ func endpointStatusFromWire(w *endpointStatusWire) (*EndpointStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointStatus) MarshalJSON() ([]byte, error) { + w, err := endpointStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointStatus) UnmarshalJSON(data []byte) error { + var w endpointStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type generateDatabaseCredentialRequestWire struct { Claims []requestedClaimsWire `json:"claims,omitempty"` Endpoint *string `json:"endpoint,omitempty"` @@ -2314,6 +3802,30 @@ func generateDatabaseCredentialRequestFromWire(w *generateDatabaseCredentialRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenerateDatabaseCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := generateDatabaseCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenerateDatabaseCredentialRequest) UnmarshalJSON(data []byte) error { + var w generateDatabaseCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := generateDatabaseCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAssessmentRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2336,8 +3848,32 @@ func getAssessmentRequestFromWire(w *getAssessmentRequestWire) (*GetAssessmentRe }, nil } -type getBranchRequestWire struct { - Name *string `json:"name,omitempty"` +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAssessmentRequest) MarshalJSON() ([]byte, error) { + w, err := getAssessmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAssessmentRequest) UnmarshalJSON(data []byte) error { + var w getAssessmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAssessmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type getBranchRequestWire struct { + Name *string `json:"name,omitempty"` } func getBranchRequestToWire(v *GetBranchRequest) (*getBranchRequestWire, error) { @@ -2358,6 +3894,30 @@ func getBranchRequestFromWire(w *getBranchRequestWire) (*GetBranchRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetBranchRequest) MarshalJSON() ([]byte, error) { + w, err := getBranchRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetBranchRequest) UnmarshalJSON(data []byte) error { + var w getBranchRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getBranchRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCatalogRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2380,6 +3940,30 @@ func getCatalogRequestFromWire(w *getCatalogRequestWire) (*GetCatalogRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCatalogRequest) MarshalJSON() ([]byte, error) { + w, err := getCatalogRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCatalogRequest) UnmarshalJSON(data []byte) error { + var w getCatalogRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCatalogRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCdfConfigRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2402,6 +3986,30 @@ func getCdfConfigRequestFromWire(w *getCdfConfigRequestWire) (*GetCdfConfigReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCdfConfigRequest) MarshalJSON() ([]byte, error) { + w, err := getCdfConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCdfConfigRequest) UnmarshalJSON(data []byte) error { + var w getCdfConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCdfConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCdfStatusRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2424,6 +4032,30 @@ func getCdfStatusRequestFromWire(w *getCdfStatusRequestWire) (*GetCdfStatusReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCdfStatusRequest) MarshalJSON() ([]byte, error) { + w, err := getCdfStatusRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCdfStatusRequest) UnmarshalJSON(data []byte) error { + var w getCdfStatusRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCdfStatusRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getDataApiRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2446,6 +4078,30 @@ func getDataApiRequestFromWire(w *getDataApiRequestWire) (*GetDataApiRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetDataApiRequest) MarshalJSON() ([]byte, error) { + w, err := getDataApiRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetDataApiRequest) UnmarshalJSON(data []byte) error { + var w getDataApiRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getDataApiRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getDatabaseRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2468,6 +4124,30 @@ func getDatabaseRequestFromWire(w *getDatabaseRequestWire) (*GetDatabaseRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetDatabaseRequest) MarshalJSON() ([]byte, error) { + w, err := getDatabaseRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetDatabaseRequest) UnmarshalJSON(data []byte) error { + var w getDatabaseRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getDatabaseRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getEndpointRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2490,6 +4170,30 @@ func getEndpointRequestFromWire(w *getEndpointRequestWire) (*GetEndpointRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := getEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetEndpointRequest) UnmarshalJSON(data []byte) error { + var w getEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getMigrationRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2512,6 +4216,30 @@ func getMigrationRequestFromWire(w *getMigrationRequestWire) (*GetMigrationReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetMigrationRequest) MarshalJSON() ([]byte, error) { + w, err := getMigrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetMigrationRequest) UnmarshalJSON(data []byte) error { + var w getMigrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getMigrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getOperationRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2534,6 +4262,30 @@ func getOperationRequestFromWire(w *getOperationRequestWire) (*GetOperationReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetOperationRequest) MarshalJSON() ([]byte, error) { + w, err := getOperationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetOperationRequest) UnmarshalJSON(data []byte) error { + var w getOperationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getOperationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getProjectRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2556,6 +4308,30 @@ func getProjectRequestFromWire(w *getProjectRequestWire) (*GetProjectRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetProjectRequest) MarshalJSON() ([]byte, error) { + w, err := getProjectRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetProjectRequest) UnmarshalJSON(data []byte) error { + var w getProjectRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getProjectRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRoleRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2578,6 +4354,30 @@ func getRoleRequestFromWire(w *getRoleRequestWire) (*GetRoleRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRoleRequest) MarshalJSON() ([]byte, error) { + w, err := getRoleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRoleRequest) UnmarshalJSON(data []byte) error { + var w getRoleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRoleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSnapshotRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2600,6 +4400,30 @@ func getSnapshotRequestFromWire(w *getSnapshotRequestWire) (*GetSnapshotRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSnapshotRequest) MarshalJSON() ([]byte, error) { + w, err := getSnapshotRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSnapshotRequest) UnmarshalJSON(data []byte) error { + var w getSnapshotRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSnapshotRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSnapshotScheduleRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2622,6 +4446,30 @@ func getSnapshotScheduleRequestFromWire(w *getSnapshotScheduleRequestWire) (*Get }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSnapshotScheduleRequest) MarshalJSON() ([]byte, error) { + w, err := getSnapshotScheduleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSnapshotScheduleRequest) UnmarshalJSON(data []byte) error { + var w getSnapshotScheduleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSnapshotScheduleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSyncedTableRequestWire struct { Name *string `json:"name,omitempty"` } @@ -2644,6 +4492,30 @@ func getSyncedTableRequestFromWire(w *getSyncedTableRequestWire) (*GetSyncedTabl }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSyncedTableRequest) MarshalJSON() ([]byte, error) { + w, err := getSyncedTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSyncedTableRequest) UnmarshalJSON(data []byte) error { + var w getSyncedTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSyncedTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type initialBranchSpecWire struct { IsProtected *bool `json:"is_protected,omitempty"` } @@ -2666,6 +4538,30 @@ func initialBranchSpecFromWire(w *initialBranchSpecWire) (*InitialBranchSpec, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InitialBranchSpec) MarshalJSON() ([]byte, error) { + w, err := initialBranchSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InitialBranchSpec) UnmarshalJSON(data []byte) error { + var w initialBranchSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := initialBranchSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type initialEndpointSpecWire struct { Group *endpointGroupSpecWire `json:"group,omitempty"` AutoscalingLimitMinCu *float64 `json:"autoscaling_limit_min_cu,omitempty"` @@ -2739,6 +4635,30 @@ func initialEndpointSpecFromWire(w *initialEndpointSpecWire) (*InitialEndpointSp }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v InitialEndpointSpec) MarshalJSON() ([]byte, error) { + w, err := initialEndpointSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *InitialEndpointSpec) UnmarshalJSON(data []byte) error { + var w initialEndpointSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := initialEndpointSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAssessmentsRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -2767,6 +4687,30 @@ func listAssessmentsRequestFromWire(w *listAssessmentsRequestWire) (*ListAssessm }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAssessmentsRequest) MarshalJSON() ([]byte, error) { + w, err := listAssessmentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAssessmentsRequest) UnmarshalJSON(data []byte) error { + var w listAssessmentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAssessmentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAssessmentsResponseWire struct { Assessments []assessmentWire `json:"assessments,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2800,6 +4744,30 @@ func listAssessmentsResponseFromWire(w *listAssessmentsResponseWire) (*ListAsses }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAssessmentsResponse) MarshalJSON() ([]byte, error) { + w, err := listAssessmentsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAssessmentsResponse) UnmarshalJSON(data []byte) error { + var w listAssessmentsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAssessmentsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listBranchesRequestWire struct { Parent *string `json:"parent,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -2831,6 +4799,30 @@ func listBranchesRequestFromWire(w *listBranchesRequestWire) (*ListBranchesReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListBranchesRequest) MarshalJSON() ([]byte, error) { + w, err := listBranchesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListBranchesRequest) UnmarshalJSON(data []byte) error { + var w listBranchesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listBranchesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listBranchesResponseWire struct { Branches []branchWire `json:"branches,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2864,6 +4856,30 @@ func listBranchesResponseFromWire(w *listBranchesResponseWire) (*ListBranchesRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListBranchesResponse) MarshalJSON() ([]byte, error) { + w, err := listBranchesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListBranchesResponse) UnmarshalJSON(data []byte) error { + var w listBranchesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listBranchesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCdfConfigsRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -2892,6 +4908,30 @@ func listCdfConfigsRequestFromWire(w *listCdfConfigsRequestWire) (*ListCdfConfig }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCdfConfigsRequest) MarshalJSON() ([]byte, error) { + w, err := listCdfConfigsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCdfConfigsRequest) UnmarshalJSON(data []byte) error { + var w listCdfConfigsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCdfConfigsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCdfConfigsResponseWire struct { CdfConfigs []cdfConfigWire `json:"cdf_configs,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2925,6 +4965,30 @@ func listCdfConfigsResponseFromWire(w *listCdfConfigsResponseWire) (*ListCdfConf }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCdfConfigsResponse) MarshalJSON() ([]byte, error) { + w, err := listCdfConfigsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCdfConfigsResponse) UnmarshalJSON(data []byte) error { + var w listCdfConfigsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCdfConfigsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCdfStatusesRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -2953,6 +5017,30 @@ func listCdfStatusesRequestFromWire(w *listCdfStatusesRequestWire) (*ListCdfStat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCdfStatusesRequest) MarshalJSON() ([]byte, error) { + w, err := listCdfStatusesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCdfStatusesRequest) UnmarshalJSON(data []byte) error { + var w listCdfStatusesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCdfStatusesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCdfStatusesResponseWire struct { CdfStatuses []cdfStatusWire `json:"cdf_statuses,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2986,6 +5074,30 @@ func listCdfStatusesResponseFromWire(w *listCdfStatusesResponseWire) (*ListCdfSt }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCdfStatusesResponse) MarshalJSON() ([]byte, error) { + w, err := listCdfStatusesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCdfStatusesResponse) UnmarshalJSON(data []byte) error { + var w listCdfStatusesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCdfStatusesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDatabasesRequestWire struct { Parent *string `json:"parent,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -3014,6 +5126,30 @@ func listDatabasesRequestFromWire(w *listDatabasesRequestWire) (*ListDatabasesRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDatabasesRequest) MarshalJSON() ([]byte, error) { + w, err := listDatabasesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDatabasesRequest) UnmarshalJSON(data []byte) error { + var w listDatabasesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDatabasesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDatabasesResponseWire struct { Databases []databaseWire `json:"databases,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3047,6 +5183,30 @@ func listDatabasesResponseFromWire(w *listDatabasesResponseWire) (*ListDatabases }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDatabasesResponse) MarshalJSON() ([]byte, error) { + w, err := listDatabasesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDatabasesResponse) UnmarshalJSON(data []byte) error { + var w listDatabasesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDatabasesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listEndpointsRequestWire struct { Parent *string `json:"parent,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -3075,6 +5235,30 @@ func listEndpointsRequestFromWire(w *listEndpointsRequestWire) (*ListEndpointsRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListEndpointsRequest) MarshalJSON() ([]byte, error) { + w, err := listEndpointsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListEndpointsRequest) UnmarshalJSON(data []byte) error { + var w listEndpointsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listEndpointsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listEndpointsResponseWire struct { Endpoints []endpointWire `json:"endpoints,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3108,6 +5292,30 @@ func listEndpointsResponseFromWire(w *listEndpointsResponseWire) (*ListEndpoints }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListEndpointsResponse) MarshalJSON() ([]byte, error) { + w, err := listEndpointsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListEndpointsResponse) UnmarshalJSON(data []byte) error { + var w listEndpointsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listEndpointsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listMigrationsRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -3136,6 +5344,30 @@ func listMigrationsRequestFromWire(w *listMigrationsRequestWire) (*ListMigration }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListMigrationsRequest) MarshalJSON() ([]byte, error) { + w, err := listMigrationsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListMigrationsRequest) UnmarshalJSON(data []byte) error { + var w listMigrationsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listMigrationsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listMigrationsResponseWire struct { Migrations []migrationWire `json:"migrations,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3169,6 +5401,30 @@ func listMigrationsResponseFromWire(w *listMigrationsResponseWire) (*ListMigrati }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListMigrationsResponse) MarshalJSON() ([]byte, error) { + w, err := listMigrationsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListMigrationsResponse) UnmarshalJSON(data []byte) error { + var w listMigrationsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listMigrationsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listProjectsRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -3197,6 +5453,30 @@ func listProjectsRequestFromWire(w *listProjectsRequestWire) (*ListProjectsReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListProjectsRequest) MarshalJSON() ([]byte, error) { + w, err := listProjectsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListProjectsRequest) UnmarshalJSON(data []byte) error { + var w listProjectsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listProjectsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listProjectsResponseWire struct { Projects []projectWire `json:"projects,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3230,6 +5510,30 @@ func listProjectsResponseFromWire(w *listProjectsResponseWire) (*ListProjectsRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListProjectsResponse) MarshalJSON() ([]byte, error) { + w, err := listProjectsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListProjectsResponse) UnmarshalJSON(data []byte) error { + var w listProjectsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listProjectsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRolesRequestWire struct { Parent *string `json:"parent,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -3258,6 +5562,30 @@ func listRolesRequestFromWire(w *listRolesRequestWire) (*ListRolesRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRolesRequest) MarshalJSON() ([]byte, error) { + w, err := listRolesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRolesRequest) UnmarshalJSON(data []byte) error { + var w listRolesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRolesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRolesResponseWire struct { Roles []roleWire `json:"roles,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3291,6 +5619,30 @@ func listRolesResponseFromWire(w *listRolesResponseWire) (*ListRolesResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRolesResponse) MarshalJSON() ([]byte, error) { + w, err := listRolesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRolesResponse) UnmarshalJSON(data []byte) error { + var w listRolesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRolesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSnapshotsRequestWire struct { Parent *string `json:"parent,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -3319,6 +5671,30 @@ func listSnapshotsRequestFromWire(w *listSnapshotsRequestWire) (*ListSnapshotsRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSnapshotsRequest) MarshalJSON() ([]byte, error) { + w, err := listSnapshotsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSnapshotsRequest) UnmarshalJSON(data []byte) error { + var w listSnapshotsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSnapshotsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSnapshotsResponseWire struct { Snapshots []snapshotWire `json:"snapshots,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -3352,6 +5728,30 @@ func listSnapshotsResponseFromWire(w *listSnapshotsResponseWire) (*ListSnapshots }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSnapshotsResponse) MarshalJSON() ([]byte, error) { + w, err := listSnapshotsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSnapshotsResponse) UnmarshalJSON(data []byte) error { + var w listSnapshotsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSnapshotsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type longTransactionDetailsWire struct { OldestTransactionAge *types.Duration `json:"oldest_transaction_age,omitempty"` } @@ -3374,6 +5774,30 @@ func longTransactionDetailsFromWire(w *longTransactionDetailsWire) (*LongTransac }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LongTransactionDetails) MarshalJSON() ([]byte, error) { + w, err := longTransactionDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LongTransactionDetails) UnmarshalJSON(data []byte) error { + var w longTransactionDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := longTransactionDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type migrationWire struct { Name *string `json:"name,omitempty"` SourceConnection *string `json:"source_connection,omitempty"` @@ -3442,6 +5866,30 @@ func migrationFromWire(w *migrationWire) (*Migration, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Migration) MarshalJSON() ([]byte, error) { + w, err := migrationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Migration) UnmarshalJSON(data []byte) error { + var w migrationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := migrationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type migrationErrorWire struct { Code *string `json:"code,omitempty"` Message *string `json:"message,omitempty"` @@ -3467,6 +5915,30 @@ func migrationErrorFromWire(w *migrationErrorWire) (*MigrationError, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MigrationError) MarshalJSON() ([]byte, error) { + w, err := migrationErrorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MigrationError) UnmarshalJSON(data []byte) error { + var w migrationErrorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := migrationErrorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type migrationOperationMetadataWire struct { } @@ -3484,6 +5956,30 @@ func migrationOperationMetadataFromWire(w *migrationOperationMetadataWire) (*Mig return &MigrationOperationMetadata{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MigrationOperationMetadata) MarshalJSON() ([]byte, error) { + w, err := migrationOperationMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MigrationOperationMetadata) UnmarshalJSON(data []byte) error { + var w migrationOperationMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := migrationOperationMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type monthlyScheduleWire struct { Day *int `json:"day,omitempty"` Hour *int `json:"hour,omitempty"` @@ -3509,6 +6005,30 @@ func monthlyScheduleFromWire(w *monthlyScheduleWire) (*MonthlySchedule, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MonthlySchedule) MarshalJSON() ([]byte, error) { + w, err := monthlyScheduleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MonthlySchedule) UnmarshalJSON(data []byte) error { + var w monthlyScheduleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := monthlyScheduleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type newPipelineSpecWire struct { StorageCatalog *string `json:"storage_catalog,omitempty"` StorageSchema *string `json:"storage_schema,omitempty"` @@ -3540,6 +6060,30 @@ func newPipelineSpecFromWire(w *newPipelineSpecWire) (*NewPipelineSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NewPipelineSpec) MarshalJSON() ([]byte, error) { + w, err := newPipelineSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NewPipelineSpec) UnmarshalJSON(data []byte) error { + var w newPipelineSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := newPipelineSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type operationWire struct { Name *string `json:"name,omitempty"` Metadata json.RawMessage `json:"metadata,omitempty"` @@ -3613,6 +6157,30 @@ func operationFromWire(w *operationWire) (*Operation, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Operation) MarshalJSON() ([]byte, error) { + w, err := operationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Operation) UnmarshalJSON(data []byte) error { + var w operationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := operationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type projectWire struct { Name *string `json:"name,omitempty"` Uid *string `json:"uid,omitempty"` @@ -3697,6 +6265,30 @@ func projectFromWire(w *projectWire) (*Project, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Project) MarshalJSON() ([]byte, error) { + w, err := projectToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Project) UnmarshalJSON(data []byte) error { + var w projectWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := projectFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type projectCustomTagWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -3722,6 +6314,30 @@ func projectCustomTagFromWire(w *projectCustomTagWire) (*ProjectCustomTag, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProjectCustomTag) MarshalJSON() ([]byte, error) { + w, err := projectCustomTagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProjectCustomTag) UnmarshalJSON(data []byte) error { + var w projectCustomTagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := projectCustomTagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type projectDefaultEndpointSettingsWire struct { AutoscalingLimitMinCu *float64 `json:"autoscaling_limit_min_cu,omitempty"` AutoscalingLimitMaxCu *float64 `json:"autoscaling_limit_max_cu,omitempty"` @@ -3787,6 +6403,30 @@ func projectDefaultEndpointSettingsFromWire(w *projectDefaultEndpointSettingsWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProjectDefaultEndpointSettings) MarshalJSON() ([]byte, error) { + w, err := projectDefaultEndpointSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProjectDefaultEndpointSettings) UnmarshalJSON(data []byte) error { + var w projectDefaultEndpointSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := projectDefaultEndpointSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type projectOperationMetadataWire struct { } @@ -3801,7 +6441,31 @@ func projectOperationMetadataFromWire(w *projectOperationMetadataWire) (*Project if w == nil { return nil, nil } - return &ProjectOperationMetadata{}, nil + return &ProjectOperationMetadata{}, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProjectOperationMetadata) MarshalJSON() ([]byte, error) { + w, err := projectOperationMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProjectOperationMetadata) UnmarshalJSON(data []byte) error { + var w projectOperationMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := projectOperationMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil } type projectSpecWire struct { @@ -3863,6 +6527,30 @@ func projectSpecFromWire(w *projectSpecWire) (*ProjectSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProjectSpec) MarshalJSON() ([]byte, error) { + w, err := projectSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProjectSpec) UnmarshalJSON(data []byte) error { + var w projectSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := projectSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type projectStatusWire struct { DisplayName *string `json:"display_name,omitempty"` PgVersion *int `json:"pg_version,omitempty"` @@ -3953,6 +6641,30 @@ func projectStatusFromWire(w *projectStatusWire) (*ProjectStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProjectStatus) MarshalJSON() ([]byte, error) { + w, err := projectStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProjectStatus) UnmarshalJSON(data []byte) error { + var w projectStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := projectStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type provisioningInfoWire struct { } @@ -3970,6 +6682,30 @@ func provisioningInfoFromWire(w *provisioningInfoWire) (*ProvisioningInfo, error return &ProvisioningInfo{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProvisioningInfo) MarshalJSON() ([]byte, error) { + w, err := provisioningInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProvisioningInfo) UnmarshalJSON(data []byte) error { + var w provisioningInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := provisioningInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type requestedClaimsWire struct { PermissionSet RequestedClaims_PermissionSet `json:"permission_set,omitempty"` Resources []requestedResourceWire `json:"resources,omitempty"` @@ -4003,6 +6739,30 @@ func requestedClaimsFromWire(w *requestedClaimsWire) (*RequestedClaims, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RequestedClaims) MarshalJSON() ([]byte, error) { + w, err := requestedClaimsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RequestedClaims) UnmarshalJSON(data []byte) error { + var w requestedClaimsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := requestedClaimsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type requestedResourceWire struct { TableName *string `json:"table_name,omitempty"` } @@ -4047,6 +6807,30 @@ func requestedResourceFromWire(w *requestedResourceWire) (*RequestedResource, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RequestedResource) MarshalJSON() ([]byte, error) { + w, err := requestedResourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RequestedResource) UnmarshalJSON(data []byte) error { + var w requestedResourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := requestedResourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type revealRolePasswordRequestWire struct { Name *string `json:"name,omitempty"` } @@ -4069,6 +6853,30 @@ func revealRolePasswordRequestFromWire(w *revealRolePasswordRequestWire) (*Revea }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RevealRolePasswordRequest) MarshalJSON() ([]byte, error) { + w, err := revealRolePasswordRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RevealRolePasswordRequest) UnmarshalJSON(data []byte) error { + var w revealRolePasswordRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := revealRolePasswordRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type revealRolePasswordResponseWire struct { Password *string `json:"password,omitempty"` } @@ -4091,6 +6899,30 @@ func revealRolePasswordResponseFromWire(w *revealRolePasswordResponseWire) (*Rev }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RevealRolePasswordResponse) MarshalJSON() ([]byte, error) { + w, err := revealRolePasswordResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RevealRolePasswordResponse) UnmarshalJSON(data []byte) error { + var w revealRolePasswordResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := revealRolePasswordResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type roleWire struct { Name *string `json:"name,omitempty"` Parent *string `json:"parent,omitempty"` @@ -4147,6 +6979,30 @@ func roleFromWire(w *roleWire) (*Role, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Role) MarshalJSON() ([]byte, error) { + w, err := roleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Role) UnmarshalJSON(data []byte) error { + var w roleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := roleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type role_AttributesWire struct { Createdb *bool `json:"createdb,omitempty"` Createrole *bool `json:"createrole,omitempty"` @@ -4175,6 +7031,30 @@ func role_AttributesFromWire(w *role_AttributesWire) (*Role_Attributes, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Role_Attributes) MarshalJSON() ([]byte, error) { + w, err := role_AttributesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Role_Attributes) UnmarshalJSON(data []byte) error { + var w role_AttributesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := role_AttributesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type role_RoleSpecWire struct { MembershipRoles []Role_MembershipRole `json:"membership_roles,omitempty"` IdentityType Role_IdentityType `json:"identity_type,omitempty"` @@ -4217,6 +7097,30 @@ func role_RoleSpecFromWire(w *role_RoleSpecWire) (*Role_RoleSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Role_RoleSpec) MarshalJSON() ([]byte, error) { + w, err := role_RoleSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Role_RoleSpec) UnmarshalJSON(data []byte) error { + var w role_RoleSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := role_RoleSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type role_RoleStatusWire struct { MembershipRoles []Role_MembershipRole `json:"membership_roles,omitempty"` IdentityType Role_IdentityType `json:"identity_type,omitempty"` @@ -4262,6 +7166,30 @@ func role_RoleStatusFromWire(w *role_RoleStatusWire) (*Role_RoleStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Role_RoleStatus) MarshalJSON() ([]byte, error) { + w, err := role_RoleStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Role_RoleStatus) UnmarshalJSON(data []byte) error { + var w role_RoleStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := role_RoleStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type roleOperationMetadataWire struct { } @@ -4279,6 +7207,30 @@ func roleOperationMetadataFromWire(w *roleOperationMetadataWire) (*RoleOperation return &RoleOperationMetadata{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RoleOperationMetadata) MarshalJSON() ([]byte, error) { + w, err := roleOperationMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RoleOperationMetadata) UnmarshalJSON(data []byte) error { + var w roleOperationMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := roleOperationMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type scheduleCadenceWire struct { DailySchedule *dailyScheduleWire `json:"daily_schedule,omitempty"` WeeklySchedule *weeklyScheduleWire `json:"weekly_schedule,omitempty"` @@ -4374,6 +7326,30 @@ func scheduleCadenceFromWire(w *scheduleCadenceWire) (*ScheduleCadence, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ScheduleCadence) MarshalJSON() ([]byte, error) { + w, err := scheduleCadenceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ScheduleCadence) UnmarshalJSON(data []byte) error { + var w scheduleCadenceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := scheduleCadenceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type snapshotWire struct { Name *string `json:"name,omitempty"` Uid *string `json:"uid,omitempty"` @@ -4427,6 +7403,30 @@ func snapshotFromWire(w *snapshotWire) (*Snapshot, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Snapshot) MarshalJSON() ([]byte, error) { + w, err := snapshotToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Snapshot) UnmarshalJSON(data []byte) error { + var w snapshotWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := snapshotFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type snapshotOperationMetadataWire struct { } @@ -4444,6 +7444,30 @@ func snapshotOperationMetadataFromWire(w *snapshotOperationMetadataWire) (*Snaps return &SnapshotOperationMetadata{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SnapshotOperationMetadata) MarshalJSON() ([]byte, error) { + w, err := snapshotOperationMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SnapshotOperationMetadata) UnmarshalJSON(data []byte) error { + var w snapshotOperationMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := snapshotOperationMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type snapshotScheduleWire struct { Name *string `json:"name,omitempty"` Schedule []scheduleCadenceWire `json:"schedule,omitempty"` @@ -4477,6 +7501,30 @@ func snapshotScheduleFromWire(w *snapshotScheduleWire) (*SnapshotSchedule, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SnapshotSchedule) MarshalJSON() ([]byte, error) { + w, err := snapshotScheduleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SnapshotSchedule) UnmarshalJSON(data []byte) error { + var w snapshotScheduleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := snapshotScheduleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type snapshotScheduleOperationMetadataWire struct { } @@ -4494,6 +7542,30 @@ func snapshotScheduleOperationMetadataFromWire(w *snapshotScheduleOperationMetad return &SnapshotScheduleOperationMetadata{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SnapshotScheduleOperationMetadata) MarshalJSON() ([]byte, error) { + w, err := snapshotScheduleOperationMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SnapshotScheduleOperationMetadata) UnmarshalJSON(data []byte) error { + var w snapshotScheduleOperationMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := snapshotScheduleOperationMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type snapshotSpecWire struct { SourceBranch *string `json:"source_branch,omitempty"` SourceBranchLsn *string `json:"source_branch_lsn,omitempty"` @@ -4602,6 +7674,30 @@ func snapshotSpecFromWire(w *snapshotSpecWire) (*SnapshotSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SnapshotSpec) MarshalJSON() ([]byte, error) { + w, err := snapshotSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SnapshotSpec) UnmarshalJSON(data []byte) error { + var w snapshotSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := snapshotSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type snapshotStatusWire struct { SourceBranch *string `json:"source_branch,omitempty"` ExpireTime *types.Time `json:"expire_time,omitempty"` @@ -4683,6 +7779,30 @@ func snapshotStatusFromWire(w *snapshotStatusWire) (*SnapshotStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SnapshotStatus) MarshalJSON() ([]byte, error) { + w, err := snapshotStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SnapshotStatus) UnmarshalJSON(data []byte) error { + var w snapshotStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := snapshotStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type startMigrationRequestWire struct { Name *string `json:"name,omitempty"` } @@ -4705,6 +7825,30 @@ func startMigrationRequestFromWire(w *startMigrationRequestWire) (*StartMigratio }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StartMigrationRequest) MarshalJSON() ([]byte, error) { + w, err := startMigrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StartMigrationRequest) UnmarshalJSON(data []byte) error { + var w startMigrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := startMigrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type startMigrationResponseWire struct { Migration *migrationWire `json:"migration,omitempty"` } @@ -4730,9 +7874,33 @@ func startMigrationResponseFromWire(w *startMigrationResponseWire) (*StartMigrat if err != nil { return nil, fmt.Errorf("%s: %w", "StartMigrationResponse.Migration", err) } - return &StartMigrationResponse{ - Migration: migrationPublicValue, - }, nil + return &StartMigrationResponse{ + Migration: migrationPublicValue, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StartMigrationResponse) MarshalJSON() ([]byte, error) { + w, err := startMigrationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StartMigrationResponse) UnmarshalJSON(data []byte) error { + var w startMigrationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := startMigrationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil } type syncedTableWire struct { @@ -4788,6 +7956,30 @@ func syncedTableFromWire(w *syncedTableWire) (*SyncedTable, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTable) MarshalJSON() ([]byte, error) { + w, err := syncedTableToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTable) UnmarshalJSON(data []byte) error { + var w syncedTableWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTableFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedTable_SyncedTableSpecWire struct { PostgresDatabase *string `json:"postgres_database,omitempty"` Branch *string `json:"branch,omitempty"` @@ -4867,6 +8059,30 @@ func syncedTable_SyncedTableSpecFromWire(w *syncedTable_SyncedTableSpecWire) (*S }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTable_SyncedTableSpec) MarshalJSON() ([]byte, error) { + w, err := syncedTable_SyncedTableSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTable_SyncedTableSpec) UnmarshalJSON(data []byte) error { + var w syncedTable_SyncedTableSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTable_SyncedTableSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedTable_SyncedTableSpec_ExtraColumnWire struct { ColumnName *string `json:"column_name,omitempty"` ColumnType *string `json:"column_type,omitempty"` @@ -4898,6 +8114,30 @@ func syncedTable_SyncedTableSpec_ExtraColumnFromWire(w *syncedTable_SyncedTableS }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTable_SyncedTableSpec_ExtraColumn) MarshalJSON() ([]byte, error) { + w, err := syncedTable_SyncedTableSpec_ExtraColumnToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTable_SyncedTableSpec_ExtraColumn) UnmarshalJSON(data []byte) error { + var w syncedTable_SyncedTableSpec_ExtraColumnWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTable_SyncedTableSpec_ExtraColumnFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedTable_SyncedTableSpec_TypeOverrideWire struct { ColumnName *string `json:"column_name,omitempty"` PgType SyncedTable_SyncedTableSpec_PgSpecificType `json:"pg_type,omitempty"` @@ -4926,6 +8166,30 @@ func syncedTable_SyncedTableSpec_TypeOverrideFromWire(w *syncedTable_SyncedTable }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTable_SyncedTableSpec_TypeOverride) MarshalJSON() ([]byte, error) { + w, err := syncedTable_SyncedTableSpec_TypeOverrideToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTable_SyncedTableSpec_TypeOverride) UnmarshalJSON(data []byte) error { + var w syncedTable_SyncedTableSpec_TypeOverrideWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTable_SyncedTableSpec_TypeOverrideFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedTable_SyncedTableStatusWire struct { Message *string `json:"message,omitempty"` DetailedState SyncedTableState `json:"detailed_state,omitempty"` @@ -4999,6 +8263,30 @@ func syncedTable_SyncedTableStatusFromWire(w *syncedTable_SyncedTableStatusWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTable_SyncedTableStatus) MarshalJSON() ([]byte, error) { + w, err := syncedTable_SyncedTableStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTable_SyncedTableStatus) UnmarshalJSON(data []byte) error { + var w syncedTable_SyncedTableStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTable_SyncedTableStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedTableOperationMetadataWire struct { } @@ -5016,6 +8304,30 @@ func syncedTableOperationMetadataFromWire(w *syncedTableOperationMetadataWire) ( return &SyncedTableOperationMetadata{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTableOperationMetadata) MarshalJSON() ([]byte, error) { + w, err := syncedTableOperationMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTableOperationMetadata) UnmarshalJSON(data []byte) error { + var w syncedTableOperationMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTableOperationMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedTablePipelineProgressWire struct { LatestVersionCurrentlyProcessing *wireInt64 `json:"latest_version_currently_processing,omitempty"` SyncedRowCount *wireInt64 `json:"synced_row_count,omitempty"` @@ -5074,6 +8386,30 @@ func syncedTablePipelineProgressFromWire(w *syncedTablePipelineProgressWire) (*S }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTablePipelineProgress) MarshalJSON() ([]byte, error) { + w, err := syncedTablePipelineProgressToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTablePipelineProgress) UnmarshalJSON(data []byte) error { + var w syncedTablePipelineProgressWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTablePipelineProgressFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncedTablePositionWire struct { SyncStartTime *types.Time `json:"sync_start_time,omitempty"` SyncEndTime *types.Time `json:"sync_end_time,omitempty"` @@ -5132,6 +8468,30 @@ func syncedTablePositionFromWire(w *syncedTablePositionWire) (*SyncedTablePositi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncedTablePosition) MarshalJSON() ([]byte, error) { + w, err := syncedTablePositionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncedTablePosition) UnmarshalJSON(data []byte) error { + var w syncedTablePositionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncedTablePositionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type undeleteBranchRequestWire struct { Name *string `json:"name,omitempty"` } @@ -5154,6 +8514,30 @@ func undeleteBranchRequestFromWire(w *undeleteBranchRequestWire) (*UndeleteBranc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UndeleteBranchRequest) MarshalJSON() ([]byte, error) { + w, err := undeleteBranchRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UndeleteBranchRequest) UnmarshalJSON(data []byte) error { + var w undeleteBranchRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := undeleteBranchRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type undeleteMigrationRequestWire struct { Name *string `json:"name,omitempty"` } @@ -5176,6 +8560,30 @@ func undeleteMigrationRequestFromWire(w *undeleteMigrationRequestWire) (*Undelet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UndeleteMigrationRequest) MarshalJSON() ([]byte, error) { + w, err := undeleteMigrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UndeleteMigrationRequest) UnmarshalJSON(data []byte) error { + var w undeleteMigrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := undeleteMigrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type undeleteMigrationResponseWire struct { Migration *migrationWire `json:"migration,omitempty"` } @@ -5206,6 +8614,30 @@ func undeleteMigrationResponseFromWire(w *undeleteMigrationResponseWire) (*Undel }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UndeleteMigrationResponse) MarshalJSON() ([]byte, error) { + w, err := undeleteMigrationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UndeleteMigrationResponse) UnmarshalJSON(data []byte) error { + var w undeleteMigrationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := undeleteMigrationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type undeleteProjectRequestWire struct { Name *string `json:"name,omitempty"` } @@ -5228,6 +8660,30 @@ func undeleteProjectRequestFromWire(w *undeleteProjectRequestWire) (*UndeletePro }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UndeleteProjectRequest) MarshalJSON() ([]byte, error) { + w, err := undeleteProjectRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UndeleteProjectRequest) UnmarshalJSON(data []byte) error { + var w undeleteProjectRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := undeleteProjectRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateBranchRequestWire struct { Branch *branchWire `json:"branch,omitempty"` UpdateMask *types.FieldMask[Branch] `json:"update_mask,omitempty"` @@ -5261,6 +8717,30 @@ func updateBranchRequestFromWire(w *updateBranchRequestWire) (*UpdateBranchReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateBranchRequest) MarshalJSON() ([]byte, error) { + w, err := updateBranchRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateBranchRequest) UnmarshalJSON(data []byte) error { + var w updateBranchRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateBranchRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateDataApiRequestWire struct { DataApi *dataApiWire `json:"data_api,omitempty"` UpdateMask *types.FieldMask[DataApi] `json:"update_mask,omitempty"` @@ -5294,6 +8774,30 @@ func updateDataApiRequestFromWire(w *updateDataApiRequestWire) (*UpdateDataApiRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateDataApiRequest) MarshalJSON() ([]byte, error) { + w, err := updateDataApiRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateDataApiRequest) UnmarshalJSON(data []byte) error { + var w updateDataApiRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateDataApiRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateDatabaseRequestWire struct { Database *databaseWire `json:"database,omitempty"` UpdateMask *types.FieldMask[Database] `json:"update_mask,omitempty"` @@ -5327,6 +8831,30 @@ func updateDatabaseRequestFromWire(w *updateDatabaseRequestWire) (*UpdateDatabas }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateDatabaseRequest) MarshalJSON() ([]byte, error) { + w, err := updateDatabaseRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateDatabaseRequest) UnmarshalJSON(data []byte) error { + var w updateDatabaseRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateDatabaseRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateEndpointRequestWire struct { Endpoint *endpointWire `json:"endpoint,omitempty"` UpdateMask *types.FieldMask[Endpoint] `json:"update_mask,omitempty"` @@ -5360,6 +8888,30 @@ func updateEndpointRequestFromWire(w *updateEndpointRequestWire) (*UpdateEndpoin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := updateEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateEndpointRequest) UnmarshalJSON(data []byte) error { + var w updateEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateMigrationRequestWire struct { Migration *migrationWire `json:"migration,omitempty"` UpdateMask *types.FieldMask[Migration] `json:"update_mask,omitempty"` @@ -5393,6 +8945,30 @@ func updateMigrationRequestFromWire(w *updateMigrationRequestWire) (*UpdateMigra }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateMigrationRequest) MarshalJSON() ([]byte, error) { + w, err := updateMigrationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateMigrationRequest) UnmarshalJSON(data []byte) error { + var w updateMigrationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateMigrationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateProjectRequestWire struct { Project *projectWire `json:"project,omitempty"` UpdateMask *types.FieldMask[Project] `json:"update_mask,omitempty"` @@ -5426,6 +9002,30 @@ func updateProjectRequestFromWire(w *updateProjectRequestWire) (*UpdateProjectRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateProjectRequest) MarshalJSON() ([]byte, error) { + w, err := updateProjectRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateProjectRequest) UnmarshalJSON(data []byte) error { + var w updateProjectRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateProjectRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateRoleRequestWire struct { Role *roleWire `json:"role,omitempty"` UpdateMask *types.FieldMask[Role] `json:"update_mask,omitempty"` @@ -5459,6 +9059,30 @@ func updateRoleRequestFromWire(w *updateRoleRequestWire) (*UpdateRoleRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateRoleRequest) MarshalJSON() ([]byte, error) { + w, err := updateRoleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateRoleRequest) UnmarshalJSON(data []byte) error { + var w updateRoleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateRoleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateSnapshotScheduleRequestWire struct { SnapshotSchedule *snapshotScheduleWire `json:"snapshot_schedule,omitempty"` UpdateMask *types.FieldMask[SnapshotSchedule] `json:"update_mask,omitempty"` @@ -5492,6 +9116,30 @@ func updateSnapshotScheduleRequestFromWire(w *updateSnapshotScheduleRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateSnapshotScheduleRequest) MarshalJSON() ([]byte, error) { + w, err := updateSnapshotScheduleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateSnapshotScheduleRequest) UnmarshalJSON(data []byte) error { + var w updateSnapshotScheduleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateSnapshotScheduleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type weeklyScheduleWire struct { DayOfWeek DayOfWeek `json:"day_of_week,omitempty"` Hour *int `json:"hour,omitempty"` @@ -5517,6 +9165,30 @@ func weeklyScheduleFromWire(w *weeklyScheduleWire) (*WeeklySchedule, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WeeklySchedule) MarshalJSON() ([]byte, error) { + w, err := weeklyScheduleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WeeklySchedule) UnmarshalJSON(data []byte) error { + var w weeklyScheduleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := weeklyScheduleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/queries/CHANGELOG.md b/queries/CHANGELOG.md index 1ce4d9b5..0b55bad9 100644 --- a/queries/CHANGELOG.md +++ b/queries/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/queries/internal/version.go b/queries/internal/version.go index e9483092..bd6c2ef6 100644 --- a/queries/internal/version.go +++ b/queries/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-queries" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/queries/v1/wire.go b/queries/v1/wire.go index f9cdbad1..f68635b6 100644 --- a/queries/v1/wire.go +++ b/queries/v1/wire.go @@ -3,6 +3,7 @@ package queries import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -41,6 +42,30 @@ func createQueryRequestFromWire(w *createQueryRequestWire) (*CreateQueryRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateQueryRequest) MarshalJSON() ([]byte, error) { + w, err := createQueryRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateQueryRequest) UnmarshalJSON(data []byte) error { + var w createQueryRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createQueryRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createQueryRequestQueryWire struct { DisplayName *string `json:"display_name,omitempty"` Description *string `json:"description,omitempty"` @@ -101,6 +126,30 @@ func createQueryRequestQueryFromWire(w *createQueryRequestQueryWire) (*CreateQue }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateQueryRequestQuery) MarshalJSON() ([]byte, error) { + w, err := createQueryRequestQueryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateQueryRequestQuery) UnmarshalJSON(data []byte) error { + var w createQueryRequestQueryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createQueryRequestQueryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dateRangeWire struct { Start *string `json:"start,omitempty"` End *string `json:"end,omitempty"` @@ -126,6 +175,30 @@ func dateRangeFromWire(w *dateRangeWire) (*DateRange, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DateRange) MarshalJSON() ([]byte, error) { + w, err := dateRangeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DateRange) UnmarshalJSON(data []byte) error { + var w dateRangeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dateRangeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dateRangeValueWire struct { DynamicDateRangeValue DateRangeValue_DynamicDateRange `json:"dynamic_date_range_value,omitempty"` DateRangeValue *dateRangeWire `json:"date_range_value,omitempty"` @@ -196,6 +269,30 @@ func dateRangeValueFromWire(w *dateRangeValueWire) (*DateRangeValue, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DateRangeValue) MarshalJSON() ([]byte, error) { + w, err := dateRangeValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DateRangeValue) UnmarshalJSON(data []byte) error { + var w dateRangeValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dateRangeValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dateValueWire struct { DynamicDateValue DateValue_DynamicDate `json:"dynamic_date_value,omitempty"` DateValue *string `json:"date_value,omitempty"` @@ -255,6 +352,30 @@ func dateValueFromWire(w *dateValueWire) (*DateValue, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DateValue) MarshalJSON() ([]byte, error) { + w, err := dateValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DateValue) UnmarshalJSON(data []byte) error { + var w dateValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dateValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type emptyWire struct { } @@ -272,6 +393,30 @@ func emptyFromWire(w *emptyWire) (*Empty, error) { return &Empty{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Empty) MarshalJSON() ([]byte, error) { + w, err := emptyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Empty) UnmarshalJSON(data []byte) error { + var w emptyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := emptyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type enumValueWire struct { Values []string `json:"values,omitempty"` EnumOptions *string `json:"enum_options,omitempty"` @@ -308,6 +453,30 @@ func enumValueFromWire(w *enumValueWire) (*EnumValue, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EnumValue) MarshalJSON() ([]byte, error) { + w, err := enumValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EnumValue) UnmarshalJSON(data []byte) error { + var w enumValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := enumValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getQueryRequestWire struct { Id *string `json:"id,omitempty"` } @@ -330,6 +499,30 @@ func getQueryRequestFromWire(w *getQueryRequestWire) (*GetQueryRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetQueryRequest) MarshalJSON() ([]byte, error) { + w, err := getQueryRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetQueryRequest) UnmarshalJSON(data []byte) error { + var w getQueryRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getQueryRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listQueriesRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -355,6 +548,30 @@ func listQueriesRequestFromWire(w *listQueriesRequestWire) (*ListQueriesRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListQueriesRequest) MarshalJSON() ([]byte, error) { + w, err := listQueriesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListQueriesRequest) UnmarshalJSON(data []byte) error { + var w listQueriesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listQueriesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listQueriesResponseWire struct { Results []listQueryObjectsResponseQueryWire `json:"results,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -388,6 +605,30 @@ func listQueriesResponseFromWire(w *listQueriesResponseWire) (*ListQueriesRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListQueriesResponse) MarshalJSON() ([]byte, error) { + w, err := listQueriesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListQueriesResponse) UnmarshalJSON(data []byte) error { + var w listQueriesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listQueriesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listQueryObjectsResponseQueryWire struct { Id *string `json:"id,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -463,6 +704,30 @@ func listQueryObjectsResponseQueryFromWire(w *listQueryObjectsResponseQueryWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListQueryObjectsResponseQuery) MarshalJSON() ([]byte, error) { + w, err := listQueryObjectsResponseQueryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListQueryObjectsResponseQuery) UnmarshalJSON(data []byte) error { + var w listQueryObjectsResponseQueryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listQueryObjectsResponseQueryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listVisualizationsForQueryRequestWire struct { Id *string `json:"id,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -491,6 +756,30 @@ func listVisualizationsForQueryRequestFromWire(w *listVisualizationsForQueryRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListVisualizationsForQueryRequest) MarshalJSON() ([]byte, error) { + w, err := listVisualizationsForQueryRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListVisualizationsForQueryRequest) UnmarshalJSON(data []byte) error { + var w listVisualizationsForQueryRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listVisualizationsForQueryRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listVisualizationsForQueryResponseWire struct { Results []visualizationWire `json:"results,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -524,6 +813,30 @@ func listVisualizationsForQueryResponseFromWire(w *listVisualizationsForQueryRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListVisualizationsForQueryResponse) MarshalJSON() ([]byte, error) { + w, err := listVisualizationsForQueryResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListVisualizationsForQueryResponse) UnmarshalJSON(data []byte) error { + var w listVisualizationsForQueryResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listVisualizationsForQueryResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type multiValuesOptionsWire struct { Prefix *string `json:"prefix,omitempty"` Separator *string `json:"separator,omitempty"` @@ -552,6 +865,30 @@ func multiValuesOptionsFromWire(w *multiValuesOptionsWire) (*MultiValuesOptions, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MultiValuesOptions) MarshalJSON() ([]byte, error) { + w, err := multiValuesOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MultiValuesOptions) UnmarshalJSON(data []byte) error { + var w multiValuesOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := multiValuesOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type numericValueWire struct { Value *float64 `json:"value,omitempty"` } @@ -574,6 +911,30 @@ func numericValueFromWire(w *numericValueWire) (*NumericValue, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NumericValue) MarshalJSON() ([]byte, error) { + w, err := numericValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NumericValue) UnmarshalJSON(data []byte) error { + var w numericValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := numericValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queryWire struct { Id *string `json:"id,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -652,6 +1013,30 @@ func queryFromWire(w *queryWire) (*Query, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Query) MarshalJSON() ([]byte, error) { + w, err := queryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Query) UnmarshalJSON(data []byte) error { + var w queryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queryBackedValueWire struct { Values []string `json:"values,omitempty"` QueryId *string `json:"query_id,omitempty"` @@ -688,6 +1073,30 @@ func queryBackedValueFromWire(w *queryBackedValueWire) (*QueryBackedValue, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueryBackedValue) MarshalJSON() ([]byte, error) { + w, err := queryBackedValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueryBackedValue) UnmarshalJSON(data []byte) error { + var w queryBackedValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queryBackedValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queryParameterWire struct { Title *string `json:"title,omitempty"` Name *string `json:"name,omitempty"` @@ -846,6 +1255,30 @@ func queryParameterFromWire(w *queryParameterWire) (*QueryParameter, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueryParameter) MarshalJSON() ([]byte, error) { + w, err := queryParameterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueryParameter) UnmarshalJSON(data []byte) error { + var w queryParameterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queryParameterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type textValueWire struct { Value *string `json:"value,omitempty"` } @@ -868,6 +1301,30 @@ func textValueFromWire(w *textValueWire) (*TextValue, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TextValue) MarshalJSON() ([]byte, error) { + w, err := textValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TextValue) UnmarshalJSON(data []byte) error { + var w textValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := textValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type trashQueryRequestWire struct { Id *string `json:"id,omitempty"` } @@ -890,6 +1347,30 @@ func trashQueryRequestFromWire(w *trashQueryRequestWire) (*TrashQueryRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TrashQueryRequest) MarshalJSON() ([]byte, error) { + w, err := trashQueryRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TrashQueryRequest) UnmarshalJSON(data []byte) error { + var w trashQueryRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := trashQueryRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateQueryRequestWire struct { Query *updateQueryRequestQueryWire `json:"query,omitempty"` UpdateMask *types.FieldMask[UpdateQueryRequestQuery] `json:"update_mask,omitempty"` @@ -929,6 +1410,30 @@ func updateQueryRequestFromWire(w *updateQueryRequestWire) (*UpdateQueryRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateQueryRequest) MarshalJSON() ([]byte, error) { + w, err := updateQueryRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateQueryRequest) UnmarshalJSON(data []byte) error { + var w updateQueryRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateQueryRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateQueryRequestQueryWire struct { DisplayName *string `json:"display_name,omitempty"` Description *string `json:"description,omitempty"` @@ -989,6 +1494,30 @@ func updateQueryRequestQueryFromWire(w *updateQueryRequestQueryWire) (*UpdateQue }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateQueryRequestQuery) MarshalJSON() ([]byte, error) { + w, err := updateQueryRequestQueryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateQueryRequestQuery) UnmarshalJSON(data []byte) error { + var w updateQueryRequestQueryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateQueryRequestQueryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type visualizationWire struct { Id *string `json:"id,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -1032,6 +1561,30 @@ func visualizationFromWire(w *visualizationWire) (*Visualization, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Visualization) MarshalJSON() ([]byte, error) { + w, err := visualizationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Visualization) UnmarshalJSON(data []byte) error { + var w visualizationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := visualizationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/queryhistory/CHANGELOG.md b/queryhistory/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/queryhistory/CHANGELOG.md +++ b/queryhistory/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/queryhistory/internal/version.go b/queryhistory/internal/version.go index ebb7a952..41725c6b 100644 --- a/queryhistory/internal/version.go +++ b/queryhistory/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-queryhistory" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/queryhistory/v1/wire.go b/queryhistory/v1/wire.go index fd227091..7eb63b64 100644 --- a/queryhistory/v1/wire.go +++ b/queryhistory/v1/wire.go @@ -77,6 +77,30 @@ func channelInfoFromWire(w *channelInfoWire) (*ChannelInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ChannelInfo) MarshalJSON() ([]byte, error) { + w, err := channelInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ChannelInfo) UnmarshalJSON(data []byte) error { + var w channelInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := channelInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type externalQuerySourceWire struct { DashboardId *string `json:"dashboard_id,omitempty"` LegacyDashboardId *string `json:"legacy_dashboard_id,omitempty"` @@ -125,6 +149,30 @@ func externalQuerySourceFromWire(w *externalQuerySourceWire) (*ExternalQuerySour }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalQuerySource) MarshalJSON() ([]byte, error) { + w, err := externalQuerySourceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalQuerySource) UnmarshalJSON(data []byte) error { + var w externalQuerySourceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalQuerySourceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type externalQuerySource_JobInfoWire struct { JobId *string `json:"job_id,omitempty"` JobRunId *string `json:"job_run_id,omitempty"` @@ -153,6 +201,30 @@ func externalQuerySource_JobInfoFromWire(w *externalQuerySource_JobInfoWire) (*E }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalQuerySource_JobInfo) MarshalJSON() ([]byte, error) { + w, err := externalQuerySource_JobInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalQuerySource_JobInfo) UnmarshalJSON(data []byte) error { + var w externalQuerySource_JobInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalQuerySource_JobInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listQueriesRequestWire struct { FilterBy *queryFilterWire `json:"filter_by,omitempty"` MaxResults *int `json:"max_results,omitempty"` @@ -192,6 +264,30 @@ func listQueriesRequestFromWire(w *listQueriesRequestWire) (*ListQueriesRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListQueriesRequest) MarshalJSON() ([]byte, error) { + w, err := listQueriesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListQueriesRequest) UnmarshalJSON(data []byte) error { + var w listQueriesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listQueriesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listQueriesResponseWire struct { NextPageToken *string `json:"next_page_token,omitempty"` HasNextPage *bool `json:"has_next_page,omitempty"` @@ -228,6 +324,30 @@ func listQueriesResponseFromWire(w *listQueriesResponseWire) (*ListQueriesRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListQueriesResponse) MarshalJSON() ([]byte, error) { + w, err := listQueriesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListQueriesResponse) UnmarshalJSON(data []byte) error { + var w listQueriesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listQueriesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queryFilterWire struct { QueryStartTimeRange *timeRangeWire `json:"query_start_time_range,omitempty"` UserIds []wireInt64 `json:"user_ids,omitempty"` @@ -278,6 +398,30 @@ func queryFilterFromWire(w *queryFilterWire) (*QueryFilter, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueryFilter) MarshalJSON() ([]byte, error) { + w, err := queryFilterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueryFilter) UnmarshalJSON(data []byte) error { + var w queryFilterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queryFilterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queryInfoWire struct { QueryId *string `json:"query_id,omitempty"` Status QueryStatus `json:"status,omitempty"` @@ -466,6 +610,30 @@ func queryInfoFromWire(w *queryInfoWire) (*QueryInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueryInfo) MarshalJSON() ([]byte, error) { + w, err := queryInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueryInfo) UnmarshalJSON(data []byte) error { + var w queryInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queryInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queryMetricsWire struct { TotalTimeMs *wireInt64 `json:"total_time_ms,omitempty"` ReadBytes *wireInt64 `json:"read_bytes,omitempty"` @@ -796,6 +964,30 @@ func queryMetricsFromWire(w *queryMetricsWire) (*QueryMetrics, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueryMetrics) MarshalJSON() ([]byte, error) { + w, err := queryMetricsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueryMetrics) UnmarshalJSON(data []byte) error { + var w queryMetricsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queryMetricsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queryTagWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -821,6 +1013,30 @@ func queryTagFromWire(w *queryTagWire) (*QueryTag, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueryTag) MarshalJSON() ([]byte, error) { + w, err := queryTagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueryTag) UnmarshalJSON(data []byte) error { + var w queryTagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queryTagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type taskTimeOverRangeWire struct { Entries []taskTimeOverRangeEntryWire `json:"entries,omitempty"` Interval *wireInt64 `json:"interval,omitempty"` @@ -862,6 +1078,30 @@ func taskTimeOverRangeFromWire(w *taskTimeOverRangeWire) (*TaskTimeOverRange, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TaskTimeOverRange) MarshalJSON() ([]byte, error) { + w, err := taskTimeOverRangeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TaskTimeOverRange) UnmarshalJSON(data []byte) error { + var w taskTimeOverRangeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := taskTimeOverRangeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type taskTimeOverRangeEntryWire struct { TaskCompletedTimeMs *wireInt64 `json:"task_completed_time_ms,omitempty"` } @@ -892,6 +1132,30 @@ func taskTimeOverRangeEntryFromWire(w *taskTimeOverRangeEntryWire) (*TaskTimeOve }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TaskTimeOverRangeEntry) MarshalJSON() ([]byte, error) { + w, err := taskTimeOverRangeEntryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TaskTimeOverRangeEntry) UnmarshalJSON(data []byte) error { + var w taskTimeOverRangeEntryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := taskTimeOverRangeEntryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type timeRangeWire struct { StartTimeMs *wireInt64 `json:"start_time_ms,omitempty"` EndTimeMs *wireInt64 `json:"end_time_ms,omitempty"` @@ -933,6 +1197,30 @@ func timeRangeFromWire(w *timeRangeWire) (*TimeRange, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TimeRange) MarshalJSON() ([]byte, error) { + w, err := timeRangeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TimeRange) UnmarshalJSON(data []byte) error { + var w timeRangeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := timeRangeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/repos/CHANGELOG.md b/repos/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/repos/CHANGELOG.md +++ b/repos/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/repos/internal/version.go b/repos/internal/version.go index 3294be3f..b5fa5dd5 100644 --- a/repos/internal/version.go +++ b/repos/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-repos" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/repos/v1/wire.go b/repos/v1/wire.go index c68f5c07..02403957 100644 --- a/repos/v1/wire.go +++ b/repos/v1/wire.go @@ -102,6 +102,30 @@ func createRepoRequestFromWire(w *createRepoRequestWire) (*CreateRepoRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateRepoRequest) MarshalJSON() ([]byte, error) { + w, err := createRepoRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateRepoRequest) UnmarshalJSON(data []byte) error { + var w createRepoRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createRepoRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createRepoResponseWire struct { Id *wireInt64 `json:"id,omitempty"` Path *string `json:"path,omitempty"` @@ -158,6 +182,30 @@ func createRepoResponseFromWire(w *createRepoResponseWire) (*CreateRepoResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateRepoResponse) MarshalJSON() ([]byte, error) { + w, err := createRepoResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateRepoResponse) UnmarshalJSON(data []byte) error { + var w createRepoResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createRepoResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRepoRequestWire struct { Id *wireInt64 `json:"id,omitempty"` } @@ -188,6 +236,30 @@ func deleteRepoRequestFromWire(w *deleteRepoRequestWire) (*DeleteRepoRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRepoRequest) MarshalJSON() ([]byte, error) { + w, err := deleteRepoRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRepoRequest) UnmarshalJSON(data []byte) error { + var w deleteRepoRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRepoRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRepoResponseWire struct { } @@ -205,6 +277,30 @@ func deleteRepoResponseFromWire(w *deleteRepoResponseWire) (*DeleteRepoResponse, return &DeleteRepoResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRepoResponse) MarshalJSON() ([]byte, error) { + w, err := deleteRepoResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRepoResponse) UnmarshalJSON(data []byte) error { + var w deleteRepoResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRepoResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRepoRequestWire struct { Id *wireInt64 `json:"id,omitempty"` } @@ -235,6 +331,30 @@ func getRepoRequestFromWire(w *getRepoRequestWire) (*GetRepoRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRepoRequest) MarshalJSON() ([]byte, error) { + w, err := getRepoRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRepoRequest) UnmarshalJSON(data []byte) error { + var w getRepoRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRepoRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRepoResponseWire struct { Id *wireInt64 `json:"id,omitempty"` Path *string `json:"path,omitempty"` @@ -294,6 +414,30 @@ func getRepoResponseFromWire(w *getRepoResponseWire) (*GetRepoResponse, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRepoResponse) MarshalJSON() ([]byte, error) { + w, err := getRepoResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRepoResponse) UnmarshalJSON(data []byte) error { + var w getRepoResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRepoResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listReposRequestWire struct { PathPrefix *string `json:"path_prefix,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -319,6 +463,30 @@ func listReposRequestFromWire(w *listReposRequestWire) (*ListReposRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListReposRequest) MarshalJSON() ([]byte, error) { + w, err := listReposRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListReposRequest) UnmarshalJSON(data []byte) error { + var w listReposRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listReposRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listReposResponseWire struct { Repos []repoInfoWire `json:"repos,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -352,6 +520,30 @@ func listReposResponseFromWire(w *listReposResponseWire) (*ListReposResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListReposResponse) MarshalJSON() ([]byte, error) { + w, err := listReposResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListReposResponse) UnmarshalJSON(data []byte) error { + var w listReposResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listReposResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type repoInfoWire struct { Id *wireInt64 `json:"id,omitempty"` Path *string `json:"path,omitempty"` @@ -408,6 +600,30 @@ func repoInfoFromWire(w *repoInfoWire) (*RepoInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RepoInfo) MarshalJSON() ([]byte, error) { + w, err := repoInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RepoInfo) UnmarshalJSON(data []byte) error { + var w repoInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := repoInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sparseCheckoutWire struct { Patterns []string `json:"patterns,omitempty"` } @@ -430,6 +646,30 @@ func sparseCheckoutFromWire(w *sparseCheckoutWire) (*SparseCheckout, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SparseCheckout) MarshalJSON() ([]byte, error) { + w, err := sparseCheckoutToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SparseCheckout) UnmarshalJSON(data []byte) error { + var w sparseCheckoutWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sparseCheckoutFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sparseCheckoutUpdateWire struct { Patterns []string `json:"patterns,omitempty"` } @@ -452,6 +692,30 @@ func sparseCheckoutUpdateFromWire(w *sparseCheckoutUpdateWire) (*SparseCheckoutU }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SparseCheckoutUpdate) MarshalJSON() ([]byte, error) { + w, err := sparseCheckoutUpdateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SparseCheckoutUpdate) UnmarshalJSON(data []byte) error { + var w sparseCheckoutUpdateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sparseCheckoutUpdateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateRepoRequestWire struct { Id *wireInt64 `json:"id,omitempty"` Branch *string `json:"branch,omitempty"` @@ -513,6 +777,30 @@ func updateRepoRequestFromWire(w *updateRepoRequestWire) (*UpdateRepoRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateRepoRequest) MarshalJSON() ([]byte, error) { + w, err := updateRepoRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateRepoRequest) UnmarshalJSON(data []byte) error { + var w updateRepoRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateRepoRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateRepoResponseWire struct { } @@ -530,6 +818,30 @@ func updateRepoResponseFromWire(w *updateRepoResponseWire) (*UpdateRepoResponse, return &UpdateRepoResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateRepoResponse) MarshalJSON() ([]byte, error) { + w, err := updateRepoResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateRepoResponse) UnmarshalJSON(data []byte) error { + var w updateRepoResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateRepoResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/sandbox/CHANGELOG.md b/sandbox/CHANGELOG.md index 8566d44b..1018025b 100644 --- a/sandbox/CHANGELOG.md +++ b/sandbox/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.11.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.10.0 (2026-11-11) ## Release v0.9.0 (2026-11-10) diff --git a/sandbox/internal/version.go b/sandbox/internal/version.go index 1d390975..43dfaa13 100644 --- a/sandbox/internal/version.go +++ b/sandbox/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-sandbox" -const Version = "0.10.0" +const Version = "0.11.0" diff --git a/sandbox/v1/wire.go b/sandbox/v1/wire.go index 99f2f21c..14a136de 100644 --- a/sandbox/v1/wire.go +++ b/sandbox/v1/wire.go @@ -99,6 +99,30 @@ func commandFromWire(w *commandWire) (*Command, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Command) MarshalJSON() ([]byte, error) { + w, err := commandToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Command) UnmarshalJSON(data []byte) error { + var w commandWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := commandFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type computeSpecWire struct { InactivityTimeout *types.Duration `json:"inactivity_timeout,omitempty"` } @@ -121,6 +145,30 @@ func computeSpecFromWire(w *computeSpecWire) (*ComputeSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ComputeSpec) MarshalJSON() ([]byte, error) { + w, err := computeSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ComputeSpec) UnmarshalJSON(data []byte) error { + var w computeSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := computeSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createDirectoryRequestWire struct { Parent *string `json:"parent,omitempty"` Path *string `json:"path,omitempty"` @@ -149,6 +197,30 @@ func createDirectoryRequestFromWire(w *createDirectoryRequestWire) (*CreateDirec }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateDirectoryRequest) MarshalJSON() ([]byte, error) { + w, err := createDirectoryRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateDirectoryRequest) UnmarshalJSON(data []byte) error { + var w createDirectoryRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createDirectoryRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createDirectoryResponseWire struct { } @@ -166,6 +238,30 @@ func createDirectoryResponseFromWire(w *createDirectoryResponseWire) (*CreateDir return &CreateDirectoryResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateDirectoryResponse) MarshalJSON() ([]byte, error) { + w, err := createDirectoryResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateDirectoryResponse) UnmarshalJSON(data []byte) error { + var w createDirectoryResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createDirectoryResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createSandboxRequestWire struct { Sandbox *sandboxWire `json:"sandbox,omitempty"` SandboxId *string `json:"sandbox_id,omitempty"` @@ -199,6 +295,30 @@ func createSandboxRequestFromWire(w *createSandboxRequestWire) (*CreateSandboxRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateSandboxRequest) MarshalJSON() ([]byte, error) { + w, err := createSandboxRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateSandboxRequest) UnmarshalJSON(data []byte) error { + var w createSandboxRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createSandboxRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deletePathRequestWire struct { Parent *string `json:"parent,omitempty"` Path *string `json:"path,omitempty"` @@ -227,6 +347,30 @@ func deletePathRequestFromWire(w *deletePathRequestWire) (*DeletePathRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeletePathRequest) MarshalJSON() ([]byte, error) { + w, err := deletePathRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeletePathRequest) UnmarshalJSON(data []byte) error { + var w deletePathRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deletePathRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deletePathResponseWire struct { } @@ -244,6 +388,30 @@ func deletePathResponseFromWire(w *deletePathResponseWire) (*DeletePathResponse, return &DeletePathResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeletePathResponse) MarshalJSON() ([]byte, error) { + w, err := deletePathResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeletePathResponse) UnmarshalJSON(data []byte) error { + var w deletePathResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deletePathResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteSandboxRequestWire struct { Name *string `json:"name,omitempty"` } @@ -266,6 +434,30 @@ func deleteSandboxRequestFromWire(w *deleteSandboxRequestWire) (*DeleteSandboxRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteSandboxRequest) MarshalJSON() ([]byte, error) { + w, err := deleteSandboxRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteSandboxRequest) UnmarshalJSON(data []byte) error { + var w deleteSandboxRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteSandboxRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type downloadFileRequestWire struct { Parent *string `json:"parent,omitempty"` Path *string `json:"path,omitempty"` @@ -309,6 +501,30 @@ func downloadFileRequestFromWire(w *downloadFileRequestWire) (*DownloadFileReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DownloadFileRequest) MarshalJSON() ([]byte, error) { + w, err := downloadFileRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DownloadFileRequest) UnmarshalJSON(data []byte) error { + var w downloadFileRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := downloadFileRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type downloadFileResponseWire struct { } @@ -348,6 +564,30 @@ func environmentSpecFromWire(w *environmentSpecWire) (*EnvironmentSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EnvironmentSpec) MarshalJSON() ([]byte, error) { + w, err := environmentSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EnvironmentSpec) UnmarshalJSON(data []byte) error { + var w environmentSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := environmentSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type executeCommandSyncRequestWire struct { Name *string `json:"name,omitempty"` Cmd *string `json:"cmd,omitempty"` @@ -382,6 +622,30 @@ func executeCommandSyncRequestFromWire(w *executeCommandSyncRequestWire) (*Execu }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExecuteCommandSyncRequest) MarshalJSON() ([]byte, error) { + w, err := executeCommandSyncRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExecuteCommandSyncRequest) UnmarshalJSON(data []byte) error { + var w executeCommandSyncRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := executeCommandSyncRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type executeCommandSyncResponseWire struct { ExitCode *int `json:"exit_code,omitempty"` Status ExecuteCommandStatus `json:"status,omitempty"` @@ -419,6 +683,30 @@ func executeCommandSyncResponseFromWire(w *executeCommandSyncResponseWire) (*Exe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExecuteCommandSyncResponse) MarshalJSON() ([]byte, error) { + w, err := executeCommandSyncResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExecuteCommandSyncResponse) UnmarshalJSON(data []byte) error { + var w executeCommandSyncResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := executeCommandSyncResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getMetadataRequestWire struct { Parent *string `json:"parent,omitempty"` Path *string `json:"path,omitempty"` @@ -444,6 +732,30 @@ func getMetadataRequestFromWire(w *getMetadataRequestWire) (*GetMetadataRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetMetadataRequest) MarshalJSON() ([]byte, error) { + w, err := getMetadataRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetMetadataRequest) UnmarshalJSON(data []byte) error { + var w getMetadataRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getMetadataRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getMetadataResponseWire struct { File *sandboxFileInfoWire `json:"file,omitempty"` } @@ -474,6 +786,30 @@ func getMetadataResponseFromWire(w *getMetadataResponseWire) (*GetMetadataRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetMetadataResponse) MarshalJSON() ([]byte, error) { + w, err := getMetadataResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetMetadataResponse) UnmarshalJSON(data []byte) error { + var w getMetadataResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getMetadataResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSandboxRequestWire struct { Name *string `json:"name,omitempty"` } @@ -496,6 +832,30 @@ func getSandboxRequestFromWire(w *getSandboxRequestWire) (*GetSandboxRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSandboxRequest) MarshalJSON() ([]byte, error) { + w, err := getSandboxRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSandboxRequest) UnmarshalJSON(data []byte) error { + var w getSandboxRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSandboxRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCommandsRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -524,6 +884,30 @@ func listCommandsRequestFromWire(w *listCommandsRequestWire) (*ListCommandsReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCommandsRequest) MarshalJSON() ([]byte, error) { + w, err := listCommandsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCommandsRequest) UnmarshalJSON(data []byte) error { + var w listCommandsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCommandsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCommandsResponseWire struct { Commands []commandWire `json:"commands,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -557,6 +941,30 @@ func listCommandsResponseFromWire(w *listCommandsResponseWire) (*ListCommandsRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCommandsResponse) MarshalJSON() ([]byte, error) { + w, err := listCommandsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCommandsResponse) UnmarshalJSON(data []byte) error { + var w listCommandsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCommandsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDirectoryContentsRequestWire struct { Parent *string `json:"parent,omitempty"` Path *string `json:"path,omitempty"` @@ -588,6 +996,30 @@ func listDirectoryContentsRequestFromWire(w *listDirectoryContentsRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDirectoryContentsRequest) MarshalJSON() ([]byte, error) { + w, err := listDirectoryContentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDirectoryContentsRequest) UnmarshalJSON(data []byte) error { + var w listDirectoryContentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDirectoryContentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDirectoryContentsResponseWire struct { Contents []sandboxFileInfoWire `json:"contents,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -621,6 +1053,30 @@ func listDirectoryContentsResponseFromWire(w *listDirectoryContentsResponseWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDirectoryContentsResponse) MarshalJSON() ([]byte, error) { + w, err := listDirectoryContentsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDirectoryContentsResponse) UnmarshalJSON(data []byte) error { + var w listDirectoryContentsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDirectoryContentsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSandboxesRequestWire struct { PageToken *string `json:"page_token,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -646,6 +1102,30 @@ func listSandboxesRequestFromWire(w *listSandboxesRequestWire) (*ListSandboxesRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSandboxesRequest) MarshalJSON() ([]byte, error) { + w, err := listSandboxesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSandboxesRequest) UnmarshalJSON(data []byte) error { + var w listSandboxesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSandboxesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSandboxesResponseWire struct { Sandboxes []sandboxWire `json:"sandboxes,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -679,6 +1159,30 @@ func listSandboxesResponseFromWire(w *listSandboxesResponseWire) (*ListSandboxes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSandboxesResponse) MarshalJSON() ([]byte, error) { + w, err := listSandboxesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSandboxesResponse) UnmarshalJSON(data []byte) error { + var w listSandboxesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSandboxesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type renamePathRequestWire struct { Parent *string `json:"parent,omitempty"` Source *string `json:"source,omitempty"` @@ -707,6 +1211,30 @@ func renamePathRequestFromWire(w *renamePathRequestWire) (*RenamePathRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RenamePathRequest) MarshalJSON() ([]byte, error) { + w, err := renamePathRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RenamePathRequest) UnmarshalJSON(data []byte) error { + var w renamePathRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := renamePathRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type renamePathResponseWire struct { } @@ -724,6 +1252,30 @@ func renamePathResponseFromWire(w *renamePathResponseWire) (*RenamePathResponse, return &RenamePathResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RenamePathResponse) MarshalJSON() ([]byte, error) { + w, err := renamePathResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RenamePathResponse) UnmarshalJSON(data []byte) error { + var w renamePathResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := renamePathResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sandboxWire struct { Metadata *sandboxMetadataWire `json:"metadata,omitempty"` Spec *sandboxSpecWire `json:"spec,omitempty"` @@ -788,6 +1340,30 @@ func sandboxFromWire(w *sandboxWire) (*Sandbox, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Sandbox) MarshalJSON() ([]byte, error) { + w, err := sandboxToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Sandbox) UnmarshalJSON(data []byte) error { + var w sandboxWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sandboxFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sandboxFileInfoWire struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` @@ -845,6 +1421,30 @@ func sandboxFileInfoFromWire(w *sandboxFileInfoWire) (*SandboxFileInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SandboxFileInfo) MarshalJSON() ([]byte, error) { + w, err := sandboxFileInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SandboxFileInfo) UnmarshalJSON(data []byte) error { + var w sandboxFileInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sandboxFileInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sandboxMetadataWire struct { CustomTags map[string]string `json:"custom_tags,omitempty"` } @@ -867,6 +1467,30 @@ func sandboxMetadataFromWire(w *sandboxMetadataWire) (*SandboxMetadata, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SandboxMetadata) MarshalJSON() ([]byte, error) { + w, err := sandboxMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SandboxMetadata) UnmarshalJSON(data []byte) error { + var w sandboxMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sandboxMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sandboxSpecWire struct { Compute *computeSpecWire `json:"compute,omitempty"` Environment *environmentSpecWire `json:"environment,omitempty"` @@ -908,6 +1532,30 @@ func sandboxSpecFromWire(w *sandboxSpecWire) (*SandboxSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SandboxSpec) MarshalJSON() ([]byte, error) { + w, err := sandboxSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SandboxSpec) UnmarshalJSON(data []byte) error { + var w sandboxSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sandboxSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sandboxStatusWire struct { State SandboxState `json:"state,omitempty"` } @@ -930,6 +1578,30 @@ func sandboxStatusFromWire(w *sandboxStatusWire) (*SandboxStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SandboxStatus) MarshalJSON() ([]byte, error) { + w, err := sandboxStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SandboxStatus) UnmarshalJSON(data []byte) error { + var w sandboxStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sandboxStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type startSandboxRequestWire struct { Name *string `json:"name,omitempty"` } @@ -952,6 +1624,30 @@ func startSandboxRequestFromWire(w *startSandboxRequestWire) (*StartSandboxReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StartSandboxRequest) MarshalJSON() ([]byte, error) { + w, err := startSandboxRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StartSandboxRequest) UnmarshalJSON(data []byte) error { + var w startSandboxRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := startSandboxRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type stopSandboxRequestWire struct { Name *string `json:"name,omitempty"` } @@ -974,6 +1670,30 @@ func stopSandboxRequestFromWire(w *stopSandboxRequestWire) (*StopSandboxRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StopSandboxRequest) MarshalJSON() ([]byte, error) { + w, err := stopSandboxRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StopSandboxRequest) UnmarshalJSON(data []byte) error { + var w stopSandboxRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := stopSandboxRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateSandboxRequestWire struct { Name *string `json:"name,omitempty"` Sandbox *sandboxWire `json:"sandbox,omitempty"` @@ -1010,6 +1730,30 @@ func updateSandboxRequestFromWire(w *updateSandboxRequestWire) (*UpdateSandboxRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateSandboxRequest) MarshalJSON() ([]byte, error) { + w, err := updateSandboxRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateSandboxRequest) UnmarshalJSON(data []byte) error { + var w updateSandboxRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateSandboxRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type uploadFileRequestWire struct { Parent *string `json:"parent,omitempty"` Path *string `json:"path,omitempty"` @@ -1052,6 +1796,30 @@ func uploadFileResponseFromWire(w *uploadFileResponseWire) (*UploadFileResponse, return &UploadFileResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UploadFileResponse) MarshalJSON() ([]byte, error) { + w, err := uploadFileResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UploadFileResponse) UnmarshalJSON(data []byte) error { + var w uploadFileResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := uploadFileResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/scim/CHANGELOG.md b/scim/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/scim/CHANGELOG.md +++ b/scim/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/scim/internal/version.go b/scim/internal/version.go index 7d4c1267..4b711d6f 100644 --- a/scim/internal/version.go +++ b/scim/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-scim" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/scim/v1/wire.go b/scim/v1/wire.go index cb4fd088..a39c5fca 100644 --- a/scim/v1/wire.go +++ b/scim/v1/wire.go @@ -86,6 +86,30 @@ func accountComplexValueFromWire(w *accountComplexValueWire) (*AccountComplexVal }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountComplexValue) MarshalJSON() ([]byte, error) { + w, err := accountComplexValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountComplexValue) UnmarshalJSON(data []byte) error { + var w accountComplexValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountComplexValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountGetSortOrderWire struct { } @@ -103,6 +127,30 @@ func accountGetSortOrderFromWire(w *accountGetSortOrderWire) (*AccountGetSortOrd return &AccountGetSortOrder{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountGetSortOrder) MarshalJSON() ([]byte, error) { + w, err := accountGetSortOrderToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountGetSortOrder) UnmarshalJSON(data []byte) error { + var w accountGetSortOrderWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountGetSortOrderFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountGroupWire struct { DisplayName *string `json:"displayName,omitempty"` ExternalId *string `json:"externalId,omitempty"` @@ -167,6 +215,30 @@ func accountGroupFromWire(w *accountGroupWire) (*AccountGroup, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountGroup) MarshalJSON() ([]byte, error) { + w, err := accountGroupToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountGroup) UnmarshalJSON(data []byte) error { + var w accountGroupWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountGroupFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountListSortWire struct { } @@ -184,6 +256,30 @@ func accountListSortFromWire(w *accountListSortWire) (*AccountListSort, error) { return &AccountListSort{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountListSort) MarshalJSON() ([]byte, error) { + w, err := accountListSortToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountListSort) UnmarshalJSON(data []byte) error { + var w accountListSortWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountListSortFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountNameWire struct { FamilyName *string `json:"familyName,omitempty"` GivenName *string `json:"givenName,omitempty"` @@ -209,6 +305,30 @@ func accountNameFromWire(w *accountNameWire) (*AccountName, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountName) MarshalJSON() ([]byte, error) { + w, err := accountNameToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountName) UnmarshalJSON(data []byte) error { + var w accountNameWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountNameFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountPatchWire struct { Op AccountPatchOp_PatchOp `json:"op,omitempty"` Path *string `json:"path,omitempty"` @@ -237,6 +357,30 @@ func accountPatchFromWire(w *accountPatchWire) (*AccountPatch, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountPatch) MarshalJSON() ([]byte, error) { + w, err := accountPatchToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountPatch) UnmarshalJSON(data []byte) error { + var w accountPatchWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountPatchFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountPatchOpWire struct { } @@ -254,6 +398,30 @@ func accountPatchOpFromWire(w *accountPatchOpWire) (*AccountPatchOp, error) { return &AccountPatchOp{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountPatchOp) MarshalJSON() ([]byte, error) { + w, err := accountPatchOpToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountPatchOp) UnmarshalJSON(data []byte) error { + var w accountPatchOpWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountPatchOpFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountPatchSchemaWire struct { } @@ -271,6 +439,30 @@ func accountPatchSchemaFromWire(w *accountPatchSchemaWire) (*AccountPatchSchema, return &AccountPatchSchema{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountPatchSchema) MarshalJSON() ([]byte, error) { + w, err := accountPatchSchemaToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountPatchSchema) UnmarshalJSON(data []byte) error { + var w accountPatchSchemaWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountPatchSchemaFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountResourceMetaWire struct { ResourceType *string `json:"resourceType,omitempty"` } @@ -293,6 +485,30 @@ func accountResourceMetaFromWire(w *accountResourceMetaWire) (*AccountResourceMe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountResourceMeta) MarshalJSON() ([]byte, error) { + w, err := accountResourceMetaToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountResourceMeta) UnmarshalJSON(data []byte) error { + var w accountResourceMetaWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountResourceMetaFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountServicePrincipalWire struct { Active *bool `json:"active,omitempty"` ApplicationId *string `json:"applicationId,omitempty"` @@ -341,6 +557,30 @@ func accountServicePrincipalFromWire(w *accountServicePrincipalWire) (*AccountSe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountServicePrincipal) MarshalJSON() ([]byte, error) { + w, err := accountServicePrincipalToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountServicePrincipal) UnmarshalJSON(data []byte) error { + var w accountServicePrincipalWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountServicePrincipalFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountUserWire struct { Active *bool `json:"active,omitempty"` DisplayName *string `json:"displayName,omitempty"` @@ -411,6 +651,30 @@ func accountUserFromWire(w *accountUserWire) (*AccountUser, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountUser) MarshalJSON() ([]byte, error) { + w, err := accountUserToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountUser) UnmarshalJSON(data []byte) error { + var w accountUserWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountUserFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type complexValueWire struct { Display *string `json:"display,omitempty"` Primary *bool `json:"primary,omitempty"` @@ -445,6 +709,30 @@ func complexValueFromWire(w *complexValueWire) (*ComplexValue, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ComplexValue) MarshalJSON() ([]byte, error) { + w, err := complexValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ComplexValue) UnmarshalJSON(data []byte) error { + var w complexValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := complexValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAccountGroupRequestWire struct { DisplayName *string `json:"displayName,omitempty"` ExternalId *string `json:"externalId,omitempty"` @@ -509,6 +797,30 @@ func createAccountGroupRequestFromWire(w *createAccountGroupRequestWire) (*Creat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAccountGroupRequest) MarshalJSON() ([]byte, error) { + w, err := createAccountGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAccountGroupRequest) UnmarshalJSON(data []byte) error { + var w createAccountGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAccountGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAccountServicePrincipalRequestWire struct { Active *bool `json:"active,omitempty"` ApplicationId *string `json:"applicationId,omitempty"` @@ -557,6 +869,30 @@ func createAccountServicePrincipalRequestFromWire(w *createAccountServicePrincip }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAccountServicePrincipalRequest) MarshalJSON() ([]byte, error) { + w, err := createAccountServicePrincipalRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAccountServicePrincipalRequest) UnmarshalJSON(data []byte) error { + var w createAccountServicePrincipalRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAccountServicePrincipalRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAccountUserRequestWire struct { Active *bool `json:"active,omitempty"` DisplayName *string `json:"displayName,omitempty"` @@ -627,6 +963,30 @@ func createAccountUserRequestFromWire(w *createAccountUserRequestWire) (*CreateA }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAccountUserRequest) MarshalJSON() ([]byte, error) { + w, err := createAccountUserRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAccountUserRequest) UnmarshalJSON(data []byte) error { + var w createAccountUserRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAccountUserRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createGroupRequestWire struct { DisplayName *string `json:"displayName,omitempty"` Entitlements []complexValueWire `json:"entitlements,omitempty"` @@ -713,6 +1073,30 @@ func createGroupRequestFromWire(w *createGroupRequestWire) (*CreateGroupRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateGroupRequest) MarshalJSON() ([]byte, error) { + w, err := createGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateGroupRequest) UnmarshalJSON(data []byte) error { + var w createGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createServicePrincipalRequestWire struct { Active *bool `json:"active,omitempty"` ApplicationId *string `json:"applicationId,omitempty"` @@ -783,6 +1167,30 @@ func createServicePrincipalRequestFromWire(w *createServicePrincipalRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateServicePrincipalRequest) MarshalJSON() ([]byte, error) { + w, err := createServicePrincipalRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateServicePrincipalRequest) UnmarshalJSON(data []byte) error { + var w createServicePrincipalRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createServicePrincipalRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createUserRequestWire struct { Active *bool `json:"active,omitempty"` DisplayName *string `json:"displayName,omitempty"` @@ -875,6 +1283,30 @@ func createUserRequestFromWire(w *createUserRequestWire) (*CreateUserRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateUserRequest) MarshalJSON() ([]byte, error) { + w, err := createUserRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateUserRequest) UnmarshalJSON(data []byte) error { + var w createUserRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createUserRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteAccountGroupRequestWire struct { Id *string `json:"id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -900,6 +1332,30 @@ func deleteAccountGroupRequestFromWire(w *deleteAccountGroupRequestWire) (*Delet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteAccountGroupRequest) MarshalJSON() ([]byte, error) { + w, err := deleteAccountGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteAccountGroupRequest) UnmarshalJSON(data []byte) error { + var w deleteAccountGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteAccountGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteAccountServicePrincipalRequestWire struct { Id *string `json:"id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -925,6 +1381,30 @@ func deleteAccountServicePrincipalRequestFromWire(w *deleteAccountServicePrincip }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteAccountServicePrincipalRequest) MarshalJSON() ([]byte, error) { + w, err := deleteAccountServicePrincipalRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteAccountServicePrincipalRequest) UnmarshalJSON(data []byte) error { + var w deleteAccountServicePrincipalRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteAccountServicePrincipalRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteAccountUserRequestWire struct { Id *string `json:"id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -950,6 +1430,30 @@ func deleteAccountUserRequestFromWire(w *deleteAccountUserRequestWire) (*DeleteA }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteAccountUserRequest) MarshalJSON() ([]byte, error) { + w, err := deleteAccountUserRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteAccountUserRequest) UnmarshalJSON(data []byte) error { + var w deleteAccountUserRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteAccountUserRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteGroupRequestWire struct { Id *string `json:"id,omitempty"` } @@ -972,6 +1476,30 @@ func deleteGroupRequestFromWire(w *deleteGroupRequestWire) (*DeleteGroupRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteGroupRequest) MarshalJSON() ([]byte, error) { + w, err := deleteGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteGroupRequest) UnmarshalJSON(data []byte) error { + var w deleteGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteServicePrincipalRequestWire struct { Id *string `json:"id,omitempty"` } @@ -994,6 +1522,30 @@ func deleteServicePrincipalRequestFromWire(w *deleteServicePrincipalRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteServicePrincipalRequest) MarshalJSON() ([]byte, error) { + w, err := deleteServicePrincipalRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteServicePrincipalRequest) UnmarshalJSON(data []byte) error { + var w deleteServicePrincipalRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteServicePrincipalRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteUserRequestWire struct { Id *string `json:"id,omitempty"` } @@ -1016,6 +1568,30 @@ func deleteUserRequestFromWire(w *deleteUserRequestWire) (*DeleteUserRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteUserRequest) MarshalJSON() ([]byte, error) { + w, err := deleteUserRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteUserRequest) UnmarshalJSON(data []byte) error { + var w deleteUserRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteUserRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAccountGroupRequestWire struct { Id *string `json:"id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -1041,6 +1617,30 @@ func getAccountGroupRequestFromWire(w *getAccountGroupRequestWire) (*GetAccountG }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAccountGroupRequest) MarshalJSON() ([]byte, error) { + w, err := getAccountGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAccountGroupRequest) UnmarshalJSON(data []byte) error { + var w getAccountGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAccountGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAccountServicePrincipalRequestWire struct { Id *string `json:"id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -1066,6 +1666,30 @@ func getAccountServicePrincipalRequestFromWire(w *getAccountServicePrincipalRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAccountServicePrincipalRequest) MarshalJSON() ([]byte, error) { + w, err := getAccountServicePrincipalRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAccountServicePrincipalRequest) UnmarshalJSON(data []byte) error { + var w getAccountServicePrincipalRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAccountServicePrincipalRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAccountUserRequestWire struct { Attributes *string `json:"attributes,omitempty"` Count *int `json:"count,omitempty"` @@ -1112,6 +1736,30 @@ func getAccountUserRequestFromWire(w *getAccountUserRequestWire) (*GetAccountUse }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAccountUserRequest) MarshalJSON() ([]byte, error) { + w, err := getAccountUserRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAccountUserRequest) UnmarshalJSON(data []byte) error { + var w getAccountUserRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAccountUserRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getGroupRequestWire struct { Id *string `json:"id,omitempty"` } @@ -1134,6 +1782,30 @@ func getGroupRequestFromWire(w *getGroupRequestWire) (*GetGroupRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetGroupRequest) MarshalJSON() ([]byte, error) { + w, err := getGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetGroupRequest) UnmarshalJSON(data []byte) error { + var w getGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPasswordPermissionLevelsRequestWire struct { } @@ -1148,7 +1820,31 @@ func getPasswordPermissionLevelsRequestFromWire(w *getPasswordPermissionLevelsRe if w == nil { return nil, nil } - return &GetPasswordPermissionLevelsRequest{}, nil + return &GetPasswordPermissionLevelsRequest{}, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPasswordPermissionLevelsRequest) MarshalJSON() ([]byte, error) { + w, err := getPasswordPermissionLevelsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPasswordPermissionLevelsRequest) UnmarshalJSON(data []byte) error { + var w getPasswordPermissionLevelsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPasswordPermissionLevelsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil } type getPasswordPermissionLevelsResponseWire struct { @@ -1181,6 +1877,30 @@ func getPasswordPermissionLevelsResponseFromWire(w *getPasswordPermissionLevelsR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPasswordPermissionLevelsResponse) MarshalJSON() ([]byte, error) { + w, err := getPasswordPermissionLevelsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPasswordPermissionLevelsResponse) UnmarshalJSON(data []byte) error { + var w getPasswordPermissionLevelsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPasswordPermissionLevelsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPasswordPermissionsRequestWire struct { } @@ -1198,6 +1918,30 @@ func getPasswordPermissionsRequestFromWire(w *getPasswordPermissionsRequestWire) return &GetPasswordPermissionsRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPasswordPermissionsRequest) MarshalJSON() ([]byte, error) { + w, err := getPasswordPermissionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPasswordPermissionsRequest) UnmarshalJSON(data []byte) error { + var w getPasswordPermissionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPasswordPermissionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getServicePrincipalRequestWire struct { Id *string `json:"id,omitempty"` } @@ -1220,6 +1964,30 @@ func getServicePrincipalRequestFromWire(w *getServicePrincipalRequestWire) (*Get }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetServicePrincipalRequest) MarshalJSON() ([]byte, error) { + w, err := getServicePrincipalRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetServicePrincipalRequest) UnmarshalJSON(data []byte) error { + var w getServicePrincipalRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getServicePrincipalRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getUserRequestWire struct { Attributes *string `json:"attributes,omitempty"` Count *int `json:"count,omitempty"` @@ -1263,6 +2031,30 @@ func getUserRequestFromWire(w *getUserRequestWire) (*GetUserRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetUserRequest) MarshalJSON() ([]byte, error) { + w, err := getUserRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetUserRequest) UnmarshalJSON(data []byte) error { + var w getUserRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getUserRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type groupWire struct { DisplayName *string `json:"displayName,omitempty"` Entitlements []complexValueWire `json:"entitlements,omitempty"` @@ -1349,6 +2141,30 @@ func groupFromWire(w *groupWire) (*Group, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Group) MarshalJSON() ([]byte, error) { + w, err := groupToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Group) UnmarshalJSON(data []byte) error { + var w groupWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := groupFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAccountGroupsRequestWire struct { AccountId *string `json:"account_id,omitempty"` Filter *string `json:"filter,omitempty"` @@ -1408,6 +2224,30 @@ func listAccountGroupsRequestFromWire(w *listAccountGroupsRequestWire) (*ListAcc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAccountGroupsRequest) MarshalJSON() ([]byte, error) { + w, err := listAccountGroupsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAccountGroupsRequest) UnmarshalJSON(data []byte) error { + var w listAccountGroupsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAccountGroupsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAccountGroupsResponseWire struct { ItemsPerPage *int `json:"itemsPerPage,omitempty"` Resources []accountGroupWire `json:"Resources,omitempty"` @@ -1455,6 +2295,30 @@ func listAccountGroupsResponseFromWire(w *listAccountGroupsResponseWire) (*ListA }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAccountGroupsResponse) MarshalJSON() ([]byte, error) { + w, err := listAccountGroupsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAccountGroupsResponse) UnmarshalJSON(data []byte) error { + var w listAccountGroupsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAccountGroupsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAccountServicePrincipalsRequestWire struct { Attributes *string `json:"attributes,omitempty"` Count *wireInt64 `json:"count,omitempty"` @@ -1514,6 +2378,30 @@ func listAccountServicePrincipalsRequestFromWire(w *listAccountServicePrincipals }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAccountServicePrincipalsRequest) MarshalJSON() ([]byte, error) { + w, err := listAccountServicePrincipalsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAccountServicePrincipalsRequest) UnmarshalJSON(data []byte) error { + var w listAccountServicePrincipalsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAccountServicePrincipalsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAccountServicePrincipalsResponseWire struct { ItemsPerPage *int `json:"itemsPerPage,omitempty"` Resources []accountServicePrincipalWire `json:"Resources,omitempty"` @@ -1561,6 +2449,30 @@ func listAccountServicePrincipalsResponseFromWire(w *listAccountServicePrincipal }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAccountServicePrincipalsResponse) MarshalJSON() ([]byte, error) { + w, err := listAccountServicePrincipalsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAccountServicePrincipalsResponse) UnmarshalJSON(data []byte) error { + var w listAccountServicePrincipalsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAccountServicePrincipalsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAccountUsersRequestWire struct { Attributes *string `json:"attributes,omitempty"` Count *wireInt64 `json:"count,omitempty"` @@ -1620,6 +2532,30 @@ func listAccountUsersRequestFromWire(w *listAccountUsersRequestWire) (*ListAccou }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAccountUsersRequest) MarshalJSON() ([]byte, error) { + w, err := listAccountUsersRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAccountUsersRequest) UnmarshalJSON(data []byte) error { + var w listAccountUsersRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAccountUsersRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAccountUsersResponseWire struct { ItemsPerPage *int `json:"itemsPerPage,omitempty"` Resources []accountUserWire `json:"Resources,omitempty"` @@ -1667,6 +2603,30 @@ func listAccountUsersResponseFromWire(w *listAccountUsersResponseWire) (*ListAcc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAccountUsersResponse) MarshalJSON() ([]byte, error) { + w, err := listAccountUsersResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAccountUsersResponse) UnmarshalJSON(data []byte) error { + var w listAccountUsersResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAccountUsersResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listGroupsRequestWire struct { Filter *string `json:"filter,omitempty"` Attributes *string `json:"attributes,omitempty"` @@ -1723,6 +2683,30 @@ func listGroupsRequestFromWire(w *listGroupsRequestWire) (*ListGroupsRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListGroupsRequest) MarshalJSON() ([]byte, error) { + w, err := listGroupsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListGroupsRequest) UnmarshalJSON(data []byte) error { + var w listGroupsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listGroupsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listGroupsResponseWire struct { ItemsPerPage *int `json:"itemsPerPage,omitempty"` Resources []groupWire `json:"Resources,omitempty"` @@ -1773,6 +2757,30 @@ func listGroupsResponseFromWire(w *listGroupsResponseWire) (*ListGroupsResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListGroupsResponse) MarshalJSON() ([]byte, error) { + w, err := listGroupsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListGroupsResponse) UnmarshalJSON(data []byte) error { + var w listGroupsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listGroupsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listServicePrincipalResponseWire struct { ItemsPerPage *int `json:"itemsPerPage,omitempty"` Resources []servicePrincipalWire `json:"Resources,omitempty"` @@ -1823,6 +2831,30 @@ func listServicePrincipalResponseFromWire(w *listServicePrincipalResponseWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListServicePrincipalResponse) MarshalJSON() ([]byte, error) { + w, err := listServicePrincipalResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListServicePrincipalResponse) UnmarshalJSON(data []byte) error { + var w listServicePrincipalResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listServicePrincipalResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listServicePrincipalsRequestWire struct { Attributes *string `json:"attributes,omitempty"` Count *wireInt64 `json:"count,omitempty"` @@ -1879,6 +2911,30 @@ func listServicePrincipalsRequestFromWire(w *listServicePrincipalsRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListServicePrincipalsRequest) MarshalJSON() ([]byte, error) { + w, err := listServicePrincipalsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListServicePrincipalsRequest) UnmarshalJSON(data []byte) error { + var w listServicePrincipalsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listServicePrincipalsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSortWire struct { } @@ -1896,6 +2952,30 @@ func listSortFromWire(w *listSortWire) (*ListSort, error) { return &ListSort{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSort) MarshalJSON() ([]byte, error) { + w, err := listSortToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSort) UnmarshalJSON(data []byte) error { + var w listSortWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSortFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listUsersRequestWire struct { Attributes *string `json:"attributes,omitempty"` Count *wireInt64 `json:"count,omitempty"` @@ -1952,6 +3032,30 @@ func listUsersRequestFromWire(w *listUsersRequestWire) (*ListUsersRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListUsersRequest) MarshalJSON() ([]byte, error) { + w, err := listUsersRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListUsersRequest) UnmarshalJSON(data []byte) error { + var w listUsersRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listUsersRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listUsersResponseWire struct { ItemsPerPage *int `json:"itemsPerPage,omitempty"` Resources []userWire `json:"Resources,omitempty"` @@ -2002,6 +3106,30 @@ func listUsersResponseFromWire(w *listUsersResponseWire) (*ListUsersResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListUsersResponse) MarshalJSON() ([]byte, error) { + w, err := listUsersResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListUsersResponse) UnmarshalJSON(data []byte) error { + var w listUsersResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listUsersResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type meRequestWire struct { Attributes *string `json:"attributes,omitempty"` ExcludedAttributes *string `json:"excludedAttributes,omitempty"` @@ -2027,6 +3155,30 @@ func meRequestFromWire(w *meRequestWire) (*MeRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MeRequest) MarshalJSON() ([]byte, error) { + w, err := meRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MeRequest) UnmarshalJSON(data []byte) error { + var w meRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := meRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type nameWire struct { FamilyName *string `json:"familyName,omitempty"` GivenName *string `json:"givenName,omitempty"` @@ -2052,6 +3204,30 @@ func nameFromWire(w *nameWire) (*Name, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Name) MarshalJSON() ([]byte, error) { + w, err := nameToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Name) UnmarshalJSON(data []byte) error { + var w nameWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := nameFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type passwordAccessControlRequestWire struct { GroupName *string `json:"group_name,omitempty"` PermissionLevel PasswordPermission_Level `json:"permission_level,omitempty"` @@ -2083,6 +3259,30 @@ func passwordAccessControlRequestFromWire(w *passwordAccessControlRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PasswordAccessControlRequest) MarshalJSON() ([]byte, error) { + w, err := passwordAccessControlRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PasswordAccessControlRequest) UnmarshalJSON(data []byte) error { + var w passwordAccessControlRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := passwordAccessControlRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type passwordAccessControlResponseWire struct { AllPermissions []passwordPermissionWire `json:"all_permissions,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -2125,6 +3325,30 @@ func passwordAccessControlResponseFromWire(w *passwordAccessControlResponseWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PasswordAccessControlResponse) MarshalJSON() ([]byte, error) { + w, err := passwordAccessControlResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PasswordAccessControlResponse) UnmarshalJSON(data []byte) error { + var w passwordAccessControlResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := passwordAccessControlResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type passwordPermissionWire struct { Inherited *bool `json:"inherited,omitempty"` InheritedFromObject []string `json:"inherited_from_object,omitempty"` @@ -2153,6 +3377,30 @@ func passwordPermissionFromWire(w *passwordPermissionWire) (*PasswordPermission, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PasswordPermission) MarshalJSON() ([]byte, error) { + w, err := passwordPermissionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PasswordPermission) UnmarshalJSON(data []byte) error { + var w passwordPermissionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := passwordPermissionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type passwordPermissionsWire struct { AccessControlList []passwordAccessControlResponseWire `json:"access_control_list,omitempty"` ObjectId *string `json:"object_id,omitempty"` @@ -2189,6 +3437,30 @@ func passwordPermissionsFromWire(w *passwordPermissionsWire) (*PasswordPermissio }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PasswordPermissions) MarshalJSON() ([]byte, error) { + w, err := passwordPermissionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PasswordPermissions) UnmarshalJSON(data []byte) error { + var w passwordPermissionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := passwordPermissionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type passwordPermissionsDescriptionWire struct { Description *string `json:"description,omitempty"` PermissionLevel PasswordPermission_Level `json:"permission_level,omitempty"` @@ -2214,6 +3486,30 @@ func passwordPermissionsDescriptionFromWire(w *passwordPermissionsDescriptionWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PasswordPermissionsDescription) MarshalJSON() ([]byte, error) { + w, err := passwordPermissionsDescriptionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PasswordPermissionsDescription) UnmarshalJSON(data []byte) error { + var w passwordPermissionsDescriptionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := passwordPermissionsDescriptionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type passwordPermissionsRequestWire struct { AccessControlList []passwordAccessControlRequestWire `json:"access_control_list,omitempty"` } @@ -2244,6 +3540,30 @@ func passwordPermissionsRequestFromWire(w *passwordPermissionsRequestWire) (*Pas }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PasswordPermissionsRequest) MarshalJSON() ([]byte, error) { + w, err := passwordPermissionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PasswordPermissionsRequest) UnmarshalJSON(data []byte) error { + var w passwordPermissionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := passwordPermissionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type patchWire struct { Op PatchOp `json:"op,omitempty"` Path *string `json:"path,omitempty"` @@ -2272,6 +3592,30 @@ func patchFromWire(w *patchWire) (*Patch, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Patch) MarshalJSON() ([]byte, error) { + w, err := patchToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Patch) UnmarshalJSON(data []byte) error { + var w patchWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := patchFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type patchAccountGroupRequestWire struct { Id *string `json:"id,omitempty"` Operations []accountPatchWire `json:"Operations,omitempty"` @@ -2311,6 +3655,30 @@ func patchAccountGroupRequestFromWire(w *patchAccountGroupRequestWire) (*PatchAc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PatchAccountGroupRequest) MarshalJSON() ([]byte, error) { + w, err := patchAccountGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PatchAccountGroupRequest) UnmarshalJSON(data []byte) error { + var w patchAccountGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := patchAccountGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type patchAccountServicePrincipalRequestWire struct { Id *string `json:"id,omitempty"` Operations []accountPatchWire `json:"Operations,omitempty"` @@ -2350,6 +3718,30 @@ func patchAccountServicePrincipalRequestFromWire(w *patchAccountServicePrincipal }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PatchAccountServicePrincipalRequest) MarshalJSON() ([]byte, error) { + w, err := patchAccountServicePrincipalRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PatchAccountServicePrincipalRequest) UnmarshalJSON(data []byte) error { + var w patchAccountServicePrincipalRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := patchAccountServicePrincipalRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type patchAccountUserRequestWire struct { Id *string `json:"id,omitempty"` Operations []accountPatchWire `json:"Operations,omitempty"` @@ -2389,6 +3781,30 @@ func patchAccountUserRequestFromWire(w *patchAccountUserRequestWire) (*PatchAcco }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PatchAccountUserRequest) MarshalJSON() ([]byte, error) { + w, err := patchAccountUserRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PatchAccountUserRequest) UnmarshalJSON(data []byte) error { + var w patchAccountUserRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := patchAccountUserRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type patchGroupRequestWire struct { Id *string `json:"id,omitempty"` Operations []patchWire `json:"Operations,omitempty"` @@ -2425,6 +3841,30 @@ func patchGroupRequestFromWire(w *patchGroupRequestWire) (*PatchGroupRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PatchGroupRequest) MarshalJSON() ([]byte, error) { + w, err := patchGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PatchGroupRequest) UnmarshalJSON(data []byte) error { + var w patchGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := patchGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type patchServicePrincipalRequestWire struct { Id *string `json:"id,omitempty"` Operations []patchWire `json:"Operations,omitempty"` @@ -2461,6 +3901,30 @@ func patchServicePrincipalRequestFromWire(w *patchServicePrincipalRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PatchServicePrincipalRequest) MarshalJSON() ([]byte, error) { + w, err := patchServicePrincipalRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PatchServicePrincipalRequest) UnmarshalJSON(data []byte) error { + var w patchServicePrincipalRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := patchServicePrincipalRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type patchUserRequestWire struct { Id *string `json:"id,omitempty"` Operations []patchWire `json:"Operations,omitempty"` @@ -2497,6 +3961,30 @@ func patchUserRequestFromWire(w *patchUserRequestWire) (*PatchUserRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PatchUserRequest) MarshalJSON() ([]byte, error) { + w, err := patchUserRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PatchUserRequest) UnmarshalJSON(data []byte) error { + var w patchUserRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := patchUserRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resourceMetaWire struct { ResourceType *string `json:"resourceType,omitempty"` } @@ -2519,6 +4007,30 @@ func resourceMetaFromWire(w *resourceMetaWire) (*ResourceMeta, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResourceMeta) MarshalJSON() ([]byte, error) { + w, err := resourceMetaToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResourceMeta) UnmarshalJSON(data []byte) error { + var w resourceMetaWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resourceMetaFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type servicePrincipalWire struct { Active *bool `json:"active,omitempty"` ApplicationId *string `json:"applicationId,omitempty"` @@ -2589,6 +4101,30 @@ func servicePrincipalFromWire(w *servicePrincipalWire) (*ServicePrincipal, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ServicePrincipal) MarshalJSON() ([]byte, error) { + w, err := servicePrincipalToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ServicePrincipal) UnmarshalJSON(data []byte) error { + var w servicePrincipalWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := servicePrincipalFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateAccountGroupRequestWire struct { DisplayName *string `json:"displayName,omitempty"` ExternalId *string `json:"externalId,omitempty"` @@ -2653,6 +4189,30 @@ func updateAccountGroupRequestFromWire(w *updateAccountGroupRequestWire) (*Updat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateAccountGroupRequest) MarshalJSON() ([]byte, error) { + w, err := updateAccountGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateAccountGroupRequest) UnmarshalJSON(data []byte) error { + var w updateAccountGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateAccountGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateAccountServicePrincipalRequestWire struct { Active *bool `json:"active,omitempty"` ApplicationId *string `json:"applicationId,omitempty"` @@ -2701,6 +4261,30 @@ func updateAccountServicePrincipalRequestFromWire(w *updateAccountServicePrincip }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateAccountServicePrincipalRequest) MarshalJSON() ([]byte, error) { + w, err := updateAccountServicePrincipalRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateAccountServicePrincipalRequest) UnmarshalJSON(data []byte) error { + var w updateAccountServicePrincipalRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateAccountServicePrincipalRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateAccountUserRequestWire struct { Active *bool `json:"active,omitempty"` DisplayName *string `json:"displayName,omitempty"` @@ -2771,6 +4355,30 @@ func updateAccountUserRequestFromWire(w *updateAccountUserRequestWire) (*UpdateA }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateAccountUserRequest) MarshalJSON() ([]byte, error) { + w, err := updateAccountUserRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateAccountUserRequest) UnmarshalJSON(data []byte) error { + var w updateAccountUserRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateAccountUserRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateGroupRequestWire struct { DisplayName *string `json:"displayName,omitempty"` Entitlements []complexValueWire `json:"entitlements,omitempty"` @@ -2857,6 +4465,30 @@ func updateGroupRequestFromWire(w *updateGroupRequestWire) (*UpdateGroupRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateGroupRequest) MarshalJSON() ([]byte, error) { + w, err := updateGroupRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateGroupRequest) UnmarshalJSON(data []byte) error { + var w updateGroupRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateGroupRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateServicePrincipalRequestWire struct { Active *bool `json:"active,omitempty"` ApplicationId *string `json:"applicationId,omitempty"` @@ -2927,6 +4559,30 @@ func updateServicePrincipalRequestFromWire(w *updateServicePrincipalRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateServicePrincipalRequest) MarshalJSON() ([]byte, error) { + w, err := updateServicePrincipalRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateServicePrincipalRequest) UnmarshalJSON(data []byte) error { + var w updateServicePrincipalRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateServicePrincipalRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateUserRequestWire struct { Active *bool `json:"active,omitempty"` DisplayName *string `json:"displayName,omitempty"` @@ -3019,6 +4675,30 @@ func updateUserRequestFromWire(w *updateUserRequestWire) (*UpdateUserRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateUserRequest) MarshalJSON() ([]byte, error) { + w, err := updateUserRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateUserRequest) UnmarshalJSON(data []byte) error { + var w updateUserRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateUserRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type userWire struct { Active *bool `json:"active,omitempty"` DisplayName *string `json:"displayName,omitempty"` @@ -3111,6 +4791,30 @@ func userFromWire(w *userWire) (*User, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v User) MarshalJSON() ([]byte, error) { + w, err := userToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *User) UnmarshalJSON(data []byte) error { + var w userWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := userFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/secrets/CHANGELOG.md b/secrets/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/secrets/CHANGELOG.md +++ b/secrets/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/secrets/internal/version.go b/secrets/internal/version.go index 9f748199..55983a9f 100644 --- a/secrets/internal/version.go +++ b/secrets/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-secrets" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/secrets/v1/wire.go b/secrets/v1/wire.go index acc26b90..762d2c37 100644 --- a/secrets/v1/wire.go +++ b/secrets/v1/wire.go @@ -77,6 +77,30 @@ func aclItemFromWire(w *aclItemWire) (*AclItem, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AclItem) MarshalJSON() ([]byte, error) { + w, err := aclItemToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AclItem) UnmarshalJSON(data []byte) error { + var w aclItemWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aclItemFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type azureKeyVaultSecretScopeMetadataWire struct { ResourceId *string `json:"resource_id,omitempty"` DnsName *string `json:"dns_name,omitempty"` @@ -102,6 +126,30 @@ func azureKeyVaultSecretScopeMetadataFromWire(w *azureKeyVaultSecretScopeMetadat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AzureKeyVaultSecretScopeMetadata) MarshalJSON() ([]byte, error) { + w, err := azureKeyVaultSecretScopeMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AzureKeyVaultSecretScopeMetadata) UnmarshalJSON(data []byte) error { + var w azureKeyVaultSecretScopeMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := azureKeyVaultSecretScopeMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createScopeRequestWire struct { Scope *string `json:"scope,omitempty"` InitialManagePrincipal *string `json:"initial_manage_principal,omitempty"` @@ -141,6 +189,30 @@ func createScopeRequestFromWire(w *createScopeRequestWire) (*CreateScopeRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateScopeRequest) MarshalJSON() ([]byte, error) { + w, err := createScopeRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateScopeRequest) UnmarshalJSON(data []byte) error { + var w createScopeRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createScopeRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createScopeResponseWire struct { } @@ -158,6 +230,30 @@ func createScopeResponseFromWire(w *createScopeResponseWire) (*CreateScopeRespon return &CreateScopeResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateScopeResponse) MarshalJSON() ([]byte, error) { + w, err := createScopeResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateScopeResponse) UnmarshalJSON(data []byte) error { + var w createScopeResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createScopeResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteAclRequestWire struct { Scope *string `json:"scope,omitempty"` Principal *string `json:"principal,omitempty"` @@ -183,6 +279,30 @@ func deleteAclRequestFromWire(w *deleteAclRequestWire) (*DeleteAclRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteAclRequest) MarshalJSON() ([]byte, error) { + w, err := deleteAclRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteAclRequest) UnmarshalJSON(data []byte) error { + var w deleteAclRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteAclRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteAclResponseWire struct { } @@ -200,6 +320,30 @@ func deleteAclResponseFromWire(w *deleteAclResponseWire) (*DeleteAclResponse, er return &DeleteAclResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteAclResponse) MarshalJSON() ([]byte, error) { + w, err := deleteAclResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteAclResponse) UnmarshalJSON(data []byte) error { + var w deleteAclResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteAclResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteScopeRequestWire struct { Scope *string `json:"scope,omitempty"` } @@ -222,6 +366,30 @@ func deleteScopeRequestFromWire(w *deleteScopeRequestWire) (*DeleteScopeRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteScopeRequest) MarshalJSON() ([]byte, error) { + w, err := deleteScopeRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteScopeRequest) UnmarshalJSON(data []byte) error { + var w deleteScopeRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteScopeRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteScopeResponseWire struct { } @@ -239,6 +407,30 @@ func deleteScopeResponseFromWire(w *deleteScopeResponseWire) (*DeleteScopeRespon return &DeleteScopeResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteScopeResponse) MarshalJSON() ([]byte, error) { + w, err := deleteScopeResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteScopeResponse) UnmarshalJSON(data []byte) error { + var w deleteScopeResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteScopeResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteSecretRequestWire struct { Scope *string `json:"scope,omitempty"` Key *string `json:"key,omitempty"` @@ -264,6 +456,30 @@ func deleteSecretRequestFromWire(w *deleteSecretRequestWire) (*DeleteSecretReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteSecretRequest) MarshalJSON() ([]byte, error) { + w, err := deleteSecretRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteSecretRequest) UnmarshalJSON(data []byte) error { + var w deleteSecretRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteSecretRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteSecretResponseWire struct { } @@ -281,6 +497,30 @@ func deleteSecretResponseFromWire(w *deleteSecretResponseWire) (*DeleteSecretRes return &DeleteSecretResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteSecretResponse) MarshalJSON() ([]byte, error) { + w, err := deleteSecretResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteSecretResponse) UnmarshalJSON(data []byte) error { + var w deleteSecretResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteSecretResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAclRequestWire struct { Scope *string `json:"scope,omitempty"` Principal *string `json:"principal,omitempty"` @@ -306,6 +546,30 @@ func getAclRequestFromWire(w *getAclRequestWire) (*GetAclRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAclRequest) MarshalJSON() ([]byte, error) { + w, err := getAclRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAclRequest) UnmarshalJSON(data []byte) error { + var w getAclRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAclRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSecretRequestWire struct { Scope *string `json:"scope,omitempty"` Key *string `json:"key,omitempty"` @@ -331,6 +595,30 @@ func getSecretRequestFromWire(w *getSecretRequestWire) (*GetSecretRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSecretRequest) MarshalJSON() ([]byte, error) { + w, err := getSecretRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSecretRequest) UnmarshalJSON(data []byte) error { + var w getSecretRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSecretRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSecretResponseWire struct { Key *string `json:"key,omitempty"` Value []byte `json:"value,omitempty"` @@ -356,6 +644,30 @@ func getSecretResponseFromWire(w *getSecretResponseWire) (*GetSecretResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSecretResponse) MarshalJSON() ([]byte, error) { + w, err := getSecretResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSecretResponse) UnmarshalJSON(data []byte) error { + var w getSecretResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSecretResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAclsRequestWire struct { Scope *string `json:"scope,omitempty"` } @@ -378,6 +690,30 @@ func listAclsRequestFromWire(w *listAclsRequestWire) (*ListAclsRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAclsRequest) MarshalJSON() ([]byte, error) { + w, err := listAclsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAclsRequest) UnmarshalJSON(data []byte) error { + var w listAclsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAclsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAclsResponseWire struct { Items []aclItemWire `json:"items,omitempty"` } @@ -408,6 +744,30 @@ func listAclsResponseFromWire(w *listAclsResponseWire) (*ListAclsResponse, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAclsResponse) MarshalJSON() ([]byte, error) { + w, err := listAclsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAclsResponse) UnmarshalJSON(data []byte) error { + var w listAclsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAclsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listScopesRequestWire struct { } @@ -425,6 +785,30 @@ func listScopesRequestFromWire(w *listScopesRequestWire) (*ListScopesRequest, er return &ListScopesRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListScopesRequest) MarshalJSON() ([]byte, error) { + w, err := listScopesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListScopesRequest) UnmarshalJSON(data []byte) error { + var w listScopesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listScopesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listScopesResponseWire struct { Scopes []secretScopeWire `json:"scopes,omitempty"` } @@ -455,6 +839,30 @@ func listScopesResponseFromWire(w *listScopesResponseWire) (*ListScopesResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListScopesResponse) MarshalJSON() ([]byte, error) { + w, err := listScopesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListScopesResponse) UnmarshalJSON(data []byte) error { + var w listScopesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listScopesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSecretsRequestWire struct { Scope *string `json:"scope,omitempty"` } @@ -477,6 +885,30 @@ func listSecretsRequestFromWire(w *listSecretsRequestWire) (*ListSecretsRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSecretsRequest) MarshalJSON() ([]byte, error) { + w, err := listSecretsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSecretsRequest) UnmarshalJSON(data []byte) error { + var w listSecretsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSecretsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSecretsResponseWire struct { Secrets []secretMetadataWire `json:"secrets,omitempty"` } @@ -507,6 +939,30 @@ func listSecretsResponseFromWire(w *listSecretsResponseWire) (*ListSecretsRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSecretsResponse) MarshalJSON() ([]byte, error) { + w, err := listSecretsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSecretsResponse) UnmarshalJSON(data []byte) error { + var w listSecretsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSecretsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type putAclRequestWire struct { Scope *string `json:"scope,omitempty"` Principal *string `json:"principal,omitempty"` @@ -535,6 +991,30 @@ func putAclRequestFromWire(w *putAclRequestWire) (*PutAclRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PutAclRequest) MarshalJSON() ([]byte, error) { + w, err := putAclRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PutAclRequest) UnmarshalJSON(data []byte) error { + var w putAclRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := putAclRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type putAclResponseWire struct { } @@ -552,6 +1032,30 @@ func putAclResponseFromWire(w *putAclResponseWire) (*PutAclResponse, error) { return &PutAclResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PutAclResponse) MarshalJSON() ([]byte, error) { + w, err := putAclResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PutAclResponse) UnmarshalJSON(data []byte) error { + var w putAclResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := putAclResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type putSecretRequestWire struct { Scope *string `json:"scope,omitempty"` Key *string `json:"key,omitempty"` @@ -614,6 +1118,30 @@ func putSecretRequestFromWire(w *putSecretRequestWire) (*PutSecretRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PutSecretRequest) MarshalJSON() ([]byte, error) { + w, err := putSecretRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PutSecretRequest) UnmarshalJSON(data []byte) error { + var w putSecretRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := putSecretRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type putSecretResponseWire struct { } @@ -631,6 +1159,30 @@ func putSecretResponseFromWire(w *putSecretResponseWire) (*PutSecretResponse, er return &PutSecretResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PutSecretResponse) MarshalJSON() ([]byte, error) { + w, err := putSecretResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PutSecretResponse) UnmarshalJSON(data []byte) error { + var w putSecretResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := putSecretResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type secretMetadataWire struct { Key *string `json:"key,omitempty"` LastUpdatedTimestamp *wireInt64 `json:"last_updated_timestamp,omitempty"` @@ -664,6 +1216,30 @@ func secretMetadataFromWire(w *secretMetadataWire) (*SecretMetadata, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SecretMetadata) MarshalJSON() ([]byte, error) { + w, err := secretMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SecretMetadata) UnmarshalJSON(data []byte) error { + var w secretMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := secretMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type secretScopeWire struct { Name *string `json:"name,omitempty"` BackendType ScopeBackendType `json:"backend_type,omitempty"` @@ -700,6 +1276,30 @@ func secretScopeFromWire(w *secretScopeWire) (*SecretScope, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SecretScope) MarshalJSON() ([]byte, error) { + w, err := secretScopeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SecretScope) UnmarshalJSON(data []byte) error { + var w secretScopeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := secretScopeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/settings/CHANGELOG.md b/settings/CHANGELOG.md index 0e9d3eb4..219b3123 100644 --- a/settings/CHANGELOG.md +++ b/settings/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/settings/internal/version.go b/settings/internal/version.go index 68708133..d91fe2a0 100644 --- a/settings/internal/version.go +++ b/settings/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-settings" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/settings/v2/wire.go b/settings/v2/wire.go index d1532690..f305a1f4 100644 --- a/settings/v2/wire.go +++ b/settings/v2/wire.go @@ -3,6 +3,7 @@ package settings import ( + "encoding/json" "fmt" ) @@ -28,6 +29,30 @@ func aibiDashboardEmbeddingAccessPolicyFromWire(w *aibiDashboardEmbeddingAccessP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AibiDashboardEmbeddingAccessPolicy) MarshalJSON() ([]byte, error) { + w, err := aibiDashboardEmbeddingAccessPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AibiDashboardEmbeddingAccessPolicy) UnmarshalJSON(data []byte) error { + var w aibiDashboardEmbeddingAccessPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aibiDashboardEmbeddingAccessPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type aibiDashboardEmbeddingApprovedDomainsWire struct { ApprovedDomains []string `json:"approved_domains,omitempty"` } @@ -50,6 +75,30 @@ func aibiDashboardEmbeddingApprovedDomainsFromWire(w *aibiDashboardEmbeddingAppr }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AibiDashboardEmbeddingApprovedDomains) MarshalJSON() ([]byte, error) { + w, err := aibiDashboardEmbeddingApprovedDomainsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AibiDashboardEmbeddingApprovedDomains) UnmarshalJSON(data []byte) error { + var w aibiDashboardEmbeddingApprovedDomainsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := aibiDashboardEmbeddingApprovedDomainsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type allowedAppsUserApiScopesMessageWire struct { AllowedScopes []string `json:"allowed_scopes,omitempty"` } @@ -72,6 +121,30 @@ func allowedAppsUserApiScopesMessageFromWire(w *allowedAppsUserApiScopesMessageW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AllowedAppsUserApiScopesMessage) MarshalJSON() ([]byte, error) { + w, err := allowedAppsUserApiScopesMessageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AllowedAppsUserApiScopesMessage) UnmarshalJSON(data []byte) error { + var w allowedAppsUserApiScopesMessageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := allowedAppsUserApiScopesMessageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type booleanMessageWire struct { Value *bool `json:"value,omitempty"` } @@ -94,6 +167,30 @@ func booleanMessageFromWire(w *booleanMessageWire) (*BooleanMessage, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BooleanMessage) MarshalJSON() ([]byte, error) { + w, err := booleanMessageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BooleanMessage) UnmarshalJSON(data []byte) error { + var w booleanMessageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := booleanMessageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterAutoRestartMessageWire struct { Enabled *bool `json:"enabled,omitempty"` CanToggle *bool `json:"can_toggle,omitempty"` @@ -144,6 +241,30 @@ func clusterAutoRestartMessageFromWire(w *clusterAutoRestartMessageWire) (*Clust }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterAutoRestartMessage) MarshalJSON() ([]byte, error) { + w, err := clusterAutoRestartMessageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterAutoRestartMessage) UnmarshalJSON(data []byte) error { + var w clusterAutoRestartMessageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterAutoRestartMessageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterAutoRestartMessage_EnablementDetailsWire struct { UnavailableForNonEnterpriseTier *bool `json:"unavailable_for_non_enterprise_tier,omitempty"` UnavailableForDisabledEntitlement *bool `json:"unavailable_for_disabled_entitlement,omitempty"` @@ -172,6 +293,30 @@ func clusterAutoRestartMessage_EnablementDetailsFromWire(w *clusterAutoRestartMe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterAutoRestartMessage_EnablementDetails) MarshalJSON() ([]byte, error) { + w, err := clusterAutoRestartMessage_EnablementDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterAutoRestartMessage_EnablementDetails) UnmarshalJSON(data []byte) error { + var w clusterAutoRestartMessage_EnablementDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterAutoRestartMessage_EnablementDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterAutoRestartMessage_MaintenanceWindowWire struct { WeekDayBasedSchedule *clusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedScheduleWire `json:"week_day_based_schedule,omitempty"` } @@ -202,6 +347,30 @@ func clusterAutoRestartMessage_MaintenanceWindowFromWire(w *clusterAutoRestartMe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterAutoRestartMessage_MaintenanceWindow) MarshalJSON() ([]byte, error) { + w, err := clusterAutoRestartMessage_MaintenanceWindowToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterAutoRestartMessage_MaintenanceWindow) UnmarshalJSON(data []byte) error { + var w clusterAutoRestartMessage_MaintenanceWindowWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterAutoRestartMessage_MaintenanceWindowFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedScheduleWire struct { Frequency ClusterAutoRestartMessage_MaintenanceWindow_WeekDayFrequency `json:"frequency,omitempty"` DayOfWeek ClusterAutoRestartMessage_MaintenanceWindow_DayOfWeek `json:"day_of_week,omitempty"` @@ -238,6 +407,30 @@ func clusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedScheduleFromWire(w }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedSchedule) MarshalJSON() ([]byte, error) { + w, err := clusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedScheduleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedSchedule) UnmarshalJSON(data []byte) error { + var w clusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedScheduleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedScheduleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type clusterAutoRestartMessage_MaintenanceWindow_WindowStartTimeWire struct { Hours *int `json:"hours,omitempty"` Minutes *int `json:"minutes,omitempty"` @@ -263,6 +456,30 @@ func clusterAutoRestartMessage_MaintenanceWindow_WindowStartTimeFromWire(w *clus }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ClusterAutoRestartMessage_MaintenanceWindow_WindowStartTime) MarshalJSON() ([]byte, error) { + w, err := clusterAutoRestartMessage_MaintenanceWindow_WindowStartTimeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ClusterAutoRestartMessage_MaintenanceWindow_WindowStartTime) UnmarshalJSON(data []byte) error { + var w clusterAutoRestartMessage_MaintenanceWindow_WindowStartTimeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := clusterAutoRestartMessage_MaintenanceWindow_WindowStartTimeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type collaborationPlatformConnectivityMessageWire struct { Connectivity CollaborationPlatformConnectivityMessage_Connectivity `json:"connectivity,omitempty"` } @@ -285,6 +502,30 @@ func collaborationPlatformConnectivityMessageFromWire(w *collaborationPlatformCo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CollaborationPlatformConnectivityMessage) MarshalJSON() ([]byte, error) { + w, err := collaborationPlatformConnectivityMessageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CollaborationPlatformConnectivityMessage) UnmarshalJSON(data []byte) error { + var w collaborationPlatformConnectivityMessageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := collaborationPlatformConnectivityMessageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dashboardThemeWire struct { CanvasBackgroundColor *dashboardTheme_DashboardThemeColorWire `json:"canvas_background_color,omitempty"` WidgetBackgroundColor *dashboardTheme_DashboardThemeColorWire `json:"widget_background_color,omitempty"` @@ -498,6 +739,30 @@ func dashboardThemeFromWire(w *dashboardThemeWire) (*DashboardTheme, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DashboardTheme) MarshalJSON() ([]byte, error) { + w, err := dashboardThemeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DashboardTheme) UnmarshalJSON(data []byte) error { + var w dashboardThemeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dashboardThemeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dashboardTheme_ContinuousGradientWire struct { LightMode *dashboardTheme_ContinuousGradient_GradientValueWire `json:"light_mode,omitempty"` DarkMode *dashboardTheme_ContinuousGradient_GradientValueWire `json:"dark_mode,omitempty"` @@ -539,6 +804,30 @@ func dashboardTheme_ContinuousGradientFromWire(w *dashboardTheme_ContinuousGradi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DashboardTheme_ContinuousGradient) MarshalJSON() ([]byte, error) { + w, err := dashboardTheme_ContinuousGradientToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DashboardTheme_ContinuousGradient) UnmarshalJSON(data []byte) error { + var w dashboardTheme_ContinuousGradientWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dashboardTheme_ContinuousGradientFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dashboardTheme_ContinuousGradient_CustomDivergingRampWire struct { Start *dashboardTheme_DashboardThemeColorWire `json:"start,omitempty"` Mid *dashboardTheme_DashboardThemeColorWire `json:"mid,omitempty"` @@ -591,6 +880,30 @@ func dashboardTheme_ContinuousGradient_CustomDivergingRampFromWire(w *dashboardT }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DashboardTheme_ContinuousGradient_CustomDivergingRamp) MarshalJSON() ([]byte, error) { + w, err := dashboardTheme_ContinuousGradient_CustomDivergingRampToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DashboardTheme_ContinuousGradient_CustomDivergingRamp) UnmarshalJSON(data []byte) error { + var w dashboardTheme_ContinuousGradient_CustomDivergingRampWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dashboardTheme_ContinuousGradient_CustomDivergingRampFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dashboardTheme_ContinuousGradient_CustomSequentialRampWire struct { Start *dashboardTheme_DashboardThemeColorWire `json:"start,omitempty"` End *dashboardTheme_DashboardThemeColorWire `json:"end,omitempty"` @@ -632,6 +945,30 @@ func dashboardTheme_ContinuousGradient_CustomSequentialRampFromWire(w *dashboard }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DashboardTheme_ContinuousGradient_CustomSequentialRamp) MarshalJSON() ([]byte, error) { + w, err := dashboardTheme_ContinuousGradient_CustomSequentialRampToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DashboardTheme_ContinuousGradient_CustomSequentialRamp) UnmarshalJSON(data []byte) error { + var w dashboardTheme_ContinuousGradient_CustomSequentialRampWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dashboardTheme_ContinuousGradient_CustomSequentialRampFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dashboardTheme_ContinuousGradient_GradientValueWire struct { FromCategoricalIndex *int `json:"from_categorical_index,omitempty"` Color *string `json:"color,omitempty"` @@ -682,6 +1019,30 @@ func dashboardTheme_ContinuousGradient_GradientValueFromWire(w *dashboardTheme_C }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DashboardTheme_ContinuousGradient_GradientValue) MarshalJSON() ([]byte, error) { + w, err := dashboardTheme_ContinuousGradient_GradientValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DashboardTheme_ContinuousGradient_GradientValue) UnmarshalJSON(data []byte) error { + var w dashboardTheme_ContinuousGradient_GradientValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dashboardTheme_ContinuousGradient_GradientValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dashboardTheme_DashboardThemeColorWire struct { Light *string `json:"light,omitempty"` Dark *string `json:"dark,omitempty"` @@ -707,6 +1068,30 @@ func dashboardTheme_DashboardThemeColorFromWire(w *dashboardTheme_DashboardTheme }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DashboardTheme_DashboardThemeColor) MarshalJSON() ([]byte, error) { + w, err := dashboardTheme_DashboardThemeColorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DashboardTheme_DashboardThemeColor) UnmarshalJSON(data []byte) error { + var w dashboardTheme_DashboardThemeColorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dashboardTheme_DashboardThemeColorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dashboardTheme_FontConfigWire struct { FontFamily *string `json:"font_family,omitempty"` TextCase DashboardTheme_TextCase `json:"text_case,omitempty"` @@ -755,6 +1140,30 @@ func dashboardTheme_FontConfigFromWire(w *dashboardTheme_FontConfigWire) (*Dashb }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DashboardTheme_FontConfig) MarshalJSON() ([]byte, error) { + w, err := dashboardTheme_FontConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DashboardTheme_FontConfig) UnmarshalJSON(data []byte) error { + var w dashboardTheme_FontConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dashboardTheme_FontConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dashboardTheme_FontSettingsWire struct { Base *dashboardTheme_FontConfigWire `json:"base,omitempty"` WidgetTitle *dashboardTheme_FontConfigWire `json:"widget_title,omitempty"` @@ -829,6 +1238,30 @@ func dashboardTheme_FontSettingsFromWire(w *dashboardTheme_FontSettingsWire) (*D }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DashboardTheme_FontSettings) MarshalJSON() ([]byte, error) { + w, err := dashboardTheme_FontSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DashboardTheme_FontSettings) UnmarshalJSON(data []byte) error { + var w dashboardTheme_FontSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dashboardTheme_FontSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dashboardTheme_SentimentColorsWire struct { Negative *dashboardTheme_DashboardThemeColorWire `json:"negative,omitempty"` Positive *dashboardTheme_DashboardThemeColorWire `json:"positive,omitempty"` @@ -881,6 +1314,30 @@ func dashboardTheme_SentimentColorsFromWire(w *dashboardTheme_SentimentColorsWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DashboardTheme_SentimentColors) MarshalJSON() ([]byte, error) { + w, err := dashboardTheme_SentimentColorsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DashboardTheme_SentimentColors) UnmarshalJSON(data []byte) error { + var w dashboardTheme_SentimentColorsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dashboardTheme_SentimentColorsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPublicAccountSettingRequestWire struct { AccountId *string `json:"account_id,omitempty"` Name *string `json:"name,omitempty"` @@ -906,6 +1363,30 @@ func getPublicAccountSettingRequestFromWire(w *getPublicAccountSettingRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPublicAccountSettingRequest) MarshalJSON() ([]byte, error) { + w, err := getPublicAccountSettingRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPublicAccountSettingRequest) UnmarshalJSON(data []byte) error { + var w getPublicAccountSettingRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPublicAccountSettingRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPublicAccountUserPreferenceRequestWire struct { AccountId *string `json:"account_id,omitempty"` UserId *string `json:"user_id,omitempty"` @@ -934,6 +1415,30 @@ func getPublicAccountUserPreferenceRequestFromWire(w *getPublicAccountUserPrefer }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPublicAccountUserPreferenceRequest) MarshalJSON() ([]byte, error) { + w, err := getPublicAccountUserPreferenceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPublicAccountUserPreferenceRequest) UnmarshalJSON(data []byte) error { + var w getPublicAccountUserPreferenceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPublicAccountUserPreferenceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPublicWorkspaceSettingRequestWire struct { Name *string `json:"name,omitempty"` } @@ -956,6 +1461,30 @@ func getPublicWorkspaceSettingRequestFromWire(w *getPublicWorkspaceSettingReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPublicWorkspaceSettingRequest) MarshalJSON() ([]byte, error) { + w, err := getPublicWorkspaceSettingRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPublicWorkspaceSettingRequest) UnmarshalJSON(data []byte) error { + var w getPublicWorkspaceSettingRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPublicWorkspaceSettingRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type integerMessageWire struct { Value *int `json:"value,omitempty"` } @@ -978,6 +1507,30 @@ func integerMessageFromWire(w *integerMessageWire) (*IntegerMessage, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IntegerMessage) MarshalJSON() ([]byte, error) { + w, err := integerMessageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IntegerMessage) UnmarshalJSON(data []byte) error { + var w integerMessageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := integerMessageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAccountSettingsMetadataRequestWire struct { AccountId *string `json:"account_id,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -1006,6 +1559,30 @@ func listAccountSettingsMetadataRequestFromWire(w *listAccountSettingsMetadataRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAccountSettingsMetadataRequest) MarshalJSON() ([]byte, error) { + w, err := listAccountSettingsMetadataRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAccountSettingsMetadataRequest) UnmarshalJSON(data []byte) error { + var w listAccountSettingsMetadataRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAccountSettingsMetadataRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAccountSettingsMetadataResponseWire struct { SettingsMetadata []settingsMetadataWire `json:"settings_metadata,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1039,6 +1616,30 @@ func listAccountSettingsMetadataResponseFromWire(w *listAccountSettingsMetadataR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAccountSettingsMetadataResponse) MarshalJSON() ([]byte, error) { + w, err := listAccountSettingsMetadataResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAccountSettingsMetadataResponse) UnmarshalJSON(data []byte) error { + var w listAccountSettingsMetadataResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAccountSettingsMetadataResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAccountUserPreferencesMetadataRequestWire struct { AccountId *string `json:"account_id,omitempty"` UserId *string `json:"user_id,omitempty"` @@ -1070,6 +1671,30 @@ func listAccountUserPreferencesMetadataRequestFromWire(w *listAccountUserPrefere }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAccountUserPreferencesMetadataRequest) MarshalJSON() ([]byte, error) { + w, err := listAccountUserPreferencesMetadataRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAccountUserPreferencesMetadataRequest) UnmarshalJSON(data []byte) error { + var w listAccountUserPreferencesMetadataRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAccountUserPreferencesMetadataRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listAccountUserPreferencesMetadataResponseWire struct { SettingsMetadata []settingsMetadataWire `json:"settings_metadata,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1103,6 +1728,30 @@ func listAccountUserPreferencesMetadataResponseFromWire(w *listAccountUserPrefer }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListAccountUserPreferencesMetadataResponse) MarshalJSON() ([]byte, error) { + w, err := listAccountUserPreferencesMetadataResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListAccountUserPreferencesMetadataResponse) UnmarshalJSON(data []byte) error { + var w listAccountUserPreferencesMetadataResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listAccountUserPreferencesMetadataResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listWorkspaceSettingsMetadataRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -1128,6 +1777,30 @@ func listWorkspaceSettingsMetadataRequestFromWire(w *listWorkspaceSettingsMetada }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListWorkspaceSettingsMetadataRequest) MarshalJSON() ([]byte, error) { + w, err := listWorkspaceSettingsMetadataRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListWorkspaceSettingsMetadataRequest) UnmarshalJSON(data []byte) error { + var w listWorkspaceSettingsMetadataRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listWorkspaceSettingsMetadataRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listWorkspaceSettingsMetadataResponseWire struct { SettingsMetadata []settingsMetadataWire `json:"settings_metadata,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1161,6 +1834,30 @@ func listWorkspaceSettingsMetadataResponseFromWire(w *listWorkspaceSettingsMetad }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListWorkspaceSettingsMetadataResponse) MarshalJSON() ([]byte, error) { + w, err := listWorkspaceSettingsMetadataResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListWorkspaceSettingsMetadataResponse) UnmarshalJSON(data []byte) error { + var w listWorkspaceSettingsMetadataResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listWorkspaceSettingsMetadataResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type operationalEmailCustomRecipientMessageWire struct { Email *string `json:"email,omitempty"` } @@ -1183,6 +1880,30 @@ func operationalEmailCustomRecipientMessageFromWire(w *operationalEmailCustomRec }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OperationalEmailCustomRecipientMessage) MarshalJSON() ([]byte, error) { + w, err := operationalEmailCustomRecipientMessageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OperationalEmailCustomRecipientMessage) UnmarshalJSON(data []byte) error { + var w operationalEmailCustomRecipientMessageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := operationalEmailCustomRecipientMessageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type patchPublicAccountSettingRequestWire struct { AccountId *string `json:"account_id,omitempty"` Name *string `json:"name,omitempty"` @@ -1219,6 +1940,30 @@ func patchPublicAccountSettingRequestFromWire(w *patchPublicAccountSettingReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PatchPublicAccountSettingRequest) MarshalJSON() ([]byte, error) { + w, err := patchPublicAccountSettingRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PatchPublicAccountSettingRequest) UnmarshalJSON(data []byte) error { + var w patchPublicAccountSettingRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := patchPublicAccountSettingRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type patchPublicAccountUserPreferenceRequestWire struct { AccountId *string `json:"account_id,omitempty"` UserId *string `json:"user_id,omitempty"` @@ -1258,6 +2003,30 @@ func patchPublicAccountUserPreferenceRequestFromWire(w *patchPublicAccountUserPr }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PatchPublicAccountUserPreferenceRequest) MarshalJSON() ([]byte, error) { + w, err := patchPublicAccountUserPreferenceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PatchPublicAccountUserPreferenceRequest) UnmarshalJSON(data []byte) error { + var w patchPublicAccountUserPreferenceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := patchPublicAccountUserPreferenceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type patchPublicWorkspaceSettingRequestWire struct { Name *string `json:"name,omitempty"` Setting *settingWire `json:"setting,omitempty"` @@ -1291,6 +2060,30 @@ func patchPublicWorkspaceSettingRequestFromWire(w *patchPublicWorkspaceSettingRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PatchPublicWorkspaceSettingRequest) MarshalJSON() ([]byte, error) { + w, err := patchPublicWorkspaceSettingRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PatchPublicWorkspaceSettingRequest) UnmarshalJSON(data []byte) error { + var w patchPublicWorkspaceSettingRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := patchPublicWorkspaceSettingRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type personalComputeMessageWire struct { Value PersonalComputeMessage_PersonalComputeMessageEnum `json:"value,omitempty"` } @@ -1313,6 +2106,30 @@ func personalComputeMessageFromWire(w *personalComputeMessageWire) (*PersonalCom }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PersonalComputeMessage) MarshalJSON() ([]byte, error) { + w, err := personalComputeMessageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PersonalComputeMessage) UnmarshalJSON(data []byte) error { + var w personalComputeMessageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := personalComputeMessageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type restrictWorkspaceAdminsMessageWire struct { Status RestrictWorkspaceAdminsMessage_Status `json:"status,omitempty"` DisableGovTagCreation *bool `json:"disable_gov_tag_creation,omitempty"` @@ -1338,6 +2155,30 @@ func restrictWorkspaceAdminsMessageFromWire(w *restrictWorkspaceAdminsMessageWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RestrictWorkspaceAdminsMessage) MarshalJSON() ([]byte, error) { + w, err := restrictWorkspaceAdminsMessageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RestrictWorkspaceAdminsMessage) UnmarshalJSON(data []byte) error { + var w restrictWorkspaceAdminsMessageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := restrictWorkspaceAdminsMessageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type settingWire struct { Name *string `json:"name,omitempty"` BooleanVal *booleanMessageWire `json:"boolean_val,omitempty"` @@ -1906,6 +2747,30 @@ func settingFromWire(w *settingWire) (*Setting, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Setting) MarshalJSON() ([]byte, error) { + w, err := settingToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Setting) UnmarshalJSON(data []byte) error { + var w settingWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := settingFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type settingsMetadataWire struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` @@ -1943,6 +2808,30 @@ func settingsMetadataFromWire(w *settingsMetadataWire) (*SettingsMetadata, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SettingsMetadata) MarshalJSON() ([]byte, error) { + w, err := settingsMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SettingsMetadata) UnmarshalJSON(data []byte) error { + var w settingsMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := settingsMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type stringMessageWire struct { Value *string `json:"value,omitempty"` } @@ -1965,6 +2854,30 @@ func stringMessageFromWire(w *stringMessageWire) (*StringMessage, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StringMessage) MarshalJSON() ([]byte, error) { + w, err := stringMessageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StringMessage) UnmarshalJSON(data []byte) error { + var w stringMessageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := stringMessageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type userPreferenceWire struct { Name *string `json:"name,omitempty"` UserId *string `json:"user_id,omitempty"` @@ -2096,6 +3009,30 @@ func userPreferenceFromWire(w *userPreferenceWire) (*UserPreference, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UserPreference) MarshalJSON() ([]byte, error) { + w, err := userPreferenceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UserPreference) UnmarshalJSON(data []byte) error { + var w userPreferenceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := userPreferenceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type workspaceLabelMessageWire struct { Label *string `json:"label,omitempty"` Color *string `json:"color,omitempty"` @@ -2121,6 +3058,30 @@ func workspaceLabelMessageFromWire(w *workspaceLabelMessageWire) (*WorkspaceLabe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WorkspaceLabelMessage) MarshalJSON() ([]byte, error) { + w, err := workspaceLabelMessageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WorkspaceLabelMessage) UnmarshalJSON(data []byte) error { + var w workspaceLabelMessageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := workspaceLabelMessageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/sharing/CHANGELOG.md b/sharing/CHANGELOG.md index 300c94d9..3fbf2d71 100644 --- a/sharing/CHANGELOG.md +++ b/sharing/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.8.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.7.0 (2026-11-11) ## Release v0.6.0 (2026-11-10) diff --git a/sharing/internal/version.go b/sharing/internal/version.go index 84a49262..759ded63 100644 --- a/sharing/internal/version.go +++ b/sharing/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-sharing" -const Version = "0.7.0" +const Version = "0.8.0" diff --git a/sharing/v1/wire.go b/sharing/v1/wire.go index 17c14893..ee9d592d 100644 --- a/sharing/v1/wire.go +++ b/sharing/v1/wire.go @@ -87,6 +87,30 @@ func createFederationPolicyRequestFromWire(w *createFederationPolicyRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateFederationPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := createFederationPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateFederationPolicyRequest) UnmarshalJSON(data []byte) error { + var w createFederationPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createFederationPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createProviderRequestWire struct { Name *string `json:"name,omitempty"` AuthenticationType DeltaSharingAuthenticationType `json:"authentication_type,omitempty"` @@ -172,6 +196,30 @@ func createProviderRequestFromWire(w *createProviderRequestWire) (*CreateProvide }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateProviderRequest) MarshalJSON() ([]byte, error) { + w, err := createProviderRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateProviderRequest) UnmarshalJSON(data []byte) error { + var w createProviderRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createProviderRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createRecipientRequestWire struct { Name *string `json:"name,omitempty"` AuthenticationType DeltaSharingAuthenticationType `json:"authentication_type,omitempty"` @@ -299,6 +347,30 @@ func createRecipientRequestFromWire(w *createRecipientRequestWire) (*CreateRecip }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateRecipientRequest) MarshalJSON() ([]byte, error) { + w, err := createRecipientRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateRecipientRequest) UnmarshalJSON(data []byte) error { + var w createRecipientRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createRecipientRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createShareRequestWire struct { Name *string `json:"name,omitempty"` Owner *string `json:"owner,omitempty"` @@ -372,6 +444,30 @@ func createShareRequestFromWire(w *createShareRequestWire) (*CreateShareRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateShareRequest) MarshalJSON() ([]byte, error) { + w, err := createShareRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateShareRequest) UnmarshalJSON(data []byte) error { + var w createShareRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createShareRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteFederationPolicyRequestWire struct { RecipientName *string `json:"recipient_name,omitempty"` Name *string `json:"name,omitempty"` @@ -397,6 +493,30 @@ func deleteFederationPolicyRequestFromWire(w *deleteFederationPolicyRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteFederationPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := deleteFederationPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteFederationPolicyRequest) UnmarshalJSON(data []byte) error { + var w deleteFederationPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteFederationPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteProviderRequestWire struct { NameArg *string `json:"name_arg,omitempty"` } @@ -419,6 +539,30 @@ func deleteProviderRequestFromWire(w *deleteProviderRequestWire) (*DeleteProvide }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteProviderRequest) MarshalJSON() ([]byte, error) { + w, err := deleteProviderRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteProviderRequest) UnmarshalJSON(data []byte) error { + var w deleteProviderRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteProviderRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteProviderResponseWire struct { } @@ -436,6 +580,30 @@ func deleteProviderResponseFromWire(w *deleteProviderResponseWire) (*DeleteProvi return &DeleteProviderResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteProviderResponse) MarshalJSON() ([]byte, error) { + w, err := deleteProviderResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteProviderResponse) UnmarshalJSON(data []byte) error { + var w deleteProviderResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteProviderResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRecipientRequestWire struct { Name *string `json:"name,omitempty"` } @@ -458,6 +626,30 @@ func deleteRecipientRequestFromWire(w *deleteRecipientRequestWire) (*DeleteRecip }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRecipientRequest) MarshalJSON() ([]byte, error) { + w, err := deleteRecipientRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRecipientRequest) UnmarshalJSON(data []byte) error { + var w deleteRecipientRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRecipientRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRecipientResponseWire struct { } @@ -475,6 +667,30 @@ func deleteRecipientResponseFromWire(w *deleteRecipientResponseWire) (*DeleteRec return &DeleteRecipientResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRecipientResponse) MarshalJSON() ([]byte, error) { + w, err := deleteRecipientResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRecipientResponse) UnmarshalJSON(data []byte) error { + var w deleteRecipientResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRecipientResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteShareRequestWire struct { Name *string `json:"name,omitempty"` } @@ -497,6 +713,30 @@ func deleteShareRequestFromWire(w *deleteShareRequestWire) (*DeleteShareRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteShareRequest) MarshalJSON() ([]byte, error) { + w, err := deleteShareRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteShareRequest) UnmarshalJSON(data []byte) error { + var w deleteShareRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteShareRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteShareResponseWire struct { } @@ -514,6 +754,30 @@ func deleteShareResponseFromWire(w *deleteShareResponseWire) (*DeleteShareRespon return &DeleteShareResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteShareResponse) MarshalJSON() ([]byte, error) { + w, err := deleteShareResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteShareResponse) UnmarshalJSON(data []byte) error { + var w deleteShareResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteShareResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dependencyWire struct { Table *tableDependencyWire `json:"table,omitempty"` Function *functionDependencyWire `json:"function,omitempty"` @@ -586,6 +850,30 @@ func dependencyFromWire(w *dependencyWire) (*Dependency, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Dependency) MarshalJSON() ([]byte, error) { + w, err := dependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Dependency) UnmarshalJSON(data []byte) error { + var w dependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dependencyListWire struct { Dependencies []dependencyWire `json:"dependencies,omitempty"` } @@ -616,6 +904,30 @@ func dependencyListFromWire(w *dependencyListWire) (*DependencyList, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DependencyList) MarshalJSON() ([]byte, error) { + w, err := dependencyListToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DependencyList) UnmarshalJSON(data []byte) error { + var w dependencyListWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dependencyListFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type federationPolicyWire struct { Name *string `json:"name,omitempty"` OidcPolicy *oidcFederationPolicyWire `json:"oidc_policy,omitempty"` @@ -683,6 +995,30 @@ func federationPolicyFromWire(w *federationPolicyWire) (*FederationPolicy, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FederationPolicy) MarshalJSON() ([]byte, error) { + w, err := federationPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FederationPolicy) UnmarshalJSON(data []byte) error { + var w federationPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := federationPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type functionWire struct { Name *string `json:"name,omitempty"` Schema *string `json:"schema,omitempty"` @@ -782,6 +1118,30 @@ func functionFromWire(w *functionWire) (*Function, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Function) MarshalJSON() ([]byte, error) { + w, err := functionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Function) UnmarshalJSON(data []byte) error { + var w functionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := functionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type functionDependencyWire struct { SchemaName *string `json:"schema_name,omitempty"` FunctionName *string `json:"function_name,omitempty"` @@ -807,6 +1167,30 @@ func functionDependencyFromWire(w *functionDependencyWire) (*FunctionDependency, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FunctionDependency) MarshalJSON() ([]byte, error) { + w, err := functionDependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FunctionDependency) UnmarshalJSON(data []byte) error { + var w functionDependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := functionDependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type functionParameterInfoWire struct { Name *string `json:"name,omitempty"` TypeText *string `json:"type_text,omitempty"` @@ -862,6 +1246,30 @@ func functionParameterInfoFromWire(w *functionParameterInfoWire) (*FunctionParam }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FunctionParameterInfo) MarshalJSON() ([]byte, error) { + w, err := functionParameterInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FunctionParameterInfo) UnmarshalJSON(data []byte) error { + var w functionParameterInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := functionParameterInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type functionParameterInfosWire struct { Parameters []functionParameterInfoWire `json:"parameters,omitempty"` } @@ -892,6 +1300,30 @@ func functionParameterInfosFromWire(w *functionParameterInfosWire) (*FunctionPar }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FunctionParameterInfos) MarshalJSON() ([]byte, error) { + w, err := functionParameterInfosToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FunctionParameterInfos) UnmarshalJSON(data []byte) error { + var w functionParameterInfosWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := functionParameterInfosFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getActivationUrlInfoRequestWire struct { ActivationUrl *string `json:"activation_url,omitempty"` } @@ -914,6 +1346,30 @@ func getActivationUrlInfoRequestFromWire(w *getActivationUrlInfoRequestWire) (*G }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetActivationUrlInfoRequest) MarshalJSON() ([]byte, error) { + w, err := getActivationUrlInfoRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetActivationUrlInfoRequest) UnmarshalJSON(data []byte) error { + var w getActivationUrlInfoRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getActivationUrlInfoRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getActivationUrlInfoResponseWire struct { } @@ -931,6 +1387,30 @@ func getActivationUrlInfoResponseFromWire(w *getActivationUrlInfoResponseWire) ( return &GetActivationUrlInfoResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetActivationUrlInfoResponse) MarshalJSON() ([]byte, error) { + w, err := getActivationUrlInfoResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetActivationUrlInfoResponse) UnmarshalJSON(data []byte) error { + var w getActivationUrlInfoResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getActivationUrlInfoResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getFederationPolicyRequestWire struct { RecipientName *string `json:"recipient_name,omitempty"` Name *string `json:"name,omitempty"` @@ -956,6 +1436,30 @@ func getFederationPolicyRequestFromWire(w *getFederationPolicyRequestWire) (*Get }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetFederationPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := getFederationPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetFederationPolicyRequest) UnmarshalJSON(data []byte) error { + var w getFederationPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getFederationPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getProviderRequestWire struct { NameArg *string `json:"name_arg,omitempty"` } @@ -978,8 +1482,32 @@ func getProviderRequestFromWire(w *getProviderRequestWire) (*GetProviderRequest, }, nil } -type getRecipientRequestWire struct { - Name *string `json:"name,omitempty"` +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetProviderRequest) MarshalJSON() ([]byte, error) { + w, err := getProviderRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetProviderRequest) UnmarshalJSON(data []byte) error { + var w getProviderRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getProviderRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type getRecipientRequestWire struct { + Name *string `json:"name,omitempty"` } func getRecipientRequestToWire(v *GetRecipientRequest) (*getRecipientRequestWire, error) { @@ -1000,6 +1528,30 @@ func getRecipientRequestFromWire(w *getRecipientRequestWire) (*GetRecipientReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRecipientRequest) MarshalJSON() ([]byte, error) { + w, err := getRecipientRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRecipientRequest) UnmarshalJSON(data []byte) error { + var w getRecipientRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRecipientRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRecipientSharePermissionsResponseWire struct { PermissionsOut []shareToPrivilegeAssignmentWire `json:"permissions_out,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1033,6 +1585,30 @@ func getRecipientSharePermissionsResponseFromWire(w *getRecipientSharePermission }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRecipientSharePermissionsResponse) MarshalJSON() ([]byte, error) { + w, err := getRecipientSharePermissionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRecipientSharePermissionsResponse) UnmarshalJSON(data []byte) error { + var w getRecipientSharePermissionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRecipientSharePermissionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSharePermissionsResponseWire struct { NextPageToken *string `json:"next_page_token,omitempty"` PrivilegeAssignments []privilegeAssignmentWire `json:"privilege_assignments,omitempty"` @@ -1066,6 +1642,30 @@ func getSharePermissionsResponseFromWire(w *getSharePermissionsResponseWire) (*G }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSharePermissionsResponse) MarshalJSON() ([]byte, error) { + w, err := getSharePermissionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSharePermissionsResponse) UnmarshalJSON(data []byte) error { + var w getSharePermissionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSharePermissionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getShareRequestWire struct { Name *string `json:"name,omitempty"` IncludeSharedData *bool `json:"include_shared_data,omitempty"` @@ -1091,6 +1691,30 @@ func getShareRequestFromWire(w *getShareRequestWire) (*GetShareRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetShareRequest) MarshalJSON() ([]byte, error) { + w, err := getShareRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetShareRequest) UnmarshalJSON(data []byte) error { + var w getShareRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getShareRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ipAccessListWire struct { AllowedIpAddresses []string `json:"allowed_ip_addresses,omitempty"` } @@ -1113,6 +1737,30 @@ func ipAccessListFromWire(w *ipAccessListWire) (*IpAccessList, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v IpAccessList) MarshalJSON() ([]byte, error) { + w, err := ipAccessListToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *IpAccessList) UnmarshalJSON(data []byte) error { + var w ipAccessListWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ipAccessListFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listFederationPoliciesRequestWire struct { RecipientName *string `json:"recipient_name,omitempty"` MaxResults *int `json:"max_results,omitempty"` @@ -1141,6 +1789,30 @@ func listFederationPoliciesRequestFromWire(w *listFederationPoliciesRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListFederationPoliciesRequest) MarshalJSON() ([]byte, error) { + w, err := listFederationPoliciesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListFederationPoliciesRequest) UnmarshalJSON(data []byte) error { + var w listFederationPoliciesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listFederationPoliciesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listFederationPoliciesResponseWire struct { Policies []federationPolicyWire `json:"policies,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1174,6 +1846,30 @@ func listFederationPoliciesResponseFromWire(w *listFederationPoliciesResponseWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListFederationPoliciesResponse) MarshalJSON() ([]byte, error) { + w, err := listFederationPoliciesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListFederationPoliciesResponse) UnmarshalJSON(data []byte) error { + var w listFederationPoliciesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listFederationPoliciesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listProviderShareAssetsRequestWire struct { ProviderNameArg *string `json:"provider_name_arg,omitempty"` ShareNameArg *string `json:"share_name_arg,omitempty"` @@ -1211,6 +1907,30 @@ func listProviderShareAssetsRequestFromWire(w *listProviderShareAssetsRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListProviderShareAssetsRequest) MarshalJSON() ([]byte, error) { + w, err := listProviderShareAssetsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListProviderShareAssetsRequest) UnmarshalJSON(data []byte) error { + var w listProviderShareAssetsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listProviderShareAssetsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listProviderShareAssetsResponseWire struct { Tables []tableWire `json:"tables,omitempty"` Functions []functionWire `json:"functions,omitempty"` @@ -1285,6 +2005,30 @@ func listProviderShareAssetsResponseFromWire(w *listProviderShareAssetsResponseW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListProviderShareAssetsResponse) MarshalJSON() ([]byte, error) { + w, err := listProviderShareAssetsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListProviderShareAssetsResponse) UnmarshalJSON(data []byte) error { + var w listProviderShareAssetsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listProviderShareAssetsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listProviderSharesRequestWire struct { ProviderNameArg *string `json:"provider_name_arg,omitempty"` MaxResults *int `json:"max_results,omitempty"` @@ -1313,6 +2057,30 @@ func listProviderSharesRequestFromWire(w *listProviderSharesRequestWire) (*ListP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListProviderSharesRequest) MarshalJSON() ([]byte, error) { + w, err := listProviderSharesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListProviderSharesRequest) UnmarshalJSON(data []byte) error { + var w listProviderSharesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listProviderSharesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listProviderSharesResponseWire struct { Shares []providerShareWire `json:"shares,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1346,6 +2114,30 @@ func listProviderSharesResponseFromWire(w *listProviderSharesResponseWire) (*Lis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListProviderSharesResponse) MarshalJSON() ([]byte, error) { + w, err := listProviderSharesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListProviderSharesResponse) UnmarshalJSON(data []byte) error { + var w listProviderSharesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listProviderSharesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listProvidersRequestWire struct { DataProviderGlobalMetastoreId *string `json:"data_provider_global_metastore_id,omitempty"` MaxResults *int `json:"max_results,omitempty"` @@ -1374,6 +2166,30 @@ func listProvidersRequestFromWire(w *listProvidersRequestWire) (*ListProvidersRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListProvidersRequest) MarshalJSON() ([]byte, error) { + w, err := listProvidersRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListProvidersRequest) UnmarshalJSON(data []byte) error { + var w listProvidersRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listProvidersRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listProvidersResponseWire struct { Providers []providerInfoWire `json:"providers,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1407,6 +2223,30 @@ func listProvidersResponseFromWire(w *listProvidersResponseWire) (*ListProviders }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListProvidersResponse) MarshalJSON() ([]byte, error) { + w, err := listProvidersResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListProvidersResponse) UnmarshalJSON(data []byte) error { + var w listProvidersResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listProvidersResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRecipientSharePermissionsRequestWire struct { Name *string `json:"name,omitempty"` MaxResults *int `json:"max_results,omitempty"` @@ -1435,6 +2275,30 @@ func listRecipientSharePermissionsRequestFromWire(w *listRecipientSharePermissio }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRecipientSharePermissionsRequest) MarshalJSON() ([]byte, error) { + w, err := listRecipientSharePermissionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRecipientSharePermissionsRequest) UnmarshalJSON(data []byte) error { + var w listRecipientSharePermissionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRecipientSharePermissionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRecipientsRequestWire struct { DataRecipientGlobalMetastoreId *string `json:"data_recipient_global_metastore_id,omitempty"` MaxResults *int `json:"max_results,omitempty"` @@ -1463,6 +2327,30 @@ func listRecipientsRequestFromWire(w *listRecipientsRequestWire) (*ListRecipient }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRecipientsRequest) MarshalJSON() ([]byte, error) { + w, err := listRecipientsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRecipientsRequest) UnmarshalJSON(data []byte) error { + var w listRecipientsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRecipientsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRecipientsResponseWire struct { Recipients []recipientInfoWire `json:"recipients,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1496,6 +2384,30 @@ func listRecipientsResponseFromWire(w *listRecipientsResponseWire) (*ListRecipie }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRecipientsResponse) MarshalJSON() ([]byte, error) { + w, err := listRecipientsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRecipientsResponse) UnmarshalJSON(data []byte) error { + var w listRecipientsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRecipientsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSharePermissionsRequestWire struct { Name *string `json:"name,omitempty"` MaxResults *int `json:"max_results,omitempty"` @@ -1524,6 +2436,30 @@ func listSharePermissionsRequestFromWire(w *listSharePermissionsRequestWire) (*L }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSharePermissionsRequest) MarshalJSON() ([]byte, error) { + w, err := listSharePermissionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSharePermissionsRequest) UnmarshalJSON(data []byte) error { + var w listSharePermissionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSharePermissionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSharesRequestWire struct { MaxResults *int `json:"max_results,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -1549,6 +2485,30 @@ func listSharesRequestFromWire(w *listSharesRequestWire) (*ListSharesRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSharesRequest) MarshalJSON() ([]byte, error) { + w, err := listSharesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSharesRequest) UnmarshalJSON(data []byte) error { + var w listSharesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSharesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSharesResponseWire struct { Shares []shareInfoWire `json:"shares,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1582,6 +2542,30 @@ func listSharesResponseFromWire(w *listSharesResponseWire) (*ListSharesResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSharesResponse) MarshalJSON() ([]byte, error) { + w, err := listSharesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSharesResponse) UnmarshalJSON(data []byte) error { + var w listSharesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSharesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type notebookFileWire struct { Name *string `json:"name,omitempty"` Share *string `json:"share,omitempty"` @@ -1627,6 +2611,30 @@ func notebookFileFromWire(w *notebookFileWire) (*NotebookFile, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NotebookFile) MarshalJSON() ([]byte, error) { + w, err := notebookFileToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NotebookFile) UnmarshalJSON(data []byte) error { + var w notebookFileWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := notebookFileFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type oidcFederationPolicyWire struct { Issuer *string `json:"issuer,omitempty"` SubjectClaim *string `json:"subject_claim,omitempty"` @@ -1658,6 +2666,30 @@ func oidcFederationPolicyFromWire(w *oidcFederationPolicyWire) (*OidcFederationP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OidcFederationPolicy) MarshalJSON() ([]byte, error) { + w, err := oidcFederationPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OidcFederationPolicy) UnmarshalJSON(data []byte) error { + var w oidcFederationPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := oidcFederationPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type partitionSpecificationWire struct { } @@ -1675,6 +2707,30 @@ func partitionSpecificationFromWire(w *partitionSpecificationWire) (*PartitionSp return &PartitionSpecification{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PartitionSpecification) MarshalJSON() ([]byte, error) { + w, err := partitionSpecificationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PartitionSpecification) UnmarshalJSON(data []byte) error { + var w partitionSpecificationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := partitionSpecificationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type partitionSpecification_PartitionWire struct { Values []partitionSpecification_Partition_PartitionValueWire `json:"values,omitempty"` } @@ -1705,6 +2761,30 @@ func partitionSpecification_PartitionFromWire(w *partitionSpecification_Partitio }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PartitionSpecification_Partition) MarshalJSON() ([]byte, error) { + w, err := partitionSpecification_PartitionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PartitionSpecification_Partition) UnmarshalJSON(data []byte) error { + var w partitionSpecification_PartitionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := partitionSpecification_PartitionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type partitionSpecification_Partition_PartitionValueWire struct { Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` @@ -1736,6 +2816,30 @@ func partitionSpecification_Partition_PartitionValueFromWire(w *partitionSpecifi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PartitionSpecification_Partition_PartitionValue) MarshalJSON() ([]byte, error) { + w, err := partitionSpecification_Partition_PartitionValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PartitionSpecification_Partition_PartitionValue) UnmarshalJSON(data []byte) error { + var w partitionSpecification_Partition_PartitionValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := partitionSpecification_Partition_PartitionValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type permissionsChangeWire struct { Principal *string `json:"principal,omitempty"` Add []string `json:"add,omitempty"` @@ -1764,6 +2868,30 @@ func permissionsChangeFromWire(w *permissionsChangeWire) (*PermissionsChange, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PermissionsChange) MarshalJSON() ([]byte, error) { + w, err := permissionsChangeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PermissionsChange) UnmarshalJSON(data []byte) error { + var w permissionsChangeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := permissionsChangeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type privilegeAssignmentWire struct { Principal *string `json:"principal,omitempty"` Privileges []string `json:"privileges,omitempty"` @@ -1789,6 +2917,30 @@ func privilegeAssignmentFromWire(w *privilegeAssignmentWire) (*PrivilegeAssignme }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PrivilegeAssignment) MarshalJSON() ([]byte, error) { + w, err := privilegeAssignmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PrivilegeAssignment) UnmarshalJSON(data []byte) error { + var w privilegeAssignmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := privilegeAssignmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type propertiesKvPairsWire struct { Properties map[string]string `json:"properties,omitempty"` } @@ -1811,6 +2963,30 @@ func propertiesKvPairsFromWire(w *propertiesKvPairsWire) (*PropertiesKvPairs, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PropertiesKvPairs) MarshalJSON() ([]byte, error) { + w, err := propertiesKvPairsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PropertiesKvPairs) UnmarshalJSON(data []byte) error { + var w propertiesKvPairsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := propertiesKvPairsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type providerInfoWire struct { Name *string `json:"name,omitempty"` AuthenticationType DeltaSharingAuthenticationType `json:"authentication_type,omitempty"` @@ -1896,6 +3072,30 @@ func providerInfoFromWire(w *providerInfoWire) (*ProviderInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProviderInfo) MarshalJSON() ([]byte, error) { + w, err := providerInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProviderInfo) UnmarshalJSON(data []byte) error { + var w providerInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := providerInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type providerShareWire struct { Name *string `json:"name,omitempty"` } @@ -1918,6 +3118,30 @@ func providerShareFromWire(w *providerShareWire) (*ProviderShare, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProviderShare) MarshalJSON() ([]byte, error) { + w, err := providerShareToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProviderShare) UnmarshalJSON(data []byte) error { + var w providerShareWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := providerShareFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type recipientInfoWire struct { Name *string `json:"name,omitempty"` AuthenticationType DeltaSharingAuthenticationType `json:"authentication_type,omitempty"` @@ -2045,6 +3269,30 @@ func recipientInfoFromWire(w *recipientInfoWire) (*RecipientInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RecipientInfo) MarshalJSON() ([]byte, error) { + w, err := recipientInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RecipientInfo) UnmarshalJSON(data []byte) error { + var w recipientInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := recipientInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type recipientProfileWire struct { ShareCredentialsVersion *int `json:"share_credentials_version,omitempty"` Endpoint *string `json:"endpoint,omitempty"` @@ -2073,6 +3321,30 @@ func recipientProfileFromWire(w *recipientProfileWire) (*RecipientProfile, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RecipientProfile) MarshalJSON() ([]byte, error) { + w, err := recipientProfileToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RecipientProfile) UnmarshalJSON(data []byte) error { + var w recipientProfileWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := recipientProfileFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type recipientTokenInfoWire struct { Id *string `json:"id,omitempty"` CreatedAt *wireInt64 `json:"created_at,omitempty"` @@ -2137,6 +3409,30 @@ func recipientTokenInfoFromWire(w *recipientTokenInfoWire) (*RecipientTokenInfo, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RecipientTokenInfo) MarshalJSON() ([]byte, error) { + w, err := recipientTokenInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RecipientTokenInfo) UnmarshalJSON(data []byte) error { + var w recipientTokenInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := recipientTokenInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type registeredModelAliasWire struct { AliasName *string `json:"alias_name,omitempty"` VersionNum *wireInt64 `json:"version_num,omitempty"` @@ -2170,6 +3466,30 @@ func registeredModelAliasFromWire(w *registeredModelAliasWire) (*RegisteredModel }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RegisteredModelAlias) MarshalJSON() ([]byte, error) { + w, err := registeredModelAliasToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RegisteredModelAlias) UnmarshalJSON(data []byte) error { + var w registeredModelAliasWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := registeredModelAliasFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type retrieveTokenRequestWire struct { ActivationUrl *string `json:"activation_url,omitempty"` } @@ -2192,6 +3512,30 @@ func retrieveTokenRequestFromWire(w *retrieveTokenRequestWire) (*RetrieveTokenRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RetrieveTokenRequest) MarshalJSON() ([]byte, error) { + w, err := retrieveTokenRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RetrieveTokenRequest) UnmarshalJSON(data []byte) error { + var w retrieveTokenRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := retrieveTokenRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type retrieveTokenResponseWire struct { ShareCredentialsVersion *int `json:"shareCredentialsVersion,omitempty"` BearerToken *string `json:"bearerToken,omitempty"` @@ -2223,6 +3567,30 @@ func retrieveTokenResponseFromWire(w *retrieveTokenResponseWire) (*RetrieveToken }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RetrieveTokenResponse) MarshalJSON() ([]byte, error) { + w, err := retrieveTokenResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RetrieveTokenResponse) UnmarshalJSON(data []byte) error { + var w retrieveTokenResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := retrieveTokenResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rotateRecipientTokenRequestWire struct { Name *string `json:"name,omitempty"` ExistingTokenExpireInSeconds *wireInt64 `json:"existing_token_expire_in_seconds,omitempty"` @@ -2256,6 +3624,30 @@ func rotateRecipientTokenRequestFromWire(w *rotateRecipientTokenRequestWire) (*R }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RotateRecipientTokenRequest) MarshalJSON() ([]byte, error) { + w, err := rotateRecipientTokenRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RotateRecipientTokenRequest) UnmarshalJSON(data []byte) error { + var w rotateRecipientTokenRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rotateRecipientTokenRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type shareWire struct { Name *string `json:"name,omitempty"` Id *string `json:"id,omitempty"` @@ -2281,6 +3673,30 @@ func shareFromWire(w *shareWire) (*Share, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Share) MarshalJSON() ([]byte, error) { + w, err := shareToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Share) UnmarshalJSON(data []byte) error { + var w shareWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := shareFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type shareInfoWire struct { Name *string `json:"name,omitempty"` Owner *string `json:"owner,omitempty"` @@ -2354,6 +3770,30 @@ func shareInfoFromWire(w *shareInfoWire) (*ShareInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ShareInfo) MarshalJSON() ([]byte, error) { + w, err := shareInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ShareInfo) UnmarshalJSON(data []byte) error { + var w shareInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := shareInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type shareToPrivilegeAssignmentWire struct { ShareName *string `json:"share_name,omitempty"` PrivilegeAssignments []privilegeAssignmentWire `json:"privilege_assignments,omitempty"` @@ -2387,6 +3827,30 @@ func shareToPrivilegeAssignmentFromWire(w *shareToPrivilegeAssignmentWire) (*Sha }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ShareToPrivilegeAssignment) MarshalJSON() ([]byte, error) { + w, err := shareToPrivilegeAssignmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ShareToPrivilegeAssignment) UnmarshalJSON(data []byte) error { + var w shareToPrivilegeAssignmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := shareToPrivilegeAssignmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sharedDataObjectWire struct { Name *string `json:"name,omitempty"` DataObjectType *string `json:"data_object_type,omitempty"` @@ -2469,6 +3933,30 @@ func sharedDataObjectFromWire(w *sharedDataObjectWire) (*SharedDataObject, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SharedDataObject) MarshalJSON() ([]byte, error) { + w, err := sharedDataObjectToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SharedDataObject) UnmarshalJSON(data []byte) error { + var w sharedDataObjectWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sharedDataObjectFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sharedDataObject_HistoryDataSharingStatusWire struct { } @@ -2486,6 +3974,30 @@ func sharedDataObject_HistoryDataSharingStatusFromWire(w *sharedDataObject_Histo return &SharedDataObject_HistoryDataSharingStatus{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SharedDataObject_HistoryDataSharingStatus) MarshalJSON() ([]byte, error) { + w, err := sharedDataObject_HistoryDataSharingStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SharedDataObject_HistoryDataSharingStatus) UnmarshalJSON(data []byte) error { + var w sharedDataObject_HistoryDataSharingStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sharedDataObject_HistoryDataSharingStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sharedDataObject_StatusWire struct { } @@ -2503,6 +4015,30 @@ func sharedDataObject_StatusFromWire(w *sharedDataObject_StatusWire) (*SharedDat return &SharedDataObject_Status{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SharedDataObject_Status) MarshalJSON() ([]byte, error) { + w, err := sharedDataObject_StatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SharedDataObject_Status) UnmarshalJSON(data []byte) error { + var w sharedDataObject_StatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sharedDataObject_StatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tableWire struct { Name *string `json:"name,omitempty"` Schema *string `json:"schema,omitempty"` @@ -2557,6 +4093,30 @@ func tableFromWire(w *tableWire) (*Table, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Table) MarshalJSON() ([]byte, error) { + w, err := tableToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Table) UnmarshalJSON(data []byte) error { + var w tableWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tableFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tableDependencyWire struct { SchemaName *string `json:"schema_name,omitempty"` TableName *string `json:"table_name,omitempty"` @@ -2582,6 +4142,30 @@ func tableDependencyFromWire(w *tableDependencyWire) (*TableDependency, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TableDependency) MarshalJSON() ([]byte, error) { + w, err := tableDependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TableDependency) UnmarshalJSON(data []byte) error { + var w tableDependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tableDependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tagKeyValueWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -2607,6 +4191,30 @@ func tagKeyValueFromWire(w *tagKeyValueWire) (*TagKeyValue, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TagKeyValue) MarshalJSON() ([]byte, error) { + w, err := tagKeyValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TagKeyValue) UnmarshalJSON(data []byte) error { + var w tagKeyValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tagKeyValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateProviderRequestWire struct { NameArg *string `json:"name_arg,omitempty"` NewName *string `json:"new_name,omitempty"` @@ -2698,6 +4306,30 @@ func updateProviderRequestFromWire(w *updateProviderRequestWire) (*UpdateProvide }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateProviderRequest) MarshalJSON() ([]byte, error) { + w, err := updateProviderRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateProviderRequest) UnmarshalJSON(data []byte) error { + var w updateProviderRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateProviderRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateRecipientRequestWire struct { NameArg *string `json:"name_arg,omitempty"` NewName *string `json:"new_name,omitempty"` @@ -2831,6 +4463,30 @@ func updateRecipientRequestFromWire(w *updateRecipientRequestWire) (*UpdateRecip }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateRecipientRequest) MarshalJSON() ([]byte, error) { + w, err := updateRecipientRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateRecipientRequest) UnmarshalJSON(data []byte) error { + var w updateRecipientRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateRecipientRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateSharePermissionsRequestWire struct { Name *string `json:"name,omitempty"` OmitPermissionsList *bool `json:"omit_permissions_list,omitempty"` @@ -2867,6 +4523,30 @@ func updateSharePermissionsRequestFromWire(w *updateSharePermissionsRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateSharePermissionsRequest) MarshalJSON() ([]byte, error) { + w, err := updateSharePermissionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateSharePermissionsRequest) UnmarshalJSON(data []byte) error { + var w updateSharePermissionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateSharePermissionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateSharePermissionsResponseWire struct { PrivilegeAssignments []privilegeAssignmentWire `json:"privilege_assignments,omitempty"` } @@ -2897,6 +4577,30 @@ func updateSharePermissionsResponseFromWire(w *updateSharePermissionsResponseWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateSharePermissionsResponse) MarshalJSON() ([]byte, error) { + w, err := updateSharePermissionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateSharePermissionsResponse) UnmarshalJSON(data []byte) error { + var w updateSharePermissionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateSharePermissionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateShareRequestWire struct { NameArg *string `json:"name_arg,omitempty"` NewName *string `json:"new_name,omitempty"` @@ -2987,6 +4691,30 @@ func updateShareRequestFromWire(w *updateShareRequestWire) (*UpdateShareRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateShareRequest) MarshalJSON() ([]byte, error) { + w, err := updateShareRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateShareRequest) UnmarshalJSON(data []byte) error { + var w updateShareRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateShareRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateShareRequest_SharedDataObjectUpdateWire struct { Action UpdateShareRequest_SharedDataObjectUpdate_Action `json:"action,omitempty"` DataObject *sharedDataObjectWire `json:"data_object,omitempty"` @@ -3020,6 +4748,30 @@ func updateShareRequest_SharedDataObjectUpdateFromWire(w *updateShareRequest_Sha }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateShareRequest_SharedDataObjectUpdate) MarshalJSON() ([]byte, error) { + w, err := updateShareRequest_SharedDataObjectUpdateToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateShareRequest_SharedDataObjectUpdate) UnmarshalJSON(data []byte) error { + var w updateShareRequest_SharedDataObjectUpdateWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateShareRequest_SharedDataObjectUpdateFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type volumeWire struct { Name *string `json:"name,omitempty"` Id *string `json:"id,omitempty"` @@ -3068,6 +4820,30 @@ func volumeFromWire(w *volumeWire) (*Volume, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Volume) MarshalJSON() ([]byte, error) { + w, err := volumeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Volume) UnmarshalJSON(data []byte) error { + var w volumeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := volumeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/softwareartifacts/CHANGELOG.md b/softwareartifacts/CHANGELOG.md index e0d568ea..c0720d69 100644 --- a/softwareartifacts/CHANGELOG.md +++ b/softwareartifacts/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.4.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.3.0 (2026-11-11) ## Release v0.2.0 (2026-11-10) diff --git a/softwareartifacts/internal/version.go b/softwareartifacts/internal/version.go index d0acdfb5..7acb32ad 100644 --- a/softwareartifacts/internal/version.go +++ b/softwareartifacts/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-softwareartifacts" -const Version = "0.3.0" +const Version = "0.4.0" diff --git a/softwareartifacts/v1/wire.go b/softwareartifacts/v1/wire.go index aef0270c..9ea09006 100644 --- a/softwareartifacts/v1/wire.go +++ b/softwareartifacts/v1/wire.go @@ -3,6 +3,7 @@ package softwareartifacts import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -30,6 +31,30 @@ func getSoftwareArtifactRequestFromWire(w *getSoftwareArtifactRequestWire) (*Get }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSoftwareArtifactRequest) MarshalJSON() ([]byte, error) { + w, err := getSoftwareArtifactRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSoftwareArtifactRequest) UnmarshalJSON(data []byte) error { + var w getSoftwareArtifactRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSoftwareArtifactRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSoftwareArtifactVersionRequestWire struct { Name *string `json:"name,omitempty"` } @@ -52,6 +77,30 @@ func getSoftwareArtifactVersionRequestFromWire(w *getSoftwareArtifactVersionRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSoftwareArtifactVersionRequest) MarshalJSON() ([]byte, error) { + w, err := getSoftwareArtifactVersionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSoftwareArtifactVersionRequest) UnmarshalJSON(data []byte) error { + var w getSoftwareArtifactVersionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSoftwareArtifactVersionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type imageAccelerationDetailWire struct { Status ImageAccelerationDetail_Status `json:"status,omitempty"` } @@ -74,6 +123,30 @@ func imageAccelerationDetailFromWire(w *imageAccelerationDetailWire) (*ImageAcce }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ImageAccelerationDetail) MarshalJSON() ([]byte, error) { + w, err := imageAccelerationDetailToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ImageAccelerationDetail) UnmarshalJSON(data []byte) error { + var w imageAccelerationDetailWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := imageAccelerationDetailFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSoftwareArtifactVersionsRequestWire struct { Parent *string `json:"parent,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -102,6 +175,30 @@ func listSoftwareArtifactVersionsRequestFromWire(w *listSoftwareArtifactVersions }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSoftwareArtifactVersionsRequest) MarshalJSON() ([]byte, error) { + w, err := listSoftwareArtifactVersionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSoftwareArtifactVersionsRequest) UnmarshalJSON(data []byte) error { + var w listSoftwareArtifactVersionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSoftwareArtifactVersionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSoftwareArtifactVersionsResponseWire struct { SoftwareArtifactVersions []softwareArtifactVersionWire `json:"software_artifact_versions,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -135,6 +232,30 @@ func listSoftwareArtifactVersionsResponseFromWire(w *listSoftwareArtifactVersion }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSoftwareArtifactVersionsResponse) MarshalJSON() ([]byte, error) { + w, err := listSoftwareArtifactVersionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSoftwareArtifactVersionsResponse) UnmarshalJSON(data []byte) error { + var w listSoftwareArtifactVersionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSoftwareArtifactVersionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSoftwareArtifactsRequestWire struct { Parent *string `json:"parent,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -163,6 +284,30 @@ func listSoftwareArtifactsRequestFromWire(w *listSoftwareArtifactsRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSoftwareArtifactsRequest) MarshalJSON() ([]byte, error) { + w, err := listSoftwareArtifactsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSoftwareArtifactsRequest) UnmarshalJSON(data []byte) error { + var w listSoftwareArtifactsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSoftwareArtifactsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSoftwareArtifactsResponseWire struct { SoftwareArtifacts []softwareArtifactWire `json:"software_artifacts,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -196,6 +341,30 @@ func listSoftwareArtifactsResponseFromWire(w *listSoftwareArtifactsResponseWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSoftwareArtifactsResponse) MarshalJSON() ([]byte, error) { + w, err := listSoftwareArtifactsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSoftwareArtifactsResponse) UnmarshalJSON(data []byte) error { + var w listSoftwareArtifactsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSoftwareArtifactsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resolveSoftwareArtifactVersionRequestWire struct { Parent *string `json:"parent,omitempty"` Alias *string `json:"alias,omitempty"` @@ -221,6 +390,30 @@ func resolveSoftwareArtifactVersionRequestFromWire(w *resolveSoftwareArtifactVer }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResolveSoftwareArtifactVersionRequest) MarshalJSON() ([]byte, error) { + w, err := resolveSoftwareArtifactVersionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResolveSoftwareArtifactVersionRequest) UnmarshalJSON(data []byte) error { + var w resolveSoftwareArtifactVersionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resolveSoftwareArtifactVersionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resolveSoftwareArtifactVersionResponseWire struct { SoftwareArtifactVersion *softwareArtifactVersionWire `json:"software_artifact_version,omitempty"` } @@ -251,6 +444,30 @@ func resolveSoftwareArtifactVersionResponseFromWire(w *resolveSoftwareArtifactVe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResolveSoftwareArtifactVersionResponse) MarshalJSON() ([]byte, error) { + w, err := resolveSoftwareArtifactVersionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResolveSoftwareArtifactVersionResponse) UnmarshalJSON(data []byte) error { + var w resolveSoftwareArtifactVersionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resolveSoftwareArtifactVersionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type softwareArtifactWire struct { Name *string `json:"name,omitempty"` Owner *string `json:"owner,omitempty"` @@ -288,6 +505,30 @@ func softwareArtifactFromWire(w *softwareArtifactWire) (*SoftwareArtifact, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SoftwareArtifact) MarshalJSON() ([]byte, error) { + w, err := softwareArtifactToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SoftwareArtifact) UnmarshalJSON(data []byte) error { + var w softwareArtifactWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := softwareArtifactFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type softwareArtifactVersionWire struct { Digest *string `json:"digest,omitempty"` Name *string `json:"name,omitempty"` @@ -339,6 +580,30 @@ func softwareArtifactVersionFromWire(w *softwareArtifactVersionWire) (*SoftwareA }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SoftwareArtifactVersion) MarshalJSON() ([]byte, error) { + w, err := softwareArtifactVersionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SoftwareArtifactVersion) UnmarshalJSON(data []byte) error { + var w softwareArtifactVersionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := softwareArtifactVersionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateSoftwareArtifactRequestWire struct { SoftwareArtifact *softwareArtifactWire `json:"software_artifact,omitempty"` UpdateMask *types.FieldMask[SoftwareArtifact] `json:"update_mask,omitempty"` @@ -372,6 +637,30 @@ func updateSoftwareArtifactRequestFromWire(w *updateSoftwareArtifactRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateSoftwareArtifactRequest) MarshalJSON() ([]byte, error) { + w, err := updateSoftwareArtifactRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateSoftwareArtifactRequest) UnmarshalJSON(data []byte) error { + var w updateSoftwareArtifactRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateSoftwareArtifactRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/statementexecution/CHANGELOG.md b/statementexecution/CHANGELOG.md index 88756478..6c2b21a2 100644 --- a/statementexecution/CHANGELOG.md +++ b/statementexecution/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/statementexecution/internal/version.go b/statementexecution/internal/version.go index a0134fe9..874ac5e0 100644 --- a/statementexecution/internal/version.go +++ b/statementexecution/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-statementexecution" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/statementexecution/v1/wire.go b/statementexecution/v1/wire.go index 7c1accb7..211a7fc4 100644 --- a/statementexecution/v1/wire.go +++ b/statementexecution/v1/wire.go @@ -77,6 +77,30 @@ func cancelStatementRequestFromWire(w *cancelStatementRequestWire) (*CancelState }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelStatementRequest) MarshalJSON() ([]byte, error) { + w, err := cancelStatementRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelStatementRequest) UnmarshalJSON(data []byte) error { + var w cancelStatementRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelStatementRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cancelStatementResponseWire struct { } @@ -94,6 +118,30 @@ func cancelStatementResponseFromWire(w *cancelStatementResponseWire) (*CancelSta return &CancelStatementResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CancelStatementResponse) MarshalJSON() ([]byte, error) { + w, err := cancelStatementResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CancelStatementResponse) UnmarshalJSON(data []byte) error { + var w cancelStatementResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cancelStatementResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type chunkInfoWire struct { ChunkIndex *int `json:"chunk_index,omitempty"` RowOffset *wireInt64 `json:"row_offset,omitempty"` @@ -155,6 +203,30 @@ func chunkInfoFromWire(w *chunkInfoWire) (*ChunkInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ChunkInfo) MarshalJSON() ([]byte, error) { + w, err := chunkInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ChunkInfo) UnmarshalJSON(data []byte) error { + var w chunkInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := chunkInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type columnInfoWire struct { Name *string `json:"name,omitempty"` TypeText *string `json:"type_text,omitempty"` @@ -195,6 +267,30 @@ func columnInfoFromWire(w *columnInfoWire) (*ColumnInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ColumnInfo) MarshalJSON() ([]byte, error) { + w, err := columnInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ColumnInfo) UnmarshalJSON(data []byte) error { + var w columnInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := columnInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type executeStatementRequestWire struct { Statement *string `json:"statement,omitempty"` WarehouseId *string `json:"warehouse_id,omitempty"` @@ -282,6 +378,30 @@ func executeStatementRequestFromWire(w *executeStatementRequestWire) (*ExecuteSt }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExecuteStatementRequest) MarshalJSON() ([]byte, error) { + w, err := executeStatementRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExecuteStatementRequest) UnmarshalJSON(data []byte) error { + var w executeStatementRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := executeStatementRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type externalLinkWire struct { ExternalLink *string `json:"external_link,omitempty"` Expiration *string `json:"expiration,omitempty"` @@ -352,6 +472,30 @@ func externalLinkFromWire(w *externalLinkWire) (*ExternalLink, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalLink) MarshalJSON() ([]byte, error) { + w, err := externalLinkToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalLink) UnmarshalJSON(data []byte) error { + var w externalLinkWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalLinkFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getResultDataRequestWire struct { StatementId *string `json:"statement_id,omitempty"` ChunkIndex *int `json:"chunk_index,omitempty"` @@ -380,6 +524,30 @@ func getResultDataRequestFromWire(w *getResultDataRequestWire) (*GetResultDataRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetResultDataRequest) MarshalJSON() ([]byte, error) { + w, err := getResultDataRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetResultDataRequest) UnmarshalJSON(data []byte) error { + var w getResultDataRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getResultDataRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getStatementResultRequestWire struct { StatementId *string `json:"statement_id,omitempty"` WarehouseId *string `json:"warehouse_id,omitempty"` @@ -405,6 +573,30 @@ func getStatementResultRequestFromWire(w *getStatementResultRequestWire) (*GetSt }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetStatementResultRequest) MarshalJSON() ([]byte, error) { + w, err := getStatementResultRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetStatementResultRequest) UnmarshalJSON(data []byte) error { + var w getStatementResultRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getStatementResultRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queryTagWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -430,6 +622,30 @@ func queryTagFromWire(w *queryTagWire) (*QueryTag, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueryTag) MarshalJSON() ([]byte, error) { + w, err := queryTagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueryTag) UnmarshalJSON(data []byte) error { + var w queryTagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queryTagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resultDataWire struct { ExternalLinks []externalLinkWire `json:"external_links,omitempty"` DataArray [][]json.RawMessage `json:"data_array,omitempty"` @@ -505,6 +721,30 @@ func resultDataFromWire(w *resultDataWire) (*ResultData, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResultData) MarshalJSON() ([]byte, error) { + w, err := resultDataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResultData) UnmarshalJSON(data []byte) error { + var w resultDataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resultDataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resultManifestWire struct { Format Format `json:"format,omitempty"` Schema *schemaWire `json:"schema,omitempty"` @@ -577,6 +817,30 @@ func resultManifestFromWire(w *resultManifestWire) (*ResultManifest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResultManifest) MarshalJSON() ([]byte, error) { + w, err := resultManifestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResultManifest) UnmarshalJSON(data []byte) error { + var w resultManifestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resultManifestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type schemaWire struct { ColumnCount *int `json:"column_count,omitempty"` Columns []columnInfoWire `json:"columns,omitempty"` @@ -610,6 +874,30 @@ func schemaFromWire(w *schemaWire) (*Schema, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Schema) MarshalJSON() ([]byte, error) { + w, err := schemaToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Schema) UnmarshalJSON(data []byte) error { + var w schemaWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := schemaFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type serviceErrorWire struct { ErrorCode ServiceErrorCode `json:"error_code,omitempty"` Message *string `json:"message,omitempty"` @@ -635,6 +923,30 @@ func serviceErrorFromWire(w *serviceErrorWire) (*ServiceError, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ServiceError) MarshalJSON() ([]byte, error) { + w, err := serviceErrorToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ServiceError) UnmarshalJSON(data []byte) error { + var w serviceErrorWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := serviceErrorFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type statementParameterWire struct { Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` @@ -663,6 +975,30 @@ func statementParameterFromWire(w *statementParameterWire) (*StatementParameter, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StatementParameter) MarshalJSON() ([]byte, error) { + w, err := statementParameterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StatementParameter) UnmarshalJSON(data []byte) error { + var w statementParameterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := statementParameterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type statementResponseWire struct { StatementId *string `json:"statement_id,omitempty"` Status *statementStatusWire `json:"status,omitempty"` @@ -718,6 +1054,30 @@ func statementResponseFromWire(w *statementResponseWire) (*StatementResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StatementResponse) MarshalJSON() ([]byte, error) { + w, err := statementResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StatementResponse) UnmarshalJSON(data []byte) error { + var w statementResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := statementResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type statementStatusWire struct { State StatementStatus_State `json:"state,omitempty"` Error *serviceErrorWire `json:"error,omitempty"` @@ -754,6 +1114,30 @@ func statementStatusFromWire(w *statementStatusWire) (*StatementStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StatementStatus) MarshalJSON() ([]byte, error) { + w, err := statementStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StatementStatus) UnmarshalJSON(data []byte) error { + var w statementStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := statementStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/storageconfigurations/CHANGELOG.md b/storageconfigurations/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/storageconfigurations/CHANGELOG.md +++ b/storageconfigurations/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/storageconfigurations/internal/version.go b/storageconfigurations/internal/version.go index e9132e79..1d2f0af2 100644 --- a/storageconfigurations/internal/version.go +++ b/storageconfigurations/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-storageconfigurations" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/storageconfigurations/v1/wire.go b/storageconfigurations/v1/wire.go index 629cf2ee..fcc1d5d3 100644 --- a/storageconfigurations/v1/wire.go +++ b/storageconfigurations/v1/wire.go @@ -91,6 +91,30 @@ func createStorageConfigurationRequestFromWire(w *createStorageConfigurationRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateStorageConfigurationRequest) MarshalJSON() ([]byte, error) { + w, err := createStorageConfigurationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateStorageConfigurationRequest) UnmarshalJSON(data []byte) error { + var w createStorageConfigurationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createStorageConfigurationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteStorageConfigurationRequestWire struct { StorageConfigurationId *string `json:"storage_configuration_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -116,6 +140,30 @@ func deleteStorageConfigurationRequestFromWire(w *deleteStorageConfigurationRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteStorageConfigurationRequest) MarshalJSON() ([]byte, error) { + w, err := deleteStorageConfigurationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteStorageConfigurationRequest) UnmarshalJSON(data []byte) error { + var w deleteStorageConfigurationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteStorageConfigurationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getStorageConfigurationRequestWire struct { StorageConfigurationId *string `json:"storage_configuration_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -141,6 +189,30 @@ func getStorageConfigurationRequestFromWire(w *getStorageConfigurationRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetStorageConfigurationRequest) MarshalJSON() ([]byte, error) { + w, err := getStorageConfigurationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetStorageConfigurationRequest) UnmarshalJSON(data []byte) error { + var w getStorageConfigurationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getStorageConfigurationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listStorageConfigurationRequestWire struct { AccountId *string `json:"account_id,omitempty"` } @@ -163,6 +235,30 @@ func listStorageConfigurationRequestFromWire(w *listStorageConfigurationRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListStorageConfigurationRequest) MarshalJSON() ([]byte, error) { + w, err := listStorageConfigurationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListStorageConfigurationRequest) UnmarshalJSON(data []byte) error { + var w listStorageConfigurationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listStorageConfigurationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listStorageConfigurationResponseWire struct { StorageConfigurations []storageConfigurationWire `json:"storage_configurations,omitempty"` } @@ -193,6 +289,30 @@ func listStorageConfigurationResponseFromWire(w *listStorageConfigurationRespons }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListStorageConfigurationResponse) MarshalJSON() ([]byte, error) { + w, err := listStorageConfigurationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListStorageConfigurationResponse) UnmarshalJSON(data []byte) error { + var w listStorageConfigurationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listStorageConfigurationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rootBucketInfoWire struct { BucketName *string `json:"bucket_name,omitempty"` } @@ -215,6 +335,30 @@ func rootBucketInfoFromWire(w *rootBucketInfoWire) (*RootBucketInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RootBucketInfo) MarshalJSON() ([]byte, error) { + w, err := rootBucketInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RootBucketInfo) UnmarshalJSON(data []byte) error { + var w rootBucketInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rootBucketInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type storageConfigurationWire struct { StorageConfigurationId *string `json:"storage_configuration_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -268,6 +412,30 @@ func storageConfigurationFromWire(w *storageConfigurationWire) (*StorageConfigur }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StorageConfiguration) MarshalJSON() ([]byte, error) { + w, err := storageConfigurationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StorageConfiguration) UnmarshalJSON(data []byte) error { + var w storageConfigurationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := storageConfigurationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/supervisoragents/CHANGELOG.md b/supervisoragents/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/supervisoragents/CHANGELOG.md +++ b/supervisoragents/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/supervisoragents/internal/version.go b/supervisoragents/internal/version.go index 90e759cc..5d374f2c 100644 --- a/supervisoragents/internal/version.go +++ b/supervisoragents/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-supervisoragents" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/supervisoragents/v1/wire.go b/supervisoragents/v1/wire.go index 4bb19b1f..4064940e 100644 --- a/supervisoragents/v1/wire.go +++ b/supervisoragents/v1/wire.go @@ -3,6 +3,7 @@ package supervisoragents import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -30,6 +31,30 @@ func appFromWire(w *appWire) (*App, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v App) MarshalJSON() ([]byte, error) { + w, err := appToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *App) UnmarshalJSON(data []byte) error { + var w appWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := appFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createExampleRequestWire struct { Parent *string `json:"parent,omitempty"` Example *exampleWire `json:"example,omitempty"` @@ -63,6 +88,30 @@ func createExampleRequestFromWire(w *createExampleRequestWire) (*CreateExampleRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateExampleRequest) MarshalJSON() ([]byte, error) { + w, err := createExampleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateExampleRequest) UnmarshalJSON(data []byte) error { + var w createExampleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createExampleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createSupervisorAgentRequestWire struct { SupervisorAgent *supervisorAgentWire `json:"supervisor_agent,omitempty"` } @@ -93,6 +142,30 @@ func createSupervisorAgentRequestFromWire(w *createSupervisorAgentRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateSupervisorAgentRequest) MarshalJSON() ([]byte, error) { + w, err := createSupervisorAgentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateSupervisorAgentRequest) UnmarshalJSON(data []byte) error { + var w createSupervisorAgentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createSupervisorAgentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createToolRequestWire struct { Parent *string `json:"parent,omitempty"` Tool *toolWire `json:"tool,omitempty"` @@ -129,6 +202,30 @@ func createToolRequestFromWire(w *createToolRequestWire) (*CreateToolRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateToolRequest) MarshalJSON() ([]byte, error) { + w, err := createToolRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateToolRequest) UnmarshalJSON(data []byte) error { + var w createToolRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createToolRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteExampleRequestWire struct { Name *string `json:"name,omitempty"` } @@ -151,6 +248,30 @@ func deleteExampleRequestFromWire(w *deleteExampleRequestWire) (*DeleteExampleRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteExampleRequest) MarshalJSON() ([]byte, error) { + w, err := deleteExampleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteExampleRequest) UnmarshalJSON(data []byte) error { + var w deleteExampleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteExampleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteSupervisorAgentRequestWire struct { Name *string `json:"name,omitempty"` } @@ -173,6 +294,30 @@ func deleteSupervisorAgentRequestFromWire(w *deleteSupervisorAgentRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteSupervisorAgentRequest) MarshalJSON() ([]byte, error) { + w, err := deleteSupervisorAgentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteSupervisorAgentRequest) UnmarshalJSON(data []byte) error { + var w deleteSupervisorAgentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteSupervisorAgentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteToolRequestWire struct { Name *string `json:"name,omitempty"` } @@ -195,6 +340,30 @@ func deleteToolRequestFromWire(w *deleteToolRequestWire) (*DeleteToolRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteToolRequest) MarshalJSON() ([]byte, error) { + w, err := deleteToolRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteToolRequest) UnmarshalJSON(data []byte) error { + var w deleteToolRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteToolRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type exampleWire struct { Name *string `json:"name,omitempty"` Question *string `json:"question,omitempty"` @@ -226,6 +395,30 @@ func exampleFromWire(w *exampleWire) (*Example, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Example) MarshalJSON() ([]byte, error) { + w, err := exampleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Example) UnmarshalJSON(data []byte) error { + var w exampleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := exampleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type genieSpaceWire struct { Id *string `json:"id,omitempty"` } @@ -248,6 +441,30 @@ func genieSpaceFromWire(w *genieSpaceWire) (*GenieSpace, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenieSpace) MarshalJSON() ([]byte, error) { + w, err := genieSpaceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenieSpace) UnmarshalJSON(data []byte) error { + var w genieSpaceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := genieSpaceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getExampleRequestWire struct { Name *string `json:"name,omitempty"` } @@ -270,6 +487,30 @@ func getExampleRequestFromWire(w *getExampleRequestWire) (*GetExampleRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetExampleRequest) MarshalJSON() ([]byte, error) { + w, err := getExampleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetExampleRequest) UnmarshalJSON(data []byte) error { + var w getExampleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getExampleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSupervisorAgentRequestWire struct { Name *string `json:"name,omitempty"` } @@ -292,6 +533,30 @@ func getSupervisorAgentRequestFromWire(w *getSupervisorAgentRequestWire) (*GetSu }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSupervisorAgentRequest) MarshalJSON() ([]byte, error) { + w, err := getSupervisorAgentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSupervisorAgentRequest) UnmarshalJSON(data []byte) error { + var w getSupervisorAgentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSupervisorAgentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getToolRequestWire struct { Name *string `json:"name,omitempty"` } @@ -314,6 +579,30 @@ func getToolRequestFromWire(w *getToolRequestWire) (*GetToolRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetToolRequest) MarshalJSON() ([]byte, error) { + w, err := getToolRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetToolRequest) UnmarshalJSON(data []byte) error { + var w getToolRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getToolRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type knowledgeAssistantWire struct { ServingEndpointName *string `json:"serving_endpoint_name,omitempty"` KnowledgeAssistantId *string `json:"knowledge_assistant_id,omitempty"` @@ -339,6 +628,30 @@ func knowledgeAssistantFromWire(w *knowledgeAssistantWire) (*KnowledgeAssistant, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v KnowledgeAssistant) MarshalJSON() ([]byte, error) { + w, err := knowledgeAssistantToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *KnowledgeAssistant) UnmarshalJSON(data []byte) error { + var w knowledgeAssistantWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := knowledgeAssistantFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExamplesRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -367,6 +680,30 @@ func listExamplesRequestFromWire(w *listExamplesRequestWire) (*ListExamplesReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExamplesRequest) MarshalJSON() ([]byte, error) { + w, err := listExamplesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExamplesRequest) UnmarshalJSON(data []byte) error { + var w listExamplesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExamplesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExamplesResponseWire struct { Examples []exampleWire `json:"examples,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -400,6 +737,30 @@ func listExamplesResponseFromWire(w *listExamplesResponseWire) (*ListExamplesRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExamplesResponse) MarshalJSON() ([]byte, error) { + w, err := listExamplesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExamplesResponse) UnmarshalJSON(data []byte) error { + var w listExamplesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExamplesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSupervisorAgentsRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -425,6 +786,30 @@ func listSupervisorAgentsRequestFromWire(w *listSupervisorAgentsRequestWire) (*L }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSupervisorAgentsRequest) MarshalJSON() ([]byte, error) { + w, err := listSupervisorAgentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSupervisorAgentsRequest) UnmarshalJSON(data []byte) error { + var w listSupervisorAgentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSupervisorAgentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSupervisorAgentsResponseWire struct { SupervisorAgents []supervisorAgentWire `json:"supervisor_agents,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -458,6 +843,30 @@ func listSupervisorAgentsResponseFromWire(w *listSupervisorAgentsResponseWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSupervisorAgentsResponse) MarshalJSON() ([]byte, error) { + w, err := listSupervisorAgentsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSupervisorAgentsResponse) UnmarshalJSON(data []byte) error { + var w listSupervisorAgentsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSupervisorAgentsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listToolsRequestWire struct { Parent *string `json:"parent,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -486,6 +895,30 @@ func listToolsRequestFromWire(w *listToolsRequestWire) (*ListToolsRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListToolsRequest) MarshalJSON() ([]byte, error) { + w, err := listToolsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListToolsRequest) UnmarshalJSON(data []byte) error { + var w listToolsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listToolsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listToolsResponseWire struct { Tools []toolWire `json:"tools,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -519,6 +952,30 @@ func listToolsResponseFromWire(w *listToolsResponseWire) (*ListToolsResponse, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListToolsResponse) MarshalJSON() ([]byte, error) { + w, err := listToolsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListToolsResponse) UnmarshalJSON(data []byte) error { + var w listToolsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listToolsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type supervisorAgentWire struct { Name *string `json:"name,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -568,6 +1025,30 @@ func supervisorAgentFromWire(w *supervisorAgentWire) (*SupervisorAgent, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SupervisorAgent) MarshalJSON() ([]byte, error) { + w, err := supervisorAgentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SupervisorAgent) UnmarshalJSON(data []byte) error { + var w supervisorAgentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := supervisorAgentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type toolWire struct { Name *string `json:"name,omitempty"` Id *string `json:"id,omitempty"` @@ -735,6 +1216,30 @@ func toolFromWire(w *toolWire) (*Tool, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Tool) MarshalJSON() ([]byte, error) { + w, err := toolToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Tool) UnmarshalJSON(data []byte) error { + var w toolWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := toolFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ucConnectionWire struct { Name *string `json:"name,omitempty"` } @@ -757,6 +1262,30 @@ func ucConnectionFromWire(w *ucConnectionWire) (*UcConnection, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UcConnection) MarshalJSON() ([]byte, error) { + w, err := ucConnectionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UcConnection) UnmarshalJSON(data []byte) error { + var w ucConnectionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ucConnectionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type ucFunctionWire struct { Name *string `json:"name,omitempty"` } @@ -779,6 +1308,30 @@ func ucFunctionFromWire(w *ucFunctionWire) (*UcFunction, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UcFunction) MarshalJSON() ([]byte, error) { + w, err := ucFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UcFunction) UnmarshalJSON(data []byte) error { + var w ucFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := ucFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateExampleRequestWire struct { Name *string `json:"name,omitempty"` Example *exampleWire `json:"example,omitempty"` @@ -815,6 +1368,30 @@ func updateExampleRequestFromWire(w *updateExampleRequestWire) (*UpdateExampleRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateExampleRequest) MarshalJSON() ([]byte, error) { + w, err := updateExampleRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateExampleRequest) UnmarshalJSON(data []byte) error { + var w updateExampleRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateExampleRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateSupervisorAgentRequestWire struct { SupervisorAgent *supervisorAgentWire `json:"supervisor_agent,omitempty"` UpdateMask *types.FieldMask[SupervisorAgent] `json:"update_mask,omitempty"` @@ -848,6 +1425,30 @@ func updateSupervisorAgentRequestFromWire(w *updateSupervisorAgentRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateSupervisorAgentRequest) MarshalJSON() ([]byte, error) { + w, err := updateSupervisorAgentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateSupervisorAgentRequest) UnmarshalJSON(data []byte) error { + var w updateSupervisorAgentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateSupervisorAgentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateToolRequestWire struct { Tool *toolWire `json:"tool,omitempty"` UpdateMask *types.FieldMask[Tool] `json:"update_mask,omitempty"` @@ -881,6 +1482,30 @@ func updateToolRequestFromWire(w *updateToolRequestWire) (*UpdateToolRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateToolRequest) MarshalJSON() ([]byte, error) { + w, err := updateToolRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateToolRequest) UnmarshalJSON(data []byte) error { + var w updateToolRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateToolRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type volumeWire struct { Name *string `json:"name,omitempty"` } @@ -903,6 +1528,30 @@ func volumeFromWire(w *volumeWire) (*Volume, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Volume) MarshalJSON() ([]byte, error) { + w, err := volumeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Volume) UnmarshalJSON(data []byte) error { + var w volumeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := volumeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/tagassignments/CHANGELOG.md b/tagassignments/CHANGELOG.md index acc6f578..5692dc8b 100644 --- a/tagassignments/CHANGELOG.md +++ b/tagassignments/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/tagassignments/internal/version.go b/tagassignments/internal/version.go index c8468fae..8d7097f9 100644 --- a/tagassignments/internal/version.go +++ b/tagassignments/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-tagassignments" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/tagassignments/v1/wire.go b/tagassignments/v1/wire.go index 3ebab638..8b3ca5b4 100644 --- a/tagassignments/v1/wire.go +++ b/tagassignments/v1/wire.go @@ -3,6 +3,7 @@ package tagassignments import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -38,6 +39,30 @@ func createTagAssignmentRequestFromWire(w *createTagAssignmentRequestWire) (*Cre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateTagAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := createTagAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateTagAssignmentRequest) UnmarshalJSON(data []byte) error { + var w createTagAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createTagAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteTagAssignmentRequestWire struct { EntityType *string `json:"entity_type,omitempty"` EntityId *string `json:"entity_id,omitempty"` @@ -66,6 +91,30 @@ func deleteTagAssignmentRequestFromWire(w *deleteTagAssignmentRequestWire) (*Del }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteTagAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := deleteTagAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteTagAssignmentRequest) UnmarshalJSON(data []byte) error { + var w deleteTagAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteTagAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getTagAssignmentRequestWire struct { EntityType *string `json:"entity_type,omitempty"` EntityId *string `json:"entity_id,omitempty"` @@ -94,6 +143,30 @@ func getTagAssignmentRequestFromWire(w *getTagAssignmentRequestWire) (*GetTagAss }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetTagAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := getTagAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetTagAssignmentRequest) UnmarshalJSON(data []byte) error { + var w getTagAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getTagAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listTagAssignmentsRequestWire struct { EntityType *string `json:"entity_type,omitempty"` EntityId *string `json:"entity_id,omitempty"` @@ -125,6 +198,30 @@ func listTagAssignmentsRequestFromWire(w *listTagAssignmentsRequestWire) (*ListT }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListTagAssignmentsRequest) MarshalJSON() ([]byte, error) { + w, err := listTagAssignmentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListTagAssignmentsRequest) UnmarshalJSON(data []byte) error { + var w listTagAssignmentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listTagAssignmentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listTagAssignmentsResponseWire struct { TagAssignments []tagAssignmentWire `json:"tag_assignments,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -158,6 +255,30 @@ func listTagAssignmentsResponseFromWire(w *listTagAssignmentsResponseWire) (*Lis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListTagAssignmentsResponse) MarshalJSON() ([]byte, error) { + w, err := listTagAssignmentsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListTagAssignmentsResponse) UnmarshalJSON(data []byte) error { + var w listTagAssignmentsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listTagAssignmentsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tagAssignmentWire struct { EntityType *string `json:"entity_type,omitempty"` EntityId *string `json:"entity_id,omitempty"` @@ -189,6 +310,30 @@ func tagAssignmentFromWire(w *tagAssignmentWire) (*TagAssignment, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TagAssignment) MarshalJSON() ([]byte, error) { + w, err := tagAssignmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TagAssignment) UnmarshalJSON(data []byte) error { + var w tagAssignmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tagAssignmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateTagAssignmentRequestWire struct { TagAssignment *tagAssignmentWire `json:"tag_assignment,omitempty"` UpdateMask *types.FieldMask[TagAssignment] `json:"update_mask,omitempty"` @@ -222,6 +367,30 @@ func updateTagAssignmentRequestFromWire(w *updateTagAssignmentRequestWire) (*Upd }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateTagAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := updateTagAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateTagAssignmentRequest) UnmarshalJSON(data []byte) error { + var w updateTagAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateTagAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/tagpolicies/CHANGELOG.md b/tagpolicies/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/tagpolicies/CHANGELOG.md +++ b/tagpolicies/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/tagpolicies/internal/version.go b/tagpolicies/internal/version.go index b001112c..59b4a0eb 100644 --- a/tagpolicies/internal/version.go +++ b/tagpolicies/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-tagpolicies" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/tagpolicies/v1/wire.go b/tagpolicies/v1/wire.go index 298f2e50..5fa1df3d 100644 --- a/tagpolicies/v1/wire.go +++ b/tagpolicies/v1/wire.go @@ -3,6 +3,7 @@ package tagpolicies import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -38,6 +39,30 @@ func createTagPolicyRequestFromWire(w *createTagPolicyRequestWire) (*CreateTagPo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateTagPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := createTagPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateTagPolicyRequest) UnmarshalJSON(data []byte) error { + var w createTagPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createTagPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteTagPolicyRequestWire struct { TagKey *string `json:"tag_key,omitempty"` } @@ -60,6 +85,30 @@ func deleteTagPolicyRequestFromWire(w *deleteTagPolicyRequestWire) (*DeleteTagPo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteTagPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := deleteTagPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteTagPolicyRequest) UnmarshalJSON(data []byte) error { + var w deleteTagPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteTagPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getTagPolicyRequestWire struct { TagKey *string `json:"tag_key,omitempty"` } @@ -82,6 +131,30 @@ func getTagPolicyRequestFromWire(w *getTagPolicyRequestWire) (*GetTagPolicyReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetTagPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := getTagPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetTagPolicyRequest) UnmarshalJSON(data []byte) error { + var w getTagPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getTagPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listTagPoliciesRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -107,6 +180,30 @@ func listTagPoliciesRequestFromWire(w *listTagPoliciesRequestWire) (*ListTagPoli }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListTagPoliciesRequest) MarshalJSON() ([]byte, error) { + w, err := listTagPoliciesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListTagPoliciesRequest) UnmarshalJSON(data []byte) error { + var w listTagPoliciesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listTagPoliciesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listTagPoliciesResponseWire struct { TagPolicies []tagPolicyWire `json:"tag_policies,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -140,6 +237,30 @@ func listTagPoliciesResponseFromWire(w *listTagPoliciesResponseWire) (*ListTagPo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListTagPoliciesResponse) MarshalJSON() ([]byte, error) { + w, err := listTagPoliciesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListTagPoliciesResponse) UnmarshalJSON(data []byte) error { + var w listTagPoliciesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listTagPoliciesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tagPolicyWire struct { TagKey *string `json:"tag_key,omitempty"` Id *string `json:"id,omitempty"` @@ -185,6 +306,30 @@ func tagPolicyFromWire(w *tagPolicyWire) (*TagPolicy, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TagPolicy) MarshalJSON() ([]byte, error) { + w, err := tagPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TagPolicy) UnmarshalJSON(data []byte) error { + var w tagPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tagPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateTagPolicyRequestWire struct { TagPolicy *tagPolicyWire `json:"tag_policy,omitempty"` UpdateMask *types.FieldMask[TagPolicy] `json:"update_mask,omitempty"` @@ -218,6 +363,30 @@ func updateTagPolicyRequestFromWire(w *updateTagPolicyRequestWire) (*UpdateTagPo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateTagPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := updateTagPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateTagPolicyRequest) UnmarshalJSON(data []byte) error { + var w updateTagPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateTagPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type valueWire struct { Name *string `json:"name,omitempty"` } @@ -240,6 +409,30 @@ func valueFromWire(w *valueWire) (*Value, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Value) MarshalJSON() ([]byte, error) { + w, err := valueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Value) UnmarshalJSON(data []byte) error { + var w valueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := valueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/tokenmanagement/CHANGELOG.md b/tokenmanagement/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/tokenmanagement/CHANGELOG.md +++ b/tokenmanagement/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/tokenmanagement/internal/version.go b/tokenmanagement/internal/version.go index 69413b93..e0a1b77c 100644 --- a/tokenmanagement/internal/version.go +++ b/tokenmanagement/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-tokenmanagement" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/tokenmanagement/v1/wire.go b/tokenmanagement/v1/wire.go index a4b1c709..315a45b7 100644 --- a/tokenmanagement/v1/wire.go +++ b/tokenmanagement/v1/wire.go @@ -160,6 +160,30 @@ func adminTokenInfoFromWire(w *adminTokenInfoWire) (*AdminTokenInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AdminTokenInfo) MarshalJSON() ([]byte, error) { + w, err := adminTokenInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AdminTokenInfo) UnmarshalJSON(data []byte) error { + var w adminTokenInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := adminTokenInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createOnBehalfOfTokenRequestWire struct { ApplicationId *string `json:"application_id,omitempty"` LifetimeSeconds *wireInt64 `json:"lifetime_seconds,omitempty"` @@ -202,6 +226,30 @@ func createOnBehalfOfTokenRequestFromWire(w *createOnBehalfOfTokenRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateOnBehalfOfTokenRequest) MarshalJSON() ([]byte, error) { + w, err := createOnBehalfOfTokenRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateOnBehalfOfTokenRequest) UnmarshalJSON(data []byte) error { + var w createOnBehalfOfTokenRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createOnBehalfOfTokenRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createOnBehalfOfTokenResponseWire struct { TokenValue *string `json:"token_value,omitempty"` TokenInfo *adminTokenInfoWire `json:"token_info,omitempty"` @@ -235,6 +283,30 @@ func createOnBehalfOfTokenResponseFromWire(w *createOnBehalfOfTokenResponseWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateOnBehalfOfTokenResponse) MarshalJSON() ([]byte, error) { + w, err := createOnBehalfOfTokenResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateOnBehalfOfTokenResponse) UnmarshalJSON(data []byte) error { + var w createOnBehalfOfTokenResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createOnBehalfOfTokenResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getTokenRequestWire struct { TokenId *string `json:"token_id,omitempty"` } @@ -257,6 +329,30 @@ func getTokenRequestFromWire(w *getTokenRequestWire) (*GetTokenRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetTokenRequest) MarshalJSON() ([]byte, error) { + w, err := getTokenRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetTokenRequest) UnmarshalJSON(data []byte) error { + var w getTokenRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getTokenRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getTokenResponseWire struct { TokenInfo *adminTokenInfoWire `json:"token_info,omitempty"` } @@ -287,6 +383,30 @@ func getTokenResponseFromWire(w *getTokenResponseWire) (*GetTokenResponse, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetTokenResponse) MarshalJSON() ([]byte, error) { + w, err := getTokenResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetTokenResponse) UnmarshalJSON(data []byte) error { + var w getTokenResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getTokenResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listTokensRequestWire struct { CreatedById *wireInt64 `json:"created_by_id,omitempty"` CreatedByUsername *string `json:"created_by_username,omitempty"` @@ -320,6 +440,30 @@ func listTokensRequestFromWire(w *listTokensRequestWire) (*ListTokensRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListTokensRequest) MarshalJSON() ([]byte, error) { + w, err := listTokensRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListTokensRequest) UnmarshalJSON(data []byte) error { + var w listTokensRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listTokensRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listTokensResponseWire struct { TokenInfos []adminTokenInfoWire `json:"token_infos,omitempty"` } @@ -350,6 +494,30 @@ func listTokensResponseFromWire(w *listTokensResponseWire) (*ListTokensResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListTokensResponse) MarshalJSON() ([]byte, error) { + w, err := listTokensResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListTokensResponse) UnmarshalJSON(data []byte) error { + var w listTokensResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listTokensResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type revokeTokenRequestWire struct { TokenId *string `json:"token_id,omitempty"` } @@ -372,6 +540,30 @@ func revokeTokenRequestFromWire(w *revokeTokenRequestWire) (*RevokeTokenRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RevokeTokenRequest) MarshalJSON() ([]byte, error) { + w, err := revokeTokenRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RevokeTokenRequest) UnmarshalJSON(data []byte) error { + var w revokeTokenRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := revokeTokenRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type revokeTokenResponseWire struct { } @@ -389,6 +581,30 @@ func revokeTokenResponseFromWire(w *revokeTokenResponseWire) (*RevokeTokenRespon return &RevokeTokenResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RevokeTokenResponse) MarshalJSON() ([]byte, error) { + w, err := revokeTokenResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RevokeTokenResponse) UnmarshalJSON(data []byte) error { + var w revokeTokenResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := revokeTokenResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateTokenRequestWire struct { Token *adminTokenInfoWire `json:"token,omitempty"` UpdateMask *types.FieldMask[AdminTokenInfo] `json:"update_mask,omitempty"` @@ -422,6 +638,30 @@ func updateTokenRequestFromWire(w *updateTokenRequestWire) (*UpdateTokenRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateTokenRequest) MarshalJSON() ([]byte, error) { + w, err := updateTokenRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateTokenRequest) UnmarshalJSON(data []byte) error { + var w updateTokenRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateTokenRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/tokens/CHANGELOG.md b/tokens/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/tokens/CHANGELOG.md +++ b/tokens/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/tokens/internal/version.go b/tokens/internal/version.go index fa124314..d9bea944 100644 --- a/tokens/internal/version.go +++ b/tokens/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-tokens" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/tokens/v1/wire.go b/tokens/v1/wire.go index 4f875d50..91f345a6 100644 --- a/tokens/v1/wire.go +++ b/tokens/v1/wire.go @@ -93,6 +93,30 @@ func createTokenRequestFromWire(w *createTokenRequestWire) (*CreateTokenRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateTokenRequest) MarshalJSON() ([]byte, error) { + w, err := createTokenRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateTokenRequest) UnmarshalJSON(data []byte) error { + var w createTokenRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createTokenRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createTokenResponseWire struct { TokenValue *string `json:"token_value,omitempty"` TokenInfo *publicTokenInfoWire `json:"token_info,omitempty"` @@ -126,6 +150,30 @@ func createTokenResponseFromWire(w *createTokenResponseWire) (*CreateTokenRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateTokenResponse) MarshalJSON() ([]byte, error) { + w, err := createTokenResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateTokenResponse) UnmarshalJSON(data []byte) error { + var w createTokenResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createTokenResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listTokensRequestWire struct { } @@ -143,6 +191,30 @@ func listTokensRequestFromWire(w *listTokensRequestWire) (*ListTokensRequest, er return &ListTokensRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListTokensRequest) MarshalJSON() ([]byte, error) { + w, err := listTokensRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListTokensRequest) UnmarshalJSON(data []byte) error { + var w listTokensRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listTokensRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listTokensResponseWire struct { TokenInfos []publicTokenInfoWire `json:"token_infos,omitempty"` } @@ -173,6 +245,30 @@ func listTokensResponseFromWire(w *listTokensResponseWire) (*ListTokensResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListTokensResponse) MarshalJSON() ([]byte, error) { + w, err := listTokensResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListTokensResponse) UnmarshalJSON(data []byte) error { + var w listTokensResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listTokensResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type publicTokenInfoWire struct { TokenId *string `json:"token_id,omitempty"` CreationTime *wireInt64 `json:"creation_time,omitempty"` @@ -232,6 +328,30 @@ func publicTokenInfoFromWire(w *publicTokenInfoWire) (*PublicTokenInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PublicTokenInfo) MarshalJSON() ([]byte, error) { + w, err := publicTokenInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PublicTokenInfo) UnmarshalJSON(data []byte) error { + var w publicTokenInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := publicTokenInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type revokeTokenRequestWire struct { TokenId *string `json:"token_id,omitempty"` } @@ -254,6 +374,30 @@ func revokeTokenRequestFromWire(w *revokeTokenRequestWire) (*RevokeTokenRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RevokeTokenRequest) MarshalJSON() ([]byte, error) { + w, err := revokeTokenRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RevokeTokenRequest) UnmarshalJSON(data []byte) error { + var w revokeTokenRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := revokeTokenRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type revokeTokenResponseWire struct { } @@ -271,6 +415,30 @@ func revokeTokenResponseFromWire(w *revokeTokenResponseWire) (*RevokeTokenRespon return &RevokeTokenResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RevokeTokenResponse) MarshalJSON() ([]byte, error) { + w, err := revokeTokenResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RevokeTokenResponse) UnmarshalJSON(data []byte) error { + var w revokeTokenResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := revokeTokenResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateTokenRequestWire struct { TokenId *string `json:"token_id,omitempty"` Token *publicTokenInfoWire `json:"token,omitempty"` @@ -307,6 +475,30 @@ func updateTokenRequestFromWire(w *updateTokenRequestWire) (*UpdateTokenRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateTokenRequest) MarshalJSON() ([]byte, error) { + w, err := updateTokenRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateTokenRequest) UnmarshalJSON(data []byte) error { + var w updateTokenRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateTokenRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateTokenResponseWire struct { } @@ -324,6 +516,30 @@ func updateTokenResponseFromWire(w *updateTokenResponseWire) (*UpdateTokenRespon return &UpdateTokenResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateTokenResponse) MarshalJSON() ([]byte, error) { + w, err := updateTokenResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateTokenResponse) UnmarshalJSON(data []byte) error { + var w updateTokenResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateTokenResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/abacpolicies/CHANGELOG.md b/uc/abacpolicies/CHANGELOG.md index ba40f099..d80ae434 100644 --- a/uc/abacpolicies/CHANGELOG.md +++ b/uc/abacpolicies/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.8.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.7.0 (2026-11-11) ## Release v0.6.0 (2026-11-10) diff --git a/uc/abacpolicies/internal/version.go b/uc/abacpolicies/internal/version.go index 04be0190..f483e23a 100644 --- a/uc/abacpolicies/internal/version.go +++ b/uc/abacpolicies/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-abacpolicies" -const Version = "0.7.0" +const Version = "0.8.0" diff --git a/uc/abacpolicies/v1/wire.go b/uc/abacpolicies/v1/wire.go index 7cec9023..a2168beb 100644 --- a/uc/abacpolicies/v1/wire.go +++ b/uc/abacpolicies/v1/wire.go @@ -90,6 +90,30 @@ func columnMaskOptionsFromWire(w *columnMaskOptionsWire) (*ColumnMaskOptions, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ColumnMaskOptions) MarshalJSON() ([]byte, error) { + w, err := columnMaskOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ColumnMaskOptions) UnmarshalJSON(data []byte) error { + var w columnMaskOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := columnMaskOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type columnTagValueExtractionWire struct { ColumnAlias *string `json:"column_alias,omitempty"` TagKey *string `json:"tag_key,omitempty"` @@ -115,6 +139,30 @@ func columnTagValueExtractionFromWire(w *columnTagValueExtractionWire) (*ColumnT }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ColumnTagValueExtraction) MarshalJSON() ([]byte, error) { + w, err := columnTagValueExtractionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ColumnTagValueExtraction) UnmarshalJSON(data []byte) error { + var w columnTagValueExtractionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := columnTagValueExtractionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createPolicyRequestWire struct { PolicyInfo *policyInfoWire `json:"policy_info,omitempty"` } @@ -145,6 +193,30 @@ func createPolicyRequestFromWire(w *createPolicyRequestWire) (*CreatePolicyReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreatePolicyRequest) MarshalJSON() ([]byte, error) { + w, err := createPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreatePolicyRequest) UnmarshalJSON(data []byte) error { + var w createPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deletePolicyRequestWire struct { OnSecurableType *string `json:"on_securable_type,omitempty"` OnSecurableFullname *string `json:"on_securable_fullname,omitempty"` @@ -173,6 +245,30 @@ func deletePolicyRequestFromWire(w *deletePolicyRequestWire) (*DeletePolicyReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeletePolicyRequest) MarshalJSON() ([]byte, error) { + w, err := deletePolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeletePolicyRequest) UnmarshalJSON(data []byte) error { + var w deletePolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deletePolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deletePolicyResponseWire struct { } @@ -190,6 +286,30 @@ func deletePolicyResponseFromWire(w *deletePolicyResponseWire) (*DeletePolicyRes return &DeletePolicyResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeletePolicyResponse) MarshalJSON() ([]byte, error) { + w, err := deletePolicyResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeletePolicyResponse) UnmarshalJSON(data []byte) error { + var w deletePolicyResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deletePolicyResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type denyOptionsWire struct { Privileges []string `json:"privileges,omitempty"` } @@ -212,6 +332,30 @@ func denyOptionsFromWire(w *denyOptionsWire) (*DenyOptions, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DenyOptions) MarshalJSON() ([]byte, error) { + w, err := denyOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DenyOptions) UnmarshalJSON(data []byte) error { + var w denyOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := denyOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type functionArgExpressionWire struct { TagIntrospection *tagIntrospectionExpressionWire `json:"tag_introspection,omitempty"` } @@ -264,6 +408,30 @@ func functionArgExpressionFromWire(w *functionArgExpressionWire) (*FunctionArgEx }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FunctionArgExpression) MarshalJSON() ([]byte, error) { + w, err := functionArgExpressionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FunctionArgExpression) UnmarshalJSON(data []byte) error { + var w functionArgExpressionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := functionArgExpressionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type functionArgumentWire struct { Alias *string `json:"alias,omitempty"` Constant *string `json:"constant,omitempty"` @@ -340,6 +508,30 @@ func functionArgumentFromWire(w *functionArgumentWire) (*FunctionArgument, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FunctionArgument) MarshalJSON() ([]byte, error) { + w, err := functionArgumentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FunctionArgument) UnmarshalJSON(data []byte) error { + var w functionArgumentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := functionArgumentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPolicyRequestWire struct { OnSecurableType *string `json:"on_securable_type,omitempty"` OnSecurableFullname *string `json:"on_securable_fullname,omitempty"` @@ -368,6 +560,30 @@ func getPolicyRequestFromWire(w *getPolicyRequestWire) (*GetPolicyRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := getPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPolicyRequest) UnmarshalJSON(data []byte) error { + var w getPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type governedTagReferenceWire struct { TagKey *string `json:"tag_key,omitempty"` TagValue *string `json:"tag_value,omitempty"` @@ -393,6 +609,30 @@ func governedTagReferenceFromWire(w *governedTagReferenceWire) (*GovernedTagRefe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GovernedTagReference) MarshalJSON() ([]byte, error) { + w, err := governedTagReferenceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GovernedTagReference) UnmarshalJSON(data []byte) error { + var w governedTagReferenceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := governedTagReferenceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type grantOptionsWire struct { Privileges []string `json:"privileges,omitempty"` } @@ -415,6 +655,30 @@ func grantOptionsFromWire(w *grantOptionsWire) (*GrantOptions, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GrantOptions) MarshalJSON() ([]byte, error) { + w, err := grantOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GrantOptions) UnmarshalJSON(data []byte) error { + var w grantOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := grantOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPoliciesRequestWire struct { OnSecurableType *string `json:"on_securable_type,omitempty"` OnSecurableFullname *string `json:"on_securable_fullname,omitempty"` @@ -449,6 +713,30 @@ func listPoliciesRequestFromWire(w *listPoliciesRequestWire) (*ListPoliciesReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPoliciesRequest) MarshalJSON() ([]byte, error) { + w, err := listPoliciesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPoliciesRequest) UnmarshalJSON(data []byte) error { + var w listPoliciesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPoliciesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPoliciesResponseWire struct { Policies []policyInfoWire `json:"policies,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -482,6 +770,30 @@ func listPoliciesResponseFromWire(w *listPoliciesResponseWire) (*ListPoliciesRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPoliciesResponse) MarshalJSON() ([]byte, error) { + w, err := listPoliciesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPoliciesResponse) UnmarshalJSON(data []byte) error { + var w listPoliciesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPoliciesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type matchColumnWire struct { Condition *string `json:"condition,omitempty"` Alias *string `json:"alias,omitempty"` @@ -507,6 +819,30 @@ func matchColumnFromWire(w *matchColumnWire) (*MatchColumn, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MatchColumn) MarshalJSON() ([]byte, error) { + w, err := matchColumnToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MatchColumn) UnmarshalJSON(data []byte) error { + var w matchColumnWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := matchColumnFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type policyInfoWire struct { Id *string `json:"id,omitempty"` OnSecurableType SecurableType `json:"on_securable_type,omitempty"` @@ -699,6 +1035,30 @@ func policyInfoFromWire(w *policyInfoWire) (*PolicyInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PolicyInfo) MarshalJSON() ([]byte, error) { + w, err := policyInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PolicyInfo) UnmarshalJSON(data []byte) error { + var w policyInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := policyInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rowFilterOptionsWire struct { FunctionName *string `json:"function_name,omitempty"` Using []functionArgumentWire `json:"using,omitempty"` @@ -732,6 +1092,30 @@ func rowFilterOptionsFromWire(w *rowFilterOptionsWire) (*RowFilterOptions, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RowFilterOptions) MarshalJSON() ([]byte, error) { + w, err := rowFilterOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RowFilterOptions) UnmarshalJSON(data []byte) error { + var w rowFilterOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rowFilterOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tagIntrospectionExpressionWire struct { TagValue *tagValueExtractionWire `json:"tag_value,omitempty"` ColumnTagValue *columnTagValueExtractionWire `json:"column_tag_value,omitempty"` @@ -804,6 +1188,30 @@ func tagIntrospectionExpressionFromWire(w *tagIntrospectionExpressionWire) (*Tag }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TagIntrospectionExpression) MarshalJSON() ([]byte, error) { + w, err := tagIntrospectionExpressionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TagIntrospectionExpression) UnmarshalJSON(data []byte) error { + var w tagIntrospectionExpressionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tagIntrospectionExpressionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tagValueExtractionWire struct { TagKey *string `json:"tag_key,omitempty"` } @@ -826,6 +1234,30 @@ func tagValueExtractionFromWire(w *tagValueExtractionWire) (*TagValueExtraction, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TagValueExtraction) MarshalJSON() ([]byte, error) { + w, err := tagValueExtractionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TagValueExtraction) UnmarshalJSON(data []byte) error { + var w tagValueExtractionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tagValueExtractionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updatePolicyRequestWire struct { OnSecurableType *string `json:"on_securable_type,omitempty"` OnSecurableFullname *string `json:"on_securable_fullname,omitempty"` @@ -868,6 +1300,30 @@ func updatePolicyRequestFromWire(w *updatePolicyRequestWire) (*UpdatePolicyReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdatePolicyRequest) MarshalJSON() ([]byte, error) { + w, err := updatePolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdatePolicyRequest) UnmarshalJSON(data []byte) error { + var w updatePolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updatePolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/artifactallowlists/CHANGELOG.md b/uc/artifactallowlists/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/uc/artifactallowlists/CHANGELOG.md +++ b/uc/artifactallowlists/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/uc/artifactallowlists/internal/version.go b/uc/artifactallowlists/internal/version.go index fe7d8042..5625191e 100644 --- a/uc/artifactallowlists/internal/version.go +++ b/uc/artifactallowlists/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-artifactallowlists" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/uc/artifactallowlists/v1/wire.go b/uc/artifactallowlists/v1/wire.go index 5d127a55..6a099fb0 100644 --- a/uc/artifactallowlists/v1/wire.go +++ b/uc/artifactallowlists/v1/wire.go @@ -99,6 +99,30 @@ func artifactAllowlistInfoFromWire(w *artifactAllowlistInfoWire) (*ArtifactAllow }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ArtifactAllowlistInfo) MarshalJSON() ([]byte, error) { + w, err := artifactAllowlistInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ArtifactAllowlistInfo) UnmarshalJSON(data []byte) error { + var w artifactAllowlistInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := artifactAllowlistInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type artifactMatcherWire struct { Artifact *string `json:"artifact,omitempty"` MatchType ArtifactMatcher_MatchType `json:"match_type,omitempty"` @@ -124,6 +148,30 @@ func artifactMatcherFromWire(w *artifactMatcherWire) (*ArtifactMatcher, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ArtifactMatcher) MarshalJSON() ([]byte, error) { + w, err := artifactMatcherToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ArtifactMatcher) UnmarshalJSON(data []byte) error { + var w artifactMatcherWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := artifactMatcherFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getArtifactAllowlistRequestWire struct { ArtifactType ArtifactType `json:"artifact_type,omitempty"` } @@ -146,6 +194,30 @@ func getArtifactAllowlistRequestFromWire(w *getArtifactAllowlistRequestWire) (*G }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetArtifactAllowlistRequest) MarshalJSON() ([]byte, error) { + w, err := getArtifactAllowlistRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetArtifactAllowlistRequest) UnmarshalJSON(data []byte) error { + var w getArtifactAllowlistRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getArtifactAllowlistRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type setArtifactAllowlistRequestWire struct { ArtifactType ArtifactType `json:"artifact_type,omitempty"` ArtifactMatchers []artifactMatcherWire `json:"artifact_matchers,omitempty"` @@ -196,6 +268,30 @@ func setArtifactAllowlistRequestFromWire(w *setArtifactAllowlistRequestWire) (*S }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SetArtifactAllowlistRequest) MarshalJSON() ([]byte, error) { + w, err := setArtifactAllowlistRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SetArtifactAllowlistRequest) UnmarshalJSON(data []byte) error { + var w setArtifactAllowlistRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := setArtifactAllowlistRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/catalogs/CHANGELOG.md b/uc/catalogs/CHANGELOG.md index 683ad314..b7192c93 100644 --- a/uc/catalogs/CHANGELOG.md +++ b/uc/catalogs/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/uc/catalogs/internal/version.go b/uc/catalogs/internal/version.go index c02653ef..d905e10b 100644 --- a/uc/catalogs/internal/version.go +++ b/uc/catalogs/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-catalogs" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/uc/catalogs/v1/wire.go b/uc/catalogs/v1/wire.go index 18f3aa9d..0e56b351 100644 --- a/uc/catalogs/v1/wire.go +++ b/uc/catalogs/v1/wire.go @@ -80,6 +80,30 @@ func azureEncryptionSettingsFromWire(w *azureEncryptionSettingsWire) (*AzureEncr }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AzureEncryptionSettings) MarshalJSON() ([]byte, error) { + w, err := azureEncryptionSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AzureEncryptionSettings) UnmarshalJSON(data []byte) error { + var w azureEncryptionSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := azureEncryptionSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type catalogInfoWire struct { Name *string `json:"name,omitempty"` Owner *string `json:"owner,omitempty"` @@ -222,6 +246,30 @@ func catalogInfoFromWire(w *catalogInfoWire) (*CatalogInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CatalogInfo) MarshalJSON() ([]byte, error) { + w, err := catalogInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CatalogInfo) UnmarshalJSON(data []byte) error { + var w catalogInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := catalogInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCatalogRequestWire struct { Name *string `json:"name,omitempty"` Owner *string `json:"owner,omitempty"` @@ -364,6 +412,30 @@ func createCatalogRequestFromWire(w *createCatalogRequestWire) (*CreateCatalogRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCatalogRequest) MarshalJSON() ([]byte, error) { + w, err := createCatalogRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCatalogRequest) UnmarshalJSON(data []byte) error { + var w createCatalogRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCatalogRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCatalogRequestWire struct { NameArg *string `json:"name_arg,omitempty"` Force *bool `json:"force,omitempty"` @@ -389,6 +461,30 @@ func deleteCatalogRequestFromWire(w *deleteCatalogRequestWire) (*DeleteCatalogRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCatalogRequest) MarshalJSON() ([]byte, error) { + w, err := deleteCatalogRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCatalogRequest) UnmarshalJSON(data []byte) error { + var w deleteCatalogRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCatalogRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCatalogResponseWire struct { } @@ -406,6 +502,30 @@ func deleteCatalogResponseFromWire(w *deleteCatalogResponseWire) (*DeleteCatalog return &DeleteCatalogResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCatalogResponse) MarshalJSON() ([]byte, error) { + w, err := deleteCatalogResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCatalogResponse) UnmarshalJSON(data []byte) error { + var w deleteCatalogResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCatalogResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type effectivePredictiveOptimizationFlagWire struct { Value *string `json:"value,omitempty"` InheritedFromType *string `json:"inherited_from_type,omitempty"` @@ -434,6 +554,30 @@ func effectivePredictiveOptimizationFlagFromWire(w *effectivePredictiveOptimizat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EffectivePredictiveOptimizationFlag) MarshalJSON() ([]byte, error) { + w, err := effectivePredictiveOptimizationFlagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EffectivePredictiveOptimizationFlag) UnmarshalJSON(data []byte) error { + var w effectivePredictiveOptimizationFlagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := effectivePredictiveOptimizationFlagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type encryptionSettingsWire struct { CustomerManagedKeyId *string `json:"customer_managed_key_id,omitempty"` AzureKeyVaultKeyId *string `json:"azure_key_vault_key_id,omitempty"` @@ -470,6 +614,30 @@ func encryptionSettingsFromWire(w *encryptionSettingsWire) (*EncryptionSettings, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EncryptionSettings) MarshalJSON() ([]byte, error) { + w, err := encryptionSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EncryptionSettings) UnmarshalJSON(data []byte) error { + var w encryptionSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := encryptionSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCatalogRequestWire struct { NameArg *string `json:"name_arg,omitempty"` IncludeBrowse *bool `json:"include_browse,omitempty"` @@ -495,6 +663,30 @@ func getCatalogRequestFromWire(w *getCatalogRequestWire) (*GetCatalogRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCatalogRequest) MarshalJSON() ([]byte, error) { + w, err := getCatalogRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCatalogRequest) UnmarshalJSON(data []byte) error { + var w getCatalogRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCatalogRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCatalogsRequestWire struct { IncludeBrowse *bool `json:"include_browse,omitempty"` MaxResults *int `json:"max_results,omitempty"` @@ -526,6 +718,30 @@ func listCatalogsRequestFromWire(w *listCatalogsRequestWire) (*ListCatalogsReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCatalogsRequest) MarshalJSON() ([]byte, error) { + w, err := listCatalogsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCatalogsRequest) UnmarshalJSON(data []byte) error { + var w listCatalogsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCatalogsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCatalogsResponseWire struct { Catalogs []catalogInfoWire `json:"catalogs,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -559,6 +775,30 @@ func listCatalogsResponseFromWire(w *listCatalogsResponseWire) (*ListCatalogsRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCatalogsResponse) MarshalJSON() ([]byte, error) { + w, err := listCatalogsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCatalogsResponse) UnmarshalJSON(data []byte) error { + var w listCatalogsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCatalogsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type provisioningInfoWire struct { State ProvisioningInfo_State `json:"state,omitempty"` } @@ -581,6 +821,30 @@ func provisioningInfoFromWire(w *provisioningInfoWire) (*ProvisioningInfo, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProvisioningInfo) MarshalJSON() ([]byte, error) { + w, err := provisioningInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProvisioningInfo) UnmarshalJSON(data []byte) error { + var w provisioningInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := provisioningInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCatalogRequestWire struct { NameArg *string `json:"name_arg,omitempty"` NewName *string `json:"new_name,omitempty"` @@ -729,6 +993,30 @@ func updateCatalogRequestFromWire(w *updateCatalogRequestWire) (*UpdateCatalogRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCatalogRequest) MarshalJSON() ([]byte, error) { + w, err := updateCatalogRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCatalogRequest) UnmarshalJSON(data []byte) error { + var w updateCatalogRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCatalogRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/connections/CHANGELOG.md b/uc/connections/CHANGELOG.md index ba40f099..d80ae434 100644 --- a/uc/connections/CHANGELOG.md +++ b/uc/connections/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.8.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.7.0 (2026-11-11) ## Release v0.6.0 (2026-11-10) diff --git a/uc/connections/internal/version.go b/uc/connections/internal/version.go index 76aca6bd..c9d69f74 100644 --- a/uc/connections/internal/version.go +++ b/uc/connections/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-connections" -const Version = "0.7.0" +const Version = "0.8.0" diff --git a/uc/connections/v1/wire.go b/uc/connections/v1/wire.go index 6ad0a5c9..8f6f9021 100644 --- a/uc/connections/v1/wire.go +++ b/uc/connections/v1/wire.go @@ -163,6 +163,30 @@ func connectionInfoFromWire(w *connectionInfoWire) (*ConnectionInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ConnectionInfo) MarshalJSON() ([]byte, error) { + w, err := connectionInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ConnectionInfo) UnmarshalJSON(data []byte) error { + var w connectionInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := connectionInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createConnectionRequestWire struct { Parent *string `json:"parent,omitempty"` Name *string `json:"name,omitempty"` @@ -277,6 +301,30 @@ func createConnectionRequestFromWire(w *createConnectionRequestWire) (*CreateCon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateConnectionRequest) MarshalJSON() ([]byte, error) { + w, err := createConnectionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateConnectionRequest) UnmarshalJSON(data []byte) error { + var w createConnectionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createConnectionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteConnectionRequestWire struct { NameArg *string `json:"name_arg,omitempty"` } @@ -299,6 +347,30 @@ func deleteConnectionRequestFromWire(w *deleteConnectionRequestWire) (*DeleteCon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteConnectionRequest) MarshalJSON() ([]byte, error) { + w, err := deleteConnectionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteConnectionRequest) UnmarshalJSON(data []byte) error { + var w deleteConnectionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteConnectionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteConnectionResponseWire struct { } @@ -316,6 +388,30 @@ func deleteConnectionResponseFromWire(w *deleteConnectionResponseWire) (*DeleteC return &DeleteConnectionResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteConnectionResponse) MarshalJSON() ([]byte, error) { + w, err := deleteConnectionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteConnectionResponse) UnmarshalJSON(data []byte) error { + var w deleteConnectionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteConnectionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type environmentSettingsWire struct { JavaDependencies []string `json:"java_dependencies,omitempty"` EnvironmentVersion *string `json:"environment_version,omitempty"` @@ -341,6 +437,30 @@ func environmentSettingsFromWire(w *environmentSettingsWire) (*EnvironmentSettin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EnvironmentSettings) MarshalJSON() ([]byte, error) { + w, err := environmentSettingsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EnvironmentSettings) UnmarshalJSON(data []byte) error { + var w environmentSettingsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := environmentSettingsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getConnectionRequestWire struct { NameArg *string `json:"name_arg,omitempty"` } @@ -363,6 +483,30 @@ func getConnectionRequestFromWire(w *getConnectionRequestWire) (*GetConnectionRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetConnectionRequest) MarshalJSON() ([]byte, error) { + w, err := getConnectionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetConnectionRequest) UnmarshalJSON(data []byte) error { + var w getConnectionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getConnectionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listConnectionsRequestWire struct { MaxResults *int `json:"max_results,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -391,6 +535,30 @@ func listConnectionsRequestFromWire(w *listConnectionsRequestWire) (*ListConnect }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListConnectionsRequest) MarshalJSON() ([]byte, error) { + w, err := listConnectionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListConnectionsRequest) UnmarshalJSON(data []byte) error { + var w listConnectionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listConnectionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listConnectionsResponseWire struct { Connections []connectionInfoWire `json:"connections,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -424,6 +592,30 @@ func listConnectionsResponseFromWire(w *listConnectionsResponseWire) (*ListConne }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListConnectionsResponse) MarshalJSON() ([]byte, error) { + w, err := listConnectionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListConnectionsResponse) UnmarshalJSON(data []byte) error { + var w listConnectionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listConnectionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type provisioningInfoWire struct { State ProvisioningInfo_State `json:"state,omitempty"` } @@ -446,6 +638,30 @@ func provisioningInfoFromWire(w *provisioningInfoWire) (*ProvisioningInfo, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProvisioningInfo) MarshalJSON() ([]byte, error) { + w, err := provisioningInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProvisioningInfo) UnmarshalJSON(data []byte) error { + var w provisioningInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := provisioningInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateConnectionRequestWire struct { NameArg *string `json:"name_arg,omitempty"` NewName *string `json:"new_name,omitempty"` @@ -563,6 +779,30 @@ func updateConnectionRequestFromWire(w *updateConnectionRequestWire) (*UpdateCon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateConnectionRequest) MarshalJSON() ([]byte, error) { + w, err := updateConnectionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateConnectionRequest) UnmarshalJSON(data []byte) error { + var w updateConnectionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateConnectionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/credentials/CHANGELOG.md b/uc/credentials/CHANGELOG.md index 864b753c..79c44032 100644 --- a/uc/credentials/CHANGELOG.md +++ b/uc/credentials/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/uc/credentials/internal/version.go b/uc/credentials/internal/version.go index e1968a06..43ac47a5 100644 --- a/uc/credentials/internal/version.go +++ b/uc/credentials/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-credentials" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/uc/credentials/v1/wire.go b/uc/credentials/v1/wire.go index 80b020d4..a17b99bd 100644 --- a/uc/credentials/v1/wire.go +++ b/uc/credentials/v1/wire.go @@ -91,6 +91,30 @@ func accountsCreateStorageCredentialRequestFromWire(w *accountsCreateStorageCred }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsCreateStorageCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := accountsCreateStorageCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsCreateStorageCredentialRequest) UnmarshalJSON(data []byte) error { + var w accountsCreateStorageCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsCreateStorageCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsCreateStorageCredentialResponseWire struct { CredentialInfo *storageCredentialInfoWire `json:"credential_info,omitempty"` } @@ -121,6 +145,30 @@ func accountsCreateStorageCredentialResponseFromWire(w *accountsCreateStorageCre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsCreateStorageCredentialResponse) MarshalJSON() ([]byte, error) { + w, err := accountsCreateStorageCredentialResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsCreateStorageCredentialResponse) UnmarshalJSON(data []byte) error { + var w accountsCreateStorageCredentialResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsCreateStorageCredentialResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsDeleteStorageCredentialRequestWire struct { AccountId *string `json:"account_id,omitempty"` MetastoreId *string `json:"metastore_id,omitempty"` @@ -152,6 +200,30 @@ func accountsDeleteStorageCredentialRequestFromWire(w *accountsDeleteStorageCred }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsDeleteStorageCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := accountsDeleteStorageCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsDeleteStorageCredentialRequest) UnmarshalJSON(data []byte) error { + var w accountsDeleteStorageCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsDeleteStorageCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsDeleteStorageCredentialResponseWire struct { } @@ -169,6 +241,30 @@ func accountsDeleteStorageCredentialResponseFromWire(w *accountsDeleteStorageCre return &AccountsDeleteStorageCredentialResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsDeleteStorageCredentialResponse) MarshalJSON() ([]byte, error) { + w, err := accountsDeleteStorageCredentialResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsDeleteStorageCredentialResponse) UnmarshalJSON(data []byte) error { + var w accountsDeleteStorageCredentialResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsDeleteStorageCredentialResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsGetStorageCredentialRequestWire struct { AccountId *string `json:"account_id,omitempty"` MetastoreId *string `json:"metastore_id,omitempty"` @@ -197,6 +293,30 @@ func accountsGetStorageCredentialRequestFromWire(w *accountsGetStorageCredential }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsGetStorageCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := accountsGetStorageCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsGetStorageCredentialRequest) UnmarshalJSON(data []byte) error { + var w accountsGetStorageCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsGetStorageCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsGetStorageCredentialResponseWire struct { CredentialInfo *storageCredentialInfoWire `json:"credential_info,omitempty"` } @@ -227,6 +347,30 @@ func accountsGetStorageCredentialResponseFromWire(w *accountsGetStorageCredentia }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsGetStorageCredentialResponse) MarshalJSON() ([]byte, error) { + w, err := accountsGetStorageCredentialResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsGetStorageCredentialResponse) UnmarshalJSON(data []byte) error { + var w accountsGetStorageCredentialResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsGetStorageCredentialResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsListStorageCredentialsRequestWire struct { AccountId *string `json:"account_id,omitempty"` MetastoreId *string `json:"metastore_id,omitempty"` @@ -252,6 +396,30 @@ func accountsListStorageCredentialsRequestFromWire(w *accountsListStorageCredent }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsListStorageCredentialsRequest) MarshalJSON() ([]byte, error) { + w, err := accountsListStorageCredentialsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsListStorageCredentialsRequest) UnmarshalJSON(data []byte) error { + var w accountsListStorageCredentialsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsListStorageCredentialsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsListStorageCredentialsResponseWire struct { StorageCredentials []storageCredentialInfoWire `json:"storage_credentials,omitempty"` } @@ -282,6 +450,30 @@ func accountsListStorageCredentialsResponseFromWire(w *accountsListStorageCreden }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsListStorageCredentialsResponse) MarshalJSON() ([]byte, error) { + w, err := accountsListStorageCredentialsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsListStorageCredentialsResponse) UnmarshalJSON(data []byte) error { + var w accountsListStorageCredentialsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsListStorageCredentialsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsUpdateStorageCredentialRequestWire struct { AccountId *string `json:"account_id,omitempty"` MetastoreId *string `json:"metastore_id,omitempty"` @@ -324,6 +516,30 @@ func accountsUpdateStorageCredentialRequestFromWire(w *accountsUpdateStorageCred }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsUpdateStorageCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := accountsUpdateStorageCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsUpdateStorageCredentialRequest) UnmarshalJSON(data []byte) error { + var w accountsUpdateStorageCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsUpdateStorageCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsUpdateStorageCredentialResponseWire struct { CredentialInfo *storageCredentialInfoWire `json:"credential_info,omitempty"` } @@ -354,6 +570,30 @@ func accountsUpdateStorageCredentialResponseFromWire(w *accountsUpdateStorageCre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsUpdateStorageCredentialResponse) MarshalJSON() ([]byte, error) { + w, err := accountsUpdateStorageCredentialResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsUpdateStorageCredentialResponse) UnmarshalJSON(data []byte) error { + var w accountsUpdateStorageCredentialResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsUpdateStorageCredentialResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type awsCredentialsWire struct { StsRole *awsCredentials_StsRoleWire `json:"sts_role,omitempty"` } @@ -406,6 +646,30 @@ func awsCredentialsFromWire(w *awsCredentialsWire) (*AwsCredentials, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AwsCredentials) MarshalJSON() ([]byte, error) { + w, err := awsCredentialsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AwsCredentials) UnmarshalJSON(data []byte) error { + var w awsCredentialsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := awsCredentialsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type awsCredentials_StsRoleWire struct { RoleArn *string `json:"role_arn,omitempty"` } @@ -428,6 +692,30 @@ func awsCredentials_StsRoleFromWire(w *awsCredentials_StsRoleWire) (*AwsCredenti }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AwsCredentials_StsRole) MarshalJSON() ([]byte, error) { + w, err := awsCredentials_StsRoleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AwsCredentials_StsRole) UnmarshalJSON(data []byte) error { + var w awsCredentials_StsRoleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := awsCredentials_StsRoleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type awsIamRoleWire struct { RoleArn *string `json:"role_arn,omitempty"` UnityCatalogIamArn *string `json:"unity_catalog_iam_arn,omitempty"` @@ -456,6 +744,30 @@ func awsIamRoleFromWire(w *awsIamRoleWire) (*AwsIamRole, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AwsIamRole) MarshalJSON() ([]byte, error) { + w, err := awsIamRoleToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AwsIamRole) UnmarshalJSON(data []byte) error { + var w awsIamRoleWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := awsIamRoleFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type azureActiveDirectoryTokenWire struct { AadToken *string `json:"aad_token,omitempty"` } @@ -478,6 +790,30 @@ func azureActiveDirectoryTokenFromWire(w *azureActiveDirectoryTokenWire) (*Azure }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AzureActiveDirectoryToken) MarshalJSON() ([]byte, error) { + w, err := azureActiveDirectoryTokenToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AzureActiveDirectoryToken) UnmarshalJSON(data []byte) error { + var w azureActiveDirectoryTokenWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := azureActiveDirectoryTokenFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type azureManagedIdentityWire struct { AccessConnectorId *string `json:"access_connector_id,omitempty"` ManagedIdentityId *string `json:"managed_identity_id,omitempty"` @@ -506,6 +842,30 @@ func azureManagedIdentityFromWire(w *azureManagedIdentityWire) (*AzureManagedIde }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AzureManagedIdentity) MarshalJSON() ([]byte, error) { + w, err := azureManagedIdentityToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AzureManagedIdentity) UnmarshalJSON(data []byte) error { + var w azureManagedIdentityWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := azureManagedIdentityFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type azureServicePrincipalWire struct { DirectoryId *string `json:"directory_id,omitempty"` ApplicationId *string `json:"application_id,omitempty"` @@ -534,6 +894,30 @@ func azureServicePrincipalFromWire(w *azureServicePrincipalWire) (*AzureServiceP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AzureServicePrincipal) MarshalJSON() ([]byte, error) { + w, err := azureServicePrincipalToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AzureServicePrincipal) UnmarshalJSON(data []byte) error { + var w azureServicePrincipalWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := azureServicePrincipalFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type azureUserDelegationSasWire struct { SasToken *string `json:"sas_token,omitempty"` } @@ -556,6 +940,30 @@ func azureUserDelegationSasFromWire(w *azureUserDelegationSasWire) (*AzureUserDe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AzureUserDelegationSas) MarshalJSON() ([]byte, error) { + w, err := azureUserDelegationSasToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AzureUserDelegationSas) UnmarshalJSON(data []byte) error { + var w azureUserDelegationSasWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := azureUserDelegationSasFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cloudflareApiTokenWire struct { AccessKeyId *string `json:"access_key_id,omitempty"` SecretAccessKey *string `json:"secret_access_key,omitempty"` @@ -584,6 +992,30 @@ func cloudflareApiTokenFromWire(w *cloudflareApiTokenWire) (*CloudflareApiToken, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CloudflareApiToken) MarshalJSON() ([]byte, error) { + w, err := cloudflareApiTokenToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CloudflareApiToken) UnmarshalJSON(data []byte) error { + var w cloudflareApiTokenWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cloudflareApiTokenFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAccountsStorageCredentialWire struct { Name *string `json:"name,omitempty"` AwsIamRole *awsIamRoleWire `json:"aws_iam_role,omitempty"` @@ -791,6 +1223,30 @@ func createAccountsStorageCredentialFromWire(w *createAccountsStorageCredentialW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAccountsStorageCredential) MarshalJSON() ([]byte, error) { + w, err := createAccountsStorageCredentialToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAccountsStorageCredential) UnmarshalJSON(data []byte) error { + var w createAccountsStorageCredentialWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAccountsStorageCredentialFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCredentialAwsCredentialsWire struct { StsRole *awsCredentials_StsRoleWire `json:"sts_role,omitempty"` } @@ -843,6 +1299,30 @@ func createCredentialAwsCredentialsFromWire(w *createCredentialAwsCredentialsWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCredentialAwsCredentials) MarshalJSON() ([]byte, error) { + w, err := createCredentialAwsCredentialsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCredentialAwsCredentials) UnmarshalJSON(data []byte) error { + var w createCredentialAwsCredentialsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCredentialAwsCredentialsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCredentialRequestWire struct { SkipValidation *bool `json:"skip_validation,omitempty"` Name *string `json:"name,omitempty"` @@ -1053,6 +1533,30 @@ func createCredentialRequestFromWire(w *createCredentialRequestWire) (*CreateCre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := createCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCredentialRequest) UnmarshalJSON(data []byte) error { + var w createCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createCredentialsRequestWire struct { AccountId *string `json:"account_id,omitempty"` CredentialsName *string `json:"credentials_name,omitempty"` @@ -1111,6 +1615,30 @@ func createCredentialsRequestFromWire(w *createCredentialsRequestWire) (*CreateC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateCredentialsRequest) MarshalJSON() ([]byte, error) { + w, err := createCredentialsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateCredentialsRequest) UnmarshalJSON(data []byte) error { + var w createCredentialsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createCredentialsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createStorageCredentialRequestWire struct { SkipValidation *bool `json:"skip_validation,omitempty"` Name *string `json:"name,omitempty"` @@ -1321,6 +1849,30 @@ func createStorageCredentialRequestFromWire(w *createStorageCredentialRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateStorageCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := createStorageCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateStorageCredentialRequest) UnmarshalJSON(data []byte) error { + var w createStorageCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createStorageCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type credentialInfoWire struct { Name *string `json:"name,omitempty"` AwsIamRole *awsIamRoleWire `json:"aws_iam_role,omitempty"` @@ -1528,6 +2080,30 @@ func credentialInfoFromWire(w *credentialInfoWire) (*CredentialInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CredentialInfo) MarshalJSON() ([]byte, error) { + w, err := credentialInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CredentialInfo) UnmarshalJSON(data []byte) error { + var w credentialInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := credentialInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type credentialsWire struct { CredentialsId *string `json:"credentials_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -1600,6 +2176,30 @@ func credentialsFromWire(w *credentialsWire) (*Credentials, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Credentials) MarshalJSON() ([]byte, error) { + w, err := credentialsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Credentials) UnmarshalJSON(data []byte) error { + var w credentialsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := credentialsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type databricksGcpServiceAccountWire struct { Email *string `json:"email,omitempty"` PrivateKeyId *string `json:"private_key_id,omitempty"` @@ -1628,6 +2228,30 @@ func databricksGcpServiceAccountFromWire(w *databricksGcpServiceAccountWire) (*D }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DatabricksGcpServiceAccount) MarshalJSON() ([]byte, error) { + w, err := databricksGcpServiceAccountToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DatabricksGcpServiceAccount) UnmarshalJSON(data []byte) error { + var w databricksGcpServiceAccountWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := databricksGcpServiceAccountFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCredentialRequestWire struct { NameArg *string `json:"name_arg,omitempty"` Force *bool `json:"force,omitempty"` @@ -1653,6 +2277,30 @@ func deleteCredentialRequestFromWire(w *deleteCredentialRequestWire) (*DeleteCre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := deleteCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCredentialRequest) UnmarshalJSON(data []byte) error { + var w deleteCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCredentialResponseWire struct { } @@ -1670,6 +2318,30 @@ func deleteCredentialResponseFromWire(w *deleteCredentialResponseWire) (*DeleteC return &DeleteCredentialResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCredentialResponse) MarshalJSON() ([]byte, error) { + w, err := deleteCredentialResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCredentialResponse) UnmarshalJSON(data []byte) error { + var w deleteCredentialResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCredentialResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteCredentialsRequestWire struct { CredentialsId *string `json:"credentials_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -1695,6 +2367,30 @@ func deleteCredentialsRequestFromWire(w *deleteCredentialsRequestWire) (*DeleteC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteCredentialsRequest) MarshalJSON() ([]byte, error) { + w, err := deleteCredentialsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteCredentialsRequest) UnmarshalJSON(data []byte) error { + var w deleteCredentialsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteCredentialsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteStorageCredentialRequestWire struct { NameArg *string `json:"name_arg,omitempty"` Force *bool `json:"force,omitempty"` @@ -1720,6 +2416,30 @@ func deleteStorageCredentialRequestFromWire(w *deleteStorageCredentialRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteStorageCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := deleteStorageCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteStorageCredentialRequest) UnmarshalJSON(data []byte) error { + var w deleteStorageCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteStorageCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteStorageCredentialResponseWire struct { } @@ -1737,6 +2457,30 @@ func deleteStorageCredentialResponseFromWire(w *deleteStorageCredentialResponseW return &DeleteStorageCredentialResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteStorageCredentialResponse) MarshalJSON() ([]byte, error) { + w, err := deleteStorageCredentialResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteStorageCredentialResponse) UnmarshalJSON(data []byte) error { + var w deleteStorageCredentialResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteStorageCredentialResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gcpOauthTokenWire struct { OauthToken *string `json:"oauth_token,omitempty"` } @@ -1759,6 +2503,30 @@ func gcpOauthTokenFromWire(w *gcpOauthTokenWire) (*GcpOauthToken, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GcpOauthToken) MarshalJSON() ([]byte, error) { + w, err := gcpOauthTokenToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GcpOauthToken) UnmarshalJSON(data []byte) error { + var w gcpOauthTokenWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gcpOauthTokenFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gcpServiceAccountKeyWire struct { Email *string `json:"email,omitempty"` PrivateKeyId *string `json:"private_key_id,omitempty"` @@ -1787,6 +2555,30 @@ func gcpServiceAccountKeyFromWire(w *gcpServiceAccountKeyWire) (*GcpServiceAccou }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GcpServiceAccountKey) MarshalJSON() ([]byte, error) { + w, err := gcpServiceAccountKeyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GcpServiceAccountKey) UnmarshalJSON(data []byte) error { + var w gcpServiceAccountKeyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gcpServiceAccountKeyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type generateTemporaryPathCredentialRequestWire struct { Url *string `json:"url,omitempty"` Operation PathOperation `json:"operation,omitempty"` @@ -1815,6 +2607,30 @@ func generateTemporaryPathCredentialRequestFromWire(w *generateTemporaryPathCred }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenerateTemporaryPathCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := generateTemporaryPathCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenerateTemporaryPathCredentialRequest) UnmarshalJSON(data []byte) error { + var w generateTemporaryPathCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := generateTemporaryPathCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type generateTemporaryPathCredentialResponseWire struct { AwsTempCredentials *temporaryAwsCredentialsWire `json:"aws_temp_credentials,omitempty"` AzureUserDelegationSas *azureUserDelegationSasWire `json:"azure_user_delegation_sas,omitempty"` @@ -1961,6 +2777,30 @@ func generateTemporaryPathCredentialResponseFromWire(w *generateTemporaryPathCre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenerateTemporaryPathCredentialResponse) MarshalJSON() ([]byte, error) { + w, err := generateTemporaryPathCredentialResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenerateTemporaryPathCredentialResponse) UnmarshalJSON(data []byte) error { + var w generateTemporaryPathCredentialResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := generateTemporaryPathCredentialResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type generateTemporaryServiceCredentialRequestWire struct { CredentialName *string `json:"credential_name,omitempty"` AzureOptions *generateTemporaryServiceCredentialRequest_AzureOptionsWire `json:"azure_options,omitempty"` @@ -2036,6 +2876,30 @@ func generateTemporaryServiceCredentialRequestFromWire(w *generateTemporaryServi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenerateTemporaryServiceCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := generateTemporaryServiceCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenerateTemporaryServiceCredentialRequest) UnmarshalJSON(data []byte) error { + var w generateTemporaryServiceCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := generateTemporaryServiceCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type generateTemporaryServiceCredentialRequest_AzureOptionsWire struct { Resources []string `json:"resources,omitempty"` } @@ -2058,6 +2922,30 @@ func generateTemporaryServiceCredentialRequest_AzureOptionsFromWire(w *generateT }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenerateTemporaryServiceCredentialRequest_AzureOptions) MarshalJSON() ([]byte, error) { + w, err := generateTemporaryServiceCredentialRequest_AzureOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenerateTemporaryServiceCredentialRequest_AzureOptions) UnmarshalJSON(data []byte) error { + var w generateTemporaryServiceCredentialRequest_AzureOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := generateTemporaryServiceCredentialRequest_AzureOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type generateTemporaryServiceCredentialRequest_GcpOptionsWire struct { Scopes []string `json:"scopes,omitempty"` } @@ -2080,6 +2968,30 @@ func generateTemporaryServiceCredentialRequest_GcpOptionsFromWire(w *generateTem }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenerateTemporaryServiceCredentialRequest_GcpOptions) MarshalJSON() ([]byte, error) { + w, err := generateTemporaryServiceCredentialRequest_GcpOptionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenerateTemporaryServiceCredentialRequest_GcpOptions) UnmarshalJSON(data []byte) error { + var w generateTemporaryServiceCredentialRequest_GcpOptionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := generateTemporaryServiceCredentialRequest_GcpOptionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type generateTemporaryTableCredentialRequestWire struct { TableId *string `json:"table_id,omitempty"` Operation TableOperation `json:"operation,omitempty"` @@ -2105,6 +3017,30 @@ func generateTemporaryTableCredentialRequestFromWire(w *generateTemporaryTableCr }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenerateTemporaryTableCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := generateTemporaryTableCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenerateTemporaryTableCredentialRequest) UnmarshalJSON(data []byte) error { + var w generateTemporaryTableCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := generateTemporaryTableCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type generateTemporaryTableCredentialResponseWire struct { AwsTempCredentials *temporaryAwsCredentialsWire `json:"aws_temp_credentials,omitempty"` AzureUserDelegationSas *azureUserDelegationSasWire `json:"azure_user_delegation_sas,omitempty"` @@ -2251,6 +3187,30 @@ func generateTemporaryTableCredentialResponseFromWire(w *generateTemporaryTableC }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenerateTemporaryTableCredentialResponse) MarshalJSON() ([]byte, error) { + w, err := generateTemporaryTableCredentialResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenerateTemporaryTableCredentialResponse) UnmarshalJSON(data []byte) error { + var w generateTemporaryTableCredentialResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := generateTemporaryTableCredentialResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type generateTemporaryVolumeCredentialRequestWire struct { VolumeId *string `json:"volume_id,omitempty"` Operation VolumeOperation `json:"operation,omitempty"` @@ -2276,6 +3236,30 @@ func generateTemporaryVolumeCredentialRequestFromWire(w *generateTemporaryVolume }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenerateTemporaryVolumeCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := generateTemporaryVolumeCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenerateTemporaryVolumeCredentialRequest) UnmarshalJSON(data []byte) error { + var w generateTemporaryVolumeCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := generateTemporaryVolumeCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type generateTemporaryVolumeCredentialResponseWire struct { AwsTempCredentials *temporaryAwsCredentialsWire `json:"aws_temp_credentials,omitempty"` AzureUserDelegationSas *azureUserDelegationSasWire `json:"azure_user_delegation_sas,omitempty"` @@ -2422,6 +3406,30 @@ func generateTemporaryVolumeCredentialResponseFromWire(w *generateTemporaryVolum }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GenerateTemporaryVolumeCredentialResponse) MarshalJSON() ([]byte, error) { + w, err := generateTemporaryVolumeCredentialResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GenerateTemporaryVolumeCredentialResponse) UnmarshalJSON(data []byte) error { + var w generateTemporaryVolumeCredentialResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := generateTemporaryVolumeCredentialResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCredentialRequestWire struct { NameArg *string `json:"name_arg,omitempty"` } @@ -2439,9 +3447,33 @@ func getCredentialRequestFromWire(w *getCredentialRequestWire) (*GetCredentialRe if w == nil { return nil, nil } - return &GetCredentialRequest{ - NameArg: w.NameArg, - }, nil + return &GetCredentialRequest{ + NameArg: w.NameArg, + }, nil +} + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := getCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCredentialRequest) UnmarshalJSON(data []byte) error { + var w getCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil } type getCredentialsRequestWire struct { @@ -2469,6 +3501,30 @@ func getCredentialsRequestFromWire(w *getCredentialsRequestWire) (*GetCredential }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCredentialsRequest) MarshalJSON() ([]byte, error) { + w, err := getCredentialsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCredentialsRequest) UnmarshalJSON(data []byte) error { + var w getCredentialsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCredentialsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getStorageCredentialRequestWire struct { NameArg *string `json:"name_arg,omitempty"` } @@ -2491,6 +3547,30 @@ func getStorageCredentialRequestFromWire(w *getStorageCredentialRequestWire) (*G }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetStorageCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := getStorageCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetStorageCredentialRequest) UnmarshalJSON(data []byte) error { + var w getStorageCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getStorageCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCredentialsPublicRequestWire struct { AccountId *string `json:"account_id,omitempty"` } @@ -2513,6 +3593,30 @@ func listCredentialsPublicRequestFromWire(w *listCredentialsPublicRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCredentialsPublicRequest) MarshalJSON() ([]byte, error) { + w, err := listCredentialsPublicRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCredentialsPublicRequest) UnmarshalJSON(data []byte) error { + var w listCredentialsPublicRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCredentialsPublicRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCredentialsRequestWire struct { IncludeUnbound *bool `json:"include_unbound,omitempty"` MaxResults *int `json:"max_results,omitempty"` @@ -2541,6 +3645,30 @@ func listCredentialsRequestFromWire(w *listCredentialsRequestWire) (*ListCredent }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCredentialsRequest) MarshalJSON() ([]byte, error) { + w, err := listCredentialsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCredentialsRequest) UnmarshalJSON(data []byte) error { + var w listCredentialsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCredentialsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCredentialsRequest_ResponseWire struct { Credentials []credentialInfoWire `json:"credentials,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2574,6 +3702,30 @@ func listCredentialsRequest_ResponseFromWire(w *listCredentialsRequest_ResponseW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCredentialsRequest_Response) MarshalJSON() ([]byte, error) { + w, err := listCredentialsRequest_ResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCredentialsRequest_Response) UnmarshalJSON(data []byte) error { + var w listCredentialsRequest_ResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCredentialsRequest_ResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listCredentialsResponseWire struct { Credentials []credentialsWire `json:"credentials,omitempty"` } @@ -2604,6 +3756,30 @@ func listCredentialsResponseFromWire(w *listCredentialsResponseWire) (*ListCrede }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListCredentialsResponse) MarshalJSON() ([]byte, error) { + w, err := listCredentialsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListCredentialsResponse) UnmarshalJSON(data []byte) error { + var w listCredentialsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listCredentialsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listStorageCredentialsRequestWire struct { IncludeUnbound *bool `json:"include_unbound,omitempty"` MaxResults *int `json:"max_results,omitempty"` @@ -2632,6 +3808,30 @@ func listStorageCredentialsRequestFromWire(w *listStorageCredentialsRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListStorageCredentialsRequest) MarshalJSON() ([]byte, error) { + w, err := listStorageCredentialsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListStorageCredentialsRequest) UnmarshalJSON(data []byte) error { + var w listStorageCredentialsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listStorageCredentialsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listStorageCredentialsResponseWire struct { StorageCredentials []storageCredentialInfoWire `json:"storage_credentials,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -2665,6 +3865,30 @@ func listStorageCredentialsResponseFromWire(w *listStorageCredentialsResponseWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListStorageCredentialsResponse) MarshalJSON() ([]byte, error) { + w, err := listStorageCredentialsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListStorageCredentialsResponse) UnmarshalJSON(data []byte) error { + var w listStorageCredentialsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listStorageCredentialsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type r2CredentialsWire struct { AccessKeyId *string `json:"access_key_id,omitempty"` SecretAccessKey *string `json:"secret_access_key,omitempty"` @@ -2693,6 +3917,30 @@ func r2CredentialsFromWire(w *r2CredentialsWire) (*R2Credentials, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v R2Credentials) MarshalJSON() ([]byte, error) { + w, err := r2CredentialsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *R2Credentials) UnmarshalJSON(data []byte) error { + var w r2CredentialsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := r2CredentialsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type storageCredentialInfoWire struct { Name *string `json:"name,omitempty"` AwsIamRole *awsIamRoleWire `json:"aws_iam_role,omitempty"` @@ -2900,6 +4148,30 @@ func storageCredentialInfoFromWire(w *storageCredentialInfoWire) (*StorageCreden }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StorageCredentialInfo) MarshalJSON() ([]byte, error) { + w, err := storageCredentialInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StorageCredentialInfo) UnmarshalJSON(data []byte) error { + var w storageCredentialInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := storageCredentialInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type temporaryAwsCredentialsWire struct { AccessKeyId *string `json:"access_key_id,omitempty"` SecretAccessKey *string `json:"secret_access_key,omitempty"` @@ -2931,6 +4203,30 @@ func temporaryAwsCredentialsFromWire(w *temporaryAwsCredentialsWire) (*Temporary }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TemporaryAwsCredentials) MarshalJSON() ([]byte, error) { + w, err := temporaryAwsCredentialsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TemporaryAwsCredentials) UnmarshalJSON(data []byte) error { + var w temporaryAwsCredentialsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := temporaryAwsCredentialsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type temporaryCredentialsWire struct { AwsTempCredentials *temporaryAwsCredentialsWire `json:"aws_temp_credentials,omitempty"` AzureUserDelegationSas *azureUserDelegationSasWire `json:"azure_user_delegation_sas,omitempty"` @@ -3077,6 +4373,30 @@ func temporaryCredentialsFromWire(w *temporaryCredentialsWire) (*TemporaryCreden }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TemporaryCredentials) MarshalJSON() ([]byte, error) { + w, err := temporaryCredentialsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TemporaryCredentials) UnmarshalJSON(data []byte) error { + var w temporaryCredentialsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := temporaryCredentialsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateAccountsStorageCredentialWire struct { Name *string `json:"name,omitempty"` AwsIamRole *awsIamRoleWire `json:"aws_iam_role,omitempty"` @@ -3284,6 +4604,30 @@ func updateAccountsStorageCredentialFromWire(w *updateAccountsStorageCredentialW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateAccountsStorageCredential) MarshalJSON() ([]byte, error) { + w, err := updateAccountsStorageCredentialToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateAccountsStorageCredential) UnmarshalJSON(data []byte) error { + var w updateAccountsStorageCredentialWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateAccountsStorageCredentialFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCredentialRequestWire struct { NameArg *string `json:"name_arg,omitempty"` NewName *string `json:"new_name,omitempty"` @@ -3503,6 +4847,30 @@ func updateCredentialRequestFromWire(w *updateCredentialRequestWire) (*UpdateCre }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := updateCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCredentialRequest) UnmarshalJSON(data []byte) error { + var w updateCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateStorageCredentialRequestWire struct { NameArg *string `json:"name_arg,omitempty"` NewName *string `json:"new_name,omitempty"` @@ -3722,6 +5090,30 @@ func updateStorageCredentialRequestFromWire(w *updateStorageCredentialRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateStorageCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := updateStorageCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateStorageCredentialRequest) UnmarshalJSON(data []byte) error { + var w updateStorageCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateStorageCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type validateCredentialRequestWire struct { CredentialName *string `json:"credential_name,omitempty"` AwsIamRole *awsIamRoleWire `json:"aws_iam_role,omitempty"` @@ -3835,6 +5227,30 @@ func validateCredentialRequestFromWire(w *validateCredentialRequestWire) (*Valid }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ValidateCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := validateCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ValidateCredentialRequest) UnmarshalJSON(data []byte) error { + var w validateCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := validateCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type validateCredentialRequest_ValidationResultWire struct { Result ValidateCredentialRequest_Result `json:"result,omitempty"` Message *string `json:"message,omitempty"` @@ -3860,6 +5276,30 @@ func validateCredentialRequest_ValidationResultFromWire(w *validateCredentialReq }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ValidateCredentialRequest_ValidationResult) MarshalJSON() ([]byte, error) { + w, err := validateCredentialRequest_ValidationResultToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ValidateCredentialRequest_ValidationResult) UnmarshalJSON(data []byte) error { + var w validateCredentialRequest_ValidationResultWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := validateCredentialRequest_ValidationResultFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type validateCredentialResponseWire struct { Results []validateCredentialRequest_ValidationResultWire `json:"results,omitempty"` IsDir *bool `json:"isDir,omitempty"` @@ -3893,6 +5333,30 @@ func validateCredentialResponseFromWire(w *validateCredentialResponseWire) (*Val }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ValidateCredentialResponse) MarshalJSON() ([]byte, error) { + w, err := validateCredentialResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ValidateCredentialResponse) UnmarshalJSON(data []byte) error { + var w validateCredentialResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := validateCredentialResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type validateStorageCredentialRequestWire struct { StorageCredentialName *string `json:"storage_credential_name,omitempty"` AwsIamRole *awsIamRoleWire `json:"aws_iam_role,omitempty"` @@ -4046,6 +5510,30 @@ func validateStorageCredentialRequestFromWire(w *validateStorageCredentialReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ValidateStorageCredentialRequest) MarshalJSON() ([]byte, error) { + w, err := validateStorageCredentialRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ValidateStorageCredentialRequest) UnmarshalJSON(data []byte) error { + var w validateStorageCredentialRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := validateStorageCredentialRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type validateStorageCredentialRequest_ValidationResultWire struct { Operation ValidateStorageCredentialRequest_FileOperation `json:"operation,omitempty"` Result ValidateStorageCredentialRequest_Result `json:"result,omitempty"` @@ -4074,6 +5562,30 @@ func validateStorageCredentialRequest_ValidationResultFromWire(w *validateStorag }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ValidateStorageCredentialRequest_ValidationResult) MarshalJSON() ([]byte, error) { + w, err := validateStorageCredentialRequest_ValidationResultToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ValidateStorageCredentialRequest_ValidationResult) UnmarshalJSON(data []byte) error { + var w validateStorageCredentialRequest_ValidationResultWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := validateStorageCredentialRequest_ValidationResultFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type validateStorageCredentialResponseWire struct { IsDir *bool `json:"isDir,omitempty"` Results []validateStorageCredentialRequest_ValidationResultWire `json:"results,omitempty"` @@ -4107,6 +5619,30 @@ func validateStorageCredentialResponseFromWire(w *validateStorageCredentialRespo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ValidateStorageCredentialResponse) MarshalJSON() ([]byte, error) { + w, err := validateStorageCredentialResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ValidateStorageCredentialResponse) UnmarshalJSON(data []byte) error { + var w validateStorageCredentialResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := validateStorageCredentialResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/entitytagassignments/CHANGELOG.md b/uc/entitytagassignments/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/uc/entitytagassignments/CHANGELOG.md +++ b/uc/entitytagassignments/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/uc/entitytagassignments/internal/version.go b/uc/entitytagassignments/internal/version.go index 9e6121b7..bec0356c 100644 --- a/uc/entitytagassignments/internal/version.go +++ b/uc/entitytagassignments/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-entitytagassignments" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/uc/entitytagassignments/v1/wire.go b/uc/entitytagassignments/v1/wire.go index 3fe445aa..6f56bf1e 100644 --- a/uc/entitytagassignments/v1/wire.go +++ b/uc/entitytagassignments/v1/wire.go @@ -3,6 +3,7 @@ package entitytagassignments import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -38,6 +39,30 @@ func createEntityTagAssignmentRequestFromWire(w *createEntityTagAssignmentReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateEntityTagAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := createEntityTagAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateEntityTagAssignmentRequest) UnmarshalJSON(data []byte) error { + var w createEntityTagAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createEntityTagAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteEntityTagAssignmentRequestWire struct { EntityName *string `json:"entity_name,omitempty"` TagKey *string `json:"tag_key,omitempty"` @@ -66,6 +91,30 @@ func deleteEntityTagAssignmentRequestFromWire(w *deleteEntityTagAssignmentReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteEntityTagAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := deleteEntityTagAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteEntityTagAssignmentRequest) UnmarshalJSON(data []byte) error { + var w deleteEntityTagAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteEntityTagAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type entityTagAssignmentWire struct { EntityName *string `json:"entity_name,omitempty"` TagKey *string `json:"tag_key,omitempty"` @@ -106,6 +155,30 @@ func entityTagAssignmentFromWire(w *entityTagAssignmentWire) (*EntityTagAssignme }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EntityTagAssignment) MarshalJSON() ([]byte, error) { + w, err := entityTagAssignmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EntityTagAssignment) UnmarshalJSON(data []byte) error { + var w entityTagAssignmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := entityTagAssignmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getEntityTagAssignmentRequestWire struct { EntityName *string `json:"entity_name,omitempty"` TagKey *string `json:"tag_key,omitempty"` @@ -134,6 +207,30 @@ func getEntityTagAssignmentRequestFromWire(w *getEntityTagAssignmentRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetEntityTagAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := getEntityTagAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetEntityTagAssignmentRequest) UnmarshalJSON(data []byte) error { + var w getEntityTagAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getEntityTagAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listEntityTagAssignmentsRequestWire struct { EntityName *string `json:"entity_name,omitempty"` MaxResults *int `json:"max_results,omitempty"` @@ -165,6 +262,30 @@ func listEntityTagAssignmentsRequestFromWire(w *listEntityTagAssignmentsRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListEntityTagAssignmentsRequest) MarshalJSON() ([]byte, error) { + w, err := listEntityTagAssignmentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListEntityTagAssignmentsRequest) UnmarshalJSON(data []byte) error { + var w listEntityTagAssignmentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listEntityTagAssignmentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listEntityTagAssignmentsResponseWire struct { TagAssignments []entityTagAssignmentWire `json:"tag_assignments,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -198,6 +319,30 @@ func listEntityTagAssignmentsResponseFromWire(w *listEntityTagAssignmentsRespons }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListEntityTagAssignmentsResponse) MarshalJSON() ([]byte, error) { + w, err := listEntityTagAssignmentsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListEntityTagAssignmentsResponse) UnmarshalJSON(data []byte) error { + var w listEntityTagAssignmentsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listEntityTagAssignmentsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateEntityTagAssignmentRequestWire struct { TagAssignment *entityTagAssignmentWire `json:"tag_assignment,omitempty"` UpdateMask *types.FieldMask[EntityTagAssignment] `json:"update_mask,omitempty"` @@ -231,6 +376,30 @@ func updateEntityTagAssignmentRequestFromWire(w *updateEntityTagAssignmentReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateEntityTagAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := updateEntityTagAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateEntityTagAssignmentRequest) UnmarshalJSON(data []byte) error { + var w updateEntityTagAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateEntityTagAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/externallineage/CHANGELOG.md b/uc/externallineage/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/uc/externallineage/CHANGELOG.md +++ b/uc/externallineage/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/uc/externallineage/internal/version.go b/uc/externallineage/internal/version.go index 445775ef..b0438f3f 100644 --- a/uc/externallineage/internal/version.go +++ b/uc/externallineage/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-externallineage" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/uc/externallineage/v1/wire.go b/uc/externallineage/v1/wire.go index 372963d1..1f54c140 100644 --- a/uc/externallineage/v1/wire.go +++ b/uc/externallineage/v1/wire.go @@ -79,6 +79,30 @@ func columnRelationshipFromWire(w *columnRelationshipWire) (*ColumnRelationship, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ColumnRelationship) MarshalJSON() ([]byte, error) { + w, err := columnRelationshipToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ColumnRelationship) UnmarshalJSON(data []byte) error { + var w columnRelationshipWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := columnRelationshipFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createExternalLineageRelationshipRequestWire struct { ExternalLineageRelationship *createRequestExternalLineageWire `json:"external_lineage_relationship,omitempty"` } @@ -109,6 +133,30 @@ func createExternalLineageRelationshipRequestFromWire(w *createExternalLineageRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateExternalLineageRelationshipRequest) MarshalJSON() ([]byte, error) { + w, err := createExternalLineageRelationshipRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateExternalLineageRelationshipRequest) UnmarshalJSON(data []byte) error { + var w createExternalLineageRelationshipRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createExternalLineageRelationshipRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createRequestExternalLineageWire struct { Id *string `json:"id,omitempty"` Source *externalLineageRelationshipObjectWire `json:"source,omitempty"` @@ -167,6 +215,30 @@ func createRequestExternalLineageFromWire(w *createRequestExternalLineageWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateRequestExternalLineage) MarshalJSON() ([]byte, error) { + w, err := createRequestExternalLineageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateRequestExternalLineage) UnmarshalJSON(data []byte) error { + var w createRequestExternalLineageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createRequestExternalLineageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteExternalLineageRelationshipRequestWire struct { ExternalLineageRelationship *deleteRequestExternalLineageWire `json:"external_lineage_relationship,omitempty"` } @@ -197,6 +269,30 @@ func deleteExternalLineageRelationshipRequestFromWire(w *deleteExternalLineageRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteExternalLineageRelationshipRequest) MarshalJSON() ([]byte, error) { + w, err := deleteExternalLineageRelationshipRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteExternalLineageRelationshipRequest) UnmarshalJSON(data []byte) error { + var w deleteExternalLineageRelationshipRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteExternalLineageRelationshipRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRequestExternalLineageWire struct { Id *string `json:"id,omitempty"` Source *externalLineageRelationshipObjectWire `json:"source,omitempty"` @@ -255,6 +351,30 @@ func deleteRequestExternalLineageFromWire(w *deleteRequestExternalLineageWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRequestExternalLineage) MarshalJSON() ([]byte, error) { + w, err := deleteRequestExternalLineageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRequestExternalLineage) UnmarshalJSON(data []byte) error { + var w deleteRequestExternalLineageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRequestExternalLineageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type directionWire struct { } @@ -272,6 +392,30 @@ func directionFromWire(w *directionWire) (*Direction, error) { return &Direction{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Direction) MarshalJSON() ([]byte, error) { + w, err := directionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Direction) UnmarshalJSON(data []byte) error { + var w directionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := directionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type externalLineageInfoWire struct { TableInfo *lineageTableInfoWire `json:"table_info,omitempty"` FileInfo *lineageFileInfoWire `json:"file_info,omitempty"` @@ -346,6 +490,30 @@ func externalLineageInfoFromWire(w *externalLineageInfoWire) (*ExternalLineageIn }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalLineageInfo) MarshalJSON() ([]byte, error) { + w, err := externalLineageInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalLineageInfo) UnmarshalJSON(data []byte) error { + var w externalLineageInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalLineageInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type externalLineageRelationshipWire struct { Id *string `json:"id,omitempty"` Source *externalLineageRelationshipObjectWire `json:"source,omitempty"` @@ -404,6 +572,30 @@ func externalLineageRelationshipFromWire(w *externalLineageRelationshipWire) (*E }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalLineageRelationship) MarshalJSON() ([]byte, error) { + w, err := externalLineageRelationshipToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalLineageRelationship) UnmarshalJSON(data []byte) error { + var w externalLineageRelationshipWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalLineageRelationshipFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type externalLineageRelationshipExternalMetadataWire struct { Name *string `json:"name,omitempty"` } @@ -426,6 +618,30 @@ func externalLineageRelationshipExternalMetadataFromWire(w *externalLineageRelat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalLineageRelationshipExternalMetadata) MarshalJSON() ([]byte, error) { + w, err := externalLineageRelationshipExternalMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalLineageRelationshipExternalMetadata) UnmarshalJSON(data []byte) error { + var w externalLineageRelationshipExternalMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalLineageRelationshipExternalMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type externalLineageRelationshipModelVersionWire struct { Name *string `json:"name,omitempty"` Version *string `json:"version,omitempty"` @@ -451,6 +667,30 @@ func externalLineageRelationshipModelVersionFromWire(w *externalLineageRelations }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalLineageRelationshipModelVersion) MarshalJSON() ([]byte, error) { + w, err := externalLineageRelationshipModelVersionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalLineageRelationshipModelVersion) UnmarshalJSON(data []byte) error { + var w externalLineageRelationshipModelVersionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalLineageRelationshipModelVersionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type externalLineageRelationshipObjectWire struct { Table *externalLineageRelationshipTableWire `json:"table,omitempty"` Path *externalLineageRelationshipPathWire `json:"path,omitempty"` @@ -563,6 +803,30 @@ func externalLineageRelationshipObjectFromWire(w *externalLineageRelationshipObj }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalLineageRelationshipObject) MarshalJSON() ([]byte, error) { + w, err := externalLineageRelationshipObjectToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalLineageRelationshipObject) UnmarshalJSON(data []byte) error { + var w externalLineageRelationshipObjectWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalLineageRelationshipObjectFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type externalLineageRelationshipPathWire struct { Url *string `json:"url,omitempty"` } @@ -585,6 +849,30 @@ func externalLineageRelationshipPathFromWire(w *externalLineageRelationshipPathW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalLineageRelationshipPath) MarshalJSON() ([]byte, error) { + w, err := externalLineageRelationshipPathToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalLineageRelationshipPath) UnmarshalJSON(data []byte) error { + var w externalLineageRelationshipPathWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalLineageRelationshipPathFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type externalLineageRelationshipTableWire struct { Name *string `json:"name,omitempty"` } @@ -607,6 +895,30 @@ func externalLineageRelationshipTableFromWire(w *externalLineageRelationshipTabl }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalLineageRelationshipTable) MarshalJSON() ([]byte, error) { + w, err := externalLineageRelationshipTableToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalLineageRelationshipTable) UnmarshalJSON(data []byte) error { + var w externalLineageRelationshipTableWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalLineageRelationshipTableFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type lineageExternalMetadataInfoWire struct { Name *string `json:"name,omitempty"` SystemType SystemType `json:"system_type,omitempty"` @@ -638,6 +950,30 @@ func lineageExternalMetadataInfoFromWire(w *lineageExternalMetadataInfoWire) (*L }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LineageExternalMetadataInfo) MarshalJSON() ([]byte, error) { + w, err := lineageExternalMetadataInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LineageExternalMetadataInfo) UnmarshalJSON(data []byte) error { + var w lineageExternalMetadataInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := lineageExternalMetadataInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type lineageFileInfoWire struct { Path *string `json:"path,omitempty"` SecurableName *string `json:"securable_name,omitempty"` @@ -672,6 +1008,30 @@ func lineageFileInfoFromWire(w *lineageFileInfoWire) (*LineageFileInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LineageFileInfo) MarshalJSON() ([]byte, error) { + w, err := lineageFileInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LineageFileInfo) UnmarshalJSON(data []byte) error { + var w lineageFileInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := lineageFileInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type lineageModelVersionInfoWire struct { ModelName *string `json:"model_name,omitempty"` Version *wireInt64 `json:"version,omitempty"` @@ -708,6 +1068,30 @@ func lineageModelVersionInfoFromWire(w *lineageModelVersionInfoWire) (*LineageMo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LineageModelVersionInfo) MarshalJSON() ([]byte, error) { + w, err := lineageModelVersionInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LineageModelVersionInfo) UnmarshalJSON(data []byte) error { + var w lineageModelVersionInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := lineageModelVersionInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type lineageTableInfoWire struct { Name *string `json:"name,omitempty"` CatalogName *string `json:"catalog_name,omitempty"` @@ -739,6 +1123,30 @@ func lineageTableInfoFromWire(w *lineageTableInfoWire) (*LineageTableInfo, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v LineageTableInfo) MarshalJSON() ([]byte, error) { + w, err := lineageTableInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *LineageTableInfo) UnmarshalJSON(data []byte) error { + var w lineageTableInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := lineageTableInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExternalLineageRelationshipsRequestWire struct { ObjectInfo *externalLineageRelationshipObjectWire `json:"object_info,omitempty"` LineageDirection Direction_LineageDirection `json:"lineage_direction,omitempty"` @@ -778,6 +1186,30 @@ func listExternalLineageRelationshipsRequestFromWire(w *listExternalLineageRelat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExternalLineageRelationshipsRequest) MarshalJSON() ([]byte, error) { + w, err := listExternalLineageRelationshipsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExternalLineageRelationshipsRequest) UnmarshalJSON(data []byte) error { + var w listExternalLineageRelationshipsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExternalLineageRelationshipsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExternalLineageRelationshipsResponseWire struct { ExternalLineageRelationships []externalLineageInfoWire `json:"external_lineage_relationships,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -811,6 +1243,30 @@ func listExternalLineageRelationshipsResponseFromWire(w *listExternalLineageRela }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExternalLineageRelationshipsResponse) MarshalJSON() ([]byte, error) { + w, err := listExternalLineageRelationshipsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExternalLineageRelationshipsResponse) UnmarshalJSON(data []byte) error { + var w listExternalLineageRelationshipsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExternalLineageRelationshipsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateExternalLineageRelationshipRequestWire struct { ExternalLineageRelationship *updateRequestExternalLineageWire `json:"external_lineage_relationship,omitempty"` UpdateMask *types.FieldMask[UpdateRequestExternalLineage] `json:"update_mask,omitempty"` @@ -844,6 +1300,30 @@ func updateExternalLineageRelationshipRequestFromWire(w *updateExternalLineageRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateExternalLineageRelationshipRequest) MarshalJSON() ([]byte, error) { + w, err := updateExternalLineageRelationshipRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateExternalLineageRelationshipRequest) UnmarshalJSON(data []byte) error { + var w updateExternalLineageRelationshipRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateExternalLineageRelationshipRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateRequestExternalLineageWire struct { Id *string `json:"id,omitempty"` Source *externalLineageRelationshipObjectWire `json:"source,omitempty"` @@ -902,6 +1382,30 @@ func updateRequestExternalLineageFromWire(w *updateRequestExternalLineageWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateRequestExternalLineage) MarshalJSON() ([]byte, error) { + w, err := updateRequestExternalLineageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateRequestExternalLineage) UnmarshalJSON(data []byte) error { + var w updateRequestExternalLineageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateRequestExternalLineageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/externallocations/CHANGELOG.md b/uc/externallocations/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/uc/externallocations/CHANGELOG.md +++ b/uc/externallocations/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/uc/externallocations/internal/version.go b/uc/externallocations/internal/version.go index 30b75ecd..6ba55c1b 100644 --- a/uc/externallocations/internal/version.go +++ b/uc/externallocations/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-externallocations" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/uc/externallocations/v1/wire.go b/uc/externallocations/v1/wire.go index 4313c4d2..1744bfb4 100644 --- a/uc/externallocations/v1/wire.go +++ b/uc/externallocations/v1/wire.go @@ -77,6 +77,30 @@ func awsSqsQueueFromWire(w *awsSqsQueueWire) (*AwsSqsQueue, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AwsSqsQueue) MarshalJSON() ([]byte, error) { + w, err := awsSqsQueueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AwsSqsQueue) UnmarshalJSON(data []byte) error { + var w awsSqsQueueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := awsSqsQueueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type azureQueueStorageWire struct { QueueUrl *string `json:"queue_url,omitempty"` SubscriptionId *string `json:"subscription_id,omitempty"` @@ -108,6 +132,30 @@ func azureQueueStorageFromWire(w *azureQueueStorageWire) (*AzureQueueStorage, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AzureQueueStorage) MarshalJSON() ([]byte, error) { + w, err := azureQueueStorageToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AzureQueueStorage) UnmarshalJSON(data []byte) error { + var w azureQueueStorageWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := azureQueueStorageFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createExternalLocationRequestWire struct { SkipValidation *bool `json:"skip_validation,omitempty"` Name *string `json:"name,omitempty"` @@ -230,6 +278,30 @@ func createExternalLocationRequestFromWire(w *createExternalLocationRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateExternalLocationRequest) MarshalJSON() ([]byte, error) { + w, err := createExternalLocationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateExternalLocationRequest) UnmarshalJSON(data []byte) error { + var w createExternalLocationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createExternalLocationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteExternalLocationRequestWire struct { NameArg *string `json:"name_arg,omitempty"` Force *bool `json:"force,omitempty"` @@ -255,6 +327,30 @@ func deleteExternalLocationRequestFromWire(w *deleteExternalLocationRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteExternalLocationRequest) MarshalJSON() ([]byte, error) { + w, err := deleteExternalLocationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteExternalLocationRequest) UnmarshalJSON(data []byte) error { + var w deleteExternalLocationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteExternalLocationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteExternalLocationResponseWire struct { } @@ -272,6 +368,30 @@ func deleteExternalLocationResponseFromWire(w *deleteExternalLocationResponseWir return &DeleteExternalLocationResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteExternalLocationResponse) MarshalJSON() ([]byte, error) { + w, err := deleteExternalLocationResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteExternalLocationResponse) UnmarshalJSON(data []byte) error { + var w deleteExternalLocationResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteExternalLocationResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type encryptionDetailsWire struct { SseEncryptionDetails *sseEncryptionDetailsWire `json:"sse_encryption_details,omitempty"` } @@ -324,6 +444,30 @@ func encryptionDetailsFromWire(w *encryptionDetailsWire) (*EncryptionDetails, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EncryptionDetails) MarshalJSON() ([]byte, error) { + w, err := encryptionDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EncryptionDetails) UnmarshalJSON(data []byte) error { + var w encryptionDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := encryptionDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type externalLocationInfoWire struct { Name *string `json:"name,omitempty"` Url *string `json:"url,omitempty"` @@ -443,6 +587,30 @@ func externalLocationInfoFromWire(w *externalLocationInfoWire) (*ExternalLocatio }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalLocationInfo) MarshalJSON() ([]byte, error) { + w, err := externalLocationInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalLocationInfo) UnmarshalJSON(data []byte) error { + var w externalLocationInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalLocationInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type fileEventQueueWire struct { ProvidedAqs *azureQueueStorageWire `json:"provided_aqs,omitempty"` ProvidedSqs *awsSqsQueueWire `json:"provided_sqs,omitempty"` @@ -608,6 +776,30 @@ func fileEventQueueFromWire(w *fileEventQueueWire) (*FileEventQueue, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FileEventQueue) MarshalJSON() ([]byte, error) { + w, err := fileEventQueueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FileEventQueue) UnmarshalJSON(data []byte) error { + var w fileEventQueueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := fileEventQueueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gcpPubsubWire struct { SubscriptionName *string `json:"subscription_name,omitempty"` ManagedResourceId *string `json:"managed_resource_id,omitempty"` @@ -633,6 +825,30 @@ func gcpPubsubFromWire(w *gcpPubsubWire) (*GcpPubsub, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GcpPubsub) MarshalJSON() ([]byte, error) { + w, err := gcpPubsubToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GcpPubsub) UnmarshalJSON(data []byte) error { + var w gcpPubsubWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gcpPubsubFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getExternalLocationRequestWire struct { NameArg *string `json:"name_arg,omitempty"` IncludeBrowse *bool `json:"include_browse,omitempty"` @@ -658,6 +874,30 @@ func getExternalLocationRequestFromWire(w *getExternalLocationRequestWire) (*Get }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetExternalLocationRequest) MarshalJSON() ([]byte, error) { + w, err := getExternalLocationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetExternalLocationRequest) UnmarshalJSON(data []byte) error { + var w getExternalLocationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getExternalLocationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExternalLocationsRequestWire struct { IncludeBrowse *bool `json:"include_browse,omitempty"` MaxResults *int `json:"max_results,omitempty"` @@ -689,6 +929,30 @@ func listExternalLocationsRequestFromWire(w *listExternalLocationsRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExternalLocationsRequest) MarshalJSON() ([]byte, error) { + w, err := listExternalLocationsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExternalLocationsRequest) UnmarshalJSON(data []byte) error { + var w listExternalLocationsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExternalLocationsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExternalLocationsResponseWire struct { ExternalLocations []externalLocationInfoWire `json:"external_locations,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -722,6 +986,30 @@ func listExternalLocationsResponseFromWire(w *listExternalLocationsResponseWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExternalLocationsResponse) MarshalJSON() ([]byte, error) { + w, err := listExternalLocationsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExternalLocationsResponse) UnmarshalJSON(data []byte) error { + var w listExternalLocationsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExternalLocationsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sseEncryptionDetailsWire struct { Algorithm SseEncryptionAlgorithm `json:"algorithm,omitempty"` AwsKmsKeyArn *string `json:"aws_kms_key_arn,omitempty"` @@ -747,6 +1035,30 @@ func sseEncryptionDetailsFromWire(w *sseEncryptionDetailsWire) (*SseEncryptionDe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SseEncryptionDetails) MarshalJSON() ([]byte, error) { + w, err := sseEncryptionDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SseEncryptionDetails) UnmarshalJSON(data []byte) error { + var w sseEncryptionDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sseEncryptionDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateExternalLocationRequestWire struct { NameArg *string `json:"name_arg,omitempty"` NewName *string `json:"new_name,omitempty"` @@ -878,6 +1190,30 @@ func updateExternalLocationRequestFromWire(w *updateExternalLocationRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateExternalLocationRequest) MarshalJSON() ([]byte, error) { + w, err := updateExternalLocationRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateExternalLocationRequest) UnmarshalJSON(data []byte) error { + var w updateExternalLocationRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateExternalLocationRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/externalmetadata/CHANGELOG.md b/uc/externalmetadata/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/uc/externalmetadata/CHANGELOG.md +++ b/uc/externalmetadata/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/uc/externalmetadata/internal/version.go b/uc/externalmetadata/internal/version.go index dd647a4e..15298933 100644 --- a/uc/externalmetadata/internal/version.go +++ b/uc/externalmetadata/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-externalmetadata" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/uc/externalmetadata/v1/wire.go b/uc/externalmetadata/v1/wire.go index f783a1ab..09e916af 100644 --- a/uc/externalmetadata/v1/wire.go +++ b/uc/externalmetadata/v1/wire.go @@ -3,6 +3,7 @@ package externalmetadata import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -38,6 +39,30 @@ func createExternalMetadataRequestFromWire(w *createExternalMetadataRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateExternalMetadataRequest) MarshalJSON() ([]byte, error) { + w, err := createExternalMetadataRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateExternalMetadataRequest) UnmarshalJSON(data []byte) error { + var w createExternalMetadataRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createExternalMetadataRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteExternalMetadataRequestWire struct { Name *string `json:"name,omitempty"` } @@ -60,6 +85,30 @@ func deleteExternalMetadataRequestFromWire(w *deleteExternalMetadataRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteExternalMetadataRequest) MarshalJSON() ([]byte, error) { + w, err := deleteExternalMetadataRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteExternalMetadataRequest) UnmarshalJSON(data []byte) error { + var w deleteExternalMetadataRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteExternalMetadataRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type externalMetadataWire struct { Name *string `json:"name,omitempty"` SystemType SystemType `json:"system_type,omitempty"` @@ -121,6 +170,30 @@ func externalMetadataFromWire(w *externalMetadataWire) (*ExternalMetadata, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExternalMetadata) MarshalJSON() ([]byte, error) { + w, err := externalMetadataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExternalMetadata) UnmarshalJSON(data []byte) error { + var w externalMetadataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := externalMetadataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getExternalMetadataRequestWire struct { Name *string `json:"name,omitempty"` } @@ -143,6 +216,30 @@ func getExternalMetadataRequestFromWire(w *getExternalMetadataRequestWire) (*Get }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetExternalMetadataRequest) MarshalJSON() ([]byte, error) { + w, err := getExternalMetadataRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetExternalMetadataRequest) UnmarshalJSON(data []byte) error { + var w getExternalMetadataRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getExternalMetadataRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExternalMetadataRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -168,6 +265,30 @@ func listExternalMetadataRequestFromWire(w *listExternalMetadataRequestWire) (*L }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExternalMetadataRequest) MarshalJSON() ([]byte, error) { + w, err := listExternalMetadataRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExternalMetadataRequest) UnmarshalJSON(data []byte) error { + var w listExternalMetadataRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExternalMetadataRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listExternalMetadataResponseV2Wire struct { ExternalMetadata []externalMetadataWire `json:"external_metadata,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -201,6 +322,30 @@ func listExternalMetadataResponseV2FromWire(w *listExternalMetadataResponseV2Wir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListExternalMetadataResponseV2) MarshalJSON() ([]byte, error) { + w, err := listExternalMetadataResponseV2ToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListExternalMetadataResponseV2) UnmarshalJSON(data []byte) error { + var w listExternalMetadataResponseV2Wire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listExternalMetadataResponseV2FromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateExternalMetadataRequestWire struct { ExternalMetadata *externalMetadataWire `json:"external_metadata,omitempty"` UpdateMask *types.FieldMask[ExternalMetadata] `json:"update_mask,omitempty"` @@ -234,6 +379,30 @@ func updateExternalMetadataRequestFromWire(w *updateExternalMetadataRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateExternalMetadataRequest) MarshalJSON() ([]byte, error) { + w, err := updateExternalMetadataRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateExternalMetadataRequest) UnmarshalJSON(data []byte) error { + var w updateExternalMetadataRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateExternalMetadataRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/functions/CHANGELOG.md b/uc/functions/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/uc/functions/CHANGELOG.md +++ b/uc/functions/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/uc/functions/internal/version.go b/uc/functions/internal/version.go index a644313b..4567cff6 100644 --- a/uc/functions/internal/version.go +++ b/uc/functions/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-functions" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/uc/functions/v1/wire.go b/uc/functions/v1/wire.go index eb63f39d..672f5dd1 100644 --- a/uc/functions/v1/wire.go +++ b/uc/functions/v1/wire.go @@ -74,6 +74,30 @@ func connectionDependencyFromWire(w *connectionDependencyWire) (*ConnectionDepen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ConnectionDependency) MarshalJSON() ([]byte, error) { + w, err := connectionDependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ConnectionDependency) UnmarshalJSON(data []byte) error { + var w connectionDependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := connectionDependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createFunctionWire struct { Name *string `json:"name,omitempty"` CatalogName *string `json:"catalog_name,omitempty"` @@ -223,6 +247,30 @@ func createFunctionFromWire(w *createFunctionWire) (*CreateFunction, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateFunction) MarshalJSON() ([]byte, error) { + w, err := createFunctionToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateFunction) UnmarshalJSON(data []byte) error { + var w createFunctionWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createFunctionFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createFunctionRequestWire struct { FunctionInfo *createFunctionWire `json:"function_info,omitempty"` } @@ -253,6 +301,30 @@ func createFunctionRequestFromWire(w *createFunctionRequestWire) (*CreateFunctio }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateFunctionRequest) MarshalJSON() ([]byte, error) { + w, err := createFunctionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateFunctionRequest) UnmarshalJSON(data []byte) error { + var w createFunctionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createFunctionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type credentialDependencyWire struct { CredentialName *string `json:"credential_name,omitempty"` } @@ -275,6 +347,30 @@ func credentialDependencyFromWire(w *credentialDependencyWire) (*CredentialDepen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CredentialDependency) MarshalJSON() ([]byte, error) { + w, err := credentialDependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CredentialDependency) UnmarshalJSON(data []byte) error { + var w credentialDependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := credentialDependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteFunctionRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` Force *bool `json:"force,omitempty"` @@ -300,6 +396,30 @@ func deleteFunctionRequestFromWire(w *deleteFunctionRequestWire) (*DeleteFunctio }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteFunctionRequest) MarshalJSON() ([]byte, error) { + w, err := deleteFunctionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteFunctionRequest) UnmarshalJSON(data []byte) error { + var w deleteFunctionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteFunctionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteFunctionResponseWire struct { } @@ -317,6 +437,30 @@ func deleteFunctionResponseFromWire(w *deleteFunctionResponseWire) (*DeleteFunct return &DeleteFunctionResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteFunctionResponse) MarshalJSON() ([]byte, error) { + w, err := deleteFunctionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteFunctionResponse) UnmarshalJSON(data []byte) error { + var w deleteFunctionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteFunctionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dependencyWire struct { Table *tableDependencyWire `json:"table,omitempty"` Function *functionDependencyWire `json:"function,omitempty"` @@ -429,6 +573,30 @@ func dependencyFromWire(w *dependencyWire) (*Dependency, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Dependency) MarshalJSON() ([]byte, error) { + w, err := dependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Dependency) UnmarshalJSON(data []byte) error { + var w dependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dependencyListWire struct { Dependencies []dependencyWire `json:"dependencies,omitempty"` } @@ -459,6 +627,30 @@ func dependencyListFromWire(w *dependencyListWire) (*DependencyList, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DependencyList) MarshalJSON() ([]byte, error) { + w, err := dependencyListToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DependencyList) UnmarshalJSON(data []byte) error { + var w dependencyListWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dependencyListFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type functionDependencyWire struct { FunctionFullName *string `json:"function_full_name,omitempty"` } @@ -481,6 +673,30 @@ func functionDependencyFromWire(w *functionDependencyWire) (*FunctionDependency, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FunctionDependency) MarshalJSON() ([]byte, error) { + w, err := functionDependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FunctionDependency) UnmarshalJSON(data []byte) error { + var w functionDependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := functionDependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type functionInfoWire struct { Name *string `json:"name,omitempty"` CatalogName *string `json:"catalog_name,omitempty"` @@ -630,6 +846,30 @@ func functionInfoFromWire(w *functionInfoWire) (*FunctionInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FunctionInfo) MarshalJSON() ([]byte, error) { + w, err := functionInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FunctionInfo) UnmarshalJSON(data []byte) error { + var w functionInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := functionInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type functionParameterInfoWire struct { Name *string `json:"name,omitempty"` TypeText *string `json:"type_text,omitempty"` @@ -685,6 +925,30 @@ func functionParameterInfoFromWire(w *functionParameterInfoWire) (*FunctionParam }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FunctionParameterInfo) MarshalJSON() ([]byte, error) { + w, err := functionParameterInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FunctionParameterInfo) UnmarshalJSON(data []byte) error { + var w functionParameterInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := functionParameterInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type functionParameterInfosWire struct { Parameters []functionParameterInfoWire `json:"parameters,omitempty"` } @@ -715,6 +979,30 @@ func functionParameterInfosFromWire(w *functionParameterInfosWire) (*FunctionPar }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FunctionParameterInfos) MarshalJSON() ([]byte, error) { + w, err := functionParameterInfosToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FunctionParameterInfos) UnmarshalJSON(data []byte) error { + var w functionParameterInfosWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := functionParameterInfosFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getFunctionRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` IncludeBrowse *bool `json:"include_browse,omitempty"` @@ -740,6 +1028,30 @@ func getFunctionRequestFromWire(w *getFunctionRequestWire) (*GetFunctionRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetFunctionRequest) MarshalJSON() ([]byte, error) { + w, err := getFunctionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetFunctionRequest) UnmarshalJSON(data []byte) error { + var w getFunctionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getFunctionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listFunctionsRequestWire struct { CatalogName *string `json:"catalog_name,omitempty"` SchemaName *string `json:"schema_name,omitempty"` @@ -774,6 +1086,30 @@ func listFunctionsRequestFromWire(w *listFunctionsRequestWire) (*ListFunctionsRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListFunctionsRequest) MarshalJSON() ([]byte, error) { + w, err := listFunctionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListFunctionsRequest) UnmarshalJSON(data []byte) error { + var w listFunctionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listFunctionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listFunctionsResponseWire struct { Functions []functionInfoWire `json:"functions,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -807,6 +1143,30 @@ func listFunctionsResponseFromWire(w *listFunctionsResponseWire) (*ListFunctions }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListFunctionsResponse) MarshalJSON() ([]byte, error) { + w, err := listFunctionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListFunctionsResponse) UnmarshalJSON(data []byte) error { + var w listFunctionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listFunctionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tableDependencyWire struct { TableFullName *string `json:"table_full_name,omitempty"` } @@ -829,6 +1189,30 @@ func tableDependencyFromWire(w *tableDependencyWire) (*TableDependency, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TableDependency) MarshalJSON() ([]byte, error) { + w, err := tableDependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TableDependency) UnmarshalJSON(data []byte) error { + var w tableDependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tableDependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateFunctionRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` Name *string `json:"name,omitempty"` @@ -981,6 +1365,30 @@ func updateFunctionRequestFromWire(w *updateFunctionRequestWire) (*UpdateFunctio }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateFunctionRequest) MarshalJSON() ([]byte, error) { + w, err := updateFunctionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateFunctionRequest) UnmarshalJSON(data []byte) error { + var w updateFunctionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateFunctionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/grants/CHANGELOG.md b/uc/grants/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/uc/grants/CHANGELOG.md +++ b/uc/grants/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/uc/grants/internal/version.go b/uc/grants/internal/version.go index d060fac7..a874eeaf 100644 --- a/uc/grants/internal/version.go +++ b/uc/grants/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-grants" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/uc/grants/v1/wire.go b/uc/grants/v1/wire.go index a35e8273..302da058 100644 --- a/uc/grants/v1/wire.go +++ b/uc/grants/v1/wire.go @@ -3,6 +3,7 @@ package grants import ( + "encoding/json" "fmt" ) @@ -34,6 +35,30 @@ func effectivePrivilegeFromWire(w *effectivePrivilegeWire) (*EffectivePrivilege, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EffectivePrivilege) MarshalJSON() ([]byte, error) { + w, err := effectivePrivilegeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EffectivePrivilege) UnmarshalJSON(data []byte) error { + var w effectivePrivilegeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := effectivePrivilegeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type effectivePrivilegeAssignmentWire struct { Principal *string `json:"principal,omitempty"` Privileges []effectivePrivilegeWire `json:"privileges,omitempty"` @@ -67,6 +92,30 @@ func effectivePrivilegeAssignmentFromWire(w *effectivePrivilegeAssignmentWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EffectivePrivilegeAssignment) MarshalJSON() ([]byte, error) { + w, err := effectivePrivilegeAssignmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EffectivePrivilegeAssignment) UnmarshalJSON(data []byte) error { + var w effectivePrivilegeAssignmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := effectivePrivilegeAssignmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getEffectivePermissionsRequestWire struct { SecurableType *string `json:"securable_type,omitempty"` SecurableFullName *string `json:"securable_full_name,omitempty"` @@ -101,6 +150,30 @@ func getEffectivePermissionsRequestFromWire(w *getEffectivePermissionsRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetEffectivePermissionsRequest) MarshalJSON() ([]byte, error) { + w, err := getEffectivePermissionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetEffectivePermissionsRequest) UnmarshalJSON(data []byte) error { + var w getEffectivePermissionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getEffectivePermissionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getEffectivePermissionsResponseWire struct { NextPageToken *string `json:"next_page_token,omitempty"` PrivilegeAssignments []effectivePrivilegeAssignmentWire `json:"privilege_assignments,omitempty"` @@ -134,6 +207,30 @@ func getEffectivePermissionsResponseFromWire(w *getEffectivePermissionsResponseW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetEffectivePermissionsResponse) MarshalJSON() ([]byte, error) { + w, err := getEffectivePermissionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetEffectivePermissionsResponse) UnmarshalJSON(data []byte) error { + var w getEffectivePermissionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getEffectivePermissionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPermissionsRequestWire struct { SecurableType *string `json:"securable_type,omitempty"` SecurableFullName *string `json:"securable_full_name,omitempty"` @@ -168,6 +265,30 @@ func getPermissionsRequestFromWire(w *getPermissionsRequestWire) (*GetPermission }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPermissionsRequest) MarshalJSON() ([]byte, error) { + w, err := getPermissionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPermissionsRequest) UnmarshalJSON(data []byte) error { + var w getPermissionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPermissionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getPermissionsResponseWire struct { NextPageToken *string `json:"next_page_token,omitempty"` PrivilegeAssignments []privilegeAssignmentWire `json:"privilege_assignments,omitempty"` @@ -201,6 +322,30 @@ func getPermissionsResponseFromWire(w *getPermissionsResponseWire) (*GetPermissi }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetPermissionsResponse) MarshalJSON() ([]byte, error) { + w, err := getPermissionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetPermissionsResponse) UnmarshalJSON(data []byte) error { + var w getPermissionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getPermissionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listEffectivePrivilegeAssignmentsRequestWire struct { SecurableType *string `json:"securable_type,omitempty"` FullName *string `json:"full_name,omitempty"` @@ -235,6 +380,30 @@ func listEffectivePrivilegeAssignmentsRequestFromWire(w *listEffectivePrivilegeA }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListEffectivePrivilegeAssignmentsRequest) MarshalJSON() ([]byte, error) { + w, err := listEffectivePrivilegeAssignmentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListEffectivePrivilegeAssignmentsRequest) UnmarshalJSON(data []byte) error { + var w listEffectivePrivilegeAssignmentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listEffectivePrivilegeAssignmentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listEffectivePrivilegeAssignmentsResponseWire struct { EffectivePrivilegeAssignments []effectivePrivilegeAssignmentWire `json:"effective_privilege_assignments,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -268,6 +437,30 @@ func listEffectivePrivilegeAssignmentsResponseFromWire(w *listEffectivePrivilege }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListEffectivePrivilegeAssignmentsResponse) MarshalJSON() ([]byte, error) { + w, err := listEffectivePrivilegeAssignmentsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListEffectivePrivilegeAssignmentsResponse) UnmarshalJSON(data []byte) error { + var w listEffectivePrivilegeAssignmentsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listEffectivePrivilegeAssignmentsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPrivilegeAssignmentsRequestWire struct { SecurableType *string `json:"securable_type,omitempty"` FullName *string `json:"full_name,omitempty"` @@ -302,6 +495,30 @@ func listPrivilegeAssignmentsRequestFromWire(w *listPrivilegeAssignmentsRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPrivilegeAssignmentsRequest) MarshalJSON() ([]byte, error) { + w, err := listPrivilegeAssignmentsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPrivilegeAssignmentsRequest) UnmarshalJSON(data []byte) error { + var w listPrivilegeAssignmentsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPrivilegeAssignmentsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listPrivilegeAssignmentsResponseWire struct { PrivilegeAssignments []privilegeAssignmentWire `json:"privilege_assignments,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -335,6 +552,30 @@ func listPrivilegeAssignmentsResponseFromWire(w *listPrivilegeAssignmentsRespons }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListPrivilegeAssignmentsResponse) MarshalJSON() ([]byte, error) { + w, err := listPrivilegeAssignmentsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListPrivilegeAssignmentsResponse) UnmarshalJSON(data []byte) error { + var w listPrivilegeAssignmentsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listPrivilegeAssignmentsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type permissionsChangeWire struct { Principal *string `json:"principal,omitempty"` Add []string `json:"add,omitempty"` @@ -363,6 +604,30 @@ func permissionsChangeFromWire(w *permissionsChangeWire) (*PermissionsChange, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PermissionsChange) MarshalJSON() ([]byte, error) { + w, err := permissionsChangeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PermissionsChange) UnmarshalJSON(data []byte) error { + var w permissionsChangeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := permissionsChangeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type privilegeAssignmentWire struct { Principal *string `json:"principal,omitempty"` Privileges []string `json:"privileges,omitempty"` @@ -388,6 +653,30 @@ func privilegeAssignmentFromWire(w *privilegeAssignmentWire) (*PrivilegeAssignme }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PrivilegeAssignment) MarshalJSON() ([]byte, error) { + w, err := privilegeAssignmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PrivilegeAssignment) UnmarshalJSON(data []byte) error { + var w privilegeAssignmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := privilegeAssignmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updatePermissionsRequestWire struct { SecurableType *string `json:"securable_type,omitempty"` SecurableFullName *string `json:"securable_full_name,omitempty"` @@ -427,6 +716,30 @@ func updatePermissionsRequestFromWire(w *updatePermissionsRequestWire) (*UpdateP }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdatePermissionsRequest) MarshalJSON() ([]byte, error) { + w, err := updatePermissionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdatePermissionsRequest) UnmarshalJSON(data []byte) error { + var w updatePermissionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updatePermissionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updatePermissionsResponseWire struct { PrivilegeAssignments []privilegeAssignmentWire `json:"privilege_assignments,omitempty"` } @@ -457,6 +770,30 @@ func updatePermissionsResponseFromWire(w *updatePermissionsResponseWire) (*Updat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdatePermissionsResponse) MarshalJSON() ([]byte, error) { + w, err := updatePermissionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdatePermissionsResponse) UnmarshalJSON(data []byte) error { + var w updatePermissionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updatePermissionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/metastores/CHANGELOG.md b/uc/metastores/CHANGELOG.md index ca91f64c..6714aa07 100644 --- a/uc/metastores/CHANGELOG.md +++ b/uc/metastores/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/uc/metastores/internal/version.go b/uc/metastores/internal/version.go index 99c9af98..162a8a60 100644 --- a/uc/metastores/internal/version.go +++ b/uc/metastores/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-metastores" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/uc/metastores/v1/wire.go b/uc/metastores/v1/wire.go index 19ccf6cf..727141e1 100644 --- a/uc/metastores/v1/wire.go +++ b/uc/metastores/v1/wire.go @@ -99,6 +99,30 @@ func accountsCreateMetastoreAssignmentRequestFromWire(w *accountsCreateMetastore }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsCreateMetastoreAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := accountsCreateMetastoreAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsCreateMetastoreAssignmentRequest) UnmarshalJSON(data []byte) error { + var w accountsCreateMetastoreAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsCreateMetastoreAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsCreateMetastoreAssignmentResponseWire struct { } @@ -116,6 +140,30 @@ func accountsCreateMetastoreAssignmentResponseFromWire(w *accountsCreateMetastor return &AccountsCreateMetastoreAssignmentResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsCreateMetastoreAssignmentResponse) MarshalJSON() ([]byte, error) { + w, err := accountsCreateMetastoreAssignmentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsCreateMetastoreAssignmentResponse) UnmarshalJSON(data []byte) error { + var w accountsCreateMetastoreAssignmentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsCreateMetastoreAssignmentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsCreateMetastoreRequestWire struct { AccountId *string `json:"account_id,omitempty"` MetastoreInfo *createAccountsMetastoreWire `json:"metastore_info,omitempty"` @@ -149,6 +197,30 @@ func accountsCreateMetastoreRequestFromWire(w *accountsCreateMetastoreRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsCreateMetastoreRequest) MarshalJSON() ([]byte, error) { + w, err := accountsCreateMetastoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsCreateMetastoreRequest) UnmarshalJSON(data []byte) error { + var w accountsCreateMetastoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsCreateMetastoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsCreateMetastoreResponseWire struct { MetastoreInfo *metastoreInfoWire `json:"metastore_info,omitempty"` } @@ -179,6 +251,30 @@ func accountsCreateMetastoreResponseFromWire(w *accountsCreateMetastoreResponseW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsCreateMetastoreResponse) MarshalJSON() ([]byte, error) { + w, err := accountsCreateMetastoreResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsCreateMetastoreResponse) UnmarshalJSON(data []byte) error { + var w accountsCreateMetastoreResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsCreateMetastoreResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsDeleteMetastoreAssignmentRequestWire struct { AccountId *string `json:"account_id,omitempty"` WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` @@ -215,6 +311,30 @@ func accountsDeleteMetastoreAssignmentRequestFromWire(w *accountsDeleteMetastore }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsDeleteMetastoreAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := accountsDeleteMetastoreAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsDeleteMetastoreAssignmentRequest) UnmarshalJSON(data []byte) error { + var w accountsDeleteMetastoreAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsDeleteMetastoreAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsDeleteMetastoreAssignmentResponseWire struct { } @@ -232,6 +352,30 @@ func accountsDeleteMetastoreAssignmentResponseFromWire(w *accountsDeleteMetastor return &AccountsDeleteMetastoreAssignmentResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsDeleteMetastoreAssignmentResponse) MarshalJSON() ([]byte, error) { + w, err := accountsDeleteMetastoreAssignmentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsDeleteMetastoreAssignmentResponse) UnmarshalJSON(data []byte) error { + var w accountsDeleteMetastoreAssignmentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsDeleteMetastoreAssignmentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsDeleteMetastoreRequestWire struct { AccountId *string `json:"account_id,omitempty"` MetastoreId *string `json:"metastore_id,omitempty"` @@ -260,6 +404,30 @@ func accountsDeleteMetastoreRequestFromWire(w *accountsDeleteMetastoreRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsDeleteMetastoreRequest) MarshalJSON() ([]byte, error) { + w, err := accountsDeleteMetastoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsDeleteMetastoreRequest) UnmarshalJSON(data []byte) error { + var w accountsDeleteMetastoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsDeleteMetastoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsDeleteMetastoreResponseWire struct { } @@ -277,6 +445,30 @@ func accountsDeleteMetastoreResponseFromWire(w *accountsDeleteMetastoreResponseW return &AccountsDeleteMetastoreResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsDeleteMetastoreResponse) MarshalJSON() ([]byte, error) { + w, err := accountsDeleteMetastoreResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsDeleteMetastoreResponse) UnmarshalJSON(data []byte) error { + var w accountsDeleteMetastoreResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsDeleteMetastoreResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsGetMetastoreAssignmentRequestWire struct { AccountId *string `json:"account_id,omitempty"` WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` @@ -310,6 +502,30 @@ func accountsGetMetastoreAssignmentRequestFromWire(w *accountsGetMetastoreAssign }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsGetMetastoreAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := accountsGetMetastoreAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsGetMetastoreAssignmentRequest) UnmarshalJSON(data []byte) error { + var w accountsGetMetastoreAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsGetMetastoreAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsGetMetastoreAssignmentResponseWire struct { MetastoreAssignment *metastoreAssignmentWire `json:"metastore_assignment,omitempty"` } @@ -340,6 +556,30 @@ func accountsGetMetastoreAssignmentResponseFromWire(w *accountsGetMetastoreAssig }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsGetMetastoreAssignmentResponse) MarshalJSON() ([]byte, error) { + w, err := accountsGetMetastoreAssignmentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsGetMetastoreAssignmentResponse) UnmarshalJSON(data []byte) error { + var w accountsGetMetastoreAssignmentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsGetMetastoreAssignmentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsGetMetastoreRequestWire struct { AccountId *string `json:"account_id,omitempty"` MetastoreId *string `json:"metastore_id,omitempty"` @@ -365,6 +605,30 @@ func accountsGetMetastoreRequestFromWire(w *accountsGetMetastoreRequestWire) (*A }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsGetMetastoreRequest) MarshalJSON() ([]byte, error) { + w, err := accountsGetMetastoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsGetMetastoreRequest) UnmarshalJSON(data []byte) error { + var w accountsGetMetastoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsGetMetastoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsGetMetastoreResponseWire struct { MetastoreInfo *metastoreInfoWire `json:"metastore_info,omitempty"` } @@ -395,6 +659,30 @@ func accountsGetMetastoreResponseFromWire(w *accountsGetMetastoreResponseWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsGetMetastoreResponse) MarshalJSON() ([]byte, error) { + w, err := accountsGetMetastoreResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsGetMetastoreResponse) UnmarshalJSON(data []byte) error { + var w accountsGetMetastoreResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsGetMetastoreResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsListMetastoresRequestWire struct { AccountId *string `json:"account_id,omitempty"` } @@ -417,6 +705,30 @@ func accountsListMetastoresRequestFromWire(w *accountsListMetastoresRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsListMetastoresRequest) MarshalJSON() ([]byte, error) { + w, err := accountsListMetastoresRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsListMetastoresRequest) UnmarshalJSON(data []byte) error { + var w accountsListMetastoresRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsListMetastoresRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsListMetastoresResponseWire struct { Metastores []metastoreInfoWire `json:"metastores,omitempty"` } @@ -447,6 +759,30 @@ func accountsListMetastoresResponseFromWire(w *accountsListMetastoresResponseWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsListMetastoresResponse) MarshalJSON() ([]byte, error) { + w, err := accountsListMetastoresResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsListMetastoresResponse) UnmarshalJSON(data []byte) error { + var w accountsListMetastoresResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsListMetastoresResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsListWorkspaceIdsForMetastoreRequestWire struct { AccountId *string `json:"account_id,omitempty"` MetastoreId *string `json:"metastore_id,omitempty"` @@ -472,6 +808,30 @@ func accountsListWorkspaceIdsForMetastoreRequestFromWire(w *accountsListWorkspac }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsListWorkspaceIdsForMetastoreRequest) MarshalJSON() ([]byte, error) { + w, err := accountsListWorkspaceIdsForMetastoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsListWorkspaceIdsForMetastoreRequest) UnmarshalJSON(data []byte) error { + var w accountsListWorkspaceIdsForMetastoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsListWorkspaceIdsForMetastoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsListWorkspaceIdsForMetastoreResponseWire struct { WorkspaceIds []wireInt64 `json:"workspace_ids,omitempty"` } @@ -502,6 +862,30 @@ func accountsListWorkspaceIdsForMetastoreResponseFromWire(w *accountsListWorkspa }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsListWorkspaceIdsForMetastoreResponse) MarshalJSON() ([]byte, error) { + w, err := accountsListWorkspaceIdsForMetastoreResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsListWorkspaceIdsForMetastoreResponse) UnmarshalJSON(data []byte) error { + var w accountsListWorkspaceIdsForMetastoreResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsListWorkspaceIdsForMetastoreResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsUpdateMetastoreAssignmentRequestWire struct { AccountId *string `json:"account_id,omitempty"` WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` @@ -549,6 +933,30 @@ func accountsUpdateMetastoreAssignmentRequestFromWire(w *accountsUpdateMetastore }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsUpdateMetastoreAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := accountsUpdateMetastoreAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsUpdateMetastoreAssignmentRequest) UnmarshalJSON(data []byte) error { + var w accountsUpdateMetastoreAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsUpdateMetastoreAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsUpdateMetastoreAssignmentResponseWire struct { } @@ -566,6 +974,30 @@ func accountsUpdateMetastoreAssignmentResponseFromWire(w *accountsUpdateMetastor return &AccountsUpdateMetastoreAssignmentResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsUpdateMetastoreAssignmentResponse) MarshalJSON() ([]byte, error) { + w, err := accountsUpdateMetastoreAssignmentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsUpdateMetastoreAssignmentResponse) UnmarshalJSON(data []byte) error { + var w accountsUpdateMetastoreAssignmentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsUpdateMetastoreAssignmentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsUpdateMetastoreRequestWire struct { AccountId *string `json:"account_id,omitempty"` MetastoreId *string `json:"metastore_id,omitempty"` @@ -602,6 +1034,30 @@ func accountsUpdateMetastoreRequestFromWire(w *accountsUpdateMetastoreRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsUpdateMetastoreRequest) MarshalJSON() ([]byte, error) { + w, err := accountsUpdateMetastoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsUpdateMetastoreRequest) UnmarshalJSON(data []byte) error { + var w accountsUpdateMetastoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsUpdateMetastoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type accountsUpdateMetastoreResponseWire struct { MetastoreInfo *metastoreInfoWire `json:"metastore_info,omitempty"` } @@ -632,6 +1088,30 @@ func accountsUpdateMetastoreResponseFromWire(w *accountsUpdateMetastoreResponseW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccountsUpdateMetastoreResponse) MarshalJSON() ([]byte, error) { + w, err := accountsUpdateMetastoreResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccountsUpdateMetastoreResponse) UnmarshalJSON(data []byte) error { + var w accountsUpdateMetastoreResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accountsUpdateMetastoreResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAccountsMetastoreWire struct { Name *string `json:"name,omitempty"` StorageRoot *string `json:"storage_root,omitempty"` @@ -732,6 +1212,30 @@ func createAccountsMetastoreFromWire(w *createAccountsMetastoreWire) (*CreateAcc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAccountsMetastore) MarshalJSON() ([]byte, error) { + w, err := createAccountsMetastoreToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAccountsMetastore) UnmarshalJSON(data []byte) error { + var w createAccountsMetastoreWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAccountsMetastoreFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createMetastoreAssignmentRequestWire struct { WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` MetastoreId *string `json:"metastore_id,omitempty"` @@ -768,6 +1272,30 @@ func createMetastoreAssignmentRequestFromWire(w *createMetastoreAssignmentReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateMetastoreAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := createMetastoreAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateMetastoreAssignmentRequest) UnmarshalJSON(data []byte) error { + var w createMetastoreAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createMetastoreAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createMetastoreAssignmentResponseWire struct { } @@ -785,6 +1313,30 @@ func createMetastoreAssignmentResponseFromWire(w *createMetastoreAssignmentRespo return &CreateMetastoreAssignmentResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateMetastoreAssignmentResponse) MarshalJSON() ([]byte, error) { + w, err := createMetastoreAssignmentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateMetastoreAssignmentResponse) UnmarshalJSON(data []byte) error { + var w createMetastoreAssignmentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createMetastoreAssignmentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createMetastoreRequestWire struct { Name *string `json:"name,omitempty"` StorageRoot *string `json:"storage_root,omitempty"` @@ -885,6 +1437,30 @@ func createMetastoreRequestFromWire(w *createMetastoreRequestWire) (*CreateMetas }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateMetastoreRequest) MarshalJSON() ([]byte, error) { + w, err := createMetastoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateMetastoreRequest) UnmarshalJSON(data []byte) error { + var w createMetastoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createMetastoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteMetastoreAssignmentRequestWire struct { WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` MetastoreId *string `json:"metastore_id,omitempty"` @@ -918,6 +1494,30 @@ func deleteMetastoreAssignmentRequestFromWire(w *deleteMetastoreAssignmentReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteMetastoreAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := deleteMetastoreAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteMetastoreAssignmentRequest) UnmarshalJSON(data []byte) error { + var w deleteMetastoreAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteMetastoreAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteMetastoreAssignmentResponseWire struct { } @@ -935,6 +1535,30 @@ func deleteMetastoreAssignmentResponseFromWire(w *deleteMetastoreAssignmentRespo return &DeleteMetastoreAssignmentResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteMetastoreAssignmentResponse) MarshalJSON() ([]byte, error) { + w, err := deleteMetastoreAssignmentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteMetastoreAssignmentResponse) UnmarshalJSON(data []byte) error { + var w deleteMetastoreAssignmentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteMetastoreAssignmentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteMetastoreRequestWire struct { Id *string `json:"id,omitempty"` Force *bool `json:"force,omitempty"` @@ -960,6 +1584,30 @@ func deleteMetastoreRequestFromWire(w *deleteMetastoreRequestWire) (*DeleteMetas }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteMetastoreRequest) MarshalJSON() ([]byte, error) { + w, err := deleteMetastoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteMetastoreRequest) UnmarshalJSON(data []byte) error { + var w deleteMetastoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteMetastoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteMetastoreResponseWire struct { } @@ -977,6 +1625,30 @@ func deleteMetastoreResponseFromWire(w *deleteMetastoreResponseWire) (*DeleteMet return &DeleteMetastoreResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteMetastoreResponse) MarshalJSON() ([]byte, error) { + w, err := deleteMetastoreResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteMetastoreResponse) UnmarshalJSON(data []byte) error { + var w deleteMetastoreResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteMetastoreResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deltaSharingScopeWire struct { } @@ -994,6 +1666,30 @@ func deltaSharingScopeFromWire(w *deltaSharingScopeWire) (*DeltaSharingScope, er return &DeltaSharingScope{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeltaSharingScope) MarshalJSON() ([]byte, error) { + w, err := deltaSharingScopeToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeltaSharingScope) UnmarshalJSON(data []byte) error { + var w deltaSharingScopeWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deltaSharingScopeFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCurrentMetastoreAssignmentRequestWire struct { } @@ -1011,6 +1707,30 @@ func getCurrentMetastoreAssignmentRequestFromWire(w *getCurrentMetastoreAssignme return &GetCurrentMetastoreAssignmentRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCurrentMetastoreAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := getCurrentMetastoreAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCurrentMetastoreAssignmentRequest) UnmarshalJSON(data []byte) error { + var w getCurrentMetastoreAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCurrentMetastoreAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getMetastoreRequestWire struct { Id *string `json:"id,omitempty"` } @@ -1033,6 +1753,30 @@ func getMetastoreRequestFromWire(w *getMetastoreRequestWire) (*GetMetastoreReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetMetastoreRequest) MarshalJSON() ([]byte, error) { + w, err := getMetastoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetMetastoreRequest) UnmarshalJSON(data []byte) error { + var w getMetastoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getMetastoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getMetastoreSummaryRequestWire struct { } @@ -1050,6 +1794,30 @@ func getMetastoreSummaryRequestFromWire(w *getMetastoreSummaryRequestWire) (*Get return &GetMetastoreSummaryRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetMetastoreSummaryRequest) MarshalJSON() ([]byte, error) { + w, err := getMetastoreSummaryRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetMetastoreSummaryRequest) UnmarshalJSON(data []byte) error { + var w getMetastoreSummaryRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getMetastoreSummaryRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getMetastoreSummaryResponseWire struct { MetastoreId *string `json:"metastore_id,omitempty"` Name *string `json:"name,omitempty"` @@ -1150,6 +1918,30 @@ func getMetastoreSummaryResponseFromWire(w *getMetastoreSummaryResponseWire) (*G }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetMetastoreSummaryResponse) MarshalJSON() ([]byte, error) { + w, err := getMetastoreSummaryResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetMetastoreSummaryResponse) UnmarshalJSON(data []byte) error { + var w getMetastoreSummaryResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getMetastoreSummaryResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listMetastoresRequestWire struct { MaxResults *int `json:"max_results,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -1175,6 +1967,30 @@ func listMetastoresRequestFromWire(w *listMetastoresRequestWire) (*ListMetastore }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListMetastoresRequest) MarshalJSON() ([]byte, error) { + w, err := listMetastoresRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListMetastoresRequest) UnmarshalJSON(data []byte) error { + var w listMetastoresRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listMetastoresRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listMetastoresResponseWire struct { Metastores []metastoreInfoWire `json:"metastores,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1208,6 +2024,30 @@ func listMetastoresResponseFromWire(w *listMetastoresResponseWire) (*ListMetasto }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListMetastoresResponse) MarshalJSON() ([]byte, error) { + w, err := listMetastoresResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListMetastoresResponse) UnmarshalJSON(data []byte) error { + var w listMetastoresResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listMetastoresResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type metastoreAssignmentWire struct { WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` MetastoreId *string `json:"metastore_id,omitempty"` @@ -1244,6 +2084,30 @@ func metastoreAssignmentFromWire(w *metastoreAssignmentWire) (*MetastoreAssignme }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MetastoreAssignment) MarshalJSON() ([]byte, error) { + w, err := metastoreAssignmentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MetastoreAssignment) UnmarshalJSON(data []byte) error { + var w metastoreAssignmentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := metastoreAssignmentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type metastoreInfoWire struct { Name *string `json:"name,omitempty"` StorageRoot *string `json:"storage_root,omitempty"` @@ -1344,6 +2208,30 @@ func metastoreInfoFromWire(w *metastoreInfoWire) (*MetastoreInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MetastoreInfo) MarshalJSON() ([]byte, error) { + w, err := metastoreInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MetastoreInfo) UnmarshalJSON(data []byte) error { + var w metastoreInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := metastoreInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type undropMetastoreByIdRequestWire struct { Id *string `json:"id,omitempty"` } @@ -1366,6 +2254,30 @@ func undropMetastoreByIdRequestFromWire(w *undropMetastoreByIdRequestWire) (*Und }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UndropMetastoreByIdRequest) MarshalJSON() ([]byte, error) { + w, err := undropMetastoreByIdRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UndropMetastoreByIdRequest) UnmarshalJSON(data []byte) error { + var w undropMetastoreByIdRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := undropMetastoreByIdRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateAccountsMetastoreWire struct { Name *string `json:"name,omitempty"` StorageRoot *string `json:"storage_root,omitempty"` @@ -1466,6 +2378,30 @@ func updateAccountsMetastoreFromWire(w *updateAccountsMetastoreWire) (*UpdateAcc }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateAccountsMetastore) MarshalJSON() ([]byte, error) { + w, err := updateAccountsMetastoreToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateAccountsMetastore) UnmarshalJSON(data []byte) error { + var w updateAccountsMetastoreWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateAccountsMetastoreFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateMetastoreAssignmentRequestWire struct { WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` MetastoreId *string `json:"metastore_id,omitempty"` @@ -1502,6 +2438,30 @@ func updateMetastoreAssignmentRequestFromWire(w *updateMetastoreAssignmentReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateMetastoreAssignmentRequest) MarshalJSON() ([]byte, error) { + w, err := updateMetastoreAssignmentRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateMetastoreAssignmentRequest) UnmarshalJSON(data []byte) error { + var w updateMetastoreAssignmentRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateMetastoreAssignmentRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateMetastoreAssignmentResponseWire struct { } @@ -1519,6 +2479,30 @@ func updateMetastoreAssignmentResponseFromWire(w *updateMetastoreAssignmentRespo return &UpdateMetastoreAssignmentResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateMetastoreAssignmentResponse) MarshalJSON() ([]byte, error) { + w, err := updateMetastoreAssignmentResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateMetastoreAssignmentResponse) UnmarshalJSON(data []byte) error { + var w updateMetastoreAssignmentResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateMetastoreAssignmentResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateMetastoreRequestWire struct { Id *string `json:"id,omitempty"` NewName *string `json:"new_name,omitempty"` @@ -1625,6 +2609,30 @@ func updateMetastoreRequestFromWire(w *updateMetastoreRequestWire) (*UpdateMetas }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateMetastoreRequest) MarshalJSON() ([]byte, error) { + w, err := updateMetastoreRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateMetastoreRequest) UnmarshalJSON(data []byte) error { + var w updateMetastoreRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateMetastoreRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/onlinetables/CHANGELOG.md b/uc/onlinetables/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/uc/onlinetables/CHANGELOG.md +++ b/uc/onlinetables/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/uc/onlinetables/internal/version.go b/uc/onlinetables/internal/version.go index 9be5ac99..e097e31b 100644 --- a/uc/onlinetables/internal/version.go +++ b/uc/onlinetables/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-onlinetables" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/uc/onlinetables/v1/wire.go b/uc/onlinetables/v1/wire.go index b4c546ed..88895808 100644 --- a/uc/onlinetables/v1/wire.go +++ b/uc/onlinetables/v1/wire.go @@ -98,6 +98,30 @@ func continuousUpdateStatusFromWire(w *continuousUpdateStatusWire) (*ContinuousU }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ContinuousUpdateStatus) MarshalJSON() ([]byte, error) { + w, err := continuousUpdateStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ContinuousUpdateStatus) UnmarshalJSON(data []byte) error { + var w continuousUpdateStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := continuousUpdateStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createOnlineTableRequestWire struct { Table *onlineTableWire `json:"table,omitempty"` } @@ -128,6 +152,30 @@ func createOnlineTableRequestFromWire(w *createOnlineTableRequestWire) (*CreateO }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateOnlineTableRequest) MarshalJSON() ([]byte, error) { + w, err := createOnlineTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateOnlineTableRequest) UnmarshalJSON(data []byte) error { + var w createOnlineTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createOnlineTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteOnlineTableRequestWire struct { Name *string `json:"name,omitempty"` } @@ -150,6 +198,30 @@ func deleteOnlineTableRequestFromWire(w *deleteOnlineTableRequestWire) (*DeleteO }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteOnlineTableRequest) MarshalJSON() ([]byte, error) { + w, err := deleteOnlineTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteOnlineTableRequest) UnmarshalJSON(data []byte) error { + var w deleteOnlineTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteOnlineTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type failedStatusWire struct { LastProcessedCommitVersion *wireInt64 `json:"last_processed_commit_version,omitempty"` Timestamp *types.Time `json:"timestamp,omitempty"` @@ -183,6 +255,30 @@ func failedStatusFromWire(w *failedStatusWire) (*FailedStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FailedStatus) MarshalJSON() ([]byte, error) { + w, err := failedStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FailedStatus) UnmarshalJSON(data []byte) error { + var w failedStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := failedStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getOnlineTableRequestWire struct { Name *string `json:"name,omitempty"` } @@ -205,6 +301,30 @@ func getOnlineTableRequestFromWire(w *getOnlineTableRequestWire) (*GetOnlineTabl }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetOnlineTableRequest) MarshalJSON() ([]byte, error) { + w, err := getOnlineTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetOnlineTableRequest) UnmarshalJSON(data []byte) error { + var w getOnlineTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getOnlineTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type onlineTableWire struct { Name *string `json:"name,omitempty"` Spec *onlineTableSpecWire `json:"spec,omitempty"` @@ -255,6 +375,30 @@ func onlineTableFromWire(w *onlineTableWire) (*OnlineTable, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OnlineTable) MarshalJSON() ([]byte, error) { + w, err := onlineTableToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OnlineTable) UnmarshalJSON(data []byte) error { + var w onlineTableWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := onlineTableFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type onlineTableSpecWire struct { RunContinuously *onlineTableSpec_ContinuousSchedulingPolicyWire `json:"run_continuously,omitempty"` RunTriggered *onlineTableSpec_TriggeredSchedulingPolicyWire `json:"run_triggered,omitempty"` @@ -342,6 +486,30 @@ func onlineTableSpecFromWire(w *onlineTableSpecWire) (*OnlineTableSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OnlineTableSpec) MarshalJSON() ([]byte, error) { + w, err := onlineTableSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OnlineTableSpec) UnmarshalJSON(data []byte) error { + var w onlineTableSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := onlineTableSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type onlineTableSpec_ContinuousSchedulingPolicyWire struct { } @@ -359,6 +527,30 @@ func onlineTableSpec_ContinuousSchedulingPolicyFromWire(w *onlineTableSpec_Conti return &OnlineTableSpec_ContinuousSchedulingPolicy{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OnlineTableSpec_ContinuousSchedulingPolicy) MarshalJSON() ([]byte, error) { + w, err := onlineTableSpec_ContinuousSchedulingPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OnlineTableSpec_ContinuousSchedulingPolicy) UnmarshalJSON(data []byte) error { + var w onlineTableSpec_ContinuousSchedulingPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := onlineTableSpec_ContinuousSchedulingPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type onlineTableSpec_TriggeredSchedulingPolicyWire struct { } @@ -376,6 +568,30 @@ func onlineTableSpec_TriggeredSchedulingPolicyFromWire(w *onlineTableSpec_Trigge return &OnlineTableSpec_TriggeredSchedulingPolicy{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OnlineTableSpec_TriggeredSchedulingPolicy) MarshalJSON() ([]byte, error) { + w, err := onlineTableSpec_TriggeredSchedulingPolicyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OnlineTableSpec_TriggeredSchedulingPolicy) UnmarshalJSON(data []byte) error { + var w onlineTableSpec_TriggeredSchedulingPolicyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := onlineTableSpec_TriggeredSchedulingPolicyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type onlineTableStatusWire struct { DetailedState OnlineTableState `json:"detailed_state,omitempty"` Message *string `json:"message,omitempty"` @@ -494,6 +710,30 @@ func onlineTableStatusFromWire(w *onlineTableStatusWire) (*OnlineTableStatus, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OnlineTableStatus) MarshalJSON() ([]byte, error) { + w, err := onlineTableStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OnlineTableStatus) UnmarshalJSON(data []byte) error { + var w onlineTableStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := onlineTableStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type pipelineProgressWire struct { LatestVersionCurrentlyProcessing *wireInt64 `json:"latest_version_currently_processing,omitempty"` SyncedRowCount *wireInt64 `json:"synced_row_count,omitempty"` @@ -552,6 +792,30 @@ func pipelineProgressFromWire(w *pipelineProgressWire) (*PipelineProgress, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PipelineProgress) MarshalJSON() ([]byte, error) { + w, err := pipelineProgressToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PipelineProgress) UnmarshalJSON(data []byte) error { + var w pipelineProgressWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := pipelineProgressFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type provisioningInfoWire struct { } @@ -569,6 +833,30 @@ func provisioningInfoFromWire(w *provisioningInfoWire) (*ProvisioningInfo, error return &ProvisioningInfo{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProvisioningInfo) MarshalJSON() ([]byte, error) { + w, err := provisioningInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProvisioningInfo) UnmarshalJSON(data []byte) error { + var w provisioningInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := provisioningInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type provisioningStatusWire struct { InitialPipelineSyncProgress *pipelineProgressWire `json:"initial_pipeline_sync_progress,omitempty"` } @@ -599,6 +887,30 @@ func provisioningStatusFromWire(w *provisioningStatusWire) (*ProvisioningStatus, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ProvisioningStatus) MarshalJSON() ([]byte, error) { + w, err := provisioningStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ProvisioningStatus) UnmarshalJSON(data []byte) error { + var w provisioningStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := provisioningStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type triggeredUpdateStatusWire struct { LastProcessedCommitVersion *wireInt64 `json:"last_processed_commit_version,omitempty"` Timestamp *types.Time `json:"timestamp,omitempty"` @@ -642,3 +954,27 @@ func triggeredUpdateStatusFromWire(w *triggeredUpdateStatusWire) (*TriggeredUpda TriggeredUpdateProgress: triggeredUpdateProgressPublicValue, }, nil } + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TriggeredUpdateStatus) MarshalJSON() ([]byte, error) { + w, err := triggeredUpdateStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TriggeredUpdateStatus) UnmarshalJSON(data []byte) error { + var w triggeredUpdateStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := triggeredUpdateStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} diff --git a/uc/registeredmodels/CHANGELOG.md b/uc/registeredmodels/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/uc/registeredmodels/CHANGELOG.md +++ b/uc/registeredmodels/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/uc/registeredmodels/internal/version.go b/uc/registeredmodels/internal/version.go index 057a2695..ca2f92e4 100644 --- a/uc/registeredmodels/internal/version.go +++ b/uc/registeredmodels/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-registeredmodels" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/uc/registeredmodels/v1/wire.go b/uc/registeredmodels/v1/wire.go index adb89e84..57db9713 100644 --- a/uc/registeredmodels/v1/wire.go +++ b/uc/registeredmodels/v1/wire.go @@ -74,6 +74,30 @@ func connectionDependencyFromWire(w *connectionDependencyWire) (*ConnectionDepen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ConnectionDependency) MarshalJSON() ([]byte, error) { + w, err := connectionDependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ConnectionDependency) UnmarshalJSON(data []byte) error { + var w connectionDependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := connectionDependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createRegisteredModelRequestWire struct { Name *string `json:"name,omitempty"` CatalogName *string `json:"catalog_name,omitempty"` @@ -159,6 +183,30 @@ func createRegisteredModelRequestFromWire(w *createRegisteredModelRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateRegisteredModelRequest) MarshalJSON() ([]byte, error) { + w, err := createRegisteredModelRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateRegisteredModelRequest) UnmarshalJSON(data []byte) error { + var w createRegisteredModelRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createRegisteredModelRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type credentialDependencyWire struct { CredentialName *string `json:"credential_name,omitempty"` } @@ -181,6 +229,30 @@ func credentialDependencyFromWire(w *credentialDependencyWire) (*CredentialDepen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CredentialDependency) MarshalJSON() ([]byte, error) { + w, err := credentialDependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CredentialDependency) UnmarshalJSON(data []byte) error { + var w credentialDependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := credentialDependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteModelVersionRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` VersionArg *wireInt64 `json:"version_arg,omitempty"` @@ -214,6 +286,30 @@ func deleteModelVersionRequestFromWire(w *deleteModelVersionRequestWire) (*Delet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteModelVersionRequest) MarshalJSON() ([]byte, error) { + w, err := deleteModelVersionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteModelVersionRequest) UnmarshalJSON(data []byte) error { + var w deleteModelVersionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteModelVersionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteModelVersionResponseWire struct { } @@ -231,6 +327,30 @@ func deleteModelVersionResponseFromWire(w *deleteModelVersionResponseWire) (*Del return &DeleteModelVersionResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteModelVersionResponse) MarshalJSON() ([]byte, error) { + w, err := deleteModelVersionResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteModelVersionResponse) UnmarshalJSON(data []byte) error { + var w deleteModelVersionResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteModelVersionResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRegisteredModelAliasRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` AliasArg *string `json:"alias_arg,omitempty"` @@ -256,6 +376,30 @@ func deleteRegisteredModelAliasRequestFromWire(w *deleteRegisteredModelAliasRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRegisteredModelAliasRequest) MarshalJSON() ([]byte, error) { + w, err := deleteRegisteredModelAliasRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRegisteredModelAliasRequest) UnmarshalJSON(data []byte) error { + var w deleteRegisteredModelAliasRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRegisteredModelAliasRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRegisteredModelAliasResponseWire struct { } @@ -273,6 +417,30 @@ func deleteRegisteredModelAliasResponseFromWire(w *deleteRegisteredModelAliasRes return &DeleteRegisteredModelAliasResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRegisteredModelAliasResponse) MarshalJSON() ([]byte, error) { + w, err := deleteRegisteredModelAliasResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRegisteredModelAliasResponse) UnmarshalJSON(data []byte) error { + var w deleteRegisteredModelAliasResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRegisteredModelAliasResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRegisteredModelRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` } @@ -295,6 +463,30 @@ func deleteRegisteredModelRequestFromWire(w *deleteRegisteredModelRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRegisteredModelRequest) MarshalJSON() ([]byte, error) { + w, err := deleteRegisteredModelRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRegisteredModelRequest) UnmarshalJSON(data []byte) error { + var w deleteRegisteredModelRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRegisteredModelRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteRegisteredModelResponseWire struct { } @@ -312,6 +504,30 @@ func deleteRegisteredModelResponseFromWire(w *deleteRegisteredModelResponseWire) return &DeleteRegisteredModelResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRegisteredModelResponse) MarshalJSON() ([]byte, error) { + w, err := deleteRegisteredModelResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRegisteredModelResponse) UnmarshalJSON(data []byte) error { + var w deleteRegisteredModelResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRegisteredModelResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dependencyWire struct { Table *tableDependencyWire `json:"table,omitempty"` Function *functionDependencyWire `json:"function,omitempty"` @@ -424,6 +640,30 @@ func dependencyFromWire(w *dependencyWire) (*Dependency, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Dependency) MarshalJSON() ([]byte, error) { + w, err := dependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Dependency) UnmarshalJSON(data []byte) error { + var w dependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dependencyListWire struct { Dependencies []dependencyWire `json:"dependencies,omitempty"` } @@ -454,6 +694,30 @@ func dependencyListFromWire(w *dependencyListWire) (*DependencyList, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DependencyList) MarshalJSON() ([]byte, error) { + w, err := dependencyListToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DependencyList) UnmarshalJSON(data []byte) error { + var w dependencyListWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dependencyListFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type functionDependencyWire struct { FunctionFullName *string `json:"function_full_name,omitempty"` } @@ -476,6 +740,30 @@ func functionDependencyFromWire(w *functionDependencyWire) (*FunctionDependency, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FunctionDependency) MarshalJSON() ([]byte, error) { + w, err := functionDependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FunctionDependency) UnmarshalJSON(data []byte) error { + var w functionDependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := functionDependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getModelVersionByAliasRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` AliasArg *string `json:"alias_arg,omitempty"` @@ -504,6 +792,30 @@ func getModelVersionByAliasRequestFromWire(w *getModelVersionByAliasRequestWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetModelVersionByAliasRequest) MarshalJSON() ([]byte, error) { + w, err := getModelVersionByAliasRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetModelVersionByAliasRequest) UnmarshalJSON(data []byte) error { + var w getModelVersionByAliasRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getModelVersionByAliasRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getModelVersionRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` VersionArg *wireInt64 `json:"version_arg,omitempty"` @@ -543,6 +855,30 @@ func getModelVersionRequestFromWire(w *getModelVersionRequestWire) (*GetModelVer }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetModelVersionRequest) MarshalJSON() ([]byte, error) { + w, err := getModelVersionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetModelVersionRequest) UnmarshalJSON(data []byte) error { + var w getModelVersionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getModelVersionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getRegisteredModelRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` IncludeAliases *bool `json:"include_aliases,omitempty"` @@ -571,6 +907,30 @@ func getRegisteredModelRequestFromWire(w *getRegisteredModelRequestWire) (*GetRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetRegisteredModelRequest) MarshalJSON() ([]byte, error) { + w, err := getRegisteredModelRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetRegisteredModelRequest) UnmarshalJSON(data []byte) error { + var w getRegisteredModelRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getRegisteredModelRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listModelVersionsRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` MaxResults *wireInt64 `json:"max_results,omitempty"` @@ -610,6 +970,30 @@ func listModelVersionsRequestFromWire(w *listModelVersionsRequestWire) (*ListMod }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListModelVersionsRequest) MarshalJSON() ([]byte, error) { + w, err := listModelVersionsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListModelVersionsRequest) UnmarshalJSON(data []byte) error { + var w listModelVersionsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listModelVersionsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listModelVersionsResponseWire struct { ModelVersions []modelVersionInfoWire `json:"model_versions,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -643,6 +1027,30 @@ func listModelVersionsResponseFromWire(w *listModelVersionsResponseWire) (*ListM }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListModelVersionsResponse) MarshalJSON() ([]byte, error) { + w, err := listModelVersionsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListModelVersionsResponse) UnmarshalJSON(data []byte) error { + var w listModelVersionsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listModelVersionsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRegisteredModelsRequestWire struct { CatalogName *string `json:"catalog_name,omitempty"` SchemaName *string `json:"schema_name,omitempty"` @@ -685,6 +1093,30 @@ func listRegisteredModelsRequestFromWire(w *listRegisteredModelsRequestWire) (*L }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRegisteredModelsRequest) MarshalJSON() ([]byte, error) { + w, err := listRegisteredModelsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRegisteredModelsRequest) UnmarshalJSON(data []byte) error { + var w listRegisteredModelsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRegisteredModelsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRegisteredModelsResponseWire struct { RegisteredModels []registeredModelInfoWire `json:"registered_models,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -718,6 +1150,30 @@ func listRegisteredModelsResponseFromWire(w *listRegisteredModelsResponseWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRegisteredModelsResponse) MarshalJSON() ([]byte, error) { + w, err := listRegisteredModelsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRegisteredModelsResponse) UnmarshalJSON(data []byte) error { + var w listRegisteredModelsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRegisteredModelsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type modelVersionInfoWire struct { ModelName *string `json:"model_name,omitempty"` CatalogName *string `json:"catalog_name,omitempty"` @@ -839,6 +1295,30 @@ func modelVersionInfoFromWire(w *modelVersionInfoWire) (*ModelVersionInfo, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ModelVersionInfo) MarshalJSON() ([]byte, error) { + w, err := modelVersionInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ModelVersionInfo) UnmarshalJSON(data []byte) error { + var w modelVersionInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := modelVersionInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type registeredModelAliasInfoWire struct { AliasName *string `json:"alias_name,omitempty"` VersionNum *wireInt64 `json:"version_num,omitempty"` @@ -884,6 +1364,30 @@ func registeredModelAliasInfoFromWire(w *registeredModelAliasInfoWire) (*Registe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RegisteredModelAliasInfo) MarshalJSON() ([]byte, error) { + w, err := registeredModelAliasInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RegisteredModelAliasInfo) UnmarshalJSON(data []byte) error { + var w registeredModelAliasInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := registeredModelAliasInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type registeredModelInfoWire struct { Name *string `json:"name,omitempty"` CatalogName *string `json:"catalog_name,omitempty"` @@ -969,6 +1473,30 @@ func registeredModelInfoFromWire(w *registeredModelInfoWire) (*RegisteredModelIn }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RegisteredModelInfo) MarshalJSON() ([]byte, error) { + w, err := registeredModelInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RegisteredModelInfo) UnmarshalJSON(data []byte) error { + var w registeredModelInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := registeredModelInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type setRegisteredModelAliasRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` AliasArg *string `json:"alias_arg,omitempty"` @@ -1005,6 +1533,30 @@ func setRegisteredModelAliasRequestFromWire(w *setRegisteredModelAliasRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SetRegisteredModelAliasRequest) MarshalJSON() ([]byte, error) { + w, err := setRegisteredModelAliasRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SetRegisteredModelAliasRequest) UnmarshalJSON(data []byte) error { + var w setRegisteredModelAliasRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := setRegisteredModelAliasRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tableDependencyWire struct { TableFullName *string `json:"table_full_name,omitempty"` } @@ -1027,6 +1579,30 @@ func tableDependencyFromWire(w *tableDependencyWire) (*TableDependency, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TableDependency) MarshalJSON() ([]byte, error) { + w, err := tableDependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TableDependency) UnmarshalJSON(data []byte) error { + var w tableDependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tableDependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateModelVersionRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` VersionArg *wireInt64 `json:"version_arg,omitempty"` @@ -1162,6 +1738,30 @@ func updateModelVersionRequestFromWire(w *updateModelVersionRequestWire) (*Updat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateModelVersionRequest) MarshalJSON() ([]byte, error) { + w, err := updateModelVersionRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateModelVersionRequest) UnmarshalJSON(data []byte) error { + var w updateModelVersionRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateModelVersionRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateRegisteredModelRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` NewName *string `json:"new_name,omitempty"` @@ -1253,6 +1853,30 @@ func updateRegisteredModelRequestFromWire(w *updateRegisteredModelRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateRegisteredModelRequest) MarshalJSON() ([]byte, error) { + w, err := updateRegisteredModelRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateRegisteredModelRequest) UnmarshalJSON(data []byte) error { + var w updateRegisteredModelRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateRegisteredModelRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/resourcequotas/CHANGELOG.md b/uc/resourcequotas/CHANGELOG.md index 683ad314..b7192c93 100644 --- a/uc/resourcequotas/CHANGELOG.md +++ b/uc/resourcequotas/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/uc/resourcequotas/internal/version.go b/uc/resourcequotas/internal/version.go index 3358ff1f..78c1cb38 100644 --- a/uc/resourcequotas/internal/version.go +++ b/uc/resourcequotas/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-resourcequotas" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/uc/resourcequotas/v1/wire.go b/uc/resourcequotas/v1/wire.go index 1799a236..33392ed6 100644 --- a/uc/resourcequotas/v1/wire.go +++ b/uc/resourcequotas/v1/wire.go @@ -80,6 +80,30 @@ func getQuotaRequestFromWire(w *getQuotaRequestWire) (*GetQuotaRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetQuotaRequest) MarshalJSON() ([]byte, error) { + w, err := getQuotaRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetQuotaRequest) UnmarshalJSON(data []byte) error { + var w getQuotaRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getQuotaRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getQuotaResponseWire struct { QuotaInfo *quotaInfoWire `json:"quota_info,omitempty"` } @@ -110,6 +134,30 @@ func getQuotaResponseFromWire(w *getQuotaResponseWire) (*GetQuotaResponse, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetQuotaResponse) MarshalJSON() ([]byte, error) { + w, err := getQuotaResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetQuotaResponse) UnmarshalJSON(data []byte) error { + var w getQuotaResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getQuotaResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listQuotasRequestWire struct { MaxResults *int `json:"max_results,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -135,6 +183,30 @@ func listQuotasRequestFromWire(w *listQuotasRequestWire) (*ListQuotasRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListQuotasRequest) MarshalJSON() ([]byte, error) { + w, err := listQuotasRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListQuotasRequest) UnmarshalJSON(data []byte) error { + var w listQuotasRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listQuotasRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listQuotasResponseWire struct { Quotas []quotaInfoWire `json:"quotas,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -168,6 +240,30 @@ func listQuotasResponseFromWire(w *listQuotasResponseWire) (*ListQuotasResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListQuotasResponse) MarshalJSON() ([]byte, error) { + w, err := listQuotasResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListQuotasResponse) UnmarshalJSON(data []byte) error { + var w listQuotasResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listQuotasResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type quotaInfoWire struct { ParentSecurableType SecurableType `json:"parent_securable_type,omitempty"` ParentFullName *string `json:"parent_full_name,omitempty"` @@ -213,6 +309,30 @@ func quotaInfoFromWire(w *quotaInfoWire) (*QuotaInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QuotaInfo) MarshalJSON() ([]byte, error) { + w, err := quotaInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QuotaInfo) UnmarshalJSON(data []byte) error { + var w quotaInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := quotaInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/rfa/CHANGELOG.md b/uc/rfa/CHANGELOG.md index 683ad314..b7192c93 100644 --- a/uc/rfa/CHANGELOG.md +++ b/uc/rfa/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/uc/rfa/internal/version.go b/uc/rfa/internal/version.go index 210b86d2..b11ea3de 100644 --- a/uc/rfa/internal/version.go +++ b/uc/rfa/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-rfa" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/uc/rfa/v1/wire.go b/uc/rfa/v1/wire.go index 231781b3..065b49fc 100644 --- a/uc/rfa/v1/wire.go +++ b/uc/rfa/v1/wire.go @@ -3,6 +3,7 @@ package rfa import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -69,6 +70,30 @@ func accessRequestDestinationsFromWire(w *accessRequestDestinationsWire) (*Acces }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AccessRequestDestinations) MarshalJSON() ([]byte, error) { + w, err := accessRequestDestinationsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AccessRequestDestinations) UnmarshalJSON(data []byte) error { + var w accessRequestDestinationsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := accessRequestDestinationsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type batchCreateAccessRequestsRequestWire struct { Requests []createAccessRequestWire `json:"requests,omitempty"` } @@ -99,6 +124,30 @@ func batchCreateAccessRequestsRequestFromWire(w *batchCreateAccessRequestsReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BatchCreateAccessRequestsRequest) MarshalJSON() ([]byte, error) { + w, err := batchCreateAccessRequestsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BatchCreateAccessRequestsRequest) UnmarshalJSON(data []byte) error { + var w batchCreateAccessRequestsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := batchCreateAccessRequestsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type batchCreateAccessRequestsResponseWire struct { Responses []createAccessRequestResponseWire `json:"responses,omitempty"` } @@ -129,6 +178,30 @@ func batchCreateAccessRequestsResponseFromWire(w *batchCreateAccessRequestsRespo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v BatchCreateAccessRequestsResponse) MarshalJSON() ([]byte, error) { + w, err := batchCreateAccessRequestsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *BatchCreateAccessRequestsResponse) UnmarshalJSON(data []byte) error { + var w batchCreateAccessRequestsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := batchCreateAccessRequestsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAccessRequestWire struct { BehalfOf *principalWire `json:"behalf_of,omitempty"` Comment *string `json:"comment,omitempty"` @@ -173,6 +246,30 @@ func createAccessRequestFromWire(w *createAccessRequestWire) (*CreateAccessReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAccessRequest) MarshalJSON() ([]byte, error) { + w, err := createAccessRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAccessRequest) UnmarshalJSON(data []byte) error { + var w createAccessRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAccessRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createAccessRequestResponseWire struct { BehalfOf *principalWire `json:"behalf_of,omitempty"` RequestDestinations []accessRequestDestinationsWire `json:"request_destinations,omitempty"` @@ -214,6 +311,30 @@ func createAccessRequestResponseFromWire(w *createAccessRequestResponseWire) (*C }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateAccessRequestResponse) MarshalJSON() ([]byte, error) { + w, err := createAccessRequestResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateAccessRequestResponse) UnmarshalJSON(data []byte) error { + var w createAccessRequestResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createAccessRequestResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getAccessRequestDestinationsRequestWire struct { SecurableType *string `json:"securable_type,omitempty"` FullName *string `json:"full_name,omitempty"` @@ -239,6 +360,30 @@ func getAccessRequestDestinationsRequestFromWire(w *getAccessRequestDestinations }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetAccessRequestDestinationsRequest) MarshalJSON() ([]byte, error) { + w, err := getAccessRequestDestinationsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetAccessRequestDestinationsRequest) UnmarshalJSON(data []byte) error { + var w getAccessRequestDestinationsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getAccessRequestDestinationsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type notificationDestinationWire struct { DestinationId *string `json:"destination_id,omitempty"` DestinationType DestinationType `json:"destination_type,omitempty"` @@ -267,6 +412,30 @@ func notificationDestinationFromWire(w *notificationDestinationWire) (*Notificat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NotificationDestination) MarshalJSON() ([]byte, error) { + w, err := notificationDestinationToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NotificationDestination) UnmarshalJSON(data []byte) error { + var w notificationDestinationWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := notificationDestinationFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type principalWire struct { Id *string `json:"id,omitempty"` PrincipalType PrincipalType `json:"principal_type,omitempty"` @@ -292,6 +461,30 @@ func principalFromWire(w *principalWire) (*Principal, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Principal) MarshalJSON() ([]byte, error) { + w, err := principalToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Principal) UnmarshalJSON(data []byte) error { + var w principalWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := principalFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type securableWire struct { Type SecurableType `json:"type,omitempty"` FullName *string `json:"full_name,omitempty"` @@ -320,6 +513,30 @@ func securableFromWire(w *securableWire) (*Securable, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Securable) MarshalJSON() ([]byte, error) { + w, err := securableToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Securable) UnmarshalJSON(data []byte) error { + var w securableWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := securableFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type securablePermissionsWire struct { Securable *securableWire `json:"securable,omitempty"` Permissions []string `json:"permissions,omitempty"` @@ -353,6 +570,30 @@ func securablePermissionsFromWire(w *securablePermissionsWire) (*SecurablePermis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SecurablePermissions) MarshalJSON() ([]byte, error) { + w, err := securablePermissionsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SecurablePermissions) UnmarshalJSON(data []byte) error { + var w securablePermissionsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := securablePermissionsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateAccessRequestDestinationsRequestWire struct { AccessRequestDestinations *accessRequestDestinationsWire `json:"access_request_destinations,omitempty"` UpdateMask *types.FieldMask[AccessRequestDestinations] `json:"update_mask,omitempty"` @@ -386,6 +627,30 @@ func updateAccessRequestDestinationsRequestFromWire(w *updateAccessRequestDestin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateAccessRequestDestinationsRequest) MarshalJSON() ([]byte, error) { + w, err := updateAccessRequestDestinationsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateAccessRequestDestinationsRequest) UnmarshalJSON(data []byte) error { + var w updateAccessRequestDestinationsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateAccessRequestDestinationsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/schemas/CHANGELOG.md b/uc/schemas/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/uc/schemas/CHANGELOG.md +++ b/uc/schemas/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/uc/schemas/internal/version.go b/uc/schemas/internal/version.go index 9a3dfc1c..26df14c3 100644 --- a/uc/schemas/internal/version.go +++ b/uc/schemas/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-schemas" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/uc/schemas/v1/wire.go b/uc/schemas/v1/wire.go index 8ffb827a..92d63351 100644 --- a/uc/schemas/v1/wire.go +++ b/uc/schemas/v1/wire.go @@ -163,6 +163,30 @@ func createSchemaRequestFromWire(w *createSchemaRequestWire) (*CreateSchemaReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateSchemaRequest) MarshalJSON() ([]byte, error) { + w, err := createSchemaRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateSchemaRequest) UnmarshalJSON(data []byte) error { + var w createSchemaRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createSchemaRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteSchemaRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` Force *bool `json:"force,omitempty"` @@ -188,6 +212,30 @@ func deleteSchemaRequestFromWire(w *deleteSchemaRequestWire) (*DeleteSchemaReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteSchemaRequest) MarshalJSON() ([]byte, error) { + w, err := deleteSchemaRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteSchemaRequest) UnmarshalJSON(data []byte) error { + var w deleteSchemaRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteSchemaRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteSchemaResponseWire struct { } @@ -205,6 +253,30 @@ func deleteSchemaResponseFromWire(w *deleteSchemaResponseWire) (*DeleteSchemaRes return &DeleteSchemaResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteSchemaResponse) MarshalJSON() ([]byte, error) { + w, err := deleteSchemaResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteSchemaResponse) UnmarshalJSON(data []byte) error { + var w deleteSchemaResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteSchemaResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type effectivePredictiveOptimizationFlagWire struct { Value *string `json:"value,omitempty"` InheritedFromType *string `json:"inherited_from_type,omitempty"` @@ -233,6 +305,30 @@ func effectivePredictiveOptimizationFlagFromWire(w *effectivePredictiveOptimizat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EffectivePredictiveOptimizationFlag) MarshalJSON() ([]byte, error) { + w, err := effectivePredictiveOptimizationFlagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EffectivePredictiveOptimizationFlag) UnmarshalJSON(data []byte) error { + var w effectivePredictiveOptimizationFlagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := effectivePredictiveOptimizationFlagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSchemaRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` IncludeBrowse *bool `json:"include_browse,omitempty"` @@ -258,6 +354,30 @@ func getSchemaRequestFromWire(w *getSchemaRequestWire) (*GetSchemaRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSchemaRequest) MarshalJSON() ([]byte, error) { + w, err := getSchemaRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSchemaRequest) UnmarshalJSON(data []byte) error { + var w getSchemaRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSchemaRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSchemasRequestWire struct { CatalogName *string `json:"catalog_name,omitempty"` MaxResults *int `json:"max_results,omitempty"` @@ -289,6 +409,30 @@ func listSchemasRequestFromWire(w *listSchemasRequestWire) (*ListSchemasRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSchemasRequest) MarshalJSON() ([]byte, error) { + w, err := listSchemasRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSchemasRequest) UnmarshalJSON(data []byte) error { + var w listSchemasRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSchemasRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSchemasResponseWire struct { Schemas []schemaInfoWire `json:"schemas,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -322,6 +466,30 @@ func listSchemasResponseFromWire(w *listSchemasResponseWire) (*ListSchemasRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSchemasResponse) MarshalJSON() ([]byte, error) { + w, err := listSchemasResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSchemasResponse) UnmarshalJSON(data []byte) error { + var w listSchemasResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSchemasResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type schemaInfoWire struct { Name *string `json:"name,omitempty"` CatalogName *string `json:"catalog_name,omitempty"` @@ -433,6 +601,30 @@ func schemaInfoFromWire(w *schemaInfoWire) (*SchemaInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SchemaInfo) MarshalJSON() ([]byte, error) { + w, err := schemaInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SchemaInfo) UnmarshalJSON(data []byte) error { + var w schemaInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := schemaInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateSchemaRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` NewName *string `json:"new_name,omitempty"` @@ -550,6 +742,30 @@ func updateSchemaRequestFromWire(w *updateSchemaRequestWire) (*UpdateSchemaReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateSchemaRequest) MarshalJSON() ([]byte, error) { + w, err := updateSchemaRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateSchemaRequest) UnmarshalJSON(data []byte) error { + var w updateSchemaRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateSchemaRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/secrets/CHANGELOG.md b/uc/secrets/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/uc/secrets/CHANGELOG.md +++ b/uc/secrets/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/uc/secrets/internal/version.go b/uc/secrets/internal/version.go index bc130300..f8595af3 100644 --- a/uc/secrets/internal/version.go +++ b/uc/secrets/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-secrets" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/uc/secrets/v1/wire.go b/uc/secrets/v1/wire.go index 100c5fd2..17764693 100644 --- a/uc/secrets/v1/wire.go +++ b/uc/secrets/v1/wire.go @@ -3,6 +3,7 @@ package secrets import ( + "encoding/json" "fmt" "github.com/databricks/sdk-go/core/types" @@ -38,6 +39,30 @@ func createSecretRequestFromWire(w *createSecretRequestWire) (*CreateSecretReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateSecretRequest) MarshalJSON() ([]byte, error) { + w, err := createSecretRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateSecretRequest) UnmarshalJSON(data []byte) error { + var w createSecretRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createSecretRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteSecretRequestWire struct { FullName *string `json:"full_name,omitempty"` } @@ -60,6 +85,30 @@ func deleteSecretRequestFromWire(w *deleteSecretRequestWire) (*DeleteSecretReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteSecretRequest) MarshalJSON() ([]byte, error) { + w, err := deleteSecretRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteSecretRequest) UnmarshalJSON(data []byte) error { + var w deleteSecretRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteSecretRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getSecretRequestWire struct { FullName *string `json:"full_name,omitempty"` IncludeValue *bool `json:"include_value,omitempty"` @@ -85,6 +134,30 @@ func getSecretRequestFromWire(w *getSecretRequestWire) (*GetSecretRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetSecretRequest) MarshalJSON() ([]byte, error) { + w, err := getSecretRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetSecretRequest) UnmarshalJSON(data []byte) error { + var w getSecretRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getSecretRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSecretsRequestWire struct { CatalogName *string `json:"catalog_name,omitempty"` SchemaName *string `json:"schema_name,omitempty"` @@ -116,6 +189,30 @@ func listSecretsRequestFromWire(w *listSecretsRequestWire) (*ListSecretsRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSecretsRequest) MarshalJSON() ([]byte, error) { + w, err := listSecretsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSecretsRequest) UnmarshalJSON(data []byte) error { + var w listSecretsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSecretsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSecretsResponseWire struct { Secrets []secretWire `json:"secrets,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -149,6 +246,30 @@ func listSecretsResponseFromWire(w *listSecretsResponseWire) (*ListSecretsRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSecretsResponse) MarshalJSON() ([]byte, error) { + w, err := listSecretsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSecretsResponse) UnmarshalJSON(data []byte) error { + var w listSecretsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSecretsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type secretWire struct { Name *string `json:"name,omitempty"` Owner *string `json:"owner,omitempty"` @@ -213,6 +334,30 @@ func secretFromWire(w *secretWire) (*Secret, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Secret) MarshalJSON() ([]byte, error) { + w, err := secretToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Secret) UnmarshalJSON(data []byte) error { + var w secretWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := secretFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateSecretRequestWire struct { FullName *string `json:"full_name,omitempty"` Secret *secretWire `json:"secret,omitempty"` @@ -249,6 +394,30 @@ func updateSecretRequestFromWire(w *updateSecretRequestWire) (*UpdateSecretReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateSecretRequest) MarshalJSON() ([]byte, error) { + w, err := updateSecretRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateSecretRequest) UnmarshalJSON(data []byte) error { + var w updateSecretRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateSecretRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/systemschemas/CHANGELOG.md b/uc/systemschemas/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/uc/systemschemas/CHANGELOG.md +++ b/uc/systemschemas/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/uc/systemschemas/internal/version.go b/uc/systemschemas/internal/version.go index d7700729..da052317 100644 --- a/uc/systemschemas/internal/version.go +++ b/uc/systemschemas/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-systemschemas" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/uc/systemschemas/v1/wire.go b/uc/systemschemas/v1/wire.go index 21267b20..ca03d6b1 100644 --- a/uc/systemschemas/v1/wire.go +++ b/uc/systemschemas/v1/wire.go @@ -3,6 +3,7 @@ package systemschemas import ( + "encoding/json" "fmt" ) @@ -31,6 +32,30 @@ func disableSystemSchemaRequestFromWire(w *disableSystemSchemaRequestWire) (*Dis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DisableSystemSchemaRequest) MarshalJSON() ([]byte, error) { + w, err := disableSystemSchemaRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DisableSystemSchemaRequest) UnmarshalJSON(data []byte) error { + var w disableSystemSchemaRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := disableSystemSchemaRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type disableSystemSchemaResponseWire struct { } @@ -48,6 +73,30 @@ func disableSystemSchemaResponseFromWire(w *disableSystemSchemaResponseWire) (*D return &DisableSystemSchemaResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DisableSystemSchemaResponse) MarshalJSON() ([]byte, error) { + w, err := disableSystemSchemaResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DisableSystemSchemaResponse) UnmarshalJSON(data []byte) error { + var w disableSystemSchemaResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := disableSystemSchemaResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type enableSystemSchemaRequestWire struct { Schema *string `json:"schema,omitempty"` MetastoreId *string `json:"metastore_id,omitempty"` @@ -76,6 +125,30 @@ func enableSystemSchemaRequestFromWire(w *enableSystemSchemaRequestWire) (*Enabl }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EnableSystemSchemaRequest) MarshalJSON() ([]byte, error) { + w, err := enableSystemSchemaRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EnableSystemSchemaRequest) UnmarshalJSON(data []byte) error { + var w enableSystemSchemaRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := enableSystemSchemaRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type enableSystemSchemaResponseWire struct { } @@ -93,6 +166,30 @@ func enableSystemSchemaResponseFromWire(w *enableSystemSchemaResponseWire) (*Ena return &EnableSystemSchemaResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EnableSystemSchemaResponse) MarshalJSON() ([]byte, error) { + w, err := enableSystemSchemaResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EnableSystemSchemaResponse) UnmarshalJSON(data []byte) error { + var w enableSystemSchemaResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := enableSystemSchemaResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSystemSchemasRequestWire struct { MetastoreId *string `json:"metastore_id,omitempty"` MaxResults *int `json:"max_results,omitempty"` @@ -121,6 +218,30 @@ func listSystemSchemasRequestFromWire(w *listSystemSchemasRequestWire) (*ListSys }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSystemSchemasRequest) MarshalJSON() ([]byte, error) { + w, err := listSystemSchemasRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSystemSchemasRequest) UnmarshalJSON(data []byte) error { + var w listSystemSchemasRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSystemSchemasRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listSystemSchemasResponseWire struct { Schemas []systemSchemaInfoWire `json:"schemas,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -154,6 +275,30 @@ func listSystemSchemasResponseFromWire(w *listSystemSchemasResponseWire) (*ListS }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListSystemSchemasResponse) MarshalJSON() ([]byte, error) { + w, err := listSystemSchemasResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListSystemSchemasResponse) UnmarshalJSON(data []byte) error { + var w listSystemSchemasResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listSystemSchemasResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type systemSchemaInfoWire struct { Schema *string `json:"schema,omitempty"` State *string `json:"state,omitempty"` @@ -179,6 +324,30 @@ func systemSchemaInfoFromWire(w *systemSchemaInfoWire) (*SystemSchemaInfo, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SystemSchemaInfo) MarshalJSON() ([]byte, error) { + w, err := systemSchemaInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SystemSchemaInfo) UnmarshalJSON(data []byte) error { + var w systemSchemaInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := systemSchemaInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/tables/CHANGELOG.md b/uc/tables/CHANGELOG.md index d49f1613..6f438e5f 100644 --- a/uc/tables/CHANGELOG.md +++ b/uc/tables/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.8.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.7.0 (2026-11-11) ## Release v0.6.0 (2026-11-10) diff --git a/uc/tables/internal/version.go b/uc/tables/internal/version.go index 643e5f48..acaee47d 100644 --- a/uc/tables/internal/version.go +++ b/uc/tables/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-tables" -const Version = "0.7.0" +const Version = "0.8.0" diff --git a/uc/tables/v1/wire.go b/uc/tables/v1/wire.go index 9d911a47..1b36c363 100644 --- a/uc/tables/v1/wire.go +++ b/uc/tables/v1/wire.go @@ -115,6 +115,30 @@ func columnInfoFromWire(w *columnInfoWire) (*ColumnInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ColumnInfo) MarshalJSON() ([]byte, error) { + w, err := columnInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ColumnInfo) UnmarshalJSON(data []byte) error { + var w columnInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := columnInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type columnMaskWire struct { FunctionName *string `json:"function_name,omitempty"` UsingColumnNames []string `json:"using_column_names,omitempty"` @@ -151,6 +175,30 @@ func columnMaskFromWire(w *columnMaskWire) (*ColumnMask, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ColumnMask) MarshalJSON() ([]byte, error) { + w, err := columnMaskToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ColumnMask) UnmarshalJSON(data []byte) error { + var w columnMaskWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := columnMaskFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type connectionDependencyWire struct { ConnectionName *string `json:"connection_name,omitempty"` } @@ -173,6 +221,30 @@ func connectionDependencyFromWire(w *connectionDependencyWire) (*ConnectionDepen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ConnectionDependency) MarshalJSON() ([]byte, error) { + w, err := connectionDependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ConnectionDependency) UnmarshalJSON(data []byte) error { + var w connectionDependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := connectionDependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createTableConstraintRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` Constraint *tableConstraintWire `json:"constraint,omitempty"` @@ -206,6 +278,30 @@ func createTableConstraintRequestFromWire(w *createTableConstraintRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateTableConstraintRequest) MarshalJSON() ([]byte, error) { + w, err := createTableConstraintRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateTableConstraintRequest) UnmarshalJSON(data []byte) error { + var w createTableConstraintRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createTableConstraintRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createTableRequestWire struct { Name *string `json:"name,omitempty"` CatalogName *string `json:"catalog_name,omitempty"` @@ -412,6 +508,30 @@ func createTableRequestFromWire(w *createTableRequestWire) (*CreateTableRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateTableRequest) MarshalJSON() ([]byte, error) { + w, err := createTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateTableRequest) UnmarshalJSON(data []byte) error { + var w createTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type credentialDependencyWire struct { CredentialName *string `json:"credential_name,omitempty"` } @@ -434,6 +554,30 @@ func credentialDependencyFromWire(w *credentialDependencyWire) (*CredentialDepen }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CredentialDependency) MarshalJSON() ([]byte, error) { + w, err := credentialDependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CredentialDependency) UnmarshalJSON(data []byte) error { + var w credentialDependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := credentialDependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteTableConstraintRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` ConstraintName *string `json:"constraint_name,omitempty"` @@ -462,6 +606,30 @@ func deleteTableConstraintRequestFromWire(w *deleteTableConstraintRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteTableConstraintRequest) MarshalJSON() ([]byte, error) { + w, err := deleteTableConstraintRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteTableConstraintRequest) UnmarshalJSON(data []byte) error { + var w deleteTableConstraintRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteTableConstraintRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteTableConstraintResponseWire struct { } @@ -479,6 +647,30 @@ func deleteTableConstraintResponseFromWire(w *deleteTableConstraintResponseWire) return &DeleteTableConstraintResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteTableConstraintResponse) MarshalJSON() ([]byte, error) { + w, err := deleteTableConstraintResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteTableConstraintResponse) UnmarshalJSON(data []byte) error { + var w deleteTableConstraintResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteTableConstraintResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteTableRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` } @@ -501,6 +693,30 @@ func deleteTableRequestFromWire(w *deleteTableRequestWire) (*DeleteTableRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteTableRequest) MarshalJSON() ([]byte, error) { + w, err := deleteTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteTableRequest) UnmarshalJSON(data []byte) error { + var w deleteTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteTableResponseWire struct { } @@ -518,6 +734,30 @@ func deleteTableResponseFromWire(w *deleteTableResponseWire) (*DeleteTableRespon return &DeleteTableResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteTableResponse) MarshalJSON() ([]byte, error) { + w, err := deleteTableResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteTableResponse) UnmarshalJSON(data []byte) error { + var w deleteTableResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteTableResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deltaRuntimePropertiesKvPairsWire struct { DeltaRuntimeProperties map[string]string `json:"delta_runtime_properties,omitempty"` } @@ -540,6 +780,30 @@ func deltaRuntimePropertiesKvPairsFromWire(w *deltaRuntimePropertiesKvPairsWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeltaRuntimePropertiesKvPairs) MarshalJSON() ([]byte, error) { + w, err := deltaRuntimePropertiesKvPairsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeltaRuntimePropertiesKvPairs) UnmarshalJSON(data []byte) error { + var w deltaRuntimePropertiesKvPairsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deltaRuntimePropertiesKvPairsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dependencyWire struct { Table *tableDependencyWire `json:"table,omitempty"` Function *functionDependencyWire `json:"function,omitempty"` @@ -652,6 +916,30 @@ func dependencyFromWire(w *dependencyWire) (*Dependency, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Dependency) MarshalJSON() ([]byte, error) { + w, err := dependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Dependency) UnmarshalJSON(data []byte) error { + var w dependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type dependencyListWire struct { Dependencies []dependencyWire `json:"dependencies,omitempty"` } @@ -682,6 +970,30 @@ func dependencyListFromWire(w *dependencyListWire) (*DependencyList, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DependencyList) MarshalJSON() ([]byte, error) { + w, err := dependencyListToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DependencyList) UnmarshalJSON(data []byte) error { + var w dependencyListWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := dependencyListFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type effectivePredictiveOptimizationFlagWire struct { Value *string `json:"value,omitempty"` InheritedFromType *string `json:"inherited_from_type,omitempty"` @@ -710,6 +1022,30 @@ func effectivePredictiveOptimizationFlagFromWire(w *effectivePredictiveOptimizat }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EffectivePredictiveOptimizationFlag) MarshalJSON() ([]byte, error) { + w, err := effectivePredictiveOptimizationFlagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EffectivePredictiveOptimizationFlag) UnmarshalJSON(data []byte) error { + var w effectivePredictiveOptimizationFlagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := effectivePredictiveOptimizationFlagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type encryptionDetailsWire struct { SseEncryptionDetails *sseEncryptionDetailsWire `json:"sse_encryption_details,omitempty"` } @@ -762,6 +1098,30 @@ func encryptionDetailsFromWire(w *encryptionDetailsWire) (*EncryptionDetails, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EncryptionDetails) MarshalJSON() ([]byte, error) { + w, err := encryptionDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EncryptionDetails) UnmarshalJSON(data []byte) error { + var w encryptionDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := encryptionDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type foreignKeyConstraintWire struct { Name *string `json:"name,omitempty"` ChildColumns []string `json:"child_columns,omitempty"` @@ -796,6 +1156,30 @@ func foreignKeyConstraintFromWire(w *foreignKeyConstraintWire) (*ForeignKeyConst }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ForeignKeyConstraint) MarshalJSON() ([]byte, error) { + w, err := foreignKeyConstraintToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ForeignKeyConstraint) UnmarshalJSON(data []byte) error { + var w foreignKeyConstraintWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := foreignKeyConstraintFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type functionDependencyWire struct { FunctionFullName *string `json:"function_full_name,omitempty"` } @@ -818,6 +1202,30 @@ func functionDependencyFromWire(w *functionDependencyWire) (*FunctionDependency, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FunctionDependency) MarshalJSON() ([]byte, error) { + w, err := functionDependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FunctionDependency) UnmarshalJSON(data []byte) error { + var w functionDependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := functionDependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getTableRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` IncludeDeltaMetadata *bool `json:"include_delta_metadata,omitempty"` @@ -849,6 +1257,30 @@ func getTableRequestFromWire(w *getTableRequestWire) (*GetTableRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetTableRequest) MarshalJSON() ([]byte, error) { + w, err := getTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetTableRequest) UnmarshalJSON(data []byte) error { + var w getTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listTableSummariesRequestWire struct { CatalogName *string `json:"catalog_name,omitempty"` SchemaNamePattern *string `json:"schema_name_pattern,omitempty"` @@ -886,6 +1318,30 @@ func listTableSummariesRequestFromWire(w *listTableSummariesRequestWire) (*ListT }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListTableSummariesRequest) MarshalJSON() ([]byte, error) { + w, err := listTableSummariesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListTableSummariesRequest) UnmarshalJSON(data []byte) error { + var w listTableSummariesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listTableSummariesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listTableSummariesResponseWire struct { Tables []tableSummaryWire `json:"tables,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -919,6 +1375,30 @@ func listTableSummariesResponseFromWire(w *listTableSummariesResponseWire) (*Lis }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListTableSummariesResponse) MarshalJSON() ([]byte, error) { + w, err := listTableSummariesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListTableSummariesResponse) UnmarshalJSON(data []byte) error { + var w listTableSummariesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listTableSummariesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listTablesRequestWire struct { CatalogName *string `json:"catalog_name,omitempty"` SchemaName *string `json:"schema_name,omitempty"` @@ -965,6 +1445,30 @@ func listTablesRequestFromWire(w *listTablesRequestWire) (*ListTablesRequest, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListTablesRequest) MarshalJSON() ([]byte, error) { + w, err := listTablesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListTablesRequest) UnmarshalJSON(data []byte) error { + var w listTablesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listTablesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listTablesResponseWire struct { Tables []tableInfoWire `json:"tables,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -998,6 +1502,30 @@ func listTablesResponseFromWire(w *listTablesResponseWire) (*ListTablesResponse, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListTablesResponse) MarshalJSON() ([]byte, error) { + w, err := listTablesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListTablesResponse) UnmarshalJSON(data []byte) error { + var w listTablesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listTablesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type namedTableConstraintWire struct { Name *string `json:"name,omitempty"` } @@ -1020,6 +1548,30 @@ func namedTableConstraintFromWire(w *namedTableConstraintWire) (*NamedTableConst }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v NamedTableConstraint) MarshalJSON() ([]byte, error) { + w, err := namedTableConstraintToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *NamedTableConstraint) UnmarshalJSON(data []byte) error { + var w namedTableConstraintWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := namedTableConstraintFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type optionSpecWire struct { Name *string `json:"name,omitempty"` Type OptionSpec_OptionType `json:"type,omitempty"` @@ -1081,6 +1633,30 @@ func optionSpecFromWire(w *optionSpecWire) (*OptionSpec, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OptionSpec) MarshalJSON() ([]byte, error) { + w, err := optionSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OptionSpec) UnmarshalJSON(data []byte) error { + var w optionSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := optionSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type policyFunctionArgumentWire struct { Column *string `json:"column,omitempty"` Constant *string `json:"constant,omitempty"` @@ -1137,6 +1713,30 @@ func policyFunctionArgumentFromWire(w *policyFunctionArgumentWire) (*PolicyFunct }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PolicyFunctionArgument) MarshalJSON() ([]byte, error) { + w, err := policyFunctionArgumentToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PolicyFunctionArgument) UnmarshalJSON(data []byte) error { + var w policyFunctionArgumentWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := policyFunctionArgumentFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type primaryKeyConstraintWire struct { Name *string `json:"name,omitempty"` ChildColumns []string `json:"child_columns,omitempty"` @@ -1168,6 +1768,30 @@ func primaryKeyConstraintFromWire(w *primaryKeyConstraintWire) (*PrimaryKeyConst }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PrimaryKeyConstraint) MarshalJSON() ([]byte, error) { + w, err := primaryKeyConstraintToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PrimaryKeyConstraint) UnmarshalJSON(data []byte) error { + var w primaryKeyConstraintWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := primaryKeyConstraintFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rowFilterWire struct { FunctionName *string `json:"function_name,omitempty"` InputColumnNames []string `json:"input_column_names,omitempty"` @@ -1204,6 +1828,30 @@ func rowFilterFromWire(w *rowFilterWire) (*RowFilter, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RowFilter) MarshalJSON() ([]byte, error) { + w, err := rowFilterToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RowFilter) UnmarshalJSON(data []byte) error { + var w rowFilterWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rowFilterFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type securableKindManifestWire struct { SecurableType SecurableType `json:"securable_type,omitempty"` SecurableKind SecurableKind `json:"securable_kind,omitempty"` @@ -1246,6 +1894,30 @@ func securableKindManifestFromWire(w *securableKindManifestWire) (*SecurableKind }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SecurableKindManifest) MarshalJSON() ([]byte, error) { + w, err := securableKindManifestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SecurableKindManifest) UnmarshalJSON(data []byte) error { + var w securableKindManifestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := securableKindManifestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sseEncryptionDetailsWire struct { Algorithm SseEncryptionAlgorithm `json:"algorithm,omitempty"` AwsKmsKeyArn *string `json:"aws_kms_key_arn,omitempty"` @@ -1271,6 +1943,30 @@ func sseEncryptionDetailsFromWire(w *sseEncryptionDetailsWire) (*SseEncryptionDe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SseEncryptionDetails) MarshalJSON() ([]byte, error) { + w, err := sseEncryptionDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SseEncryptionDetails) UnmarshalJSON(data []byte) error { + var w sseEncryptionDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sseEncryptionDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tableConstraintWire struct { PrimaryKeyConstraint *primaryKeyConstraintWire `json:"primary_key_constraint,omitempty"` ForeignKeyConstraint *foreignKeyConstraintWire `json:"foreign_key_constraint,omitempty"` @@ -1363,6 +2059,30 @@ func tableConstraintFromWire(w *tableConstraintWire) (*TableConstraint, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TableConstraint) MarshalJSON() ([]byte, error) { + w, err := tableConstraintToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TableConstraint) UnmarshalJSON(data []byte) error { + var w tableConstraintWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tableConstraintFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tableDependencyWire struct { TableFullName *string `json:"table_full_name,omitempty"` } @@ -1385,6 +2105,30 @@ func tableDependencyFromWire(w *tableDependencyWire) (*TableDependency, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TableDependency) MarshalJSON() ([]byte, error) { + w, err := tableDependencyToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TableDependency) UnmarshalJSON(data []byte) error { + var w tableDependencyWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tableDependencyFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tableExistsRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` } @@ -1407,6 +2151,30 @@ func tableExistsRequestFromWire(w *tableExistsRequestWire) (*TableExistsRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TableExistsRequest) MarshalJSON() ([]byte, error) { + w, err := tableExistsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TableExistsRequest) UnmarshalJSON(data []byte) error { + var w tableExistsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tableExistsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tableExistsResponseWire struct { TableExists *bool `json:"table_exists,omitempty"` } @@ -1429,6 +2197,30 @@ func tableExistsResponseFromWire(w *tableExistsResponseWire) (*TableExistsRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TableExistsResponse) MarshalJSON() ([]byte, error) { + w, err := tableExistsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TableExistsResponse) UnmarshalJSON(data []byte) error { + var w tableExistsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tableExistsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tableInfoWire struct { Name *string `json:"name,omitempty"` CatalogName *string `json:"catalog_name,omitempty"` @@ -1635,6 +2427,30 @@ func tableInfoFromWire(w *tableInfoWire) (*TableInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TableInfo) MarshalJSON() ([]byte, error) { + w, err := tableInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TableInfo) UnmarshalJSON(data []byte) error { + var w tableInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tableInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type tableSummaryWire struct { FullName *string `json:"full_name,omitempty"` TableType TableType `json:"table_type,omitempty"` @@ -1671,6 +2487,30 @@ func tableSummaryFromWire(w *tableSummaryWire) (*TableSummary, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TableSummary) MarshalJSON() ([]byte, error) { + w, err := tableSummaryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TableSummary) UnmarshalJSON(data []byte) error { + var w tableSummaryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := tableSummaryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateTableRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` Name *string `json:"name,omitempty"` @@ -1880,6 +2720,30 @@ func updateTableRequestFromWire(w *updateTableRequestWire) (*UpdateTableRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateTableRequest) MarshalJSON() ([]byte, error) { + w, err := updateTableRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateTableRequest) UnmarshalJSON(data []byte) error { + var w updateTableRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateTableRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateTableResponseWire struct { } @@ -1897,6 +2761,30 @@ func updateTableResponseFromWire(w *updateTableResponseWire) (*UpdateTableRespon return &UpdateTableResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateTableResponse) MarshalJSON() ([]byte, error) { + w, err := updateTableResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateTableResponse) UnmarshalJSON(data []byte) error { + var w updateTableResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateTableResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/volumes/CHANGELOG.md b/uc/volumes/CHANGELOG.md index 864b753c..79c44032 100644 --- a/uc/volumes/CHANGELOG.md +++ b/uc/volumes/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.7.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.6.0 (2026-11-11) ## Release v0.5.0 (2026-11-10) diff --git a/uc/volumes/internal/version.go b/uc/volumes/internal/version.go index d23a8dd3..97fbc7cb 100644 --- a/uc/volumes/internal/version.go +++ b/uc/volumes/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-volumes" -const Version = "0.6.0" +const Version = "0.7.0" diff --git a/uc/volumes/v1/wire.go b/uc/volumes/v1/wire.go index c8144d0f..12fe7a24 100644 --- a/uc/volumes/v1/wire.go +++ b/uc/volumes/v1/wire.go @@ -146,6 +146,30 @@ func createVolumeRequestFromWire(w *createVolumeRequestWire) (*CreateVolumeReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateVolumeRequest) MarshalJSON() ([]byte, error) { + w, err := createVolumeRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateVolumeRequest) UnmarshalJSON(data []byte) error { + var w createVolumeRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createVolumeRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteVolumeRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` } @@ -168,6 +192,30 @@ func deleteVolumeRequestFromWire(w *deleteVolumeRequestWire) (*DeleteVolumeReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteVolumeRequest) MarshalJSON() ([]byte, error) { + w, err := deleteVolumeRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteVolumeRequest) UnmarshalJSON(data []byte) error { + var w deleteVolumeRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteVolumeRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteVolumeResponseWire struct { } @@ -185,6 +233,30 @@ func deleteVolumeResponseFromWire(w *deleteVolumeResponseWire) (*DeleteVolumeRes return &DeleteVolumeResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteVolumeResponse) MarshalJSON() ([]byte, error) { + w, err := deleteVolumeResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteVolumeResponse) UnmarshalJSON(data []byte) error { + var w deleteVolumeResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteVolumeResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type encryptionDetailsWire struct { SseEncryptionDetails *sseEncryptionDetailsWire `json:"sse_encryption_details,omitempty"` } @@ -237,6 +309,30 @@ func encryptionDetailsFromWire(w *encryptionDetailsWire) (*EncryptionDetails, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EncryptionDetails) MarshalJSON() ([]byte, error) { + w, err := encryptionDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EncryptionDetails) UnmarshalJSON(data []byte) error { + var w encryptionDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := encryptionDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getVolumeRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` IncludeBrowse *bool `json:"include_browse,omitempty"` @@ -262,6 +358,30 @@ func getVolumeRequestFromWire(w *getVolumeRequestWire) (*GetVolumeRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetVolumeRequest) MarshalJSON() ([]byte, error) { + w, err := getVolumeRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetVolumeRequest) UnmarshalJSON(data []byte) error { + var w getVolumeRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getVolumeRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listVolumesRequestWire struct { CatalogName *string `json:"catalog_name,omitempty"` SchemaName *string `json:"schema_name,omitempty"` @@ -296,6 +416,30 @@ func listVolumesRequestFromWire(w *listVolumesRequestWire) (*ListVolumesRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListVolumesRequest) MarshalJSON() ([]byte, error) { + w, err := listVolumesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListVolumesRequest) UnmarshalJSON(data []byte) error { + var w listVolumesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listVolumesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listVolumesResponseWire struct { Volumes []volumeInfoWire `json:"volumes,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -329,6 +473,30 @@ func listVolumesResponseFromWire(w *listVolumesResponseWire) (*ListVolumesRespon }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListVolumesResponse) MarshalJSON() ([]byte, error) { + w, err := listVolumesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListVolumesResponse) UnmarshalJSON(data []byte) error { + var w listVolumesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listVolumesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type sseEncryptionDetailsWire struct { Algorithm SseEncryptionAlgorithm `json:"algorithm,omitempty"` AwsKmsKeyArn *string `json:"aws_kms_key_arn,omitempty"` @@ -354,6 +522,30 @@ func sseEncryptionDetailsFromWire(w *sseEncryptionDetailsWire) (*SseEncryptionDe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SseEncryptionDetails) MarshalJSON() ([]byte, error) { + w, err := sseEncryptionDetailsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SseEncryptionDetails) UnmarshalJSON(data []byte) error { + var w sseEncryptionDetailsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := sseEncryptionDetailsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateVolumeRequestWire struct { FullNameArg *string `json:"full_name_arg,omitempty"` NewName *string `json:"new_name,omitempty"` @@ -454,6 +646,30 @@ func updateVolumeRequestFromWire(w *updateVolumeRequestWire) (*UpdateVolumeReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateVolumeRequest) MarshalJSON() ([]byte, error) { + w, err := updateVolumeRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateVolumeRequest) UnmarshalJSON(data []byte) error { + var w updateVolumeRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateVolumeRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type volumeInfoWire struct { Name *string `json:"name,omitempty"` CatalogName *string `json:"catalog_name,omitempty"` @@ -548,6 +764,30 @@ func volumeInfoFromWire(w *volumeInfoWire) (*VolumeInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v VolumeInfo) MarshalJSON() ([]byte, error) { + w, err := volumeInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *VolumeInfo) UnmarshalJSON(data []byte) error { + var w volumeInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := volumeInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/uc/workspacebindings/CHANGELOG.md b/uc/workspacebindings/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/uc/workspacebindings/CHANGELOG.md +++ b/uc/workspacebindings/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/uc/workspacebindings/internal/version.go b/uc/workspacebindings/internal/version.go index c32f742d..47a26073 100644 --- a/uc/workspacebindings/internal/version.go +++ b/uc/workspacebindings/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-uc-workspacebindings" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/uc/workspacebindings/v1/wire.go b/uc/workspacebindings/v1/wire.go index 9b5586a8..c32c2f5b 100644 --- a/uc/workspacebindings/v1/wire.go +++ b/uc/workspacebindings/v1/wire.go @@ -74,6 +74,30 @@ func getCatalogWorkspaceBindingsRequestFromWire(w *getCatalogWorkspaceBindingsRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCatalogWorkspaceBindingsRequest) MarshalJSON() ([]byte, error) { + w, err := getCatalogWorkspaceBindingsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCatalogWorkspaceBindingsRequest) UnmarshalJSON(data []byte) error { + var w getCatalogWorkspaceBindingsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCatalogWorkspaceBindingsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getCatalogWorkspaceBindingsResponseWire struct { Workspaces []wireInt64 `json:"workspaces,omitempty"` } @@ -104,6 +128,30 @@ func getCatalogWorkspaceBindingsResponseFromWire(w *getCatalogWorkspaceBindingsR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetCatalogWorkspaceBindingsResponse) MarshalJSON() ([]byte, error) { + w, err := getCatalogWorkspaceBindingsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetCatalogWorkspaceBindingsResponse) UnmarshalJSON(data []byte) error { + var w getCatalogWorkspaceBindingsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getCatalogWorkspaceBindingsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getWorkspaceBindingsRequestWire struct { SecurableType *string `json:"securable_type,omitempty"` SecurableFullName *string `json:"securable_full_name,omitempty"` @@ -135,6 +183,30 @@ func getWorkspaceBindingsRequestFromWire(w *getWorkspaceBindingsRequestWire) (*G }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetWorkspaceBindingsRequest) MarshalJSON() ([]byte, error) { + w, err := getWorkspaceBindingsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetWorkspaceBindingsRequest) UnmarshalJSON(data []byte) error { + var w getWorkspaceBindingsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getWorkspaceBindingsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getWorkspaceBindingsResponseWire struct { Bindings []workspaceBindingInfoWire `json:"bindings,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -168,6 +240,30 @@ func getWorkspaceBindingsResponseFromWire(w *getWorkspaceBindingsResponseWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetWorkspaceBindingsResponse) MarshalJSON() ([]byte, error) { + w, err := getWorkspaceBindingsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetWorkspaceBindingsResponse) UnmarshalJSON(data []byte) error { + var w getWorkspaceBindingsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getWorkspaceBindingsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCatalogWorkspaceBindingsRequestWire struct { CatalogName *string `json:"catalog_name,omitempty"` AssignWorkspaces []wireInt64 `json:"assign_workspaces,omitempty"` @@ -212,6 +308,30 @@ func updateCatalogWorkspaceBindingsRequestFromWire(w *updateCatalogWorkspaceBind }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCatalogWorkspaceBindingsRequest) MarshalJSON() ([]byte, error) { + w, err := updateCatalogWorkspaceBindingsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCatalogWorkspaceBindingsRequest) UnmarshalJSON(data []byte) error { + var w updateCatalogWorkspaceBindingsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCatalogWorkspaceBindingsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateCatalogWorkspaceBindingsResponseWire struct { Workspaces []wireInt64 `json:"workspaces,omitempty"` } @@ -242,6 +362,30 @@ func updateCatalogWorkspaceBindingsResponseFromWire(w *updateCatalogWorkspaceBin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateCatalogWorkspaceBindingsResponse) MarshalJSON() ([]byte, error) { + w, err := updateCatalogWorkspaceBindingsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateCatalogWorkspaceBindingsResponse) UnmarshalJSON(data []byte) error { + var w updateCatalogWorkspaceBindingsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateCatalogWorkspaceBindingsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateWorkspaceBindingsRequestWire struct { SecurableType *string `json:"securable_type,omitempty"` SecurableFullName *string `json:"securable_full_name,omitempty"` @@ -289,6 +433,30 @@ func updateWorkspaceBindingsRequestFromWire(w *updateWorkspaceBindingsRequestWir }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateWorkspaceBindingsRequest) MarshalJSON() ([]byte, error) { + w, err := updateWorkspaceBindingsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateWorkspaceBindingsRequest) UnmarshalJSON(data []byte) error { + var w updateWorkspaceBindingsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateWorkspaceBindingsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateWorkspaceBindingsResponseWire struct { Bindings []workspaceBindingInfoWire `json:"bindings,omitempty"` } @@ -319,6 +487,30 @@ func updateWorkspaceBindingsResponseFromWire(w *updateWorkspaceBindingsResponseW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateWorkspaceBindingsResponse) MarshalJSON() ([]byte, error) { + w, err := updateWorkspaceBindingsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateWorkspaceBindingsResponse) UnmarshalJSON(data []byte) error { + var w updateWorkspaceBindingsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateWorkspaceBindingsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type workspaceBindingInfoWire struct { WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` BindingType BindingType `json:"binding_type,omitempty"` @@ -352,6 +544,30 @@ func workspaceBindingInfoFromWire(w *workspaceBindingInfoWire) (*WorkspaceBindin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WorkspaceBindingInfo) MarshalJSON() ([]byte, error) { + w, err := workspaceBindingInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WorkspaceBindingInfo) UnmarshalJSON(data []byte) error { + var w workspaceBindingInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := workspaceBindingInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/usagedashboards/CHANGELOG.md b/usagedashboards/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/usagedashboards/CHANGELOG.md +++ b/usagedashboards/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/usagedashboards/internal/version.go b/usagedashboards/internal/version.go index 0cd6294e..6ab431dc 100644 --- a/usagedashboards/internal/version.go +++ b/usagedashboards/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-usagedashboards" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/usagedashboards/v1/wire.go b/usagedashboards/v1/wire.go index 104850cc..a33b401c 100644 --- a/usagedashboards/v1/wire.go +++ b/usagedashboards/v1/wire.go @@ -91,6 +91,30 @@ func createBillingUsageDashboardRequestFromWire(w *createBillingUsageDashboardRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateBillingUsageDashboardRequest) MarshalJSON() ([]byte, error) { + w, err := createBillingUsageDashboardRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateBillingUsageDashboardRequest) UnmarshalJSON(data []byte) error { + var w createBillingUsageDashboardRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createBillingUsageDashboardRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createBillingUsageDashboardResponseWire struct { DashboardId *string `json:"dashboard_id,omitempty"` } @@ -113,6 +137,30 @@ func createBillingUsageDashboardResponseFromWire(w *createBillingUsageDashboardR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateBillingUsageDashboardResponse) MarshalJSON() ([]byte, error) { + w, err := createBillingUsageDashboardResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateBillingUsageDashboardResponse) UnmarshalJSON(data []byte) error { + var w createBillingUsageDashboardResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createBillingUsageDashboardResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getBillingUsageDashboardRequestWire struct { WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -149,6 +197,30 @@ func getBillingUsageDashboardRequestFromWire(w *getBillingUsageDashboardRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetBillingUsageDashboardRequest) MarshalJSON() ([]byte, error) { + w, err := getBillingUsageDashboardRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetBillingUsageDashboardRequest) UnmarshalJSON(data []byte) error { + var w getBillingUsageDashboardRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getBillingUsageDashboardRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getBillingUsageDashboardResponseWire struct { DashboardId *string `json:"dashboard_id,omitempty"` DashboardUrl *string `json:"dashboard_url,omitempty"` @@ -173,3 +245,27 @@ func getBillingUsageDashboardResponseFromWire(w *getBillingUsageDashboardRespons DashboardUrl: w.DashboardUrl, }, nil } + +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetBillingUsageDashboardResponse) MarshalJSON() ([]byte, error) { + w, err := getBillingUsageDashboardResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetBillingUsageDashboardResponse) UnmarshalJSON(data []byte) error { + var w getBillingUsageDashboardResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getBillingUsageDashboardResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} diff --git a/vectorsearch/CHANGELOG.md b/vectorsearch/CHANGELOG.md index 8ad02b48..8273527a 100644 --- a/vectorsearch/CHANGELOG.md +++ b/vectorsearch/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.9.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.8.0 (2026-11-11) ## Release v0.7.0 (2026-11-10) diff --git a/vectorsearch/internal/version.go b/vectorsearch/internal/version.go index b664f559..b6caaca4 100644 --- a/vectorsearch/internal/version.go +++ b/vectorsearch/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-vectorsearch" -const Version = "0.8.0" +const Version = "0.9.0" diff --git a/vectorsearch/v1/wire.go b/vectorsearch/v1/wire.go index fec43af4..219fe7ac 100644 --- a/vectorsearch/v1/wire.go +++ b/vectorsearch/v1/wire.go @@ -79,6 +79,30 @@ func columnInfoFromWire(w *columnInfoWire) (*ColumnInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ColumnInfo) MarshalJSON() ([]byte, error) { + w, err := columnInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ColumnInfo) UnmarshalJSON(data []byte) error { + var w columnInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := columnInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createEndpointRequestWire struct { Name *string `json:"name,omitempty"` EndpointType EndpointType `json:"endpoint_type,omitempty"` @@ -121,6 +145,30 @@ func createEndpointRequestFromWire(w *createEndpointRequestWire) (*CreateEndpoin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := createEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateEndpointRequest) UnmarshalJSON(data []byte) error { + var w createEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createVectorIndexRequestWire struct { Name *string `json:"name,omitempty"` EndpointName *string `json:"endpoint_name,omitempty"` @@ -208,6 +256,30 @@ func createVectorIndexRequestFromWire(w *createVectorIndexRequestWire) (*CreateV }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateVectorIndexRequest) MarshalJSON() ([]byte, error) { + w, err := createVectorIndexRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateVectorIndexRequest) UnmarshalJSON(data []byte) error { + var w createVectorIndexRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createVectorIndexRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type customTagWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -233,6 +305,30 @@ func customTagFromWire(w *customTagWire) (*CustomTag, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CustomTag) MarshalJSON() ([]byte, error) { + w, err := customTagToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CustomTag) UnmarshalJSON(data []byte) error { + var w customTagWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := customTagFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteDataVectorIndexRequestWire struct { Name *string `json:"name,omitempty"` PrimaryKeys []string `json:"primary_keys,omitempty"` @@ -258,6 +354,30 @@ func deleteDataVectorIndexRequestFromWire(w *deleteDataVectorIndexRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteDataVectorIndexRequest) MarshalJSON() ([]byte, error) { + w, err := deleteDataVectorIndexRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteDataVectorIndexRequest) UnmarshalJSON(data []byte) error { + var w deleteDataVectorIndexRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteDataVectorIndexRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteDataVectorIndexResponseWire struct { Status UpsertDeleteDataStatus `json:"status,omitempty"` Result *upsertDeleteDataResultWire `json:"result,omitempty"` @@ -291,6 +411,30 @@ func deleteDataVectorIndexResponseFromWire(w *deleteDataVectorIndexResponseWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteDataVectorIndexResponse) MarshalJSON() ([]byte, error) { + w, err := deleteDataVectorIndexResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteDataVectorIndexResponse) UnmarshalJSON(data []byte) error { + var w deleteDataVectorIndexResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteDataVectorIndexResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteEndpointRequestWire struct { Name *string `json:"name,omitempty"` } @@ -313,6 +457,30 @@ func deleteEndpointRequestFromWire(w *deleteEndpointRequestWire) (*DeleteEndpoin }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := deleteEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteEndpointRequest) UnmarshalJSON(data []byte) error { + var w deleteEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteEndpointResponseWire struct { } @@ -330,6 +498,30 @@ func deleteEndpointResponseFromWire(w *deleteEndpointResponseWire) (*DeleteEndpo return &DeleteEndpointResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteEndpointResponse) MarshalJSON() ([]byte, error) { + w, err := deleteEndpointResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteEndpointResponse) UnmarshalJSON(data []byte) error { + var w deleteEndpointResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteEndpointResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteVectorIndexRequestWire struct { Name *string `json:"name,omitempty"` } @@ -352,6 +544,30 @@ func deleteVectorIndexRequestFromWire(w *deleteVectorIndexRequestWire) (*DeleteV }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteVectorIndexRequest) MarshalJSON() ([]byte, error) { + w, err := deleteVectorIndexRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteVectorIndexRequest) UnmarshalJSON(data []byte) error { + var w deleteVectorIndexRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteVectorIndexRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteVectorIndexResponseWire struct { } @@ -369,6 +585,30 @@ func deleteVectorIndexResponseFromWire(w *deleteVectorIndexResponseWire) (*Delet return &DeleteVectorIndexResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteVectorIndexResponse) MarshalJSON() ([]byte, error) { + w, err := deleteVectorIndexResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteVectorIndexResponse) UnmarshalJSON(data []byte) error { + var w deleteVectorIndexResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteVectorIndexResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deltaSyncVectorIndexSpecWire struct { SourceTable *string `json:"source_table,omitempty"` EmbeddingSourceColumns []embeddingSourceColumnWire `json:"embedding_source_columns,omitempty"` @@ -428,6 +668,30 @@ func deltaSyncVectorIndexSpecFromWire(w *deltaSyncVectorIndexSpecWire) (*DeltaSy }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeltaSyncVectorIndexSpec) MarshalJSON() ([]byte, error) { + w, err := deltaSyncVectorIndexSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeltaSyncVectorIndexSpec) UnmarshalJSON(data []byte) error { + var w deltaSyncVectorIndexSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deltaSyncVectorIndexSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deltaSyncVectorIndexSpecRequestWire struct { SourceTable *string `json:"source_table,omitempty"` EmbeddingSourceColumns []embeddingSourceColumnWire `json:"embedding_source_columns,omitempty"` @@ -487,6 +751,30 @@ func deltaSyncVectorIndexSpecRequestFromWire(w *deltaSyncVectorIndexSpecRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeltaSyncVectorIndexSpecRequest) MarshalJSON() ([]byte, error) { + w, err := deltaSyncVectorIndexSpecRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeltaSyncVectorIndexSpecRequest) UnmarshalJSON(data []byte) error { + var w deltaSyncVectorIndexSpecRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deltaSyncVectorIndexSpecRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type directAccessVectorIndexSpecWire struct { EmbeddingVectorColumns []embeddingVectorColumnWire `json:"embedding_vector_columns,omitempty"` SchemaJson *string `json:"schema_json,omitempty"` @@ -531,6 +819,30 @@ func directAccessVectorIndexSpecFromWire(w *directAccessVectorIndexSpecWire) (*D }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DirectAccessVectorIndexSpec) MarshalJSON() ([]byte, error) { + w, err := directAccessVectorIndexSpecToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DirectAccessVectorIndexSpec) UnmarshalJSON(data []byte) error { + var w directAccessVectorIndexSpecWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := directAccessVectorIndexSpecFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type embeddingSourceColumnWire struct { Name *string `json:"name,omitempty"` EmbeddingModelEndpointName *string `json:"embedding_model_endpoint_name,omitempty"` @@ -581,6 +893,30 @@ func embeddingSourceColumnFromWire(w *embeddingSourceColumnWire) (*EmbeddingSour }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EmbeddingSourceColumn) MarshalJSON() ([]byte, error) { + w, err := embeddingSourceColumnToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EmbeddingSourceColumn) UnmarshalJSON(data []byte) error { + var w embeddingSourceColumnWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := embeddingSourceColumnFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type embeddingVectorColumnWire struct { Name *string `json:"name,omitempty"` EmbeddingDimension *int `json:"embedding_dimension,omitempty"` @@ -606,6 +942,30 @@ func embeddingVectorColumnFromWire(w *embeddingVectorColumnWire) (*EmbeddingVect }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EmbeddingVectorColumn) MarshalJSON() ([]byte, error) { + w, err := embeddingVectorColumnToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EmbeddingVectorColumn) UnmarshalJSON(data []byte) error { + var w embeddingVectorColumnWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := embeddingVectorColumnFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointWire struct { Name *string `json:"name,omitempty"` Creator *string `json:"creator,omitempty"` @@ -704,6 +1064,30 @@ func endpointFromWire(w *endpointWire) (*Endpoint, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Endpoint) MarshalJSON() ([]byte, error) { + w, err := endpointToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Endpoint) UnmarshalJSON(data []byte) error { + var w endpointWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointScalingInfoWire struct { State ScalingChangeState `json:"state,omitempty"` RequestedTargetQps *wireInt64 `json:"requested_target_qps,omitempty"` @@ -768,6 +1152,30 @@ func endpointScalingInfoFromWire(w *endpointScalingInfoWire) (*EndpointScalingIn }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointScalingInfo) MarshalJSON() ([]byte, error) { + w, err := endpointScalingInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointScalingInfo) UnmarshalJSON(data []byte) error { + var w endpointScalingInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointScalingInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointStatusWire struct { State EndpointStatus_State `json:"state,omitempty"` Message *string `json:"message,omitempty"` @@ -793,6 +1201,30 @@ func endpointStatusFromWire(w *endpointStatusWire) (*EndpointStatus, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointStatus) MarshalJSON() ([]byte, error) { + w, err := endpointStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointStatus) UnmarshalJSON(data []byte) error { + var w endpointStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type facetResultDataWire struct { FacetRowCount *int `json:"facet_row_count,omitempty"` FacetArray [][]json.RawMessage `json:"facet_array,omitempty"` @@ -818,6 +1250,30 @@ func facetResultDataFromWire(w *facetResultDataWire) (*FacetResultData, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v FacetResultData) MarshalJSON() ([]byte, error) { + w, err := facetResultDataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *FacetResultData) UnmarshalJSON(data []byte) error { + var w facetResultDataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := facetResultDataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getEndpointRequestWire struct { Name *string `json:"name,omitempty"` } @@ -840,6 +1296,30 @@ func getEndpointRequestFromWire(w *getEndpointRequestWire) (*GetEndpointRequest, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := getEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetEndpointRequest) UnmarshalJSON(data []byte) error { + var w getEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getVectorIndexRequestWire struct { Name *string `json:"name,omitempty"` EnsureRerankerCompatible *bool `json:"ensure_reranker_compatible,omitempty"` @@ -865,6 +1345,30 @@ func getVectorIndexRequestFromWire(w *getVectorIndexRequestWire) (*GetVectorInde }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetVectorIndexRequest) MarshalJSON() ([]byte, error) { + w, err := getVectorIndexRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetVectorIndexRequest) UnmarshalJSON(data []byte) error { + var w getVectorIndexRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getVectorIndexRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listEndpointResponseWire struct { Endpoints []endpointWire `json:"endpoints,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -898,8 +1402,32 @@ func listEndpointResponseFromWire(w *listEndpointResponseWire) (*ListEndpointRes }, nil } -type listEndpointsRequestWire struct { - PageToken *string `json:"page_token,omitempty"` +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListEndpointResponse) MarshalJSON() ([]byte, error) { + w, err := listEndpointResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListEndpointResponse) UnmarshalJSON(data []byte) error { + var w listEndpointResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listEndpointResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + +type listEndpointsRequestWire struct { + PageToken *string `json:"page_token,omitempty"` } func listEndpointsRequestToWire(v *ListEndpointsRequest) (*listEndpointsRequestWire, error) { @@ -920,6 +1448,30 @@ func listEndpointsRequestFromWire(w *listEndpointsRequestWire) (*ListEndpointsRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListEndpointsRequest) MarshalJSON() ([]byte, error) { + w, err := listEndpointsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListEndpointsRequest) UnmarshalJSON(data []byte) error { + var w listEndpointsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listEndpointsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listValueWire struct { Values []valueWire `json:"values,omitempty"` } @@ -950,6 +1502,30 @@ func listValueFromWire(w *listValueWire) (*ListValue, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListValue) MarshalJSON() ([]byte, error) { + w, err := listValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListValue) UnmarshalJSON(data []byte) error { + var w listValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listVectorIndexRequestWire struct { EndpointName *string `json:"endpoint_name,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -975,6 +1551,30 @@ func listVectorIndexRequestFromWire(w *listVectorIndexRequestWire) (*ListVectorI }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListVectorIndexRequest) MarshalJSON() ([]byte, error) { + w, err := listVectorIndexRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListVectorIndexRequest) UnmarshalJSON(data []byte) error { + var w listVectorIndexRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listVectorIndexRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listVectorIndexResponseWire struct { VectorIndexes []miniVectorIndexWire `json:"vector_indexes,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1008,6 +1608,30 @@ func listVectorIndexResponseFromWire(w *listVectorIndexResponseWire) (*ListVecto }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListVectorIndexResponse) MarshalJSON() ([]byte, error) { + w, err := listVectorIndexResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListVectorIndexResponse) UnmarshalJSON(data []byte) error { + var w listVectorIndexResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listVectorIndexResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type mapStringValueEntryWire struct { Key *string `json:"key,omitempty"` Value *valueWire `json:"value,omitempty"` @@ -1041,6 +1665,30 @@ func mapStringValueEntryFromWire(w *mapStringValueEntryWire) (*MapStringValueEnt }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MapStringValueEntry) MarshalJSON() ([]byte, error) { + w, err := mapStringValueEntryToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MapStringValueEntry) UnmarshalJSON(data []byte) error { + var w mapStringValueEntryWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := mapStringValueEntryFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type metricWire struct { Name *string `json:"name,omitempty"` Labels []metricLabelWire `json:"labels,omitempty"` @@ -1077,6 +1725,30 @@ func metricFromWire(w *metricWire) (*Metric, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Metric) MarshalJSON() ([]byte, error) { + w, err := metricToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Metric) UnmarshalJSON(data []byte) error { + var w metricWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := metricFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type metricLabelWire struct { Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` @@ -1102,6 +1774,30 @@ func metricLabelFromWire(w *metricLabelWire) (*MetricLabel, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MetricLabel) MarshalJSON() ([]byte, error) { + w, err := metricLabelToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MetricLabel) UnmarshalJSON(data []byte) error { + var w metricLabelWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := metricLabelFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type metricValueWire struct { Timestamp *wireInt64 `json:"timestamp,omitempty"` Value *float64 `json:"value,omitempty"` @@ -1135,6 +1831,30 @@ func metricValueFromWire(w *metricValueWire) (*MetricValue, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MetricValue) MarshalJSON() ([]byte, error) { + w, err := metricValueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MetricValue) UnmarshalJSON(data []byte) error { + var w metricValueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := metricValueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type metricValuesWire struct { Metric *metricWire `json:"metric,omitempty"` Values []metricValueWire `json:"values,omitempty"` @@ -1176,6 +1896,30 @@ func metricValuesFromWire(w *metricValuesWire) (*MetricValues, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MetricValues) MarshalJSON() ([]byte, error) { + w, err := metricValuesToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MetricValues) UnmarshalJSON(data []byte) error { + var w metricValuesWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := metricValuesFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type miniVectorIndexWire struct { Name *string `json:"name,omitempty"` EndpointName *string `json:"endpoint_name,omitempty"` @@ -1280,6 +2024,30 @@ func miniVectorIndexFromWire(w *miniVectorIndexWire) (*MiniVectorIndex, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MiniVectorIndex) MarshalJSON() ([]byte, error) { + w, err := miniVectorIndexToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MiniVectorIndex) UnmarshalJSON(data []byte) error { + var w miniVectorIndexWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := miniVectorIndexFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type patchEndpointBudgetPolicyRequestWire struct { Name *string `json:"name,omitempty"` BudgetPolicyId *string `json:"budget_policy_id,omitempty"` @@ -1305,6 +2073,30 @@ func patchEndpointBudgetPolicyRequestFromWire(w *patchEndpointBudgetPolicyReques }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PatchEndpointBudgetPolicyRequest) MarshalJSON() ([]byte, error) { + w, err := patchEndpointBudgetPolicyRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PatchEndpointBudgetPolicyRequest) UnmarshalJSON(data []byte) error { + var w patchEndpointBudgetPolicyRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := patchEndpointBudgetPolicyRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type patchEndpointBudgetPolicyResponseWire struct { BudgetPolicyId *string `json:"budget_policy_id,omitempty"` EffectiveBudgetPolicyId *string `json:"effective_budget_policy_id,omitempty"` @@ -1330,6 +2122,30 @@ func patchEndpointBudgetPolicyResponseFromWire(w *patchEndpointBudgetPolicyRespo }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PatchEndpointBudgetPolicyResponse) MarshalJSON() ([]byte, error) { + w, err := patchEndpointBudgetPolicyResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PatchEndpointBudgetPolicyResponse) UnmarshalJSON(data []byte) error { + var w patchEndpointBudgetPolicyResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := patchEndpointBudgetPolicyResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type patchEndpointRequestWire struct { Name *string `json:"name,omitempty"` TargetQps *wireInt64 `json:"target_qps,omitempty"` @@ -1363,6 +2179,30 @@ func patchEndpointRequestFromWire(w *patchEndpointRequestWire) (*PatchEndpointRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v PatchEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := patchEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *PatchEndpointRequest) UnmarshalJSON(data []byte) error { + var w patchEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := patchEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queryVectorIndexNextPageRequestWire struct { Name *string `json:"name,omitempty"` EndpointName *string `json:"endpoint_name,omitempty"` @@ -1391,6 +2231,30 @@ func queryVectorIndexNextPageRequestFromWire(w *queryVectorIndexNextPageRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueryVectorIndexNextPageRequest) MarshalJSON() ([]byte, error) { + w, err := queryVectorIndexNextPageRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueryVectorIndexNextPageRequest) UnmarshalJSON(data []byte) error { + var w queryVectorIndexNextPageRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queryVectorIndexNextPageRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queryVectorIndexRequestWire struct { Name *string `json:"name,omitempty"` NumResults *int `json:"num_results,omitempty"` @@ -1457,6 +2321,30 @@ func queryVectorIndexRequestFromWire(w *queryVectorIndexRequestWire) (*QueryVect }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueryVectorIndexRequest) MarshalJSON() ([]byte, error) { + w, err := queryVectorIndexRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueryVectorIndexRequest) UnmarshalJSON(data []byte) error { + var w queryVectorIndexRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queryVectorIndexRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type queryVectorIndexResponseWire struct { Manifest *resultManifestWire `json:"manifest,omitempty"` Result *resultDataWire `json:"result,omitempty"` @@ -1512,6 +2400,30 @@ func queryVectorIndexResponseFromWire(w *queryVectorIndexResponseWire) (*QueryVe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v QueryVectorIndexResponse) MarshalJSON() ([]byte, error) { + w, err := queryVectorIndexResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *QueryVectorIndexResponse) UnmarshalJSON(data []byte) error { + var w queryVectorIndexResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := queryVectorIndexResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rerankerConfigWire struct { Model *string `json:"model,omitempty"` Parameters *rerankerConfig_RerankerParametersWire `json:"parameters,omitempty"` @@ -1545,6 +2457,30 @@ func rerankerConfigFromWire(w *rerankerConfigWire) (*RerankerConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RerankerConfig) MarshalJSON() ([]byte, error) { + w, err := rerankerConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RerankerConfig) UnmarshalJSON(data []byte) error { + var w rerankerConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rerankerConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type rerankerConfig_RerankerParametersWire struct { ColumnsToRerank []string `json:"columns_to_rerank,omitempty"` } @@ -1567,6 +2503,30 @@ func rerankerConfig_RerankerParametersFromWire(w *rerankerConfig_RerankerParamet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RerankerConfig_RerankerParameters) MarshalJSON() ([]byte, error) { + w, err := rerankerConfig_RerankerParametersToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RerankerConfig_RerankerParameters) UnmarshalJSON(data []byte) error { + var w rerankerConfig_RerankerParametersWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := rerankerConfig_RerankerParametersFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resultDataWire struct { RowCount *int `json:"row_count,omitempty"` DataArray [][]json.RawMessage `json:"data_array,omitempty"` @@ -1592,6 +2552,30 @@ func resultDataFromWire(w *resultDataWire) (*ResultData, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResultData) MarshalJSON() ([]byte, error) { + w, err := resultDataToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResultData) UnmarshalJSON(data []byte) error { + var w resultDataWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resultDataFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type resultManifestWire struct { ColumnCount *int `json:"column_count,omitempty"` Columns []columnInfoWire `json:"columns,omitempty"` @@ -1639,6 +2623,30 @@ func resultManifestFromWire(w *resultManifestWire) (*ResultManifest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ResultManifest) MarshalJSON() ([]byte, error) { + w, err := resultManifestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ResultManifest) UnmarshalJSON(data []byte) error { + var w resultManifestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := resultManifestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type retrieveUserVisibleMetricsRequestWire struct { Name *string `json:"name,omitempty"` StartTime *types.Time `json:"start_time,omitempty"` @@ -1684,6 +2692,30 @@ func retrieveUserVisibleMetricsRequestFromWire(w *retrieveUserVisibleMetricsRequ }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RetrieveUserVisibleMetricsRequest) MarshalJSON() ([]byte, error) { + w, err := retrieveUserVisibleMetricsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RetrieveUserVisibleMetricsRequest) UnmarshalJSON(data []byte) error { + var w retrieveUserVisibleMetricsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := retrieveUserVisibleMetricsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type retrieveUserVisibleMetricsResponseWire struct { MetricValues []metricValuesWire `json:"metric_values,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1717,6 +2749,30 @@ func retrieveUserVisibleMetricsResponseFromWire(w *retrieveUserVisibleMetricsRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RetrieveUserVisibleMetricsResponse) MarshalJSON() ([]byte, error) { + w, err := retrieveUserVisibleMetricsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RetrieveUserVisibleMetricsResponse) UnmarshalJSON(data []byte) error { + var w retrieveUserVisibleMetricsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := retrieveUserVisibleMetricsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type scanVectorIndexRequestWire struct { Name *string `json:"name,omitempty"` NumResults *int `json:"num_results,omitempty"` @@ -1745,6 +2801,30 @@ func scanVectorIndexRequestFromWire(w *scanVectorIndexRequestWire) (*ScanVectorI }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ScanVectorIndexRequest) MarshalJSON() ([]byte, error) { + w, err := scanVectorIndexRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ScanVectorIndexRequest) UnmarshalJSON(data []byte) error { + var w scanVectorIndexRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := scanVectorIndexRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type scanVectorIndexResponseWire struct { Data []structWire `json:"data,omitempty"` LastPrimaryKey *string `json:"last_primary_key,omitempty"` @@ -1778,6 +2858,30 @@ func scanVectorIndexResponseFromWire(w *scanVectorIndexResponseWire) (*ScanVecto }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ScanVectorIndexResponse) MarshalJSON() ([]byte, error) { + w, err := scanVectorIndexResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ScanVectorIndexResponse) UnmarshalJSON(data []byte) error { + var w scanVectorIndexResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := scanVectorIndexResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type startEndpointRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1800,6 +2904,30 @@ func startEndpointRequestFromWire(w *startEndpointRequestWire) (*StartEndpointRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StartEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := startEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StartEndpointRequest) UnmarshalJSON(data []byte) error { + var w startEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := startEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type stopEndpointRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1822,6 +2950,30 @@ func stopEndpointRequestFromWire(w *stopEndpointRequestWire) (*StopEndpointReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StopEndpointRequest) MarshalJSON() ([]byte, error) { + w, err := stopEndpointRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StopEndpointRequest) UnmarshalJSON(data []byte) error { + var w stopEndpointRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := stopEndpointRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type structWire struct { Fields []mapStringValueEntryWire `json:"fields,omitempty"` } @@ -1852,6 +3004,30 @@ func structFromWire(w *structWire) (*Struct, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Struct) MarshalJSON() ([]byte, error) { + w, err := structToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Struct) UnmarshalJSON(data []byte) error { + var w structWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := structFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncVectorIndexRequestWire struct { Name *string `json:"name,omitempty"` } @@ -1874,6 +3050,30 @@ func syncVectorIndexRequestFromWire(w *syncVectorIndexRequestWire) (*SyncVectorI }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncVectorIndexRequest) MarshalJSON() ([]byte, error) { + w, err := syncVectorIndexRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncVectorIndexRequest) UnmarshalJSON(data []byte) error { + var w syncVectorIndexRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncVectorIndexRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type syncVectorIndexResponseWire struct { } @@ -1891,6 +3091,30 @@ func syncVectorIndexResponseFromWire(w *syncVectorIndexResponseWire) (*SyncVecto return &SyncVectorIndexResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SyncVectorIndexResponse) MarshalJSON() ([]byte, error) { + w, err := syncVectorIndexResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SyncVectorIndexResponse) UnmarshalJSON(data []byte) error { + var w syncVectorIndexResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := syncVectorIndexResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateEndpointCustomTagsRequestWire struct { Name *string `json:"name,omitempty"` CustomTags []customTagWire `json:"custom_tags,omitempty"` @@ -1924,6 +3148,30 @@ func updateEndpointCustomTagsRequestFromWire(w *updateEndpointCustomTagsRequestW }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateEndpointCustomTagsRequest) MarshalJSON() ([]byte, error) { + w, err := updateEndpointCustomTagsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateEndpointCustomTagsRequest) UnmarshalJSON(data []byte) error { + var w updateEndpointCustomTagsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateEndpointCustomTagsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateEndpointCustomTagsResponseWire struct { Name *string `json:"name,omitempty"` CustomTags []customTagWire `json:"custom_tags,omitempty"` @@ -1957,6 +3205,30 @@ func updateEndpointCustomTagsResponseFromWire(w *updateEndpointCustomTagsRespons }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateEndpointCustomTagsResponse) MarshalJSON() ([]byte, error) { + w, err := updateEndpointCustomTagsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateEndpointCustomTagsResponse) UnmarshalJSON(data []byte) error { + var w updateEndpointCustomTagsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateEndpointCustomTagsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type upsertDataVectorIndexRequestWire struct { Name *string `json:"name,omitempty"` InputsJson *string `json:"inputs_json,omitempty"` @@ -1982,6 +3254,30 @@ func upsertDataVectorIndexRequestFromWire(w *upsertDataVectorIndexRequestWire) ( }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpsertDataVectorIndexRequest) MarshalJSON() ([]byte, error) { + w, err := upsertDataVectorIndexRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpsertDataVectorIndexRequest) UnmarshalJSON(data []byte) error { + var w upsertDataVectorIndexRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := upsertDataVectorIndexRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type upsertDataVectorIndexResponseWire struct { Status UpsertDeleteDataStatus `json:"status,omitempty"` Result *upsertDeleteDataResultWire `json:"result,omitempty"` @@ -2015,6 +3311,30 @@ func upsertDataVectorIndexResponseFromWire(w *upsertDataVectorIndexResponseWire) }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpsertDataVectorIndexResponse) MarshalJSON() ([]byte, error) { + w, err := upsertDataVectorIndexResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpsertDataVectorIndexResponse) UnmarshalJSON(data []byte) error { + var w upsertDataVectorIndexResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := upsertDataVectorIndexResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type upsertDeleteDataResultWire struct { SuccessRowCount *wireInt64 `json:"success_row_count,omitempty"` FailedPrimaryKeys []string `json:"failed_primary_keys,omitempty"` @@ -2048,6 +3368,30 @@ func upsertDeleteDataResultFromWire(w *upsertDeleteDataResultWire) (*UpsertDelet }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpsertDeleteDataResult) MarshalJSON() ([]byte, error) { + w, err := upsertDeleteDataResultToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpsertDeleteDataResult) UnmarshalJSON(data []byte) error { + var w upsertDeleteDataResultWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := upsertDeleteDataResultFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type valueWire struct { NumberValue *float64 `json:"number_value,omitempty"` StringValue *string `json:"string_value,omitempty"` @@ -2156,6 +3500,30 @@ func valueFromWire(w *valueWire) (*Value, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Value) MarshalJSON() ([]byte, error) { + w, err := valueToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Value) UnmarshalJSON(data []byte) error { + var w valueWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := valueFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type vectorIndexWire struct { Name *string `json:"name,omitempty"` EndpointName *string `json:"endpoint_name,omitempty"` @@ -2260,6 +3628,30 @@ func vectorIndexFromWire(w *vectorIndexWire) (*VectorIndex, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v VectorIndex) MarshalJSON() ([]byte, error) { + w, err := vectorIndexToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *VectorIndex) UnmarshalJSON(data []byte) error { + var w vectorIndexWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := vectorIndexFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type vectorIndexStatusWire struct { Message *string `json:"message,omitempty"` IndexedRowCount *wireInt64 `json:"indexed_row_count,omitempty"` @@ -2299,6 +3691,30 @@ func vectorIndexStatusFromWire(w *vectorIndexStatusWire) (*VectorIndexStatus, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v VectorIndexStatus) MarshalJSON() ([]byte, error) { + w, err := vectorIndexStatusToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *VectorIndexStatus) UnmarshalJSON(data []byte) error { + var w vectorIndexStatusWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := vectorIndexStatusFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/warehouses/CHANGELOG.md b/warehouses/CHANGELOG.md index b2277f70..c8867401 100644 --- a/warehouses/CHANGELOG.md +++ b/warehouses/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.10.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.9.0 (2026-11-11) ## Release v0.8.0 (2026-11-10) diff --git a/warehouses/internal/version.go b/warehouses/internal/version.go index 070166b8..a095847d 100644 --- a/warehouses/internal/version.go +++ b/warehouses/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-warehouses" -const Version = "0.9.0" +const Version = "0.10.0" diff --git a/warehouses/v1/wire.go b/warehouses/v1/wire.go index 9c23ba2c..a0e2ea51 100644 --- a/warehouses/v1/wire.go +++ b/warehouses/v1/wire.go @@ -79,6 +79,30 @@ func channelFromWire(w *channelWire) (*Channel, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Channel) MarshalJSON() ([]byte, error) { + w, err := channelToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Channel) UnmarshalJSON(data []byte) error { + var w channelWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := channelFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createDefaultWarehouseOverrideRequestWire struct { DefaultWarehouseOverrideId *string `json:"default_warehouse_override_id,omitempty"` DefaultWarehouseOverride *defaultWarehouseOverrideWire `json:"default_warehouse_override,omitempty"` @@ -112,6 +136,30 @@ func createDefaultWarehouseOverrideRequestFromWire(w *createDefaultWarehouseOver }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateDefaultWarehouseOverrideRequest) MarshalJSON() ([]byte, error) { + w, err := createDefaultWarehouseOverrideRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateDefaultWarehouseOverrideRequest) UnmarshalJSON(data []byte) error { + var w createDefaultWarehouseOverrideRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createDefaultWarehouseOverrideRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createWarehouseRequestWire struct { Name *string `json:"name,omitempty"` ClusterSize *string `json:"cluster_size,omitempty"` @@ -198,6 +246,30 @@ func createWarehouseRequestFromWire(w *createWarehouseRequestWire) (*CreateWareh }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateWarehouseRequest) MarshalJSON() ([]byte, error) { + w, err := createWarehouseRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateWarehouseRequest) UnmarshalJSON(data []byte) error { + var w createWarehouseRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createWarehouseRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createWarehouseResponseWire struct { Id *string `json:"id,omitempty"` } @@ -220,6 +292,30 @@ func createWarehouseResponseFromWire(w *createWarehouseResponseWire) (*CreateWar }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateWarehouseResponse) MarshalJSON() ([]byte, error) { + w, err := createWarehouseResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateWarehouseResponse) UnmarshalJSON(data []byte) error { + var w createWarehouseResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createWarehouseResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type defaultWarehouseOverrideWire struct { Name *string `json:"name,omitempty"` DefaultWarehouseOverrideId *string `json:"default_warehouse_override_id,omitempty"` @@ -251,6 +347,30 @@ func defaultWarehouseOverrideFromWire(w *defaultWarehouseOverrideWire) (*Default }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DefaultWarehouseOverride) MarshalJSON() ([]byte, error) { + w, err := defaultWarehouseOverrideToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DefaultWarehouseOverride) UnmarshalJSON(data []byte) error { + var w defaultWarehouseOverrideWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := defaultWarehouseOverrideFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteDefaultWarehouseOverrideRequestWire struct { Name *string `json:"name,omitempty"` } @@ -273,6 +393,30 @@ func deleteDefaultWarehouseOverrideRequestFromWire(w *deleteDefaultWarehouseOver }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteDefaultWarehouseOverrideRequest) MarshalJSON() ([]byte, error) { + w, err := deleteDefaultWarehouseOverrideRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteDefaultWarehouseOverrideRequest) UnmarshalJSON(data []byte) error { + var w deleteDefaultWarehouseOverrideRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteDefaultWarehouseOverrideRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteWarehouseResponseWire struct { } @@ -290,6 +434,30 @@ func deleteWarehouseResponseFromWire(w *deleteWarehouseResponseWire) (*DeleteWar return &DeleteWarehouseResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteWarehouseResponse) MarshalJSON() ([]byte, error) { + w, err := deleteWarehouseResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteWarehouseResponse) UnmarshalJSON(data []byte) error { + var w deleteWarehouseResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteWarehouseResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type editWarehouseRequestWire struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -379,6 +547,30 @@ func editWarehouseRequestFromWire(w *editWarehouseRequestWire) (*EditWarehouseRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EditWarehouseRequest) MarshalJSON() ([]byte, error) { + w, err := editWarehouseRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EditWarehouseRequest) UnmarshalJSON(data []byte) error { + var w editWarehouseRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := editWarehouseRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type editWarehouseResponseWire struct { } @@ -396,6 +588,30 @@ func editWarehouseResponseFromWire(w *editWarehouseResponseWire) (*EditWarehouse return &EditWarehouseResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EditWarehouseResponse) MarshalJSON() ([]byte, error) { + w, err := editWarehouseResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EditWarehouseResponse) UnmarshalJSON(data []byte) error { + var w editWarehouseResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := editWarehouseResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointConfPairWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -421,6 +637,30 @@ func endpointConfPairFromWire(w *endpointConfPairWire) (*EndpointConfPair, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointConfPair) MarshalJSON() ([]byte, error) { + w, err := endpointConfPairToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointConfPair) UnmarshalJSON(data []byte) error { + var w endpointConfPairWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointConfPairFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointHealthWire struct { Status EndpointHealth_Status `json:"status,omitempty"` Message *string `json:"message,omitempty"` @@ -463,6 +703,30 @@ func endpointHealthFromWire(w *endpointHealthWire) (*EndpointHealth, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointHealth) MarshalJSON() ([]byte, error) { + w, err := endpointHealthToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointHealth) UnmarshalJSON(data []byte) error { + var w endpointHealthWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointHealthFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointInfoWire struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -594,6 +858,30 @@ func endpointInfoFromWire(w *endpointInfoWire) (*EndpointInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointInfo) MarshalJSON() ([]byte, error) { + w, err := endpointInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointInfo) UnmarshalJSON(data []byte) error { + var w endpointInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointTagPairWire struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` @@ -619,6 +907,30 @@ func endpointTagPairFromWire(w *endpointTagPairWire) (*EndpointTagPair, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointTagPair) MarshalJSON() ([]byte, error) { + w, err := endpointTagPairToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointTagPair) UnmarshalJSON(data []byte) error { + var w endpointTagPairWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointTagPairFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type endpointTagsWire struct { CustomTags []endpointTagPairWire `json:"custom_tags,omitempty"` } @@ -649,6 +961,30 @@ func endpointTagsFromWire(w *endpointTagsWire) (*EndpointTags, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v EndpointTags) MarshalJSON() ([]byte, error) { + w, err := endpointTagsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *EndpointTags) UnmarshalJSON(data []byte) error { + var w endpointTagsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := endpointTagsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getDefaultWarehouseOverrideRequestWire struct { Name *string `json:"name,omitempty"` } @@ -671,6 +1007,30 @@ func getDefaultWarehouseOverrideRequestFromWire(w *getDefaultWarehouseOverrideRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetDefaultWarehouseOverrideRequest) MarshalJSON() ([]byte, error) { + w, err := getDefaultWarehouseOverrideRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetDefaultWarehouseOverrideRequest) UnmarshalJSON(data []byte) error { + var w getDefaultWarehouseOverrideRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getDefaultWarehouseOverrideRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getWarehouseRequestWire struct { Id *string `json:"id,omitempty"` } @@ -693,6 +1053,30 @@ func getWarehouseRequestFromWire(w *getWarehouseRequestWire) (*GetWarehouseReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetWarehouseRequest) MarshalJSON() ([]byte, error) { + w, err := getWarehouseRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetWarehouseRequest) UnmarshalJSON(data []byte) error { + var w getWarehouseRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getWarehouseRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getWarehouseResponseWire struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -824,6 +1208,30 @@ func getWarehouseResponseFromWire(w *getWarehouseResponseWire) (*GetWarehouseRes }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetWarehouseResponse) MarshalJSON() ([]byte, error) { + w, err := getWarehouseResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetWarehouseResponse) UnmarshalJSON(data []byte) error { + var w getWarehouseResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getWarehouseResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getWorkspaceWarehouseConfigRequestWire struct { } @@ -841,6 +1249,30 @@ func getWorkspaceWarehouseConfigRequestFromWire(w *getWorkspaceWarehouseConfigRe return &GetWorkspaceWarehouseConfigRequest{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetWorkspaceWarehouseConfigRequest) MarshalJSON() ([]byte, error) { + w, err := getWorkspaceWarehouseConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetWorkspaceWarehouseConfigRequest) UnmarshalJSON(data []byte) error { + var w getWorkspaceWarehouseConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getWorkspaceWarehouseConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getWorkspaceWarehouseConfigResponseWire struct { SecurityPolicy EndpointSecurityPolicy `json:"security_policy,omitempty"` DataAccessConfig []endpointConfPairWire `json:"data_access_config,omitempty"` @@ -938,6 +1370,30 @@ func getWorkspaceWarehouseConfigResponseFromWire(w *getWorkspaceWarehouseConfigR }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetWorkspaceWarehouseConfigResponse) MarshalJSON() ([]byte, error) { + w, err := getWorkspaceWarehouseConfigResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetWorkspaceWarehouseConfigResponse) UnmarshalJSON(data []byte) error { + var w getWorkspaceWarehouseConfigResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getWorkspaceWarehouseConfigResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDefaultWarehouseOverridesRequestWire struct { PageSize *int `json:"page_size,omitempty"` PageToken *string `json:"page_token,omitempty"` @@ -963,6 +1419,30 @@ func listDefaultWarehouseOverridesRequestFromWire(w *listDefaultWarehouseOverrid }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDefaultWarehouseOverridesRequest) MarshalJSON() ([]byte, error) { + w, err := listDefaultWarehouseOverridesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDefaultWarehouseOverridesRequest) UnmarshalJSON(data []byte) error { + var w listDefaultWarehouseOverridesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDefaultWarehouseOverridesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listDefaultWarehouseOverridesResponseWire struct { DefaultWarehouseOverrides []defaultWarehouseOverrideWire `json:"default_warehouse_overrides,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -996,6 +1476,30 @@ func listDefaultWarehouseOverridesResponseFromWire(w *listDefaultWarehouseOverri }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListDefaultWarehouseOverridesResponse) MarshalJSON() ([]byte, error) { + w, err := listDefaultWarehouseOverridesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListDefaultWarehouseOverridesResponse) UnmarshalJSON(data []byte) error { + var w listDefaultWarehouseOverridesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listDefaultWarehouseOverridesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listWarehousesResponseWire struct { Warehouses []endpointInfoWire `json:"warehouses,omitempty"` NextPageToken *string `json:"next_page_token,omitempty"` @@ -1029,6 +1533,30 @@ func listWarehousesResponseFromWire(w *listWarehousesResponseWire) (*ListWarehou }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListWarehousesResponse) MarshalJSON() ([]byte, error) { + w, err := listWarehousesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListWarehousesResponse) UnmarshalJSON(data []byte) error { + var w listWarehousesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listWarehousesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type odbcParamsWire struct { Hostname *string `json:"hostname,omitempty"` Path *string `json:"path,omitempty"` @@ -1060,6 +1588,30 @@ func odbcParamsFromWire(w *odbcParamsWire) (*OdbcParams, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v OdbcParams) MarshalJSON() ([]byte, error) { + w, err := odbcParamsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *OdbcParams) UnmarshalJSON(data []byte) error { + var w odbcParamsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := odbcParamsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type repeatedEndpointConfPairsWire struct { ConfigPair []endpointConfPairWire `json:"config_pair,omitempty"` ConfigurationPairs []endpointConfPairWire `json:"configuration_pairs,omitempty"` @@ -1101,6 +1653,30 @@ func repeatedEndpointConfPairsFromWire(w *repeatedEndpointConfPairsWire) (*Repea }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v RepeatedEndpointConfPairs) MarshalJSON() ([]byte, error) { + w, err := repeatedEndpointConfPairsToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *RepeatedEndpointConfPairs) UnmarshalJSON(data []byte) error { + var w repeatedEndpointConfPairsWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := repeatedEndpointConfPairsFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type setWorkspaceWarehouseConfigRequestWire struct { SecurityPolicy EndpointSecurityPolicy `json:"security_policy,omitempty"` DataAccessConfig []endpointConfPairWire `json:"data_access_config,omitempty"` @@ -1198,6 +1774,30 @@ func setWorkspaceWarehouseConfigRequestFromWire(w *setWorkspaceWarehouseConfigRe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SetWorkspaceWarehouseConfigRequest) MarshalJSON() ([]byte, error) { + w, err := setWorkspaceWarehouseConfigRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SetWorkspaceWarehouseConfigRequest) UnmarshalJSON(data []byte) error { + var w setWorkspaceWarehouseConfigRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := setWorkspaceWarehouseConfigRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type setWorkspaceWarehouseConfigResponseWire struct { } @@ -1215,6 +1815,30 @@ func setWorkspaceWarehouseConfigResponseFromWire(w *setWorkspaceWarehouseConfigR return &SetWorkspaceWarehouseConfigResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v SetWorkspaceWarehouseConfigResponse) MarshalJSON() ([]byte, error) { + w, err := setWorkspaceWarehouseConfigResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *SetWorkspaceWarehouseConfigResponse) UnmarshalJSON(data []byte) error { + var w setWorkspaceWarehouseConfigResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := setWorkspaceWarehouseConfigResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type startResponseWire struct { } @@ -1232,6 +1856,30 @@ func startResponseFromWire(w *startResponseWire) (*StartResponse, error) { return &StartResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StartResponse) MarshalJSON() ([]byte, error) { + w, err := startResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StartResponse) UnmarshalJSON(data []byte) error { + var w startResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := startResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type stopResponseWire struct { } @@ -1249,6 +1897,30 @@ func stopResponseFromWire(w *stopResponseWire) (*StopResponse, error) { return &StopResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StopResponse) MarshalJSON() ([]byte, error) { + w, err := stopResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StopResponse) UnmarshalJSON(data []byte) error { + var w stopResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := stopResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type terminationReasonWire struct { Code TerminationCode `json:"code,omitempty"` Type TerminationType `json:"type,omitempty"` @@ -1277,6 +1949,30 @@ func terminationReasonFromWire(w *terminationReasonWire) (*TerminationReason, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v TerminationReason) MarshalJSON() ([]byte, error) { + w, err := terminationReasonToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *TerminationReason) UnmarshalJSON(data []byte) error { + var w terminationReasonWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := terminationReasonFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateDefaultWarehouseOverrideRequestWire struct { DefaultWarehouseOverride *defaultWarehouseOverrideWire `json:"default_warehouse_override,omitempty"` UpdateMask *types.FieldMask[DefaultWarehouseOverride] `json:"update_mask,omitempty"` @@ -1313,6 +2009,30 @@ func updateDefaultWarehouseOverrideRequestFromWire(w *updateDefaultWarehouseOver }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateDefaultWarehouseOverrideRequest) MarshalJSON() ([]byte, error) { + w, err := updateDefaultWarehouseOverrideRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateDefaultWarehouseOverrideRequest) UnmarshalJSON(data []byte) error { + var w updateDefaultWarehouseOverrideRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateDefaultWarehouseOverrideRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type warehouseTypePairWire struct { WarehouseType WarehouseType `json:"warehouse_type,omitempty"` Enabled *bool `json:"enabled,omitempty"` @@ -1338,6 +2058,30 @@ func warehouseTypePairFromWire(w *warehouseTypePairWire) (*WarehouseTypePair, er }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WarehouseTypePair) MarshalJSON() ([]byte, error) { + w, err := warehouseTypePairToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WarehouseTypePair) UnmarshalJSON(data []byte) error { + var w warehouseTypePairWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := warehouseTypePairFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteWarehouseRequestWire struct { Id *string `json:"id,omitempty"` } @@ -1360,6 +2104,30 @@ func deleteWarehouseRequestFromWire(w *deleteWarehouseRequestWire) (*DeleteWareh }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteWarehouseRequest) MarshalJSON() ([]byte, error) { + w, err := deleteWarehouseRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteWarehouseRequest) UnmarshalJSON(data []byte) error { + var w deleteWarehouseRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteWarehouseRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listWarehousesRequestWire struct { RunAsUserId *wireInt64 `json:"run_as_user_id,omitempty"` PageSize *int `json:"page_size,omitempty"` @@ -1396,6 +2164,30 @@ func listWarehousesRequestFromWire(w *listWarehousesRequestWire) (*ListWarehouse }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListWarehousesRequest) MarshalJSON() ([]byte, error) { + w, err := listWarehousesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListWarehousesRequest) UnmarshalJSON(data []byte) error { + var w listWarehousesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listWarehousesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type startRequestWire struct { Id *string `json:"id,omitempty"` } @@ -1418,6 +2210,30 @@ func startRequestFromWire(w *startRequestWire) (*StartRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StartRequest) MarshalJSON() ([]byte, error) { + w, err := startRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StartRequest) UnmarshalJSON(data []byte) error { + var w startRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := startRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type stopRequestWire struct { Id *string `json:"id,omitempty"` } @@ -1440,6 +2256,30 @@ func stopRequestFromWire(w *stopRequestWire) (*StopRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v StopRequest) MarshalJSON() ([]byte, error) { + w, err := stopRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *StopRequest) UnmarshalJSON(data []byte) error { + var w stopRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := stopRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/workspacefiles/CHANGELOG.md b/workspacefiles/CHANGELOG.md index 72b7552d..1fdc6d96 100644 --- a/workspacefiles/CHANGELOG.md +++ b/workspacefiles/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.4.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.3.0 (2026-11-11) ## Release v0.2.0 (2026-11-10) diff --git a/workspacefiles/internal/version.go b/workspacefiles/internal/version.go index 3d6e406c..ae7cb5e4 100644 --- a/workspacefiles/internal/version.go +++ b/workspacefiles/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-workspacefiles" -const Version = "0.3.0" +const Version = "0.4.0" diff --git a/workspacefiles/v1/wire.go b/workspacefiles/v1/wire.go index 500dd80b..1ffc2bd7 100644 --- a/workspacefiles/v1/wire.go +++ b/workspacefiles/v1/wire.go @@ -77,6 +77,30 @@ func deleteRequestFromWire(w *deleteRequestWire) (*DeleteRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteRequest) MarshalJSON() ([]byte, error) { + w, err := deleteRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteRequest) UnmarshalJSON(data []byte) error { + var w deleteRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteResponseWire struct { } @@ -94,6 +118,30 @@ func deleteResponseFromWire(w *deleteResponseWire) (*DeleteResponse, error) { return &DeleteResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteResponse) MarshalJSON() ([]byte, error) { + w, err := deleteResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteResponse) UnmarshalJSON(data []byte) error { + var w deleteResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type directoryInfoWire struct { IsGitFolder *bool `json:"is_git_folder,omitempty"` } @@ -116,6 +164,30 @@ func directoryInfoFromWire(w *directoryInfoWire) (*DirectoryInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DirectoryInfo) MarshalJSON() ([]byte, error) { + w, err := directoryInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DirectoryInfo) UnmarshalJSON(data []byte) error { + var w directoryInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := directoryInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type exportRequestWire struct { Path *string `json:"path,omitempty"` Format ExportFormat `json:"format,omitempty"` @@ -144,6 +216,30 @@ func exportRequestFromWire(w *exportRequestWire) (*ExportRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExportRequest) MarshalJSON() ([]byte, error) { + w, err := exportRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExportRequest) UnmarshalJSON(data []byte) error { + var w exportRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := exportRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type exportResponseWire struct { Content []byte `json:"content,omitempty"` FileType *string `json:"file_type,omitempty"` @@ -169,6 +265,30 @@ func exportResponseFromWire(w *exportResponseWire) (*ExportResponse, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ExportResponse) MarshalJSON() ([]byte, error) { + w, err := exportResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ExportResponse) UnmarshalJSON(data []byte) error { + var w exportResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := exportResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getStatusRequestWire struct { Path *string `json:"path,omitempty"` } @@ -191,6 +311,30 @@ func getStatusRequestFromWire(w *getStatusRequestWire) (*GetStatusRequest, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetStatusRequest) MarshalJSON() ([]byte, error) { + w, err := getStatusRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetStatusRequest) UnmarshalJSON(data []byte) error { + var w getStatusRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getStatusRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type importRequestWire struct { Path *string `json:"path,omitempty"` Format ExportFormat `json:"format,omitempty"` @@ -225,6 +369,30 @@ func importRequestFromWire(w *importRequestWire) (*ImportRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ImportRequest) MarshalJSON() ([]byte, error) { + w, err := importRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ImportRequest) UnmarshalJSON(data []byte) error { + var w importRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := importRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type importResponseWire struct { } @@ -242,6 +410,30 @@ func importResponseFromWire(w *importResponseWire) (*ImportResponse, error) { return &ImportResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ImportResponse) MarshalJSON() ([]byte, error) { + w, err := importResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ImportResponse) UnmarshalJSON(data []byte) error { + var w importResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := importResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listRequestWire struct { Path *string `json:"path,omitempty"` NotebooksModifiedAfter *wireInt64 `json:"notebooks_modified_after,omitempty"` @@ -275,6 +467,30 @@ func listRequestFromWire(w *listRequestWire) (*ListRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListRequest) MarshalJSON() ([]byte, error) { + w, err := listRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListRequest) UnmarshalJSON(data []byte) error { + var w listRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listResponseWire struct { Objects []objectInfoWire `json:"objects,omitempty"` } @@ -305,6 +521,30 @@ func listResponseFromWire(w *listResponseWire) (*ListResponse, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListResponse) MarshalJSON() ([]byte, error) { + w, err := listResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListResponse) UnmarshalJSON(data []byte) error { + var w listResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type mkdirsRequestWire struct { Path *string `json:"path,omitempty"` } @@ -327,6 +567,30 @@ func mkdirsRequestFromWire(w *mkdirsRequestWire) (*MkdirsRequest, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MkdirsRequest) MarshalJSON() ([]byte, error) { + w, err := mkdirsRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MkdirsRequest) UnmarshalJSON(data []byte) error { + var w mkdirsRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := mkdirsRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type mkdirsResponseWire struct { } @@ -344,6 +608,30 @@ func mkdirsResponseFromWire(w *mkdirsResponseWire) (*MkdirsResponse, error) { return &MkdirsResponse{}, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v MkdirsResponse) MarshalJSON() ([]byte, error) { + w, err := mkdirsResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *MkdirsResponse) UnmarshalJSON(data []byte) error { + var w mkdirsResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := mkdirsResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type objectInfoWire struct { ObjectType ObjectType `json:"object_type,omitempty"` Path *string `json:"path,omitempty"` @@ -430,6 +718,30 @@ func objectInfoFromWire(w *objectInfoWire) (*ObjectInfo, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ObjectInfo) MarshalJSON() ([]byte, error) { + w, err := objectInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ObjectInfo) UnmarshalJSON(data []byte) error { + var w objectInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := objectInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil diff --git a/workspaces/CHANGELOG.md b/workspaces/CHANGELOG.md index 1724375a..343b52e7 100644 --- a/workspaces/CHANGELOG.md +++ b/workspaces/CHANGELOG.md @@ -1,5 +1,13 @@ # Version changelog +## Release v0.6.0 (2026-11-12) + +### New Features and Improvements +* Structs in this package implement `json.Marshaler` and `json.Unmarshaler`, so they can be stored as JSON and read back. + +### Breaking Changes +* `json.Marshal` and `json.Unmarshal` on structs in this package use a different JSON format than before. + ## Release v0.5.0 (2026-11-11) ## Release v0.4.0 (2026-11-10) diff --git a/workspaces/internal/version.go b/workspaces/internal/version.go index 3e416bc6..2547715c 100644 --- a/workspaces/internal/version.go +++ b/workspaces/internal/version.go @@ -2,4 +2,4 @@ package internal const ModuleName = "sdk-go-workspaces" -const Version = "0.5.0" +const Version = "0.6.0" diff --git a/workspaces/v1/wire.go b/workspaces/v1/wire.go index 04d9f298..938fd055 100644 --- a/workspaces/v1/wire.go +++ b/workspaces/v1/wire.go @@ -79,6 +79,30 @@ func azureWorkspaceInfoFromWire(w *azureWorkspaceInfoWire) (*AzureWorkspaceInfo, }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v AzureWorkspaceInfo) MarshalJSON() ([]byte, error) { + w, err := azureWorkspaceInfoToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *AzureWorkspaceInfo) UnmarshalJSON(data []byte) error { + var w azureWorkspaceInfoWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := azureWorkspaceInfoFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type cloudResourceContainerWire struct { Gcp *gcpCloudResourceContainerWire `json:"gcp,omitempty"` } @@ -131,6 +155,30 @@ func cloudResourceContainerFromWire(w *cloudResourceContainerWire) (*CloudResour }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CloudResourceContainer) MarshalJSON() ([]byte, error) { + w, err := cloudResourceContainerToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CloudResourceContainer) UnmarshalJSON(data []byte) error { + var w cloudResourceContainerWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := cloudResourceContainerFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type createWorkspaceRequestWire struct { AccountId *string `json:"account_id,omitempty"` WorkspaceName *string `json:"workspace_name,omitempty"` @@ -231,6 +279,30 @@ func createWorkspaceRequestFromWire(w *createWorkspaceRequestWire) (*CreateWorks }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v CreateWorkspaceRequest) MarshalJSON() ([]byte, error) { + w, err := createWorkspaceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *CreateWorkspaceRequest) UnmarshalJSON(data []byte) error { + var w createWorkspaceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := createWorkspaceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type deleteWorkspaceRequestWire struct { WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -264,6 +336,30 @@ func deleteWorkspaceRequestFromWire(w *deleteWorkspaceRequestWire) (*DeleteWorks }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v DeleteWorkspaceRequest) MarshalJSON() ([]byte, error) { + w, err := deleteWorkspaceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *DeleteWorkspaceRequest) UnmarshalJSON(data []byte) error { + var w deleteWorkspaceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := deleteWorkspaceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gcpCloudResourceContainerWire struct { ProjectId *string `json:"project_id,omitempty"` } @@ -286,6 +382,30 @@ func gcpCloudResourceContainerFromWire(w *gcpCloudResourceContainerWire) (*GcpCl }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GcpCloudResourceContainer) MarshalJSON() ([]byte, error) { + w, err := gcpCloudResourceContainerToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GcpCloudResourceContainer) UnmarshalJSON(data []byte) error { + var w gcpCloudResourceContainerWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gcpCloudResourceContainerFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gcpCommonNetworkConfigWire struct { GkeConnectivityType GkeConnectivityType `json:"gke_connectivity_type,omitempty"` GkeClusterMasterIpRange *string `json:"gke_cluster_master_ip_range,omitempty"` @@ -311,6 +431,30 @@ func gcpCommonNetworkConfigFromWire(w *gcpCommonNetworkConfigWire) (*GcpCommonNe }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GcpCommonNetworkConfig) MarshalJSON() ([]byte, error) { + w, err := gcpCommonNetworkConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GcpCommonNetworkConfig) UnmarshalJSON(data []byte) error { + var w gcpCommonNetworkConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gcpCommonNetworkConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gcpManagedNetworkConfigWire struct { SubnetCidr *string `json:"subnet_cidr,omitempty"` GkeClusterPodIpRange *string `json:"gke_cluster_pod_ip_range,omitempty"` @@ -339,6 +483,30 @@ func gcpManagedNetworkConfigFromWire(w *gcpManagedNetworkConfigWire) (*GcpManage }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GcpManagedNetworkConfig) MarshalJSON() ([]byte, error) { + w, err := gcpManagedNetworkConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GcpManagedNetworkConfig) UnmarshalJSON(data []byte) error { + var w gcpManagedNetworkConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gcpManagedNetworkConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type getWorkspaceRequestWire struct { WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` AccountId *string `json:"account_id,omitempty"` @@ -372,6 +540,30 @@ func getWorkspaceRequestFromWire(w *getWorkspaceRequestWire) (*GetWorkspaceReque }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GetWorkspaceRequest) MarshalJSON() ([]byte, error) { + w, err := getWorkspaceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GetWorkspaceRequest) UnmarshalJSON(data []byte) error { + var w getWorkspaceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := getWorkspaceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type gkeConfigWire struct { ConnectivityType GkeConnectivityType `json:"connectivity_type,omitempty"` MasterIpRange *string `json:"master_ip_range,omitempty"` @@ -397,6 +589,30 @@ func gkeConfigFromWire(w *gkeConfigWire) (*GkeConfig, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v GkeConfig) MarshalJSON() ([]byte, error) { + w, err := gkeConfigToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *GkeConfig) UnmarshalJSON(data []byte) error { + var w gkeConfigWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := gkeConfigFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listWorkspacesRequestWire struct { AccountId *string `json:"account_id,omitempty"` } @@ -419,6 +635,30 @@ func listWorkspacesRequestFromWire(w *listWorkspacesRequestWire) (*ListWorkspace }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListWorkspacesRequest) MarshalJSON() ([]byte, error) { + w, err := listWorkspacesRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListWorkspacesRequest) UnmarshalJSON(data []byte) error { + var w listWorkspacesRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listWorkspacesRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type listWorkspacesResponseWire struct { Workspaces []workspaceWire `json:"workspaces,omitempty"` } @@ -449,6 +689,30 @@ func listWorkspacesResponseFromWire(w *listWorkspacesResponseWire) (*ListWorkspa }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v ListWorkspacesResponse) MarshalJSON() ([]byte, error) { + w, err := listWorkspacesResponseToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *ListWorkspacesResponse) UnmarshalJSON(data []byte) error { + var w listWorkspacesResponseWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := listWorkspacesResponseFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type updateWorkspaceRequestWire struct { CustomerFacingWorkspace *workspaceWire `json:"customer_facing_workspace,omitempty"` UpdateMask *types.FieldMask[Workspace] `json:"update_mask,omitempty"` @@ -482,6 +746,30 @@ func updateWorkspaceRequestFromWire(w *updateWorkspaceRequestWire) (*UpdateWorks }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v UpdateWorkspaceRequest) MarshalJSON() ([]byte, error) { + w, err := updateWorkspaceRequestToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *UpdateWorkspaceRequest) UnmarshalJSON(data []byte) error { + var w updateWorkspaceRequestWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := updateWorkspaceRequestFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type workspaceWire struct { WorkspaceId *wireInt64 `json:"workspace_id,omitempty"` WorkspaceName *string `json:"workspace_name,omitempty"` @@ -669,6 +957,30 @@ func workspaceFromWire(w *workspaceWire) (*Workspace, error) { }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v Workspace) MarshalJSON() ([]byte, error) { + w, err := workspaceToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *Workspace) UnmarshalJSON(data []byte) error { + var w workspaceWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := workspaceFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + type workspaceNetworkWire struct { GcpManagedNetworkConfig *gcpManagedNetworkConfigWire `json:"gcp_managed_network_config,omitempty"` NetworkId *string `json:"network_id,omitempty"` @@ -744,6 +1056,30 @@ func workspaceNetworkFromWire(w *workspaceNetworkWire) (*WorkspaceNetwork, error }, nil } +// MarshalJSON returns the JSON form that the API uses for this message, with +// fields that a request sends in the URL path or query as regular fields. +func (v WorkspaceNetwork) MarshalJSON() ([]byte, error) { + w, err := workspaceNetworkToWire(&v) + if err != nil { + return nil, err + } + return json.Marshal(w) +} + +// UnmarshalJSON sets the message from the JSON that MarshalJSON writes. +func (v *WorkspaceNetwork) UnmarshalJSON(data []byte) error { + var w workspaceNetworkWire + if err := json.Unmarshal(data, &w); err != nil { + return err + } + decoded, err := workspaceNetworkFromWire(&w) + if err != nil { + return err + } + *v = *decoded + return nil +} + func convertSlice[T, W any](s []T, conv func(*T) (*W, error)) ([]W, error) { if s == nil { return nil, nil