From b3c39ab16456a7e0f94bd9cb585777b1a34e769a Mon Sep 17 00:00:00 2001 From: Alex Ong Date: Wed, 23 Sep 2026 13:50:33 +1000 Subject: [PATCH 1/2] coreapi: refresh the vendored core spec Refresh spec/core.openapi.json from the control plane and regenerate the client. The spec has moved on since the last vendor: it adds the org invitation routes COR-1744 needs, and it also reshapes surfaces the CLI already calls. What changed on the wire, and what each needed here: - create and delete now return an X-Entire-Commit-Token response header, so ogen wraps their results. Unwrap at the call sites; `org create` and `project create` keep printing the object, whose --json now also carries the deprecated commitToken field the server sends. - CreateRepo returns CreatedRepo, a twin of Repo with that extra field. The readiness poll and the creation report both work on Repo, so convert once at the boundary. - GrantProjectAccessInputBody and GrantRepoAccessInputBody collapsed into one GrantAccessBody whose provider pair is optional, because the route now also takes an accountId. The CLI always sends the pair. - BranchRule split into a read model and BranchRuleUpdate for patches. - createMirror and getPermissions are gone. The mirror flow already posts to the async createMirrorRequest route and only borrowed CreatedMirror to carry three fields home; MirrorRequestResult already holds them. Membership and Invitation ship role and status as enums, and the create responses repeat their read models' required capabilities. Both are the cases readModelEnumFields and readModelOptionalFields exist for: the CLI only prints these values, so a value added later must display rather than fail the whole listing. Add the entries and lock them in with tests. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01PLWcdMjoLpAaiATYzY3v74 --- cmd/entire/cli/grant.go | 28 +- cmd/entire/cli/grant_test.go | 4 +- cmd/entire/cli/org.go | 6 +- cmd/entire/cli/project.go | 6 +- cmd/entire/cli/repo.go | 9 +- cmd/entire/cli/repo_mirror.go | 4 +- cmd/entire/cli/repo_mirror_probe.go | 8 +- cmd/entire/cli/repo_mirror_request_test.go | 1 - cmd/entire/cli/repo_mirror_test.go | 4 +- cmd/entire/cli/repo_protection.go | 4 +- cmd/entire/cli/repo_protection_test.go | 16 +- cmd/entire/cli/repo_readiness.go | 18 + internal/coreapi/UPSTREAM.md | 14 +- internal/coreapi/client_test.go | 73 + internal/coreapi/oas_cfg_gen.go | 7 +- internal/coreapi/oas_client_gen.go | 2877 +- internal/coreapi/oas_defaults_gen.go | 16 +- internal/coreapi/oas_interfaces_gen.go | 10 + internal/coreapi/oas_json_gen.go | 30961 ++++++++++------ internal/coreapi/oas_operations_gen.go | 19 +- internal/coreapi/oas_parameters_gen.go | 140 +- internal/coreapi/oas_request_encoders_gen.go | 68 +- internal/coreapi/oas_response_decoders_gen.go | 2753 +- internal/coreapi/oas_schemas_gen.go | 16714 ++++++--- internal/coreapi/oas_security_gen.go | 38 +- internal/coreapi/oas_validators_gen.go | 2242 +- internal/coreapi/repo_readiness_test.go | 3 +- internal/coreapi/spec/core.gen.json | 3261 +- internal/coreapi/spec/core.openapi.json | 6191 ++- internal/coreapi/spec/normalize.go | 6 + 30 files changed, 45216 insertions(+), 20285 deletions(-) create mode 100644 internal/coreapi/oas_interfaces_gen.go diff --git a/cmd/entire/cli/grant.go b/cmd/entire/cli/grant.go index e0603cb81d..caccbdb41f 100644 --- a/cmd/entire/cli/grant.go +++ b/cmd/entire/cli/grant.go @@ -177,8 +177,8 @@ func newGrantRemoveCmd[Row any](t grantTarget[Row]) *cobra.Command { // validateRole rejects a --role outside the target's set at the CLI boundary // so the user gets a clear message instead of a server 422. The generated -// bodies use a distinct enum type per target that shares these values, so the -// targets cast the validated string to whichever type they need. +// bodies type their role field as an enum, so the targets cast the validated +// string to whichever type they need. func validateRole(role string, allowed []string) error { if slices.Contains(allowed, role) { return nil @@ -245,6 +245,18 @@ const granteeTypeAccount = "account" // set because the server's SpiceDB relations are the same for both. var accessRoles = []string{"reader", "writer", "admin"} +// grantAccessBody builds the request body the project and repo grant routes +// share. Provider and providerUserId are optional on the wire because the +// route also accepts an accountId; the CLI always addresses a grantee by +// provider handle, so it always sends the pair. +func grantAccessBody(provider, providerUserID, role string) *coreapi.GrantAccessBody { + return &coreapi.GrantAccessBody{ + Provider: coreapi.NewOptString(provider), + ProviderUserId: coreapi.NewOptString(providerUserID), + Role: coreapi.GrantAccessBodyRole(role), + } +} + // orgGrantTarget is org membership: roles owner/admin/member with member as // the server default, a target addressed by name or ULID, and no typed-id // revoke route — members are removed by their provider identity. @@ -293,11 +305,7 @@ var projectGrantTarget = grantTarget[coreapi.ProjectGrant]{ return resolveProjectRef(ctx, c, ref) }, grant: func(ctx context.Context, c *coreapi.Client, id, provider, providerUserID, role string) (string, any, error) { - out, err := c.GrantProjectAccess(ctx, &coreapi.GrantProjectAccessInputBody{ - Provider: provider, - ProviderUserId: providerUserID, - Role: coreapi.GrantProjectAccessInputBodyRole(role), - }, coreapi.GrantProjectAccessParams{ProjectId: id}) + out, err := c.GrantProjectAccess(ctx, grantAccessBody(provider, providerUserID, role), coreapi.GrantProjectAccessParams{ProjectId: id}) if err != nil { return "", nil, err } @@ -331,11 +339,7 @@ var repoGrantTarget = grantTarget[coreapi.RepoGrant]{ return resolveRepoPath(ctx, c, ref) }, grant: func(ctx context.Context, c *coreapi.Client, id, provider, providerUserID, role string) (string, any, error) { - out, err := c.GrantRepoAccess(ctx, &coreapi.GrantRepoAccessInputBody{ - Provider: provider, - ProviderUserId: providerUserID, - Role: coreapi.GrantRepoAccessInputBodyRole(role), - }, coreapi.GrantRepoAccessParams{RepoId: id}) + out, err := c.GrantRepoAccess(ctx, grantAccessBody(provider, providerUserID, role), coreapi.GrantRepoAccessParams{RepoId: id}) if err != nil { return "", nil, err } diff --git a/cmd/entire/cli/grant_test.go b/cmd/entire/cli/grant_test.go index 975ce40df0..62daf6b544 100644 --- a/cmd/entire/cli/grant_test.go +++ b/cmd/entire/cli/grant_test.go @@ -44,8 +44,8 @@ func TestGrantTargetRoles(t *testing.T) { require.Empty(t, repoGrantTarget.defaultRole) require.Equal(t, enumStrings(coreapi.AddOrgMemberInputBodyRole("").AllValues()), orgGrantTarget.roles) - require.Equal(t, enumStrings(coreapi.GrantProjectAccessInputBodyRole("").AllValues()), projectGrantTarget.roles) - require.Equal(t, enumStrings(coreapi.GrantRepoAccessInputBodyRole("").AllValues()), repoGrantTarget.roles) + require.Equal(t, enumStrings(coreapi.GrantAccessBodyRole("").AllValues()), projectGrantTarget.roles) + require.Equal(t, enumStrings(coreapi.GrantAccessBodyRole("").AllValues()), repoGrantTarget.roles) } // enumStrings converts a generated enum's AllValues() into the plain strings a diff --git a/cmd/entire/cli/org.go b/cmd/entire/cli/org.go index 25a14e3f1f..d883e4393f 100644 --- a/cmd/entire/cli/org.go +++ b/cmd/entire/cli/org.go @@ -46,10 +46,11 @@ func newOrgCreateCmd() *cobra.Command { if region != "" { body.Region = coreapi.NewOptString(region) } - org, err := c.CreateOrg(ctx, body) + created, err := c.CreateOrg(ctx, body) if err != nil { return "", nil, err } + org := &created.Response return fmt.Sprintf("✓ Created org %s (%s)", org.Name, org.ID), org, nil }) }, @@ -114,7 +115,8 @@ func newOrgDeleteCmd() *cobra.Command { return resolveOrgRefResolved(ctx, c, args[0]) }, func(ctx context.Context, c *coreapi.Client, id string) error { - return c.DeleteOrg(ctx, coreapi.DeleteOrgParams{OrgId: id}) + _, err := c.DeleteOrg(ctx, coreapi.DeleteOrgParams{OrgId: id}) + return err }) }, } diff --git a/cmd/entire/cli/project.go b/cmd/entire/cli/project.go index 84a8626c30..496789a0dd 100644 --- a/cmd/entire/cli/project.go +++ b/cmd/entire/cli/project.go @@ -77,10 +77,11 @@ func newProjectCreateCmd() *cobra.Command { if region != "" { body.Region = coreapi.NewOptString(region) } - project, err := c.CreateProject(ctx, body) + created, err := c.CreateProject(ctx, body) if err != nil { return "", nil, err } + project := &created.Response return fmt.Sprintf("✓ Created project %s (%s)", project.Name, project.ID), project, nil }) }, @@ -192,7 +193,8 @@ func newProjectDeleteCmd() *cobra.Command { return resolveProjectRefResolved(ctx, c, args[0]) }, func(ctx context.Context, c *coreapi.Client, id string) error { - return c.DeleteProject(ctx, coreapi.DeleteProjectParams{ProjectId: id}) + _, err := c.DeleteProject(ctx, coreapi.DeleteProjectParams{ProjectId: id}) + return err }) }, } diff --git a/cmd/entire/cli/repo.go b/cmd/entire/cli/repo.go index f938aac0a9..6126b82e21 100644 --- a/cmd/entire/cli/repo.go +++ b/cmd/entire/cli/repo.go @@ -164,7 +164,11 @@ and recovery instructions go to stderr.`, if format != "" { body.ObjectFormat = coreapi.NewOptCreateRepoInputBodyObjectFormat(format) } - created, err := c.CreateRepo(ctx, body) + response, err := c.CreateRepo(ctx, body) + if err != nil { + return err + } + created, err := createdRepoAsRepo(&response.Response) if err != nil { return err } @@ -367,7 +371,8 @@ func newRepoDeleteCmd() *cobra.Command { return resolveRepoRefResolved(ctx, c, args[0], project) }, func(ctx context.Context, c *coreapi.Client, id string) error { - return c.DeleteRepo(ctx, coreapi.DeleteRepoParams{RepoId: id}) + _, err := c.DeleteRepo(ctx, coreapi.DeleteRepoParams{RepoId: id}) + return err }) }, } diff --git a/cmd/entire/cli/repo_mirror.go b/cmd/entire/cli/repo_mirror.go index 39045ab159..9b16946a92 100644 --- a/cmd/entire/cli/repo_mirror.go +++ b/cmd/entire/cli/repo_mirror.go @@ -746,7 +746,7 @@ func chooseMirrorAddRegions(cmd *cobra.Command, ref mirrorRepoRef, nativeRepo *c // mirrorAddOutcome bundles the create response with the clone status // observed while waiting. polled is false for --no-wait, where status is unset. type mirrorAddOutcome struct { - created *coreapi.CreatedMirror + created *coreapi.MirrorRequestResult status coreapi.MirrorStatus polled bool } @@ -1465,7 +1465,7 @@ func parseMirrorCloneURL(raw string) (clusterHost, provider, owner, repo string, // same as the bare clone URL (matching gitremote.ParseURL). GitHub repo // names can contain dots, so only the suffix is trimmed, not all dots. repo = strings.ToLower(strings.TrimSuffix(parts[2], mirrorGitDirSuffix)) - return u.Host, string(coreapi.CreateMirrorInputBodyProviderGithub), strings.ToLower(parts[1]), repo, nil + return u.Host, string(coreapi.CreateMirrorRequestInputBodyProviderGithub), strings.ToLower(parts[1]), repo, nil } func noMirrorErr(ref string) error { diff --git a/cmd/entire/cli/repo_mirror_probe.go b/cmd/entire/cli/repo_mirror_probe.go index 4b8a22d970..cd88a65cd7 100644 --- a/cmd/entire/cli/repo_mirror_probe.go +++ b/cmd/entire/cli/repo_mirror_probe.go @@ -118,7 +118,7 @@ type mirrorRequestGetter interface { GetMirrorRequest(ctx context.Context, params coreapi.GetMirrorRequestParams) (*coreapi.MirrorRequest, error) } -func awaitMirrorPlacement(ctx context.Context, c mirrorRequestGetter, initial coreapi.MirrorRequest, location string, onStatus func(coreapi.MirrorRequestStatus)) (*coreapi.CreatedMirror, error) { +func awaitMirrorPlacement(ctx context.Context, c mirrorRequestGetter, initial coreapi.MirrorRequest, location string, onStatus func(coreapi.MirrorRequestStatus)) (*coreapi.MirrorRequestResult, error) { serverURL, requestID, err := mirrorRequestPollTarget(location) if err != nil { return nil, err @@ -145,11 +145,7 @@ func awaitMirrorPlacement(ctx context.Context, c mirrorRequestGetter, initial co if !ok || result.MirrorId == "" || result.MirrorUrl == "" { return nil, errors.New("mirror request succeeded without a mirror id and URL") } - return &coreapi.CreatedMirror{ - MirrorId: result.MirrorId, - MirrorUrl: result.MirrorUrl, - PublicUrl: result.PublicUrl, - }, nil + return &result, nil case coreapi.MirrorRequestStatusFailed: return nil, mirrorRequestFailureError(*request) case coreapi.MirrorRequestStatusPending, coreapi.MirrorRequestStatusProcessing: diff --git a/cmd/entire/cli/repo_mirror_request_test.go b/cmd/entire/cli/repo_mirror_request_test.go index ff5a18bd92..fca28a5fa8 100644 --- a/cmd/entire/cli/repo_mirror_request_test.go +++ b/cmd/entire/cli/repo_mirror_request_test.go @@ -66,7 +66,6 @@ func TestCreateAndAwaitMirror_AsyncSuccess(t *testing.T) { }) require.NoError(t, err) require.Equal(t, "mirror-1", outcome.created.MirrorId) - require.False(t, outcome.created.Created) require.Equal(t, coreapi.MirrorStatusReady, outcome.status) require.Equal(t, []mirrorAddPhase{mirrorAddPhaseQueued, mirrorAddPhasePlacing, mirrorAddPhaseCloning}, phases) require.Equal(t, []string{ diff --git a/cmd/entire/cli/repo_mirror_test.go b/cmd/entire/cli/repo_mirror_test.go index 7061520a77..e891b2f75e 100644 --- a/cmd/entire/cli/repo_mirror_test.go +++ b/cmd/entire/cli/repo_mirror_test.go @@ -1114,7 +1114,7 @@ func TestParseMirrorCloneURL(t *testing.T) { if err != nil { t.Fatalf("parseMirrorCloneURL(%q): %v", tt.raw, err) } - if provider != string(coreapi.CreateMirrorInputBodyProviderGithub) { + if provider != string(coreapi.CreateMirrorRequestInputBodyProviderGithub) { t.Errorf("provider = %q, want github", provider) } if cluster != tt.wantCluster || owner != tt.wantOwner || repo != tt.wantRepo { @@ -1171,7 +1171,7 @@ func TestResolveMirrorRef(t *testing.T) { } // The (cluster, provider, owner) narrowing must be server-side; only the // repo is matched client-side (ListMirrors has no repo filter). - if gotCluster != "aws-eu-central-1.entire.io" || gotProvider != string(coreapi.CreateMirrorInputBodyProviderGithub) || gotOwner != "entirehq" { + if gotCluster != "aws-eu-central-1.entire.io" || gotProvider != string(coreapi.CreateMirrorRequestInputBodyProviderGithub) || gotOwner != "entirehq" { t.Errorf("filters = cluster %q provider %q owner %q, want the clone URL's coords", gotCluster, gotProvider, gotOwner) } }) diff --git a/cmd/entire/cli/repo_protection.go b/cmd/entire/cli/repo_protection.go index eca166c4e7..f970224ba1 100644 --- a/cmd/entire/cli/repo_protection.go +++ b/cmd/entire/cli/repo_protection.go @@ -213,11 +213,11 @@ func newRepoProtectionAddCmd() *cobra.Command { // server keeps an existing rule's level and protects a new // branch, so an add that only names a branch can never lower // it; --server-side-merge-only=false is the explicit way down. - rule := coreapi.BranchRule{Ref: ref} + rule := coreapi.BranchRuleUpdate{Ref: ref} if cmd.Flags().Changed(serverSideMergeOnlyFlag) { rule.ServerSideMergeOnly = coreapi.NewOptBool(mergeOnly) } - body := &coreapi.UpdateBranchProtectionInputBody{AddRules: []coreapi.BranchRule{rule}} + body := &coreapi.UpdateBranchProtectionInputBody{AddRules: []coreapi.BranchRuleUpdate{rule}} out, err := c.UpdateBranchProtection(ctx, body, coreapi.UpdateBranchProtectionParams{RepoId: repoID}) if err != nil { return nil, err diff --git a/cmd/entire/cli/repo_protection_test.go b/cmd/entire/cli/repo_protection_test.go index 454004ac70..de958fc2f2 100644 --- a/cmd/entire/cli/repo_protection_test.go +++ b/cmd/entire/cli/repo_protection_test.go @@ -152,7 +152,7 @@ func (f *fakeProtectionServer) apply(body coreapi.UpdateBranchProtectionInputBod } } if !present { - next = append(next, a) + next = append(next, coreapi.BranchRule{Ref: a.Ref, ServerSideMergeOnly: a.ServerSideMergeOnly}) } } f.rules = next @@ -179,6 +179,16 @@ func rulesView(rs []coreapi.BranchRule) []branchRule { return branchRulesFromWire(&coreapi.BranchProtection{Rules: rs}) } +// updatesView is rulesView for the rules a patch sends, which the spec types +// separately from the rules a read returns. +func updatesView(us []coreapi.BranchRuleUpdate) []branchRule { + rs := make([]coreapi.BranchRule, len(us)) + for i, u := range us { + rs[i] = coreapi.BranchRule{Ref: u.Ref, ServerSideMergeOnly: u.ServerSideMergeOnly} + } + return rulesView(rs) +} + func execRepoProtection(t *testing.T, args ...string) (stdout string, err error) { t.Helper() stdout, _, err = execRepoProtectionBothStreams(t, args...) @@ -278,7 +288,7 @@ func TestRepoProtection_AddAndRemove(t *testing.T) { out, err := execRepoProtection(t, "add", testProtectionRepoULID, "release/*") require.NoError(t, err) require.Len(t, fake.patches, 1) - assert.Equal(t, []branchRule{{Ref: "refs/heads/release/*"}}, rulesView(fake.patches[0].AddRules)) + assert.Equal(t, []branchRule{{Ref: "refs/heads/release/*"}}, updatesView(fake.patches[0].AddRules)) assert.False(t, fake.patches[0].AddRules[0].ServerSideMergeOnly.IsSet(), "no flag, no level on the wire") assert.Empty(t, fake.patches[0].RemoveRefs) assert.Contains(t, out, "refs/heads/release/*") @@ -286,7 +296,7 @@ func TestRepoProtection_AddAndRemove(t *testing.T) { out, err = execRepoProtection(t, "add", testProtectionRepoULID, "HEAD", "--server-side-merge-only") require.NoError(t, err) require.Len(t, fake.patches, 2) - assert.Equal(t, []branchRule{{Ref: "HEAD", ServerSideMergeOnly: true}}, rulesView(fake.patches[1].AddRules)) + assert.Equal(t, []branchRule{{Ref: "HEAD", ServerSideMergeOnly: true}}, updatesView(fake.patches[1].AddRules)) assert.True(t, fake.patches[1].AddRules[0].ServerSideMergeOnly.IsSet()) assert.Contains(t, out, protectionLevelMergeOnly) assert.Equal(t, []branchRule{ diff --git a/cmd/entire/cli/repo_readiness.go b/cmd/entire/cli/repo_readiness.go index 52c9f2bf41..d42af56da2 100644 --- a/cmd/entire/cli/repo_readiness.go +++ b/cmd/entire/cli/repo_readiness.go @@ -2,6 +2,7 @@ package cli import ( "context" + "encoding/json" "errors" "fmt" "math/rand/v2" @@ -14,6 +15,23 @@ import ( "github.com/entireio/cli/internal/coreapi" ) +// createdRepoAsRepo converts the create response into the read model that the +// readiness poll and the creation report share. The spec gives the two schemas +// the same fields apart from the deprecated commitToken, so the conversion goes +// through the wire form: it carries additional properties and any field a later +// spec adds to both, where a field-by-field copy would silently drop them. +func createdRepoAsRepo(created *coreapi.CreatedRepo) (*coreapi.Repo, error) { + raw, err := json.Marshal(created) + if err != nil { + return nil, fmt.Errorf("encode created repository: %w", err) + } + var repo coreapi.Repo + if err := json.Unmarshal(raw, &repo); err != nil { + return nil, fmt.Errorf("decode created repository: %w", err) + } + return &repo, nil +} + // These values mirror the provisioning enum in entiredb api/corev1/repos.go. // Mirror clone readiness has its own enum: an active repo need not be cloned. const ( diff --git a/internal/coreapi/UPSTREAM.md b/internal/coreapi/UPSTREAM.md index d58ad45d8a..834299ea1b 100644 --- a/internal/coreapi/UPSTREAM.md +++ b/internal/coreapi/UPSTREAM.md @@ -43,12 +43,19 @@ plain strings (drop `enum`), or have ogen treat them as open enums. Enums the *client sends* (request bodies like `SetRepoVisibilityInputBody`) should stay strict. +`Membership.role`/`status` and `Invitation.role`/`status` are the same shape: +`entire org grant list` and `entire grant org invites` only print them, so a +role or lifecycle state added later must display rather than fail the listing. + **Workaround:** `spec/normalize.go` (`loosenReadModelEnums`, allowlist `readModelEnumFields`) deletes the `enum` constraint from those response read-model fields, so ogen emits plain strings with no `Validate()` and unknown values pass through for display. Only response read models are -loosened; request-body enums stay strict. Locked in by -`TestListProjectRepos_UnknownEnumValuesPassThrough` in `client_test.go`. +loosened; request-body enums stay strict — `CreateOrgInvitationInputBody.role` +keeps its enum, so a bad `--role` is still refused before it is sent. Locked in +by `TestListProjectRepos_UnknownEnumValuesPassThrough`, +`TestListOrgInvitations_UnknownEnumValuesPassThrough` and +`TestListOrgMembers_UnknownEnumValuesPassThrough` in `client_test.go`. Retire the allowlist entries as upstream loosens the corresponding fields. ## 2b. New read-model fields ship as `required` @@ -60,6 +67,9 @@ decoder then fails the whole response when a field is absent, so a core that predates the field, or a mixed-version roll, breaks every list, get and repo-routing call in a client that does not depend on any of them. +The create responses (`CreatedOrg`, `CreatedProject`, `CreatedRepo`) repeat the +shape of their read models and so repeat the problem. + **Fix upstream:** add read-model fields as optional until every deployment sends them, then tighten. diff --git a/internal/coreapi/client_test.go b/internal/coreapi/client_test.go index 287a77b43b..44477c097b 100644 --- a/internal/coreapi/client_test.go +++ b/internal/coreapi/client_test.go @@ -421,3 +421,76 @@ func TestListOrgsAndProjects_UnsentCapabilitiesDecode(t *testing.T) { }) } } + +// TestListOrgInvitations_UnknownEnumValuesPassThrough locks in the +// forward-compat contract for spec/normalize.go's loosenReadModelEnums on +// Invitation: the CLI only prints `role` and `status`, so a lifecycle state or +// role the server adds later must decode and display rather than fail the whole +// listing in ogen's Validate(). +func TestListOrgInvitations_UnknownEnumValuesPassThrough(t *testing.T) { + t.Parallel() + + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + if _, err := w.Write([]byte(`{"invitations":[{"id":"01H0000000000000000000000I","email":"dev@example.com","role":"auditor","status":"bounced","invitedBy":"01H0000000000000000000000A","createdAt":"2026-01-01T00:00:00Z","expiresAt":"2026-01-08T00:00:00Z"}]}`)); err != nil { + t.Errorf("writing test response: %v", err) + } + })) + t.Cleanup(srv.Close) + + c, err := NewClient(srv.URL, bearerOnlySource{}) + if err != nil { + t.Fatalf("NewClient: %v", err) + } + + out, err := c.ListOrgInvitations(context.Background(), ListOrgInvitationsParams{OrgId: "01H000000000000000000000O1"}) + if err != nil { + t.Fatalf("ListOrgInvitations with unknown enum values must not fail (forward-compat), got: %v", err) + } + if len(out.Invitations) != 1 { + t.Fatalf("Invitations len = %d, want 1", len(out.Invitations)) + } + inv := out.Invitations[0] + if inv.Role != "auditor" { + t.Errorf("Role = %q, want the unknown value %q passed through verbatim", inv.Role, "auditor") + } + if inv.Status != "bounced" { + t.Errorf("Status = %q, want the unknown value %q passed through verbatim", inv.Status, "bounced") + } +} + +// TestListOrgMembers_UnknownEnumValuesPassThrough is the same contract for +// Membership, which `entire org grant list` prints the same way. +func TestListOrgMembers_UnknownEnumValuesPassThrough(t *testing.T) { + t.Parallel() + + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + if _, err := w.Write([]byte(`{"members":[{"id":"01H0000000000000000000000M","orgId":"01H000000000000000000000O1","accountId":"01H0000000000000000000000A","role":"auditor","status":"suspended","createdAt":"2026-01-01T00:00:00Z"}]}`)); err != nil { + t.Errorf("writing test response: %v", err) + } + })) + t.Cleanup(srv.Close) + + c, err := NewClient(srv.URL, bearerOnlySource{}) + if err != nil { + t.Fatalf("NewClient: %v", err) + } + + out, err := c.ListOrgMembers(context.Background(), ListOrgMembersParams{OrgId: "01H000000000000000000000O1"}) + if err != nil { + t.Fatalf("ListOrgMembers with unknown enum values must not fail (forward-compat), got: %v", err) + } + if len(out.Members) != 1 { + t.Fatalf("Members len = %d, want 1", len(out.Members)) + } + member := out.Members[0] + if member.Role != "auditor" { + t.Errorf("Role = %q, want the unknown value %q passed through verbatim", member.Role, "auditor") + } + if member.Status != "suspended" { + t.Errorf("Status = %q, want the unknown value %q passed through verbatim", member.Status, "suspended") + } +} diff --git a/internal/coreapi/oas_cfg_gen.go b/internal/coreapi/oas_cfg_gen.go index fb6c9dade2..ec231e3a5d 100644 --- a/internal/coreapi/oas_cfg_gen.go +++ b/internal/coreapi/oas_cfg_gen.go @@ -10,8 +10,11 @@ import ( ) var regexMap = map[string]ogenregex.Regexp{ - "^[0-9A-HJKMNP-TV-Z]{26}$": ogenregex.MustCompile("^[0-9A-HJKMNP-TV-Z]{26}$"), - "^[a-z0-9][a-z0-9-]*$": ogenregex.MustCompile("^[a-z0-9][a-z0-9-]*$"), + "^$|^[0-9A-HJKMNP-TV-Z]{26}$": ogenregex.MustCompile("^$|^[0-9A-HJKMNP-TV-Z]{26}$"), + "^$|^[A-Za-z0-9_-]{20,512}$": ogenregex.MustCompile("^$|^[A-Za-z0-9_-]{20,512}$"), + "^$|^[A-Za-z0-9_-]{60,512}$": ogenregex.MustCompile("^$|^[A-Za-z0-9_-]{60,512}$"), + "^[0-9A-HJKMNP-TV-Z]{26}$": ogenregex.MustCompile("^[0-9A-HJKMNP-TV-Z]{26}$"), + "^[a-z0-9][a-z0-9-]*$": ogenregex.MustCompile("^[a-z0-9][a-z0-9-]*$"), } type ( diff --git a/internal/coreapi/oas_client_gen.go b/internal/coreapi/oas_client_gen.go index 5e04fc2529..4f797c7586 100644 --- a/internal/coreapi/oas_client_gen.go +++ b/internal/coreapi/oas_client_gen.go @@ -21,6 +21,12 @@ func trimTrailingSlashes(u *url.URL) { // Invoker invokes operations described by OpenAPI v3 specification. type Invoker interface { + // AcceptInvitation invokes acceptInvitation operation. + // + // Accept an organization invitation. + // + // POST /invitations/accept + AcceptInvitation(ctx context.Context, request *AcceptInvitationInputBody) (AcceptInvitationRes, error) // AddOrgMember invokes addOrgMember operation. // // Add a member to an organization. @@ -45,18 +51,22 @@ type Invoker interface { // // POST /orgs/{orgId}/ci/buildkite/credential ConnectOrgCIBuildkiteCredential(ctx context.Context, request *ConnectOrgCIBuildkiteCredentialInputBody, params ConnectOrgCIBuildkiteCredentialParams) (*OrgCIBuildkiteCredentialView, error) + // ConnectOrgCIDepotOrganization invokes connectOrgCIDepotOrganization operation. + // + // Operator-only: requires platform#admin, unlike the Buildkite routes beside it, because nothing can + // verify a Depot organisation id. Depot hands Entire no credential, so there is no token to store + // and no API to check the id against; the operator vouches for it. Records the Depot organisation id + // the org's repositories enrol against. Returns 201 on a fresh connection and 200 when the same pair + // is already connected. + // + // POST /orgs/{orgId}/ci/depot/connection + ConnectOrgCIDepotOrganization(ctx context.Context, request *ConnectOrgCIDepotOrganizationInputBody, params ConnectOrgCIDepotOrganizationParams) (*OrgCIDepotConnectionView, error) // CreateBinding invokes createBinding operation. // // Create OIDC binding. // // POST /service-accounts/{accountId}/bindings CreateBinding(ctx context.Context, request *CreateBindingInputBody, params CreateBindingParams) (*Binding, error) - // CreateMirror invokes createMirror operation. - // - // Create GitHub mirror. - // - // POST /mirrors - CreateMirror(ctx context.Context, request *CreateMirrorInputBody) (*CreatedMirror, error) // CreateMirrorRequest invokes createMirrorRequest operation. // // A validation failure may be reported synchronously at submission or as a terminal state on the @@ -75,19 +85,25 @@ type Invoker interface { // Create organization. // // POST /orgs - CreateOrg(ctx context.Context, request *CreateOrgInputBody) (*Org, error) + CreateOrg(ctx context.Context, request *CreateOrgInputBody) (*CreatedOrgHeaders, error) + // CreateOrgInvitation invokes createOrgInvitation operation. + // + // Invite an address into an organization. + // + // POST /orgs/{orgId}/invitations + CreateOrgInvitation(ctx context.Context, request *CreateOrgInvitationInputBody, params CreateOrgInvitationParams) (CreateOrgInvitationRes, error) // CreateProject invokes createProject operation. // // Create project. // // POST /projects - CreateProject(ctx context.Context, request *CreateProjectInputBody) (*Project, error) + CreateProject(ctx context.Context, request *CreateProjectInputBody) (*CreatedProjectHeaders, error) // CreateRepo invokes createRepo operation. // // Create repository. // // POST /repos - CreateRepo(ctx context.Context, request *CreateRepoInputBody) (*Repo, error) + CreateRepo(ctx context.Context, request *CreateRepoInputBody) (*CreatedRepoHeaders, error) // CreateRepoCIWebhook invokes createRepoCIWebhook operation. // // Enroll a repo into a CI webhook (Buildkite). @@ -129,7 +145,7 @@ type Invoker interface { // Delete an organization. // // DELETE /orgs/{orgId} - DeleteOrg(ctx context.Context, params DeleteOrgParams) error + DeleteOrg(ctx context.Context, params DeleteOrgParams) (*DeleteOrgNoContent, error) // DeleteOrgCIBuildkiteCluster invokes deleteOrgCIBuildkiteCluster operation. // // Remove a registered Buildkite cluster from an org. @@ -147,24 +163,20 @@ type Invoker interface { // Delete a project. // // DELETE /projects/{projectId} - DeleteProject(ctx context.Context, params DeleteProjectParams) error + DeleteProject(ctx context.Context, params DeleteProjectParams) (*DeleteProjectNoContent, error) // DeleteRepo invokes deleteRepo operation. // // Delete repository. // // DELETE /repos/{repoId} - DeleteRepo(ctx context.Context, params DeleteRepoParams) error + DeleteRepo(ctx context.Context, params DeleteRepoParams) (*DeleteRepoNoContent, error) // DeleteRepoCIWebhook invokes deleteRepoCIWebhook operation. // - // Deletes the subscription AND tears down its enrollment identity: the automation row (when no - // sibling repo shares it), its expiring repo grant, and its Buildkite OIDC binding. The Buildkite - // pipeline itself is always kept. Pass keep_identity=true to delete only the subscription — for an - // immediate re-enroll that must preserve automation_id, since teardown retires it and a re-enroll - // declares a new one that only bk_force_rescaffold pushes into the pipeline. A retained identity - // holds read access on this repo until its grant lapses. A subscription enrolled before the - // automation principal has no automation to retire: the delete succeeds and removes only the - // subscription, reported as identity_retired=false on the ci_webhook_deleted audit event — the - // list an operator queries to hand-delete the leftover service accounts. + // Deletes the subscription and clears this repo's own enrolment marker. This does NOT immediately + // revoke the automation's access to the repo: that access normally continues, on its existing expiry, + // in the background. Pass keep_identity=true to leave the marker untouched too — for an immediate + // re-enroll, which always resumes the same automation_id either way. The Buildkite pipeline is + // always kept. // // DELETE /repos/{repoId}/ci-webhooks/{id} DeleteRepoCIWebhook(ctx context.Context, params DeleteRepoCIWebhookParams) error @@ -174,6 +186,21 @@ type Invoker interface { // // DELETE /service-accounts/{accountId} DeleteServiceAccount(ctx context.Context, params DeleteServiceAccountParams) error + // DetachMyHandle invokes detachMyHandle operation. + // + // Detach a linked sign-in method from the calling account. + // + // DELETE /me/handles/{provider}/{providerUserId} + DetachMyHandle(ctx context.Context, params DetachMyHandleParams) error + // DisconnectOrgCIDepotOrganization invokes disconnectOrgCIDepotOrganization operation. + // + // Operator-only: requires platform#admin, mirroring the connect, because withdrawing an operator's + // vouch is at least as privileged as granting it. Provider-scoped on ci-webhooks, so it removes only + // the depot row and never a Buildkite credential of the same name. Removing a connection a + // subscription still names is allowed and logged; those subscriptions stop dispatching. + // + // DELETE /orgs/{orgId}/ci/depot/connection/{account} + DisconnectOrgCIDepotOrganization(ctx context.Context, params DisconnectOrgCIDepotOrganizationParams) error // GetBranchProtection invokes getBranchProtection operation. // // Get repository branch protection. @@ -216,12 +243,15 @@ type Invoker interface { // // GET /orgs/{orgId} GetOrg(ctx context.Context, params GetOrgParams) (*Org, error) - // GetPermissions invokes getPermissions operation. + // GetOrgPersonAccess invokes getOrgPersonAccess operation. // - // List the caller's permissions on a single resource. + // Requires organization management permission. Selects the exact account within this organization's + // roster, not a handle or substring. Returns all recorded grants and fresh caller-specific editing + // capabilities. Missing or excluded people return 404; incomplete organization read models return + // 503. Uses global public data only. Mutations independently reauthorize every write. // - // GET /access/{resourceType}/{resourceId} - GetPermissions(ctx context.Context, params GetPermissionsParams) (*GetPermissionsOutputBody, error) + // GET /orgs/{orgId}/people/{accountId}/access + GetOrgPersonAccess(ctx context.Context, params GetOrgPersonAccessParams) (*OrgPersonHeaders, error) // GetProject invokes getProject operation. // // Get a project by id. @@ -234,6 +264,13 @@ type Invoker interface { // // GET /repos/{repoId} GetRepo(ctx context.Context, params GetRepoParams) (*Repo, error) + // GetRepoCIDelivery invokes getRepoCIDelivery operation. + // + // The id is the opaque value from a list response. A payload is absent once its day has been swept + // (payload_absent=swept) or when no request was ever built (payload_absent=no_request). + // + // GET /repos/{repoId}/ci-deliveries/{id} + GetRepoCIDelivery(ctx context.Context, params GetRepoCIDeliveryParams) (*CIDeliveryDetailView, error) // GetRepoVisibility invokes getRepoVisibility operation. // // Get repository visibility. @@ -263,13 +300,13 @@ type Invoker interface { // Grant project access to an identity. // // POST /projects/{projectId}/grants - GrantProjectAccess(ctx context.Context, request *GrantProjectAccessInputBody, params GrantProjectAccessParams) (*GrantProjectAccessOutputBody, error) + GrantProjectAccess(ctx context.Context, request *GrantAccessBody, params GrantProjectAccessParams) (*GrantProjectAccessOutputBody, error) // GrantRepoAccess invokes grantRepoAccess operation. // // Grant repo access to an identity. // // POST /repos/{repoId}/grants - GrantRepoAccess(ctx context.Context, request *GrantRepoAccessInputBody, params GrantRepoAccessParams) (*GrantRepoAccessOutputBody, error) + GrantRepoAccess(ctx context.Context, request *GrantAccessBody, params GrantRepoAccessParams) (*GrantRepoAccessOutputBody, error) // GrantServiceAccountAccess invokes grantServiceAccountAccess operation. // // Grant service account access on a repo or project. @@ -336,12 +373,45 @@ type Invoker interface { // // GET /orgs/{orgId}/ci/buildkite/credentials ListOrgCIBuildkiteCredentials(ctx context.Context, params ListOrgCIBuildkiteCredentialsParams) (*ListOrgCIBuildkiteCredentialsOutputBody, error) + // ListOrgCIDepotOrganizations invokes listOrgCIDepotOrganizations operation. + // + // Requires org#manage, like the Buildkite credential list. A Depot connection holds no secret: it is + // the Depot organisation id this org's repositories enrol against. + // + // GET /orgs/{orgId}/ci/depot/connections + ListOrgCIDepotOrganizations(ctx context.Context, params ListOrgCIDepotOrganizationsParams) (*ListOrgCIDepotOrganizationsOutputBody, error) + // ListOrgInvitations invokes listOrgInvitations operation. + // + // List an organization's invitations. + // + // GET /orgs/{orgId}/invitations + ListOrgInvitations(ctx context.Context, params ListOrgInvitationsParams) (*ListOrgInvitationsOutputBody, error) // ListOrgMembers invokes listOrgMembers operation. // // List members of an organization. // // GET /orgs/{orgId}/members ListOrgMembers(ctx context.Context, params ListOrgMembersParams) (*ListOrgMembersOutputBody, error) + // ListOrgPeople invokes listOrgPeople operation. + // + // Requires organization management permission, not repository pull permission. Returns one row per + // account with membership metadata and recorded accessScopes, without grant details or editing + // capabilities. Grants retain each distinct role and origin (membership, direct, team, or github), + // without inherited expansion or strongest-role collapsing. Repository IDs identify published + // logical repo groups, not placements. Membership grants include pending and inactive memberships; + // membership.status describes their lifecycle. GitHub grants use the collaborator read model and can + // differ from live SpiceDB permissions during reconciliation. This is a roster read model, not an + // authorization check or complete SpiceDB audit. Management does not imply Git read permission. + // Snapshot readiness uses the shared GitHub discovery eligibility and 15-minute grace policy. + // Detached, suspended, sync-blocked, sync-banned, and wholly suspended mirror targets do not block + // readiness; recorded edges still serve. Overdue eligible snapshots or missing mirror mappings + // return 503. Filters select people by recorded grants, not inherited roles. Load + // /people/{accountId}/access when opening an editor; it returns that person's grants and fresh + // editing capabilities. The list has no full mode. Filters and totalCount apply before cursor + // pagination; results are ordered by account ID. + // + // GET /orgs/{orgId}/people + ListOrgPeople(ctx context.Context, params ListOrgPeopleParams) (*ListOrgPeopleOutputBodyHeaders, error) // ListOrgProjects invokes listOrgProjects operation. // // List projects owned by an organization. @@ -360,6 +430,17 @@ type Invoker interface { // // GET /projects/{projectId}/members ListProjectMembers(ctx context.Context, params ListProjectMembersParams) (*ListProjectMembersOutputBody, error) + // ListProjectPeople invokes listProjectPeople operation. + // + // Requires project roster-view permission, held by project managers and source-managed forge members + // but not ordinary native readers or writers. Returns one account per row with its effective role + // and merged access sources. Grant managers also receive the mutable direct grant. Search and role + // filters run before cursor pagination. Results are ordered by effective role (owner, admin, + // mirror_source_admin, writer, reader, member), then by handle without the provider prefix, ignoring + // case, then by account ID. Accounts without a handle come last within their role. + // + // GET /projects/{projectId}/people + ListProjectPeople(ctx context.Context, params ListProjectPeopleParams) (*ResourcePeopleOutputBody, error) // ListProjectRepos invokes listProjectRepos operation. // // List repositories in a project (or one by name). @@ -378,6 +459,13 @@ type Invoker interface { // // GET /repos/{repoId}/ci-builds ListRepoCIBuilds(ctx context.Context, params ListRepoCIBuildsParams) (*ListRepoCIBuildsOutputBody, error) + // ListRepoCIDeliveries invokes listRepoCIDeliveries operation. + // + // Recent deliveries, newest first. direction=outbound (default) is what Entire sent the repo's CI + // when refs changed; direction=inbound is what that CI sent back. + // + // GET /repos/{repoId}/ci-deliveries + ListRepoCIDeliveries(ctx context.Context, params ListRepoCIDeliveriesParams) (*ListRepoCIDeliveriesOutputBody, error) // ListRepoCIProviders invokes listRepoCIProviders operation. // // Returns each provider's enrolment form AS DATA: its modes, its fields, and the select options @@ -428,6 +516,16 @@ type Invoker interface { // // GET /repos/facets/orgs ListRepoOrgFacets(ctx context.Context, params ListRepoOrgFacetsParams) (*RepoFacetPage, error) + // ListRepoPeople invokes listRepoPeople operation. + // + // Returns one account per row with its effective role and merged access sources. Grant managers also + // receive the mutable direct grant. Search and role filters run before cursor pagination. Results + // are ordered by effective role (owner, admin, mirror_source_admin, writer, reader, member), then by + // handle without the provider prefix, ignoring case, then by account ID. Accounts without a handle + // come last within their role. + // + // GET /repos/{repoId}/people + ListRepoPeople(ctx context.Context, params ListRepoPeopleParams) (*ResourcePeopleOutputBody, error) // ListRepos invokes listRepos operation. // // List the caller's readable repositories (placement index). @@ -469,6 +567,12 @@ type Invoker interface { // // PATCH /repos/{repoId}/ci-webhooks/{id} PatchRepoCIWebhook(ctx context.Context, request *PatchRepoCIWebhookInputBody, params PatchRepoCIWebhookParams) (*CIWebhookView, error) + // PreviewInvitation invokes previewInvitation operation. + // + // Preview an organization invitation. + // + // POST /invitations/preview + PreviewInvitation(ctx context.Context, request *PreviewInvitationInputBody) (*PreviewInvitationOKHeaders, error) // RegisterOrgCIBuildkiteCluster invokes registerOrgCIBuildkiteCluster operation. // // Register or update a Buildkite hosted cluster for an org. @@ -493,6 +597,14 @@ type Invoker interface { // // GET /mirrors/placements ResolveMirrorPlacements(ctx context.Context, params ResolveMirrorPlacementsParams) (*ResolvePlacementsOutputBody, error) + // ResolveProject invokes resolveProject operation. + // + // Case-insensitive lookup by native project name (et) or GitHub owner namespace (gh). Uses project + // inspect permission, including platform administrators. Missing and inaccessible projects both + // return 404. + // + // GET /projects/resolve/{host}/{project} + ResolveProject(ctx context.Context, params ResolveProjectParams) (*ResolveProjectOutputBody, error) // ResolveRepoIDs invokes resolveRepoIDs operation. // // Resolve repository ids to full name and provider. @@ -505,6 +617,12 @@ type Invoker interface { // // POST /repos/resolve ResolveRepos(ctx context.Context, request *ResolveReposInputBody) (*ResolveReposResponse, error) + // RevokeOrgInvitation invokes revokeOrgInvitation operation. + // + // Revoke an organization invitation. + // + // DELETE /orgs/{orgId}/invitations/{id} + RevokeOrgInvitation(ctx context.Context, params RevokeOrgInvitationParams) error // RevokeProjectAccess invokes revokeProjectAccess operation. // // Revoke project access by grantee id. @@ -559,6 +677,12 @@ type Invoker interface { // // PATCH /repos/{repoId}/branch-protection UpdateBranchProtection(ctx context.Context, request *UpdateBranchProtectionInputBody, params UpdateBranchProtectionParams) (*BranchProtection, error) + // UpdateOrgMemberRole invokes updateOrgMemberRole operation. + // + // Update an organization member's role. + // + // PATCH /orgs/{orgId}/members/{membershipId} + UpdateOrgMemberRole(ctx context.Context, request *UpdateOrgMemberRoleInputBody, params UpdateOrgMemberRoleParams) (*Membership, error) } // Client implements OAS client. @@ -602,6 +726,91 @@ func (c *Client) requestURL(ctx context.Context) *url.URL { return u } +// AcceptInvitation invokes acceptInvitation operation. +// +// Accept an organization invitation. +// +// POST /invitations/accept +func (c *Client) AcceptInvitation(ctx context.Context, request *AcceptInvitationInputBody) (AcceptInvitationRes, error) { + res, err := c.sendAcceptInvitation(ctx, request) + return res, err +} + +func (c *Client) sendAcceptInvitation(ctx context.Context, request *AcceptInvitationInputBody) (res AcceptInvitationRes, err error) { + + u := uri.Clone(c.requestURL(ctx)) + var pathParts [1]string + pathParts[0] = "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/invitations/accept" + uri.AddPathParts(u, pathParts[:]...) + + r, err := ht.NewRequest(ctx, "POST", u) + if err != nil { + return res, errors.Wrap(err, "create request") + } + if err := encodeAcceptInvitationRequest(request, r); err != nil { + return res, errors.Wrap(err, "encode request") + } + + { + type bitset = [1]uint8 + var satisfied bitset + { + + switch err := c.securityBearerAuth(ctx, AcceptInvitationOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 0 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"BearerAuth\"") + } + } + { + + switch err := c.securitySessionAuth(ctx, AcceptInvitationOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 1 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"SessionAuth\"") + } + } + + if ok := func() bool { + nextRequirement: + for _, requirement := range []bitset{ + {0b00000001}, + {0b00000010}, + } { + for i, mask := range requirement { + if satisfied[i]&mask != mask { + continue nextRequirement + } + } + return true + } + return false + }(); !ok { + return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied + } + } + + resp, err := c.cfg.Client.Do(r) + if err != nil { + return res, errors.Wrap(err, "do request") + } + body := resp.Body + defer body.Close() + + result, err := decodeAcceptInvitationResponse(resp) + if err != nil { + return res, errors.Wrap(err, "decode response") + } + + return result, nil +} + // AddOrgMember invokes addOrgMember operation. // // Add a member to an organization. @@ -974,30 +1183,34 @@ func (c *Client) sendConnectOrgCIBuildkiteCredential(ctx context.Context, reques return result, nil } -// CreateBinding invokes createBinding operation. +// ConnectOrgCIDepotOrganization invokes connectOrgCIDepotOrganization operation. // -// Create OIDC binding. +// Operator-only: requires platform#admin, unlike the Buildkite routes beside it, because nothing can +// verify a Depot organisation id. Depot hands Entire no credential, so there is no token to store +// and no API to check the id against; the operator vouches for it. Records the Depot organisation id +// the org's repositories enrol against. Returns 201 on a fresh connection and 200 when the same pair +// is already connected. // -// POST /service-accounts/{accountId}/bindings -func (c *Client) CreateBinding(ctx context.Context, request *CreateBindingInputBody, params CreateBindingParams) (*Binding, error) { - res, err := c.sendCreateBinding(ctx, request, params) +// POST /orgs/{orgId}/ci/depot/connection +func (c *Client) ConnectOrgCIDepotOrganization(ctx context.Context, request *ConnectOrgCIDepotOrganizationInputBody, params ConnectOrgCIDepotOrganizationParams) (*OrgCIDepotConnectionView, error) { + res, err := c.sendConnectOrgCIDepotOrganization(ctx, request, params) return res, err } -func (c *Client) sendCreateBinding(ctx context.Context, request *CreateBindingInputBody, params CreateBindingParams) (res *Binding, err error) { +func (c *Client) sendConnectOrgCIDepotOrganization(ctx context.Context, request *ConnectOrgCIDepotOrganizationInputBody, params ConnectOrgCIDepotOrganizationParams) (res *OrgCIDepotConnectionView, err error) { u := uri.Clone(c.requestURL(ctx)) var pathParts [3]string - pathParts[0] = "/service-accounts/" + pathParts[0] = "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/orgs/" { - // Encode "accountId" parameter. + // Encode "orgId" parameter. e := uri.NewPathEncoder(uri.PathEncoderConfig{ - Param: "accountId", + Param: "orgId", Style: uri.PathStyleSimple, Explode: false, }) if err := func() error { - return e.EncodeValue(conv.StringToString(params.AccountId)) + return e.EncodeValue(conv.StringToString(params.OrgId)) }(); err != nil { return res, errors.Wrap(err, "encode path") } @@ -1007,14 +1220,14 @@ func (c *Client) sendCreateBinding(ctx context.Context, request *CreateBindingIn } pathParts[1] = encoded } - pathParts[2] = "/bindings" + pathParts[2] = "/ci/depot/connection" uri.AddPathParts(u, pathParts[:]...) r, err := ht.NewRequest(ctx, "POST", u) if err != nil { return res, errors.Wrap(err, "create request") } - if err := encodeCreateBindingRequest(request, r); err != nil { + if err := encodeConnectOrgCIDepotOrganizationRequest(request, r); err != nil { return res, errors.Wrap(err, "encode request") } @@ -1023,7 +1236,7 @@ func (c *Client) sendCreateBinding(ctx context.Context, request *CreateBindingIn var satisfied bitset { - switch err := c.securityBearerAuth(ctx, CreateBindingOperation, r); { + switch err := c.securityBearerAuth(ctx, ConnectOrgCIDepotOrganizationOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 0 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -1034,7 +1247,7 @@ func (c *Client) sendCreateBinding(ctx context.Context, request *CreateBindingIn } { - switch err := c.securitySessionAuth(ctx, CreateBindingOperation, r); { + switch err := c.securitySessionAuth(ctx, ConnectOrgCIDepotOrganizationOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 1 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -1070,7 +1283,7 @@ func (c *Client) sendCreateBinding(ctx context.Context, request *CreateBindingIn body := resp.Body defer body.Close() - result, err := decodeCreateBindingResponse(resp) + result, err := decodeConnectOrgCIDepotOrganizationResponse(resp) if err != nil { return res, errors.Wrap(err, "decode response") } @@ -1078,28 +1291,47 @@ func (c *Client) sendCreateBinding(ctx context.Context, request *CreateBindingIn return result, nil } -// CreateMirror invokes createMirror operation. +// CreateBinding invokes createBinding operation. // -// Create GitHub mirror. +// Create OIDC binding. // -// POST /mirrors -func (c *Client) CreateMirror(ctx context.Context, request *CreateMirrorInputBody) (*CreatedMirror, error) { - res, err := c.sendCreateMirror(ctx, request) +// POST /service-accounts/{accountId}/bindings +func (c *Client) CreateBinding(ctx context.Context, request *CreateBindingInputBody, params CreateBindingParams) (*Binding, error) { + res, err := c.sendCreateBinding(ctx, request, params) return res, err } -func (c *Client) sendCreateMirror(ctx context.Context, request *CreateMirrorInputBody) (res *CreatedMirror, err error) { +func (c *Client) sendCreateBinding(ctx context.Context, request *CreateBindingInputBody, params CreateBindingParams) (res *Binding, err error) { u := uri.Clone(c.requestURL(ctx)) - var pathParts [1]string - pathParts[0] = "/mirrors" + var pathParts [3]string + pathParts[0] = "/service-accounts/" + { + // Encode "accountId" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "accountId", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.AccountId)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[1] = encoded + } + pathParts[2] = "/bindings" uri.AddPathParts(u, pathParts[:]...) r, err := ht.NewRequest(ctx, "POST", u) if err != nil { return res, errors.Wrap(err, "create request") } - if err := encodeCreateMirrorRequest(request, r); err != nil { + if err := encodeCreateBindingRequest(request, r); err != nil { return res, errors.Wrap(err, "encode request") } @@ -1108,7 +1340,7 @@ func (c *Client) sendCreateMirror(ctx context.Context, request *CreateMirrorInpu var satisfied bitset { - switch err := c.securityBearerAuth(ctx, CreateMirrorOperation, r); { + switch err := c.securityBearerAuth(ctx, CreateBindingOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 0 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -1119,7 +1351,7 @@ func (c *Client) sendCreateMirror(ctx context.Context, request *CreateMirrorInpu } { - switch err := c.securitySessionAuth(ctx, CreateMirrorOperation, r); { + switch err := c.securitySessionAuth(ctx, CreateBindingOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 1 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -1155,7 +1387,7 @@ func (c *Client) sendCreateMirror(ctx context.Context, request *CreateMirrorInpu body := resp.Body defer body.Close() - result, err := decodeCreateMirrorResponse(resp) + result, err := decodeCreateBindingResponse(resp) if err != nil { return res, errors.Wrap(err, "decode response") } @@ -1358,12 +1590,12 @@ func (c *Client) sendCreateNativeMirror(ctx context.Context, request *CreateNati // Create organization. // // POST /orgs -func (c *Client) CreateOrg(ctx context.Context, request *CreateOrgInputBody) (*Org, error) { +func (c *Client) CreateOrg(ctx context.Context, request *CreateOrgInputBody) (*CreatedOrgHeaders, error) { res, err := c.sendCreateOrg(ctx, request) return res, err } -func (c *Client) sendCreateOrg(ctx context.Context, request *CreateOrgInputBody) (res *Org, err error) { +func (c *Client) sendCreateOrg(ctx context.Context, request *CreateOrgInputBody) (res *CreatedOrgHeaders, err error) { u := uri.Clone(c.requestURL(ctx)) var pathParts [1]string @@ -1438,17 +1670,121 @@ func (c *Client) sendCreateOrg(ctx context.Context, request *CreateOrgInputBody) return result, nil } +// CreateOrgInvitation invokes createOrgInvitation operation. +// +// Invite an address into an organization. +// +// POST /orgs/{orgId}/invitations +func (c *Client) CreateOrgInvitation(ctx context.Context, request *CreateOrgInvitationInputBody, params CreateOrgInvitationParams) (CreateOrgInvitationRes, error) { + res, err := c.sendCreateOrgInvitation(ctx, request, params) + return res, err +} + +func (c *Client) sendCreateOrgInvitation(ctx context.Context, request *CreateOrgInvitationInputBody, params CreateOrgInvitationParams) (res CreateOrgInvitationRes, err error) { + + u := uri.Clone(c.requestURL(ctx)) + var pathParts [3]string + pathParts[0] = "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/orgs/" + { + // Encode "orgId" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "orgId", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.OrgId)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[1] = encoded + } + pathParts[2] = "/invitations" + uri.AddPathParts(u, pathParts[:]...) + + r, err := ht.NewRequest(ctx, "POST", u) + if err != nil { + return res, errors.Wrap(err, "create request") + } + if err := encodeCreateOrgInvitationRequest(request, r); err != nil { + return res, errors.Wrap(err, "encode request") + } + + { + type bitset = [1]uint8 + var satisfied bitset + { + + switch err := c.securityBearerAuth(ctx, CreateOrgInvitationOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 0 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"BearerAuth\"") + } + } + { + + switch err := c.securitySessionAuth(ctx, CreateOrgInvitationOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 1 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"SessionAuth\"") + } + } + + if ok := func() bool { + nextRequirement: + for _, requirement := range []bitset{ + {0b00000001}, + {0b00000010}, + } { + for i, mask := range requirement { + if satisfied[i]&mask != mask { + continue nextRequirement + } + } + return true + } + return false + }(); !ok { + return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied + } + } + + resp, err := c.cfg.Client.Do(r) + if err != nil { + return res, errors.Wrap(err, "do request") + } + body := resp.Body + defer body.Close() + + result, err := decodeCreateOrgInvitationResponse(resp) + if err != nil { + return res, errors.Wrap(err, "decode response") + } + + return result, nil +} + // CreateProject invokes createProject operation. // // Create project. // // POST /projects -func (c *Client) CreateProject(ctx context.Context, request *CreateProjectInputBody) (*Project, error) { +func (c *Client) CreateProject(ctx context.Context, request *CreateProjectInputBody) (*CreatedProjectHeaders, error) { res, err := c.sendCreateProject(ctx, request) return res, err } -func (c *Client) sendCreateProject(ctx context.Context, request *CreateProjectInputBody) (res *Project, err error) { +func (c *Client) sendCreateProject(ctx context.Context, request *CreateProjectInputBody) (res *CreatedProjectHeaders, err error) { u := uri.Clone(c.requestURL(ctx)) var pathParts [1]string @@ -1528,12 +1864,12 @@ func (c *Client) sendCreateProject(ctx context.Context, request *CreateProjectIn // Create repository. // // POST /repos -func (c *Client) CreateRepo(ctx context.Context, request *CreateRepoInputBody) (*Repo, error) { +func (c *Client) CreateRepo(ctx context.Context, request *CreateRepoInputBody) (*CreatedRepoHeaders, error) { res, err := c.sendCreateRepo(ctx, request) return res, err } -func (c *Client) sendCreateRepo(ctx context.Context, request *CreateRepoInputBody) (res *Repo, err error) { +func (c *Client) sendCreateRepo(ctx context.Context, request *CreateRepoInputBody) (res *CreatedRepoHeaders, err error) { u := uri.Clone(c.requestURL(ctx)) var pathParts [1]string @@ -2263,9 +2599,9 @@ func (c *Client) sendDeleteNativeMirror(ctx context.Context, params DeleteNative // Delete an organization. // // DELETE /orgs/{orgId} -func (c *Client) DeleteOrg(ctx context.Context, params DeleteOrgParams) error { - _, err := c.sendDeleteOrg(ctx, params) - return err +func (c *Client) DeleteOrg(ctx context.Context, params DeleteOrgParams) (*DeleteOrgNoContent, error) { + res, err := c.sendDeleteOrg(ctx, params) + return res, err } func (c *Client) sendDeleteOrg(ctx context.Context, params DeleteOrgParams) (res *DeleteOrgNoContent, err error) { @@ -2620,9 +2956,9 @@ func (c *Client) sendDeleteOrgCIBuildkiteCredential(ctx context.Context, params // Delete a project. // // DELETE /projects/{projectId} -func (c *Client) DeleteProject(ctx context.Context, params DeleteProjectParams) error { - _, err := c.sendDeleteProject(ctx, params) - return err +func (c *Client) DeleteProject(ctx context.Context, params DeleteProjectParams) (*DeleteProjectNoContent, error) { + res, err := c.sendDeleteProject(ctx, params) + return res, err } func (c *Client) sendDeleteProject(ctx context.Context, params DeleteProjectParams) (res *DeleteProjectNoContent, err error) { @@ -2720,9 +3056,9 @@ func (c *Client) sendDeleteProject(ctx context.Context, params DeleteProjectPara // Delete repository. // // DELETE /repos/{repoId} -func (c *Client) DeleteRepo(ctx context.Context, params DeleteRepoParams) error { - _, err := c.sendDeleteRepo(ctx, params) - return err +func (c *Client) DeleteRepo(ctx context.Context, params DeleteRepoParams) (*DeleteRepoNoContent, error) { + res, err := c.sendDeleteRepo(ctx, params) + return res, err } func (c *Client) sendDeleteRepo(ctx context.Context, params DeleteRepoParams) (res *DeleteRepoNoContent, err error) { @@ -2817,15 +3153,13 @@ func (c *Client) sendDeleteRepo(ctx context.Context, params DeleteRepoParams) (r // DeleteRepoCIWebhook invokes deleteRepoCIWebhook operation. // -// Deletes the subscription AND tears down its enrollment identity: the automation row (when no -// sibling repo shares it), its expiring repo grant, and its Buildkite OIDC binding. The Buildkite -// pipeline itself is always kept. Pass keep_identity=true to delete only the subscription — for an -// immediate re-enroll that must preserve automation_id, since teardown retires it and a re-enroll -// declares a new one that only bk_force_rescaffold pushes into the pipeline. A retained identity -// holds read access on this repo until its grant lapses. A subscription enrolled before the -// automation principal has no automation to retire: the delete succeeds and removes only the -// subscription, reported as identity_retired=false on the ci_webhook_deleted audit event — the -// list an operator queries to hand-delete the leftover service accounts. +// Deletes the subscription and clears this repo's own enrolment marker. This does NOT immediately +// revoke the automation's access to the repo: that access normally continues, on its existing expiry, +// +// in the background. Pass keep_identity=true to leave the marker untouched too — for an immediate +// +// re-enroll, which always resumes the same automation_id either way. The Buildkite pipeline is +// always kept. // // DELETE /repos/{repoId}/ci-webhooks/{id} func (c *Client) DeleteRepoCIWebhook(ctx context.Context, params DeleteRepoCIWebhookParams) error { @@ -3062,6 +3396,247 @@ func (c *Client) sendDeleteServiceAccount(ctx context.Context, params DeleteServ return result, nil } +// DetachMyHandle invokes detachMyHandle operation. +// +// Detach a linked sign-in method from the calling account. +// +// DELETE /me/handles/{provider}/{providerUserId} +func (c *Client) DetachMyHandle(ctx context.Context, params DetachMyHandleParams) error { + _, err := c.sendDetachMyHandle(ctx, params) + return err +} + +func (c *Client) sendDetachMyHandle(ctx context.Context, params DetachMyHandleParams) (res *DetachMyHandleNoContent, err error) { + + u := uri.Clone(c.requestURL(ctx)) + var pathParts [4]string + pathParts[0] = "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/me/handles/" + { + // Encode "provider" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "provider", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(string(params.Provider))) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[1] = encoded + } + pathParts[2] = "/" + { + // Encode "providerUserId" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "providerUserId", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.ProviderUserId)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[3] = encoded + } + uri.AddPathParts(u, pathParts[:]...) + + r, err := ht.NewRequest(ctx, "DELETE", u) + if err != nil { + return res, errors.Wrap(err, "create request") + } + + { + type bitset = [1]uint8 + var satisfied bitset + { + + switch err := c.securityBearerAuth(ctx, DetachMyHandleOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 0 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"BearerAuth\"") + } + } + { + + switch err := c.securitySessionAuth(ctx, DetachMyHandleOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 1 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"SessionAuth\"") + } + } + + if ok := func() bool { + nextRequirement: + for _, requirement := range []bitset{ + {0b00000001}, + {0b00000010}, + } { + for i, mask := range requirement { + if satisfied[i]&mask != mask { + continue nextRequirement + } + } + return true + } + return false + }(); !ok { + return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied + } + } + + resp, err := c.cfg.Client.Do(r) + if err != nil { + return res, errors.Wrap(err, "do request") + } + body := resp.Body + defer body.Close() + + result, err := decodeDetachMyHandleResponse(resp) + if err != nil { + return res, errors.Wrap(err, "decode response") + } + + return result, nil +} + +// DisconnectOrgCIDepotOrganization invokes disconnectOrgCIDepotOrganization operation. +// +// Operator-only: requires platform#admin, mirroring the connect, because withdrawing an operator's +// vouch is at least as privileged as granting it. Provider-scoped on ci-webhooks, so it removes only +// the depot row and never a Buildkite credential of the same name. Removing a connection a +// subscription still names is allowed and logged; those subscriptions stop dispatching. +// +// DELETE /orgs/{orgId}/ci/depot/connection/{account} +func (c *Client) DisconnectOrgCIDepotOrganization(ctx context.Context, params DisconnectOrgCIDepotOrganizationParams) error { + _, err := c.sendDisconnectOrgCIDepotOrganization(ctx, params) + return err +} + +func (c *Client) sendDisconnectOrgCIDepotOrganization(ctx context.Context, params DisconnectOrgCIDepotOrganizationParams) (res *DisconnectOrgCIDepotOrganizationNoContent, err error) { + + u := uri.Clone(c.requestURL(ctx)) + var pathParts [4]string + pathParts[0] = "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/orgs/" + { + // Encode "orgId" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "orgId", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.OrgId)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[1] = encoded + } + pathParts[2] = "/ci/depot/connection/" + { + // Encode "account" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "account", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.Account)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[3] = encoded + } + uri.AddPathParts(u, pathParts[:]...) + + r, err := ht.NewRequest(ctx, "DELETE", u) + if err != nil { + return res, errors.Wrap(err, "create request") + } + + { + type bitset = [1]uint8 + var satisfied bitset + { + + switch err := c.securityBearerAuth(ctx, DisconnectOrgCIDepotOrganizationOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 0 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"BearerAuth\"") + } + } + { + + switch err := c.securitySessionAuth(ctx, DisconnectOrgCIDepotOrganizationOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 1 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"SessionAuth\"") + } + } + + if ok := func() bool { + nextRequirement: + for _, requirement := range []bitset{ + {0b00000001}, + {0b00000010}, + } { + for i, mask := range requirement { + if satisfied[i]&mask != mask { + continue nextRequirement + } + } + return true + } + return false + }(); !ok { + return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied + } + } + + resp, err := c.cfg.Client.Do(r) + if err != nil { + return res, errors.Wrap(err, "do request") + } + body := resp.Body + defer body.Close() + + result, err := decodeDisconnectOrgCIDepotOrganizationResponse(resp) + if err != nil { + return res, errors.Wrap(err, "decode response") + } + + return result, nil +} + // GetBranchProtection invokes getBranchProtection operation. // // Get repository branch protection. @@ -3709,30 +4284,33 @@ func (c *Client) sendGetOrg(ctx context.Context, params GetOrgParams) (res *Org, return result, nil } -// GetPermissions invokes getPermissions operation. +// GetOrgPersonAccess invokes getOrgPersonAccess operation. // -// List the caller's permissions on a single resource. +// Requires organization management permission. Selects the exact account within this organization's +// roster, not a handle or substring. Returns all recorded grants and fresh caller-specific editing +// capabilities. Missing or excluded people return 404; incomplete organization read models return +// 503. Uses global public data only. Mutations independently reauthorize every write. // -// GET /access/{resourceType}/{resourceId} -func (c *Client) GetPermissions(ctx context.Context, params GetPermissionsParams) (*GetPermissionsOutputBody, error) { - res, err := c.sendGetPermissions(ctx, params) +// GET /orgs/{orgId}/people/{accountId}/access +func (c *Client) GetOrgPersonAccess(ctx context.Context, params GetOrgPersonAccessParams) (*OrgPersonHeaders, error) { + res, err := c.sendGetOrgPersonAccess(ctx, params) return res, err } -func (c *Client) sendGetPermissions(ctx context.Context, params GetPermissionsParams) (res *GetPermissionsOutputBody, err error) { +func (c *Client) sendGetOrgPersonAccess(ctx context.Context, params GetOrgPersonAccessParams) (res *OrgPersonHeaders, err error) { u := uri.Clone(c.requestURL(ctx)) - var pathParts [4]string - pathParts[0] = "/access/" + var pathParts [5]string + pathParts[0] = "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/orgs/" { - // Encode "resourceType" parameter. + // Encode "orgId" parameter. e := uri.NewPathEncoder(uri.PathEncoderConfig{ - Param: "resourceType", + Param: "orgId", Style: uri.PathStyleSimple, Explode: false, }) if err := func() error { - return e.EncodeValue(conv.StringToString(params.ResourceType)) + return e.EncodeValue(conv.StringToString(params.OrgId)) }(); err != nil { return res, errors.Wrap(err, "encode path") } @@ -3742,16 +4320,16 @@ func (c *Client) sendGetPermissions(ctx context.Context, params GetPermissionsPa } pathParts[1] = encoded } - pathParts[2] = "/" + pathParts[2] = "/people/" { - // Encode "resourceId" parameter. + // Encode "accountId" parameter. e := uri.NewPathEncoder(uri.PathEncoderConfig{ - Param: "resourceId", + Param: "accountId", Style: uri.PathStyleSimple, Explode: false, }) if err := func() error { - return e.EncodeValue(conv.StringToString(params.ResourceId)) + return e.EncodeValue(conv.StringToString(params.AccountId)) }(); err != nil { return res, errors.Wrap(err, "encode path") } @@ -3761,28 +4339,9 @@ func (c *Client) sendGetPermissions(ctx context.Context, params GetPermissionsPa } pathParts[3] = encoded } + pathParts[4] = "/access" uri.AddPathParts(u, pathParts[:]...) - q := uri.NewQueryEncoder() - { - // Encode "explain" parameter. - cfg := uri.QueryParameterEncodingConfig{ - Name: "explain", - Style: uri.QueryStyleForm, - Explode: false, - } - - if err := q.EncodeParam(cfg, func(e uri.Encoder) error { - if val, ok := params.Explain.Get(); ok { - return e.EncodeValue(conv.StringToString(val)) - } - return nil - }); err != nil { - return res, errors.Wrap(err, "encode query") - } - } - u.RawQuery = q.Values().Encode() - r, err := ht.NewRequest(ctx, "GET", u) if err != nil { return res, errors.Wrap(err, "create request") @@ -3793,7 +4352,7 @@ func (c *Client) sendGetPermissions(ctx context.Context, params GetPermissionsPa var satisfied bitset { - switch err := c.securityBearerAuth(ctx, GetPermissionsOperation, r); { + switch err := c.securityBearerAuth(ctx, GetOrgPersonAccessOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 0 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -3804,7 +4363,7 @@ func (c *Client) sendGetPermissions(ctx context.Context, params GetPermissionsPa } { - switch err := c.securitySessionAuth(ctx, GetPermissionsOperation, r); { + switch err := c.securitySessionAuth(ctx, GetOrgPersonAccessOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 1 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -3840,7 +4399,7 @@ func (c *Client) sendGetPermissions(ctx context.Context, params GetPermissionsPa body := resp.Body defer body.Close() - result, err := decodeGetPermissionsResponse(resp) + result, err := decodeGetOrgPersonAccessResponse(resp) if err != nil { return res, errors.Wrap(err, "decode response") } @@ -4068,17 +4627,137 @@ func (c *Client) sendGetRepo(ctx context.Context, params GetRepoParams) (res *Re return result, nil } -// GetRepoVisibility invokes getRepoVisibility operation. +// GetRepoCIDelivery invokes getRepoCIDelivery operation. // -// Get repository visibility. +// The id is the opaque value from a list response. A payload is absent once its day has been swept +// (payload_absent=swept) or when no request was ever built (payload_absent=no_request). // -// GET /repos/{repoId}/visibility -func (c *Client) GetRepoVisibility(ctx context.Context, params GetRepoVisibilityParams) (*GetRepoVisibilityOutputBody, error) { - res, err := c.sendGetRepoVisibility(ctx, params) +// GET /repos/{repoId}/ci-deliveries/{id} +func (c *Client) GetRepoCIDelivery(ctx context.Context, params GetRepoCIDeliveryParams) (*CIDeliveryDetailView, error) { + res, err := c.sendGetRepoCIDelivery(ctx, params) return res, err } -func (c *Client) sendGetRepoVisibility(ctx context.Context, params GetRepoVisibilityParams) (res *GetRepoVisibilityOutputBody, err error) { +func (c *Client) sendGetRepoCIDelivery(ctx context.Context, params GetRepoCIDeliveryParams) (res *CIDeliveryDetailView, err error) { + + u := uri.Clone(c.requestURL(ctx)) + var pathParts [4]string + pathParts[0] = "/repos/" + { + // Encode "repoId" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "repoId", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.RepoId)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[1] = encoded + } + pathParts[2] = "/ci-deliveries/" + { + // Encode "id" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "id", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.ID)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[3] = encoded + } + uri.AddPathParts(u, pathParts[:]...) + + r, err := ht.NewRequest(ctx, "GET", u) + if err != nil { + return res, errors.Wrap(err, "create request") + } + + { + type bitset = [1]uint8 + var satisfied bitset + { + + switch err := c.securityBearerAuth(ctx, GetRepoCIDeliveryOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 0 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"BearerAuth\"") + } + } + { + + switch err := c.securitySessionAuth(ctx, GetRepoCIDeliveryOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 1 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"SessionAuth\"") + } + } + + if ok := func() bool { + nextRequirement: + for _, requirement := range []bitset{ + {0b00000001}, + {0b00000010}, + } { + for i, mask := range requirement { + if satisfied[i]&mask != mask { + continue nextRequirement + } + } + return true + } + return false + }(); !ok { + return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied + } + } + + resp, err := c.cfg.Client.Do(r) + if err != nil { + return res, errors.Wrap(err, "do request") + } + body := resp.Body + defer body.Close() + + result, err := decodeGetRepoCIDeliveryResponse(resp) + if err != nil { + return res, errors.Wrap(err, "decode response") + } + + return result, nil +} + +// GetRepoVisibility invokes getRepoVisibility operation. +// +// Get repository visibility. +// +// GET /repos/{repoId}/visibility +func (c *Client) GetRepoVisibility(ctx context.Context, params GetRepoVisibilityParams) (*GetRepoVisibilityOutputBody, error) { + res, err := c.sendGetRepoVisibility(ctx, params) + return res, err +} + +func (c *Client) sendGetRepoVisibility(ctx context.Context, params GetRepoVisibilityParams) (res *GetRepoVisibilityOutputBody, err error) { u := uri.Clone(c.requestURL(ctx)) var pathParts [3]string @@ -4393,12 +5072,12 @@ func (c *Client) sendGetVersion(ctx context.Context) (res *GetVersionOutputBody, // Grant project access to an identity. // // POST /projects/{projectId}/grants -func (c *Client) GrantProjectAccess(ctx context.Context, request *GrantProjectAccessInputBody, params GrantProjectAccessParams) (*GrantProjectAccessOutputBody, error) { +func (c *Client) GrantProjectAccess(ctx context.Context, request *GrantAccessBody, params GrantProjectAccessParams) (*GrantProjectAccessOutputBody, error) { res, err := c.sendGrantProjectAccess(ctx, request, params) return res, err } -func (c *Client) sendGrantProjectAccess(ctx context.Context, request *GrantProjectAccessInputBody, params GrantProjectAccessParams) (res *GrantProjectAccessOutputBody, err error) { +func (c *Client) sendGrantProjectAccess(ctx context.Context, request *GrantAccessBody, params GrantProjectAccessParams) (res *GrantProjectAccessOutputBody, err error) { u := uri.Clone(c.requestURL(ctx)) var pathParts [3]string @@ -4497,12 +5176,12 @@ func (c *Client) sendGrantProjectAccess(ctx context.Context, request *GrantProje // Grant repo access to an identity. // // POST /repos/{repoId}/grants -func (c *Client) GrantRepoAccess(ctx context.Context, request *GrantRepoAccessInputBody, params GrantRepoAccessParams) (*GrantRepoAccessOutputBody, error) { +func (c *Client) GrantRepoAccess(ctx context.Context, request *GrantAccessBody, params GrantRepoAccessParams) (*GrantRepoAccessOutputBody, error) { res, err := c.sendGrantRepoAccess(ctx, request, params) return res, err } -func (c *Client) sendGrantRepoAccess(ctx context.Context, request *GrantRepoAccessInputBody, params GrantRepoAccessParams) (res *GrantRepoAccessOutputBody, err error) { +func (c *Client) sendGrantRepoAccess(ctx context.Context, request *GrantAccessBody, params GrantRepoAccessParams) (res *GrantRepoAccessOutputBody, err error) { u := uri.Clone(c.requestURL(ctx)) var pathParts [3]string @@ -5894,17 +6573,18 @@ func (c *Client) sendListOrgCIBuildkiteCredentials(ctx context.Context, params L return result, nil } -// ListOrgMembers invokes listOrgMembers operation. +// ListOrgCIDepotOrganizations invokes listOrgCIDepotOrganizations operation. // -// List members of an organization. +// Requires org#manage, like the Buildkite credential list. A Depot connection holds no secret: it is +// the Depot organisation id this org's repositories enrol against. // -// GET /orgs/{orgId}/members -func (c *Client) ListOrgMembers(ctx context.Context, params ListOrgMembersParams) (*ListOrgMembersOutputBody, error) { - res, err := c.sendListOrgMembers(ctx, params) +// GET /orgs/{orgId}/ci/depot/connections +func (c *Client) ListOrgCIDepotOrganizations(ctx context.Context, params ListOrgCIDepotOrganizationsParams) (*ListOrgCIDepotOrganizationsOutputBody, error) { + res, err := c.sendListOrgCIDepotOrganizations(ctx, params) return res, err } -func (c *Client) sendListOrgMembers(ctx context.Context, params ListOrgMembersParams) (res *ListOrgMembersOutputBody, err error) { +func (c *Client) sendListOrgCIDepotOrganizations(ctx context.Context, params ListOrgCIDepotOrganizationsParams) (res *ListOrgCIDepotOrganizationsOutputBody, err error) { u := uri.Clone(c.requestURL(ctx)) var pathParts [3]string @@ -5927,46 +6607,9 @@ func (c *Client) sendListOrgMembers(ctx context.Context, params ListOrgMembersPa } pathParts[1] = encoded } - pathParts[2] = "/members" + pathParts[2] = "/ci/depot/connections" uri.AddPathParts(u, pathParts[:]...) - q := uri.NewQueryEncoder() - { - // Encode "pageSize" parameter. - cfg := uri.QueryParameterEncodingConfig{ - Name: "pageSize", - Style: uri.QueryStyleForm, - Explode: false, - } - - if err := q.EncodeParam(cfg, func(e uri.Encoder) error { - if val, ok := params.PageSize.Get(); ok { - return e.EncodeValue(conv.Int32ToString(val)) - } - return nil - }); err != nil { - return res, errors.Wrap(err, "encode query") - } - } - { - // Encode "pageToken" parameter. - cfg := uri.QueryParameterEncodingConfig{ - Name: "pageToken", - Style: uri.QueryStyleForm, - Explode: false, - } - - if err := q.EncodeParam(cfg, func(e uri.Encoder) error { - if val, ok := params.PageToken.Get(); ok { - return e.EncodeValue(conv.StringToString(val)) - } - return nil - }); err != nil { - return res, errors.Wrap(err, "encode query") - } - } - u.RawQuery = q.Values().Encode() - r, err := ht.NewRequest(ctx, "GET", u) if err != nil { return res, errors.Wrap(err, "create request") @@ -5977,7 +6620,7 @@ func (c *Client) sendListOrgMembers(ctx context.Context, params ListOrgMembersPa var satisfied bitset { - switch err := c.securityBearerAuth(ctx, ListOrgMembersOperation, r); { + switch err := c.securityBearerAuth(ctx, ListOrgCIDepotOrganizationsOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 0 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -5988,7 +6631,7 @@ func (c *Client) sendListOrgMembers(ctx context.Context, params ListOrgMembersPa } { - switch err := c.securitySessionAuth(ctx, ListOrgMembersOperation, r); { + switch err := c.securitySessionAuth(ctx, ListOrgCIDepotOrganizationsOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 1 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -6024,7 +6667,7 @@ func (c *Client) sendListOrgMembers(ctx context.Context, params ListOrgMembersPa body := resp.Body defer body.Close() - result, err := decodeListOrgMembersResponse(resp) + result, err := decodeListOrgCIDepotOrganizationsResponse(resp) if err != nil { return res, errors.Wrap(err, "decode response") } @@ -6032,17 +6675,17 @@ func (c *Client) sendListOrgMembers(ctx context.Context, params ListOrgMembersPa return result, nil } -// ListOrgProjects invokes listOrgProjects operation. +// ListOrgInvitations invokes listOrgInvitations operation. // -// List projects owned by an organization. +// List an organization's invitations. // -// GET /orgs/{orgId}/projects -func (c *Client) ListOrgProjects(ctx context.Context, params ListOrgProjectsParams) (*ListOrgProjectsOutputBody, error) { - res, err := c.sendListOrgProjects(ctx, params) +// GET /orgs/{orgId}/invitations +func (c *Client) ListOrgInvitations(ctx context.Context, params ListOrgInvitationsParams) (*ListOrgInvitationsOutputBody, error) { + res, err := c.sendListOrgInvitations(ctx, params) return res, err } -func (c *Client) sendListOrgProjects(ctx context.Context, params ListOrgProjectsParams) (res *ListOrgProjectsOutputBody, err error) { +func (c *Client) sendListOrgInvitations(ctx context.Context, params ListOrgInvitationsParams) (res *ListOrgInvitationsOutputBody, err error) { u := uri.Clone(c.requestURL(ctx)) var pathParts [3]string @@ -6065,7 +6708,7 @@ func (c *Client) sendListOrgProjects(ctx context.Context, params ListOrgProjects } pathParts[1] = encoded } - pathParts[2] = "/projects" + pathParts[2] = "/invitations" uri.AddPathParts(u, pathParts[:]...) q := uri.NewQueryEncoder() @@ -6104,16 +6747,16 @@ func (c *Client) sendListOrgProjects(ctx context.Context, params ListOrgProjects } } { - // Encode "name" parameter. + // Encode "status" parameter. cfg := uri.QueryParameterEncodingConfig{ - Name: "name", + Name: "status", Style: uri.QueryStyleForm, Explode: false, } if err := q.EncodeParam(cfg, func(e uri.Encoder) error { - if val, ok := params.Name.Get(); ok { - return e.EncodeValue(conv.StringToString(val)) + if val, ok := params.Status.Get(); ok { + return e.EncodeValue(conv.StringToString(string(val))) } return nil }); err != nil { @@ -6132,7 +6775,7 @@ func (c *Client) sendListOrgProjects(ctx context.Context, params ListOrgProjects var satisfied bitset { - switch err := c.securityBearerAuth(ctx, ListOrgProjectsOperation, r); { + switch err := c.securityBearerAuth(ctx, ListOrgInvitationsOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 0 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -6143,7 +6786,7 @@ func (c *Client) sendListOrgProjects(ctx context.Context, params ListOrgProjects } { - switch err := c.securitySessionAuth(ctx, ListOrgProjectsOperation, r); { + switch err := c.securitySessionAuth(ctx, ListOrgInvitationsOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 1 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -6179,7 +6822,7 @@ func (c *Client) sendListOrgProjects(ctx context.Context, params ListOrgProjects body := resp.Body defer body.Close() - result, err := decodeListOrgProjectsResponse(resp) + result, err := decodeListOrgInvitationsResponse(resp) if err != nil { return res, errors.Wrap(err, "decode response") } @@ -6187,21 +6830,40 @@ func (c *Client) sendListOrgProjects(ctx context.Context, params ListOrgProjects return result, nil } -// ListOrgs invokes listOrgs operation. +// ListOrgMembers invokes listOrgMembers operation. // -// List organizations the caller can see (or one by name). +// List members of an organization. // -// GET /orgs -func (c *Client) ListOrgs(ctx context.Context, params ListOrgsParams) (*ListOrgsOutputBodyHeaders, error) { - res, err := c.sendListOrgs(ctx, params) +// GET /orgs/{orgId}/members +func (c *Client) ListOrgMembers(ctx context.Context, params ListOrgMembersParams) (*ListOrgMembersOutputBody, error) { + res, err := c.sendListOrgMembers(ctx, params) return res, err } -func (c *Client) sendListOrgs(ctx context.Context, params ListOrgsParams) (res *ListOrgsOutputBodyHeaders, err error) { +func (c *Client) sendListOrgMembers(ctx context.Context, params ListOrgMembersParams) (res *ListOrgMembersOutputBody, err error) { u := uri.Clone(c.requestURL(ctx)) - var pathParts [1]string - pathParts[0] = "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/orgs" + var pathParts [3]string + pathParts[0] = "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/orgs/" + { + // Encode "orgId" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "orgId", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.OrgId)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[1] = encoded + } + pathParts[2] = "/members" uri.AddPathParts(u, pathParts[:]...) q := uri.NewQueryEncoder() @@ -6239,23 +6901,6 @@ func (c *Client) sendListOrgs(ctx context.Context, params ListOrgsParams) (res * return res, errors.Wrap(err, "encode query") } } - { - // Encode "name" parameter. - cfg := uri.QueryParameterEncodingConfig{ - Name: "name", - Style: uri.QueryStyleForm, - Explode: false, - } - - if err := q.EncodeParam(cfg, func(e uri.Encoder) error { - if val, ok := params.Name.Get(); ok { - return e.EncodeValue(conv.StringToString(val)) - } - return nil - }); err != nil { - return res, errors.Wrap(err, "encode query") - } - } u.RawQuery = q.Values().Encode() r, err := ht.NewRequest(ctx, "GET", u) @@ -6263,28 +6908,12 @@ func (c *Client) sendListOrgs(ctx context.Context, params ListOrgsParams) (res * return res, errors.Wrap(err, "create request") } - h := uri.NewHeaderEncoder(r.Header) - { - cfg := uri.HeaderParameterEncodingConfig{ - Name: "If-None-Match", - Explode: false, - } - if err := h.EncodeParam(cfg, func(e uri.Encoder) error { - if val, ok := params.IfNoneMatch.Get(); ok { - return e.EncodeValue(conv.StringToString(val)) - } - return nil - }); err != nil { - return res, errors.Wrap(err, "encode header") - } - } - { type bitset = [1]uint8 var satisfied bitset { - switch err := c.securityBearerAuth(ctx, ListOrgsOperation, r); { + switch err := c.securityBearerAuth(ctx, ListOrgMembersOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 0 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -6295,7 +6924,7 @@ func (c *Client) sendListOrgs(ctx context.Context, params ListOrgsParams) (res * } { - switch err := c.securitySessionAuth(ctx, ListOrgsOperation, r); { + switch err := c.securitySessionAuth(ctx, ListOrgMembersOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 1 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -6331,7 +6960,7 @@ func (c *Client) sendListOrgs(ctx context.Context, params ListOrgsParams) (res * body := resp.Body defer body.Close() - result, err := decodeListOrgsResponse(resp) + result, err := decodeListOrgMembersResponse(resp) if err != nil { return res, errors.Wrap(err, "decode response") } @@ -6339,17 +6968,721 @@ func (c *Client) sendListOrgs(ctx context.Context, params ListOrgsParams) (res * return result, nil } -// ListProjectMembers invokes listProjectMembers operation. -// +// ListOrgPeople invokes listOrgPeople operation. +// +// Requires organization management permission, not repository pull permission. Returns one row per +// account with membership metadata and recorded accessScopes, without grant details or editing +// capabilities. Grants retain each distinct role and origin (membership, direct, team, or github), +// without inherited expansion or strongest-role collapsing. Repository IDs identify published +// logical repo groups, not placements. Membership grants include pending and inactive memberships; +// membership.status describes their lifecycle. GitHub grants use the collaborator read model and can +// differ from live SpiceDB permissions during reconciliation. This is a roster read model, not an +// authorization check or complete SpiceDB audit. Management does not imply Git read permission. +// Snapshot readiness uses the shared GitHub discovery eligibility and 15-minute grace policy. +// Detached, suspended, sync-blocked, sync-banned, and wholly suspended mirror targets do not block +// readiness; recorded edges still serve. Overdue eligible snapshots or missing mirror mappings +// return 503. Filters select people by recorded grants, not inherited roles. Load +// /people/{accountId}/access when opening an editor; it returns that person's grants and fresh +// editing capabilities. The list has no full mode. Filters and totalCount apply before cursor +// pagination; results are ordered by account ID. +// +// GET /orgs/{orgId}/people +func (c *Client) ListOrgPeople(ctx context.Context, params ListOrgPeopleParams) (*ListOrgPeopleOutputBodyHeaders, error) { + res, err := c.sendListOrgPeople(ctx, params) + return res, err +} + +func (c *Client) sendListOrgPeople(ctx context.Context, params ListOrgPeopleParams) (res *ListOrgPeopleOutputBodyHeaders, err error) { + + u := uri.Clone(c.requestURL(ctx)) + var pathParts [3]string + pathParts[0] = "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/orgs/" + { + // Encode "orgId" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "orgId", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.OrgId)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[1] = encoded + } + pathParts[2] = "/people" + uri.AddPathParts(u, pathParts[:]...) + + q := uri.NewQueryEncoder() + { + // Encode "pageSize" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "pageSize", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.PageSize.Get(); ok { + return e.EncodeValue(conv.Int32ToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "pageToken" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "pageToken", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.PageToken.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "scope" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "scope", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.Scope.Get(); ok { + return e.EncodeValue(conv.StringToString(string(val))) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "search" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "search", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.Search.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "membership" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "membership", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.Membership.Get(); ok { + return e.EncodeValue(conv.StringToString(string(val))) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "status" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "status", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.Status.Get(); ok { + return e.EncodeValue(conv.StringToString(string(val))) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "role" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "role", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.Role.Get(); ok { + return e.EncodeValue(conv.StringToString(string(val))) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + u.RawQuery = q.Values().Encode() + + r, err := ht.NewRequest(ctx, "GET", u) + if err != nil { + return res, errors.Wrap(err, "create request") + } + + { + type bitset = [1]uint8 + var satisfied bitset + { + + switch err := c.securityBearerAuth(ctx, ListOrgPeopleOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 0 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"BearerAuth\"") + } + } + { + + switch err := c.securitySessionAuth(ctx, ListOrgPeopleOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 1 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"SessionAuth\"") + } + } + + if ok := func() bool { + nextRequirement: + for _, requirement := range []bitset{ + {0b00000001}, + {0b00000010}, + } { + for i, mask := range requirement { + if satisfied[i]&mask != mask { + continue nextRequirement + } + } + return true + } + return false + }(); !ok { + return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied + } + } + + resp, err := c.cfg.Client.Do(r) + if err != nil { + return res, errors.Wrap(err, "do request") + } + body := resp.Body + defer body.Close() + + result, err := decodeListOrgPeopleResponse(resp) + if err != nil { + return res, errors.Wrap(err, "decode response") + } + + return result, nil +} + +// ListOrgProjects invokes listOrgProjects operation. +// +// List projects owned by an organization. +// +// GET /orgs/{orgId}/projects +func (c *Client) ListOrgProjects(ctx context.Context, params ListOrgProjectsParams) (*ListOrgProjectsOutputBody, error) { + res, err := c.sendListOrgProjects(ctx, params) + return res, err +} + +func (c *Client) sendListOrgProjects(ctx context.Context, params ListOrgProjectsParams) (res *ListOrgProjectsOutputBody, err error) { + + u := uri.Clone(c.requestURL(ctx)) + var pathParts [3]string + pathParts[0] = "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/orgs/" + { + // Encode "orgId" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "orgId", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.OrgId)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[1] = encoded + } + pathParts[2] = "/projects" + uri.AddPathParts(u, pathParts[:]...) + + q := uri.NewQueryEncoder() + { + // Encode "pageSize" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "pageSize", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.PageSize.Get(); ok { + return e.EncodeValue(conv.Int32ToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "pageToken" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "pageToken", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.PageToken.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "name" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "name", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.Name.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + u.RawQuery = q.Values().Encode() + + r, err := ht.NewRequest(ctx, "GET", u) + if err != nil { + return res, errors.Wrap(err, "create request") + } + + { + type bitset = [1]uint8 + var satisfied bitset + { + + switch err := c.securityBearerAuth(ctx, ListOrgProjectsOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 0 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"BearerAuth\"") + } + } + { + + switch err := c.securitySessionAuth(ctx, ListOrgProjectsOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 1 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"SessionAuth\"") + } + } + + if ok := func() bool { + nextRequirement: + for _, requirement := range []bitset{ + {0b00000001}, + {0b00000010}, + } { + for i, mask := range requirement { + if satisfied[i]&mask != mask { + continue nextRequirement + } + } + return true + } + return false + }(); !ok { + return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied + } + } + + resp, err := c.cfg.Client.Do(r) + if err != nil { + return res, errors.Wrap(err, "do request") + } + body := resp.Body + defer body.Close() + + result, err := decodeListOrgProjectsResponse(resp) + if err != nil { + return res, errors.Wrap(err, "decode response") + } + + return result, nil +} + +// ListOrgs invokes listOrgs operation. +// +// List organizations the caller can see (or one by name). +// +// GET /orgs +func (c *Client) ListOrgs(ctx context.Context, params ListOrgsParams) (*ListOrgsOutputBodyHeaders, error) { + res, err := c.sendListOrgs(ctx, params) + return res, err +} + +func (c *Client) sendListOrgs(ctx context.Context, params ListOrgsParams) (res *ListOrgsOutputBodyHeaders, err error) { + + u := uri.Clone(c.requestURL(ctx)) + var pathParts [1]string + pathParts[0] = "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/orgs" + uri.AddPathParts(u, pathParts[:]...) + + q := uri.NewQueryEncoder() + { + // Encode "pageSize" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "pageSize", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.PageSize.Get(); ok { + return e.EncodeValue(conv.Int32ToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "pageToken" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "pageToken", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.PageToken.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "name" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "name", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.Name.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "commitToken" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "commitToken", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.CommitToken.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + u.RawQuery = q.Values().Encode() + + r, err := ht.NewRequest(ctx, "GET", u) + if err != nil { + return res, errors.Wrap(err, "create request") + } + + h := uri.NewHeaderEncoder(r.Header) + { + cfg := uri.HeaderParameterEncodingConfig{ + Name: "If-None-Match", + Explode: false, + } + if err := h.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.IfNoneMatch.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode header") + } + } + + { + type bitset = [1]uint8 + var satisfied bitset + { + + switch err := c.securityBearerAuth(ctx, ListOrgsOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 0 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"BearerAuth\"") + } + } + { + + switch err := c.securitySessionAuth(ctx, ListOrgsOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 1 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"SessionAuth\"") + } + } + + if ok := func() bool { + nextRequirement: + for _, requirement := range []bitset{ + {0b00000001}, + {0b00000010}, + } { + for i, mask := range requirement { + if satisfied[i]&mask != mask { + continue nextRequirement + } + } + return true + } + return false + }(); !ok { + return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied + } + } + + resp, err := c.cfg.Client.Do(r) + if err != nil { + return res, errors.Wrap(err, "do request") + } + body := resp.Body + defer body.Close() + + result, err := decodeListOrgsResponse(resp) + if err != nil { + return res, errors.Wrap(err, "decode response") + } + + return result, nil +} + +// ListProjectMembers invokes listProjectMembers operation. +// // List project members and their roles. // -// GET /projects/{projectId}/members -func (c *Client) ListProjectMembers(ctx context.Context, params ListProjectMembersParams) (*ListProjectMembersOutputBody, error) { - res, err := c.sendListProjectMembers(ctx, params) +// GET /projects/{projectId}/members +func (c *Client) ListProjectMembers(ctx context.Context, params ListProjectMembersParams) (*ListProjectMembersOutputBody, error) { + res, err := c.sendListProjectMembers(ctx, params) + return res, err +} + +func (c *Client) sendListProjectMembers(ctx context.Context, params ListProjectMembersParams) (res *ListProjectMembersOutputBody, err error) { + + u := uri.Clone(c.requestURL(ctx)) + var pathParts [3]string + pathParts[0] = "/projects/" + { + // Encode "projectId" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "projectId", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.ProjectId)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[1] = encoded + } + pathParts[2] = "/members" + uri.AddPathParts(u, pathParts[:]...) + + q := uri.NewQueryEncoder() + { + // Encode "pageSize" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "pageSize", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.PageSize.Get(); ok { + return e.EncodeValue(conv.Int32ToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "pageToken" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "pageToken", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.PageToken.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + u.RawQuery = q.Values().Encode() + + r, err := ht.NewRequest(ctx, "GET", u) + if err != nil { + return res, errors.Wrap(err, "create request") + } + + { + type bitset = [1]uint8 + var satisfied bitset + { + + switch err := c.securityBearerAuth(ctx, ListProjectMembersOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 0 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"BearerAuth\"") + } + } + { + + switch err := c.securitySessionAuth(ctx, ListProjectMembersOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 1 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"SessionAuth\"") + } + } + + if ok := func() bool { + nextRequirement: + for _, requirement := range []bitset{ + {0b00000001}, + {0b00000010}, + } { + for i, mask := range requirement { + if satisfied[i]&mask != mask { + continue nextRequirement + } + } + return true + } + return false + }(); !ok { + return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied + } + } + + resp, err := c.cfg.Client.Do(r) + if err != nil { + return res, errors.Wrap(err, "do request") + } + body := resp.Body + defer body.Close() + + result, err := decodeListProjectMembersResponse(resp) + if err != nil { + return res, errors.Wrap(err, "decode response") + } + + return result, nil +} + +// ListProjectPeople invokes listProjectPeople operation. +// +// Requires project roster-view permission, held by project managers and source-managed forge members +// but not ordinary native readers or writers. Returns one account per row with its effective role +// and merged access sources. Grant managers also receive the mutable direct grant. Search and role +// filters run before cursor pagination. Results are ordered by effective role (owner, admin, +// mirror_source_admin, writer, reader, member), then by handle without the provider prefix, ignoring +// case, then by account ID. Accounts without a handle come last within their role. +// +// GET /projects/{projectId}/people +func (c *Client) ListProjectPeople(ctx context.Context, params ListProjectPeopleParams) (*ResourcePeopleOutputBody, error) { + res, err := c.sendListProjectPeople(ctx, params) return res, err } -func (c *Client) sendListProjectMembers(ctx context.Context, params ListProjectMembersParams) (res *ListProjectMembersOutputBody, err error) { +func (c *Client) sendListProjectPeople(ctx context.Context, params ListProjectPeopleParams) (res *ResourcePeopleOutputBody, err error) { u := uri.Clone(c.requestURL(ctx)) var pathParts [3]string @@ -6372,7 +7705,7 @@ func (c *Client) sendListProjectMembers(ctx context.Context, params ListProjectM } pathParts[1] = encoded } - pathParts[2] = "/members" + pathParts[2] = "/people" uri.AddPathParts(u, pathParts[:]...) q := uri.NewQueryEncoder() @@ -6410,6 +7743,40 @@ func (c *Client) sendListProjectMembers(ctx context.Context, params ListProjectM return res, errors.Wrap(err, "encode query") } } + { + // Encode "search" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "search", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.Search.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "role" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "role", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.Role.Get(); ok { + return e.EncodeValue(conv.StringToString(string(val))) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } u.RawQuery = q.Values().Encode() r, err := ht.NewRequest(ctx, "GET", u) @@ -6422,7 +7789,7 @@ func (c *Client) sendListProjectMembers(ctx context.Context, params ListProjectM var satisfied bitset { - switch err := c.securityBearerAuth(ctx, ListProjectMembersOperation, r); { + switch err := c.securityBearerAuth(ctx, ListProjectPeopleOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 0 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -6433,7 +7800,7 @@ func (c *Client) sendListProjectMembers(ctx context.Context, params ListProjectM } { - switch err := c.securitySessionAuth(ctx, ListProjectMembersOperation, r); { + switch err := c.securitySessionAuth(ctx, ListProjectPeopleOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 1 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -6469,7 +7836,7 @@ func (c *Client) sendListProjectMembers(ctx context.Context, params ListProjectM body := resp.Body defer body.Close() - result, err := decodeListProjectMembersResponse(resp) + result, err := decodeListProjectPeopleResponse(resp) if err != nil { return res, errors.Wrap(err, "decode response") } @@ -6565,6 +7932,23 @@ func (c *Client) sendListProjectRepos(ctx context.Context, params ListProjectRep return res, errors.Wrap(err, "encode query") } } + { + // Encode "commitToken" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "commitToken", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.CommitToken.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } u.RawQuery = q.Values().Encode() r, err := ht.NewRequest(ctx, "GET", u) @@ -6642,25 +8026,197 @@ func (c *Client) ListProjects(ctx context.Context, params ListProjectsParams) (* return res, err } -func (c *Client) sendListProjects(ctx context.Context, params ListProjectsParams) (res *ListProjectsOutputBody, err error) { +func (c *Client) sendListProjects(ctx context.Context, params ListProjectsParams) (res *ListProjectsOutputBody, err error) { + + u := uri.Clone(c.requestURL(ctx)) + var pathParts [1]string + pathParts[0] = "/projects" + uri.AddPathParts(u, pathParts[:]...) + + q := uri.NewQueryEncoder() + { + // Encode "pageSize" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "pageSize", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.PageSize.Get(); ok { + return e.EncodeValue(conv.Int32ToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "pageToken" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "pageToken", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.PageToken.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "name" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "name", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.Name.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "commitToken" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "commitToken", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.CommitToken.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + u.RawQuery = q.Values().Encode() + + r, err := ht.NewRequest(ctx, "GET", u) + if err != nil { + return res, errors.Wrap(err, "create request") + } + + { + type bitset = [1]uint8 + var satisfied bitset + { + + switch err := c.securityBearerAuth(ctx, ListProjectsOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 0 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"BearerAuth\"") + } + } + { + + switch err := c.securitySessionAuth(ctx, ListProjectsOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 1 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"SessionAuth\"") + } + } + + if ok := func() bool { + nextRequirement: + for _, requirement := range []bitset{ + {0b00000001}, + {0b00000010}, + } { + for i, mask := range requirement { + if satisfied[i]&mask != mask { + continue nextRequirement + } + } + return true + } + return false + }(); !ok { + return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied + } + } + + resp, err := c.cfg.Client.Do(r) + if err != nil { + return res, errors.Wrap(err, "do request") + } + body := resp.Body + defer body.Close() + + result, err := decodeListProjectsResponse(resp) + if err != nil { + return res, errors.Wrap(err, "decode response") + } + + return result, nil +} + +// ListRepoCIBuilds invokes listRepoCIBuilds operation. +// +// List a repo's CI build statuses. +// +// GET /repos/{repoId}/ci-builds +func (c *Client) ListRepoCIBuilds(ctx context.Context, params ListRepoCIBuildsParams) (*ListRepoCIBuildsOutputBody, error) { + res, err := c.sendListRepoCIBuilds(ctx, params) + return res, err +} + +func (c *Client) sendListRepoCIBuilds(ctx context.Context, params ListRepoCIBuildsParams) (res *ListRepoCIBuildsOutputBody, err error) { u := uri.Clone(c.requestURL(ctx)) - var pathParts [1]string - pathParts[0] = "/projects" + var pathParts [3]string + pathParts[0] = "/repos/" + { + // Encode "repoId" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "repoId", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.RepoId)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[1] = encoded + } + pathParts[2] = "/ci-builds" uri.AddPathParts(u, pathParts[:]...) q := uri.NewQueryEncoder() { - // Encode "pageSize" parameter. + // Encode "commit" parameter. cfg := uri.QueryParameterEncodingConfig{ - Name: "pageSize", + Name: "commit", Style: uri.QueryStyleForm, Explode: false, } if err := q.EncodeParam(cfg, func(e uri.Encoder) error { - if val, ok := params.PageSize.Get(); ok { - return e.EncodeValue(conv.Int32ToString(val)) + if val, ok := params.Commit.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) } return nil }); err != nil { @@ -6668,15 +8224,15 @@ func (c *Client) sendListProjects(ctx context.Context, params ListProjectsParams } } { - // Encode "pageToken" parameter. + // Encode "pipeline" parameter. cfg := uri.QueryParameterEncodingConfig{ - Name: "pageToken", + Name: "pipeline", Style: uri.QueryStyleForm, Explode: false, } if err := q.EncodeParam(cfg, func(e uri.Encoder) error { - if val, ok := params.PageToken.Get(); ok { + if val, ok := params.Pipeline.Get(); ok { return e.EncodeValue(conv.StringToString(val)) } return nil @@ -6685,16 +8241,33 @@ func (c *Client) sendListProjects(ctx context.Context, params ListProjectsParams } } { - // Encode "name" parameter. + // Encode "build_number" parameter. cfg := uri.QueryParameterEncodingConfig{ - Name: "name", + Name: "build_number", Style: uri.QueryStyleForm, Explode: false, } if err := q.EncodeParam(cfg, func(e uri.Encoder) error { - if val, ok := params.Name.Get(); ok { - return e.EncodeValue(conv.StringToString(val)) + if val, ok := params.BuildNumber.Get(); ok { + return e.EncodeValue(conv.Int64ToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "limit" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "limit", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.Limit.Get(); ok { + return e.EncodeValue(conv.Int64ToString(val)) } return nil }); err != nil { @@ -6713,7 +8286,7 @@ func (c *Client) sendListProjects(ctx context.Context, params ListProjectsParams var satisfied bitset { - switch err := c.securityBearerAuth(ctx, ListProjectsOperation, r); { + switch err := c.securityBearerAuth(ctx, ListRepoCIBuildsOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 0 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -6724,7 +8297,7 @@ func (c *Client) sendListProjects(ctx context.Context, params ListProjectsParams } { - switch err := c.securitySessionAuth(ctx, ListProjectsOperation, r); { + switch err := c.securitySessionAuth(ctx, ListRepoCIBuildsOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 1 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -6760,7 +8333,7 @@ func (c *Client) sendListProjects(ctx context.Context, params ListProjectsParams body := resp.Body defer body.Close() - result, err := decodeListProjectsResponse(resp) + result, err := decodeListRepoCIBuildsResponse(resp) if err != nil { return res, errors.Wrap(err, "decode response") } @@ -6768,17 +8341,18 @@ func (c *Client) sendListProjects(ctx context.Context, params ListProjectsParams return result, nil } -// ListRepoCIBuilds invokes listRepoCIBuilds operation. +// ListRepoCIDeliveries invokes listRepoCIDeliveries operation. // -// List a repo's CI build statuses. +// Recent deliveries, newest first. direction=outbound (default) is what Entire sent the repo's CI +// when refs changed; direction=inbound is what that CI sent back. // -// GET /repos/{repoId}/ci-builds -func (c *Client) ListRepoCIBuilds(ctx context.Context, params ListRepoCIBuildsParams) (*ListRepoCIBuildsOutputBody, error) { - res, err := c.sendListRepoCIBuilds(ctx, params) +// GET /repos/{repoId}/ci-deliveries +func (c *Client) ListRepoCIDeliveries(ctx context.Context, params ListRepoCIDeliveriesParams) (*ListRepoCIDeliveriesOutputBody, error) { + res, err := c.sendListRepoCIDeliveries(ctx, params) return res, err } -func (c *Client) sendListRepoCIBuilds(ctx context.Context, params ListRepoCIBuildsParams) (res *ListRepoCIBuildsOutputBody, err error) { +func (c *Client) sendListRepoCIDeliveries(ctx context.Context, params ListRepoCIDeliveriesParams) (res *ListRepoCIDeliveriesOutputBody, err error) { u := uri.Clone(c.requestURL(ctx)) var pathParts [3]string @@ -6801,55 +8375,21 @@ func (c *Client) sendListRepoCIBuilds(ctx context.Context, params ListRepoCIBuil } pathParts[1] = encoded } - pathParts[2] = "/ci-builds" + pathParts[2] = "/ci-deliveries" uri.AddPathParts(u, pathParts[:]...) q := uri.NewQueryEncoder() { - // Encode "commit" parameter. - cfg := uri.QueryParameterEncodingConfig{ - Name: "commit", - Style: uri.QueryStyleForm, - Explode: false, - } - - if err := q.EncodeParam(cfg, func(e uri.Encoder) error { - if val, ok := params.Commit.Get(); ok { - return e.EncodeValue(conv.StringToString(val)) - } - return nil - }); err != nil { - return res, errors.Wrap(err, "encode query") - } - } - { - // Encode "pipeline" parameter. - cfg := uri.QueryParameterEncodingConfig{ - Name: "pipeline", - Style: uri.QueryStyleForm, - Explode: false, - } - - if err := q.EncodeParam(cfg, func(e uri.Encoder) error { - if val, ok := params.Pipeline.Get(); ok { - return e.EncodeValue(conv.StringToString(val)) - } - return nil - }); err != nil { - return res, errors.Wrap(err, "encode query") - } - } - { - // Encode "build_number" parameter. + // Encode "direction" parameter. cfg := uri.QueryParameterEncodingConfig{ - Name: "build_number", + Name: "direction", Style: uri.QueryStyleForm, Explode: false, } if err := q.EncodeParam(cfg, func(e uri.Encoder) error { - if val, ok := params.BuildNumber.Get(); ok { - return e.EncodeValue(conv.Int64ToString(val)) + if val, ok := params.Direction.Get(); ok { + return e.EncodeValue(conv.StringToString(string(val))) } return nil }); err != nil { @@ -6885,7 +8425,7 @@ func (c *Client) sendListRepoCIBuilds(ctx context.Context, params ListRepoCIBuil var satisfied bitset { - switch err := c.securityBearerAuth(ctx, ListRepoCIBuildsOperation, r); { + switch err := c.securityBearerAuth(ctx, ListRepoCIDeliveriesOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 0 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -6896,7 +8436,7 @@ func (c *Client) sendListRepoCIBuilds(ctx context.Context, params ListRepoCIBuil } { - switch err := c.securitySessionAuth(ctx, ListRepoCIBuildsOperation, r); { + switch err := c.securitySessionAuth(ctx, ListRepoCIDeliveriesOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 1 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -6932,7 +8472,7 @@ func (c *Client) sendListRepoCIBuilds(ctx context.Context, params ListRepoCIBuil body := resp.Body defer body.Close() - result, err := decodeListRepoCIBuildsResponse(resp) + result, err := decodeListRepoCIDeliveriesResponse(resp) if err != nil { return res, errors.Wrap(err, "decode response") } @@ -7673,7 +9213,143 @@ func (c *Client) sendListRepoLanguageFacets(ctx context.Context, params ListRepo } { - switch err := c.securitySessionAuth(ctx, ListRepoLanguageFacetsOperation, r); { + switch err := c.securitySessionAuth(ctx, ListRepoLanguageFacetsOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 1 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"SessionAuth\"") + } + } + + if ok := func() bool { + nextRequirement: + for _, requirement := range []bitset{ + {0b00000001}, + {0b00000010}, + } { + for i, mask := range requirement { + if satisfied[i]&mask != mask { + continue nextRequirement + } + } + return true + } + return false + }(); !ok { + return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied + } + } + + resp, err := c.cfg.Client.Do(r) + if err != nil { + return res, errors.Wrap(err, "do request") + } + body := resp.Body + defer body.Close() + + result, err := decodeListRepoLanguageFacetsResponse(resp) + if err != nil { + return res, errors.Wrap(err, "decode response") + } + + return result, nil +} + +// ListRepoOrgFacets invokes listRepoOrgFacets operation. +// +// List repository org facets. +// +// GET /repos/facets/orgs +func (c *Client) ListRepoOrgFacets(ctx context.Context, params ListRepoOrgFacetsParams) (*RepoFacetPage, error) { + res, err := c.sendListRepoOrgFacets(ctx, params) + return res, err +} + +func (c *Client) sendListRepoOrgFacets(ctx context.Context, params ListRepoOrgFacetsParams) (res *RepoFacetPage, err error) { + + u := uri.Clone(c.requestURL(ctx)) + var pathParts [1]string + pathParts[0] = "/repos/facets/orgs" + uri.AddPathParts(u, pathParts[:]...) + + q := uri.NewQueryEncoder() + { + // Encode "pageSize" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "pageSize", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.PageSize.Get(); ok { + return e.EncodeValue(conv.Int32ToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "pageToken" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "pageToken", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.PageToken.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "q" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "q", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.Q.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + u.RawQuery = q.Values().Encode() + + r, err := ht.NewRequest(ctx, "GET", u) + if err != nil { + return res, errors.Wrap(err, "create request") + } + + { + type bitset = [1]uint8 + var satisfied bitset + { + + switch err := c.securityBearerAuth(ctx, ListRepoOrgFacetsOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 0 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"BearerAuth\"") + } + } + { + + switch err := c.securitySessionAuth(ctx, ListRepoOrgFacetsOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 1 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -7709,7 +9385,7 @@ func (c *Client) sendListRepoLanguageFacets(ctx context.Context, params ListRepo body := resp.Body defer body.Close() - result, err := decodeListRepoLanguageFacetsResponse(resp) + result, err := decodeListRepoOrgFacetsResponse(resp) if err != nil { return res, errors.Wrap(err, "decode response") } @@ -7717,21 +9393,44 @@ func (c *Client) sendListRepoLanguageFacets(ctx context.Context, params ListRepo return result, nil } -// ListRepoOrgFacets invokes listRepoOrgFacets operation. +// ListRepoPeople invokes listRepoPeople operation. // -// List repository org facets. +// Returns one account per row with its effective role and merged access sources. Grant managers also +// receive the mutable direct grant. Search and role filters run before cursor pagination. Results +// are ordered by effective role (owner, admin, mirror_source_admin, writer, reader, member), then by +// handle without the provider prefix, ignoring case, then by account ID. Accounts without a handle +// come last within their role. // -// GET /repos/facets/orgs -func (c *Client) ListRepoOrgFacets(ctx context.Context, params ListRepoOrgFacetsParams) (*RepoFacetPage, error) { - res, err := c.sendListRepoOrgFacets(ctx, params) +// GET /repos/{repoId}/people +func (c *Client) ListRepoPeople(ctx context.Context, params ListRepoPeopleParams) (*ResourcePeopleOutputBody, error) { + res, err := c.sendListRepoPeople(ctx, params) return res, err } -func (c *Client) sendListRepoOrgFacets(ctx context.Context, params ListRepoOrgFacetsParams) (res *RepoFacetPage, err error) { +func (c *Client) sendListRepoPeople(ctx context.Context, params ListRepoPeopleParams) (res *ResourcePeopleOutputBody, err error) { u := uri.Clone(c.requestURL(ctx)) - var pathParts [1]string - pathParts[0] = "/repos/facets/orgs" + var pathParts [3]string + pathParts[0] = "/repos/" + { + // Encode "repoId" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "repoId", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.RepoId)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[1] = encoded + } + pathParts[2] = "/people" uri.AddPathParts(u, pathParts[:]...) q := uri.NewQueryEncoder() @@ -7770,15 +9469,15 @@ func (c *Client) sendListRepoOrgFacets(ctx context.Context, params ListRepoOrgFa } } { - // Encode "q" parameter. + // Encode "search" parameter. cfg := uri.QueryParameterEncodingConfig{ - Name: "q", + Name: "search", Style: uri.QueryStyleForm, Explode: false, } if err := q.EncodeParam(cfg, func(e uri.Encoder) error { - if val, ok := params.Q.Get(); ok { + if val, ok := params.Search.Get(); ok { return e.EncodeValue(conv.StringToString(val)) } return nil @@ -7786,6 +9485,23 @@ func (c *Client) sendListRepoOrgFacets(ctx context.Context, params ListRepoOrgFa return res, errors.Wrap(err, "encode query") } } + { + // Encode "role" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "role", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.Role.Get(); ok { + return e.EncodeValue(conv.StringToString(string(val))) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } u.RawQuery = q.Values().Encode() r, err := ht.NewRequest(ctx, "GET", u) @@ -7798,7 +9514,7 @@ func (c *Client) sendListRepoOrgFacets(ctx context.Context, params ListRepoOrgFa var satisfied bitset { - switch err := c.securityBearerAuth(ctx, ListRepoOrgFacetsOperation, r); { + switch err := c.securityBearerAuth(ctx, ListRepoPeopleOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 0 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -7809,7 +9525,7 @@ func (c *Client) sendListRepoOrgFacets(ctx context.Context, params ListRepoOrgFa } { - switch err := c.securitySessionAuth(ctx, ListRepoOrgFacetsOperation, r); { + switch err := c.securitySessionAuth(ctx, ListRepoPeopleOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 1 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -7845,7 +9561,7 @@ func (c *Client) sendListRepoOrgFacets(ctx context.Context, params ListRepoOrgFa body := resp.Body defer body.Close() - result, err := decodeListRepoOrgFacetsResponse(resp) + result, err := decodeListRepoPeopleResponse(resp) if err != nil { return res, errors.Wrap(err, "decode response") } @@ -7939,6 +9655,23 @@ func (c *Client) sendListRepos(ctx context.Context, params ListReposParams) (res return res, errors.Wrap(err, "encode query") } } + { + // Encode "commitToken" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "commitToken", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.CommitToken.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } { // Encode "sort" parameter. cfg := uri.QueryParameterEncodingConfig{ @@ -8075,6 +9808,23 @@ func (c *Client) sendListRepos(ctx context.Context, params ListReposParams) (res return res, errors.Wrap(err, "encode query") } } + { + // Encode "projectId" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "projectId", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + if val, ok := params.ProjectId.Get(); ok { + return e.EncodeValue(conv.StringToString(val)) + } + return nil + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } { // Encode "status" parameter. cfg := uri.QueryParameterEncodingConfig{ @@ -8732,6 +10482,91 @@ func (c *Client) sendPatchRepoCIWebhook(ctx context.Context, request *PatchRepoC return result, nil } +// PreviewInvitation invokes previewInvitation operation. +// +// Preview an organization invitation. +// +// POST /invitations/preview +func (c *Client) PreviewInvitation(ctx context.Context, request *PreviewInvitationInputBody) (*PreviewInvitationOKHeaders, error) { + res, err := c.sendPreviewInvitation(ctx, request) + return res, err +} + +func (c *Client) sendPreviewInvitation(ctx context.Context, request *PreviewInvitationInputBody) (res *PreviewInvitationOKHeaders, err error) { + + u := uri.Clone(c.requestURL(ctx)) + var pathParts [1]string + pathParts[0] = "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/invitations/preview" + uri.AddPathParts(u, pathParts[:]...) + + r, err := ht.NewRequest(ctx, "POST", u) + if err != nil { + return res, errors.Wrap(err, "create request") + } + if err := encodePreviewInvitationRequest(request, r); err != nil { + return res, errors.Wrap(err, "encode request") + } + + { + type bitset = [1]uint8 + var satisfied bitset + { + + switch err := c.securityBearerAuth(ctx, PreviewInvitationOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 0 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"BearerAuth\"") + } + } + { + + switch err := c.securitySessionAuth(ctx, PreviewInvitationOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 1 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"SessionAuth\"") + } + } + + if ok := func() bool { + nextRequirement: + for _, requirement := range []bitset{ + {0b00000001}, + {0b00000010}, + } { + for i, mask := range requirement { + if satisfied[i]&mask != mask { + continue nextRequirement + } + } + return true + } + return false + }(); !ok { + return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied + } + } + + resp, err := c.cfg.Client.Do(r) + if err != nil { + return res, errors.Wrap(err, "do request") + } + body := resp.Body + defer body.Close() + + result, err := decodePreviewInvitationResponse(resp) + if err != nil { + return res, errors.Wrap(err, "decode response") + } + + return result, nil +} + // RegisterOrgCIBuildkiteCluster invokes registerOrgCIBuildkiteCluster operation. // // Register or update a Buildkite hosted cluster for an org. @@ -9132,28 +10967,149 @@ func (c *Client) sendResolveMirrorPlacements(ctx context.Context, params Resolve Style: uri.QueryStyleForm, Explode: false, } - - if err := q.EncodeParam(cfg, func(e uri.Encoder) error { - return e.EncodeValue(conv.StringToString(params.Owner)) - }); err != nil { - return res, errors.Wrap(err, "encode query") + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + return e.EncodeValue(conv.StringToString(params.Owner)) + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + { + // Encode "repo" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "repo", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + return e.EncodeValue(conv.StringToString(params.Repo)) + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } + u.RawQuery = q.Values().Encode() + + r, err := ht.NewRequest(ctx, "GET", u) + if err != nil { + return res, errors.Wrap(err, "create request") + } + + { + type bitset = [1]uint8 + var satisfied bitset + { + + switch err := c.securityBearerAuth(ctx, ResolveMirrorPlacementsOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 0 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"BearerAuth\"") + } + } + { + + switch err := c.securitySessionAuth(ctx, ResolveMirrorPlacementsOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 1 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"SessionAuth\"") + } + } + + if ok := func() bool { + nextRequirement: + for _, requirement := range []bitset{ + {0b00000001}, + {0b00000010}, + } { + for i, mask := range requirement { + if satisfied[i]&mask != mask { + continue nextRequirement + } + } + return true + } + return false + }(); !ok { + return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied + } + } + + resp, err := c.cfg.Client.Do(r) + if err != nil { + return res, errors.Wrap(err, "do request") + } + body := resp.Body + defer body.Close() + + result, err := decodeResolveMirrorPlacementsResponse(resp) + if err != nil { + return res, errors.Wrap(err, "decode response") + } + + return result, nil +} + +// ResolveProject invokes resolveProject operation. +// +// Case-insensitive lookup by native project name (et) or GitHub owner namespace (gh). Uses project +// inspect permission, including platform administrators. Missing and inaccessible projects both +// return 404. +// +// GET /projects/resolve/{host}/{project} +func (c *Client) ResolveProject(ctx context.Context, params ResolveProjectParams) (*ResolveProjectOutputBody, error) { + res, err := c.sendResolveProject(ctx, params) + return res, err +} + +func (c *Client) sendResolveProject(ctx context.Context, params ResolveProjectParams) (res *ResolveProjectOutputBody, err error) { + + u := uri.Clone(c.requestURL(ctx)) + var pathParts [4]string + pathParts[0] = "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/projects/resolve/" + { + // Encode "host" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "host", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(string(params.Host))) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") } + pathParts[1] = encoded } + pathParts[2] = "/" { - // Encode "repo" parameter. - cfg := uri.QueryParameterEncodingConfig{ - Name: "repo", - Style: uri.QueryStyleForm, + // Encode "project" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "project", + Style: uri.PathStyleSimple, Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.Project)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") } - - if err := q.EncodeParam(cfg, func(e uri.Encoder) error { - return e.EncodeValue(conv.StringToString(params.Repo)) - }); err != nil { - return res, errors.Wrap(err, "encode query") + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") } + pathParts[3] = encoded } - u.RawQuery = q.Values().Encode() + uri.AddPathParts(u, pathParts[:]...) r, err := ht.NewRequest(ctx, "GET", u) if err != nil { @@ -9165,7 +11121,7 @@ func (c *Client) sendResolveMirrorPlacements(ctx context.Context, params Resolve var satisfied bitset { - switch err := c.securityBearerAuth(ctx, ResolveMirrorPlacementsOperation, r); { + switch err := c.securityBearerAuth(ctx, ResolveProjectOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 0 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -9176,7 +11132,7 @@ func (c *Client) sendResolveMirrorPlacements(ctx context.Context, params Resolve } { - switch err := c.securitySessionAuth(ctx, ResolveMirrorPlacementsOperation, r); { + switch err := c.securitySessionAuth(ctx, ResolveProjectOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 1 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -9212,7 +11168,7 @@ func (c *Client) sendResolveMirrorPlacements(ctx context.Context, params Resolve body := resp.Body defer body.Close() - result, err := decodeResolveMirrorPlacementsResponse(resp) + result, err := decodeResolveProjectResponse(resp) if err != nil { return res, errors.Wrap(err, "decode response") } @@ -9390,6 +11346,125 @@ func (c *Client) sendResolveRepos(ctx context.Context, request *ResolveReposInpu return result, nil } +// RevokeOrgInvitation invokes revokeOrgInvitation operation. +// +// Revoke an organization invitation. +// +// DELETE /orgs/{orgId}/invitations/{id} +func (c *Client) RevokeOrgInvitation(ctx context.Context, params RevokeOrgInvitationParams) error { + _, err := c.sendRevokeOrgInvitation(ctx, params) + return err +} + +func (c *Client) sendRevokeOrgInvitation(ctx context.Context, params RevokeOrgInvitationParams) (res *RevokeOrgInvitationNoContent, err error) { + + u := uri.Clone(c.requestURL(ctx)) + var pathParts [4]string + pathParts[0] = "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/orgs/" + { + // Encode "orgId" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "orgId", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.OrgId)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[1] = encoded + } + pathParts[2] = "/invitations/" + { + // Encode "id" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "id", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.ID)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[3] = encoded + } + uri.AddPathParts(u, pathParts[:]...) + + r, err := ht.NewRequest(ctx, "DELETE", u) + if err != nil { + return res, errors.Wrap(err, "create request") + } + + { + type bitset = [1]uint8 + var satisfied bitset + { + + switch err := c.securityBearerAuth(ctx, RevokeOrgInvitationOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 0 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"BearerAuth\"") + } + } + { + + switch err := c.securitySessionAuth(ctx, RevokeOrgInvitationOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 1 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"SessionAuth\"") + } + } + + if ok := func() bool { + nextRequirement: + for _, requirement := range []bitset{ + {0b00000001}, + {0b00000010}, + } { + for i, mask := range requirement { + if satisfied[i]&mask != mask { + continue nextRequirement + } + } + return true + } + return false + }(); !ok { + return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied + } + } + + resp, err := c.cfg.Client.Do(r) + if err != nil { + return res, errors.Wrap(err, "do request") + } + body := resp.Body + defer body.Close() + + result, err := decodeRevokeOrgInvitationResponse(resp) + if err != nil { + return res, errors.Wrap(err, "decode response") + } + + return result, nil +} + // RevokeProjectAccess invokes revokeProjectAccess operation. // // Revoke project access by grantee id. @@ -10511,3 +12586,125 @@ func (c *Client) sendUpdateBranchProtection(ctx context.Context, request *Update return result, nil } + +// UpdateOrgMemberRole invokes updateOrgMemberRole operation. +// +// Update an organization member's role. +// +// PATCH /orgs/{orgId}/members/{membershipId} +func (c *Client) UpdateOrgMemberRole(ctx context.Context, request *UpdateOrgMemberRoleInputBody, params UpdateOrgMemberRoleParams) (*Membership, error) { + res, err := c.sendUpdateOrgMemberRole(ctx, request, params) + return res, err +} + +func (c *Client) sendUpdateOrgMemberRole(ctx context.Context, request *UpdateOrgMemberRoleInputBody, params UpdateOrgMemberRoleParams) (res *Membership, err error) { + + u := uri.Clone(c.requestURL(ctx)) + var pathParts [4]string + pathParts[0] = "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/orgs/" + { + // Encode "orgId" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "orgId", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.OrgId)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[1] = encoded + } + pathParts[2] = "/members/" + { + // Encode "membershipId" parameter. + e := uri.NewPathEncoder(uri.PathEncoderConfig{ + Param: "membershipId", + Style: uri.PathStyleSimple, + Explode: false, + }) + if err := func() error { + return e.EncodeValue(conv.StringToString(params.MembershipId)) + }(); err != nil { + return res, errors.Wrap(err, "encode path") + } + encoded, err := e.Result() + if err != nil { + return res, errors.Wrap(err, "encode path") + } + pathParts[3] = encoded + } + uri.AddPathParts(u, pathParts[:]...) + + r, err := ht.NewRequest(ctx, "PATCH", u) + if err != nil { + return res, errors.Wrap(err, "create request") + } + if err := encodeUpdateOrgMemberRoleRequest(request, r); err != nil { + return res, errors.Wrap(err, "encode request") + } + + { + type bitset = [1]uint8 + var satisfied bitset + { + + switch err := c.securityBearerAuth(ctx, UpdateOrgMemberRoleOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 0 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"BearerAuth\"") + } + } + { + + switch err := c.securitySessionAuth(ctx, UpdateOrgMemberRoleOperation, r); { + case err == nil: // if NO error + satisfied[0] |= 1 << 1 + case errors.Is(err, ogenerrors.ErrSkipClientSecurity): + // Skip this security. + default: + return res, errors.Wrap(err, "security \"SessionAuth\"") + } + } + + if ok := func() bool { + nextRequirement: + for _, requirement := range []bitset{ + {0b00000001}, + {0b00000010}, + } { + for i, mask := range requirement { + if satisfied[i]&mask != mask { + continue nextRequirement + } + } + return true + } + return false + }(); !ok { + return res, ogenerrors.ErrSecurityRequirementIsNotSatisfied + } + } + + resp, err := c.cfg.Client.Do(r) + if err != nil { + return res, errors.Wrap(err, "do request") + } + body := resp.Body + defer body.Close() + + result, err := decodeUpdateOrgMemberRoleResponse(resp) + if err != nil { + return res, errors.Wrap(err, "decode response") + } + + return result, nil +} diff --git a/internal/coreapi/oas_defaults_gen.go b/internal/coreapi/oas_defaults_gen.go index 70caf34852..a5b438a408 100644 --- a/internal/coreapi/oas_defaults_gen.go +++ b/internal/coreapi/oas_defaults_gen.go @@ -16,25 +16,25 @@ func (s *AddOrgMemberInputBody) setDefaults() { } // setDefaults set default value of fields. -func (s *ErrorModel) setDefaults() { +func (s *CreateOrgInvitationInputBody) setDefaults() { { - val, _ := json.DecodeURI(jx.DecodeStr("\"about:blank\"")) - s.Type.SetTo(val) + val := CreateOrgInvitationInputBodyRole("member") + s.Role = val } } // setDefaults set default value of fields. -func (s *GrantProjectAccessInputBody) setDefaults() { +func (s *ErrorModel) setDefaults() { { - val := GrantProjectAccessInputBodyGranteeType("account") - s.GranteeType.SetTo(val) + val, _ := json.DecodeURI(jx.DecodeStr("\"about:blank\"")) + s.Type.SetTo(val) } } // setDefaults set default value of fields. -func (s *GrantRepoAccessInputBody) setDefaults() { +func (s *GrantAccessBody) setDefaults() { { - val := GrantRepoAccessInputBodyGranteeType("account") + val := GrantAccessBodyGranteeType("account") s.GranteeType.SetTo(val) } } diff --git a/internal/coreapi/oas_interfaces_gen.go b/internal/coreapi/oas_interfaces_gen.go new file mode 100644 index 0000000000..5860d6c8e4 --- /dev/null +++ b/internal/coreapi/oas_interfaces_gen.go @@ -0,0 +1,10 @@ +// Code generated by ogen, DO NOT EDIT. +package coreapi + +type AcceptInvitationRes interface { + acceptInvitationRes() +} + +type CreateOrgInvitationRes interface { + createOrgInvitationRes() +} diff --git a/internal/coreapi/oas_json_gen.go b/internal/coreapi/oas_json_gen.go index db56351ae1..892871cb06 100644 --- a/internal/coreapi/oas_json_gen.go +++ b/internal/coreapi/oas_json_gen.go @@ -14,14 +14,14 @@ import ( ) // Encode implements json.Marshaler. -func (s *AddOrgMemberInputBody) Encode(e *jx.Encoder) { +func (s *AcceptInvitationInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *AddOrgMemberInputBody) encodeFields(e *jx.Encoder) { +func (s *AcceptInvitationInputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -29,18 +29,8 @@ func (s *AddOrgMemberInputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("provider") - e.Str(s.Provider) - } - { - e.FieldStart("providerUserId") - e.Str(s.ProviderUserId) - } - { - if s.Role.Set { - e.FieldStart("role") - s.Role.Encode(e) - } + e.FieldStart("token") + e.Str(s.Token) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -51,20 +41,17 @@ func (s *AddOrgMemberInputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfAddOrgMemberInputBody = [4]string{ +var jsonFieldsNameOfAcceptInvitationInputBody = [2]string{ 0: "$schema", - 1: "provider", - 2: "providerUserId", - 3: "role", + 1: "token", } -// Decode decodes AddOrgMemberInputBody from json. -func (s *AddOrgMemberInputBody) Decode(d *jx.Decoder) error { +// Decode decodes AcceptInvitationInputBody from json. +func (s *AcceptInvitationInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode AddOrgMemberInputBody to nil") + return errors.New("invalid: unable to decode AcceptInvitationInputBody to nil") } var requiredBitSet [1]uint8 - s.setDefaults() s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -79,39 +66,17 @@ func (s *AddOrgMemberInputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "provider": + case "token": requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.Provider = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"provider\"") - } - case "providerUserId": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.ProviderUserId = string(v) + s.Token = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"providerUserId\"") - } - case "role": - if err := func() error { - s.Role.Reset() - if err := s.Role.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"role\"") + return errors.Wrap(err, "decode field \"token\"") } default: var elem jx.Raw @@ -129,12 +94,12 @@ func (s *AddOrgMemberInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode AddOrgMemberInputBody") + return errors.Wrap(err, "decode AcceptInvitationInputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000110, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -146,8 +111,8 @@ func (s *AddOrgMemberInputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfAddOrgMemberInputBody) { - name = jsonFieldsNameOfAddOrgMemberInputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfAcceptInvitationInputBody) { + name = jsonFieldsNameOfAcceptInvitationInputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -168,27 +133,27 @@ func (s *AddOrgMemberInputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *AddOrgMemberInputBody) MarshalJSON() ([]byte, error) { +func (s *AcceptInvitationInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *AddOrgMemberInputBody) UnmarshalJSON(data []byte) error { +func (s *AcceptInvitationInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s AddOrgMemberInputBodyAdditional) Encode(e *jx.Encoder) { +func (s AcceptInvitationInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s AddOrgMemberInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s AcceptInvitationInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -198,10 +163,10 @@ func (s AddOrgMemberInputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes AddOrgMemberInputBodyAdditional from json. -func (s *AddOrgMemberInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes AcceptInvitationInputBodyAdditional from json. +func (s *AcceptInvitationInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode AddOrgMemberInputBodyAdditional to nil") + return errors.New("invalid: unable to decode AcceptInvitationInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -219,103 +184,45 @@ func (s *AddOrgMemberInputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode AddOrgMemberInputBodyAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s AddOrgMemberInputBodyAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *AddOrgMemberInputBodyAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes AddOrgMemberInputBodyRole as json. -func (s AddOrgMemberInputBodyRole) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes AddOrgMemberInputBodyRole from json. -func (s *AddOrgMemberInputBodyRole) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode AddOrgMemberInputBodyRole to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch AddOrgMemberInputBodyRole(v) { - case AddOrgMemberInputBodyRoleOwner: - *s = AddOrgMemberInputBodyRoleOwner - case AddOrgMemberInputBodyRoleAdmin: - *s = AddOrgMemberInputBodyRoleAdmin - case AddOrgMemberInputBodyRoleMember: - *s = AddOrgMemberInputBodyRoleMember - default: - *s = AddOrgMemberInputBodyRole(v) + return errors.Wrap(err, "decode AcceptInvitationInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s AddOrgMemberInputBodyRole) MarshalJSON() ([]byte, error) { +func (s AcceptInvitationInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *AddOrgMemberInputBodyRole) UnmarshalJSON(data []byte) error { +func (s *AcceptInvitationInputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *AuditEvent) Encode(e *jx.Encoder) { +func (s *AcceptInvitationOK) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *AuditEvent) encodeFields(e *jx.Encoder) { - { - e.FieldStart("actorId") - e.Str(s.ActorId) - } - { - e.FieldStart("eventType") - e.Str(s.EventType) - } - { - e.FieldStart("id") - e.Str(s.ID) - } +func (s *AcceptInvitationOK) encodeFields(e *jx.Encoder) { { - if s.IpAddress.Set { - e.FieldStart("ipAddress") - s.IpAddress.Encode(e) - } + e.FieldStart("membership") + s.Membership.Encode(e) } { - if s.Metadata.Set { - e.FieldStart("metadata") - s.Metadata.Encode(e) - } + e.FieldStart("orgId") + e.Str(s.OrgId) } { - e.FieldStart("occurredAt") - json.EncodeDateTime(e, s.OccurredAt) + e.FieldStart("orgName") + e.Str(s.OrgName) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -326,92 +233,55 @@ func (s *AuditEvent) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfAuditEvent = [6]string{ - 0: "actorId", - 1: "eventType", - 2: "id", - 3: "ipAddress", - 4: "metadata", - 5: "occurredAt", +var jsonFieldsNameOfAcceptInvitationOK = [3]string{ + 0: "membership", + 1: "orgId", + 2: "orgName", } -// Decode decodes AuditEvent from json. -func (s *AuditEvent) Decode(d *jx.Decoder) error { +// Decode decodes AcceptInvitationOK from json. +func (s *AcceptInvitationOK) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode AuditEvent to nil") + return errors.New("invalid: unable to decode AcceptInvitationOK to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "actorId": + case "membership": requiredBitSet[0] |= 1 << 0 if err := func() error { - v, err := d.Str() - s.ActorId = string(v) - if err != nil { + if err := s.Membership.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"actorId\"") + return errors.Wrap(err, "decode field \"membership\"") } - case "eventType": + case "orgId": requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.EventType = string(v) + s.OrgId = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"eventType\"") + return errors.Wrap(err, "decode field \"orgId\"") } - case "id": + case "orgName": requiredBitSet[0] |= 1 << 2 if err := func() error { v, err := d.Str() - s.ID = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"id\"") - } - case "ipAddress": - if err := func() error { - s.IpAddress.Reset() - if err := s.IpAddress.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"ipAddress\"") - } - case "metadata": - if err := func() error { - s.Metadata.Reset() - if err := s.Metadata.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"metadata\"") - } - case "occurredAt": - requiredBitSet[0] |= 1 << 5 - if err := func() error { - v, err := json.DecodeDateTime(d) - s.OccurredAt = v + s.OrgName = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"occurredAt\"") + return errors.Wrap(err, "decode field \"orgName\"") } default: var elem jx.Raw @@ -429,12 +299,12 @@ func (s *AuditEvent) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode AuditEvent") + return errors.Wrap(err, "decode AcceptInvitationOK") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00100111, + 0b00000111, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -446,8 +316,8 @@ func (s *AuditEvent) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfAuditEvent) { - name = jsonFieldsNameOfAuditEvent[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfAcceptInvitationOK) { + name = jsonFieldsNameOfAcceptInvitationOK[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -468,85 +338,27 @@ func (s *AuditEvent) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *AuditEvent) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *AuditEvent) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode implements json.Marshaler. -func (s AuditEventAdditional) Encode(e *jx.Encoder) { - e.ObjStart() - s.encodeFields(e) - e.ObjEnd() -} - -// encodeFields implements json.Marshaler. -func (s AuditEventAdditional) encodeFields(e *jx.Encoder) { - for k, elem := range s { - e.FieldStart(k) - - if len(elem) != 0 { - e.Raw(elem) - } - } -} - -// Decode decodes AuditEventAdditional from json. -func (s *AuditEventAdditional) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode AuditEventAdditional to nil") - } - m := s.init() - if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { - var elem jx.Raw - if err := func() error { - v, err := d.RawAppend(nil) - elem = jx.Raw(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrapf(err, "decode field %q", k) - } - m[string(k)] = elem - return nil - }); err != nil { - return errors.Wrap(err, "decode AuditEventAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s AuditEventAdditional) MarshalJSON() ([]byte, error) { +func (s *AcceptInvitationOK) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *AuditEventAdditional) UnmarshalJSON(data []byte) error { +func (s *AcceptInvitationOK) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s AuditEventMetadata) Encode(e *jx.Encoder) { +func (s AcceptInvitationOKAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s AuditEventMetadata) encodeFields(e *jx.Encoder) { +func (s AcceptInvitationOKAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -556,10 +368,10 @@ func (s AuditEventMetadata) encodeFields(e *jx.Encoder) { } } -// Decode decodes AuditEventMetadata from json. -func (s *AuditEventMetadata) Decode(d *jx.Decoder) error { +// Decode decodes AcceptInvitationOKAdditional from json. +func (s *AcceptInvitationOKAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode AuditEventMetadata to nil") + return errors.New("invalid: unable to decode AcceptInvitationOKAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -577,67 +389,51 @@ func (s *AuditEventMetadata) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode AuditEventMetadata") + return errors.Wrap(err, "decode AcceptInvitationOKAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s AuditEventMetadata) MarshalJSON() ([]byte, error) { +func (s AcceptInvitationOKAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *AuditEventMetadata) UnmarshalJSON(data []byte) error { +func (s *AcceptInvitationOKAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *AvailableMirror) Encode(e *jx.Encoder) { +func (s *AcceptedInvitation) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *AvailableMirror) encodeFields(e *jx.Encoder) { - { - e.FieldStart("access") - s.Access.Encode(e) - } - { - if s.IsArchived.Set { - e.FieldStart("isArchived") - s.IsArchived.Encode(e) - } - } +func (s *AcceptedInvitation) encodeFields(e *jx.Encoder) { { - if s.IsPrivate.Set { - e.FieldStart("isPrivate") - s.IsPrivate.Encode(e) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) } } { - e.FieldStart("owner") - e.Str(s.Owner) - } - { - if s.PushedAt.Set { - e.FieldStart("pushedAt") - s.PushedAt.Encode(e, json.EncodeDateTime) - } + e.FieldStart("membership") + s.Membership.Encode(e) } { - e.FieldStart("repo") - e.Str(s.Repo) + e.FieldStart("orgId") + e.Str(s.OrgId) } { - e.FieldStart("status") - s.Status.Encode(e) + e.FieldStart("orgName") + e.Str(s.OrgName) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -648,99 +444,66 @@ func (s *AvailableMirror) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfAvailableMirror = [7]string{ - 0: "access", - 1: "isArchived", - 2: "isPrivate", - 3: "owner", - 4: "pushedAt", - 5: "repo", - 6: "status", +var jsonFieldsNameOfAcceptedInvitation = [4]string{ + 0: "$schema", + 1: "membership", + 2: "orgId", + 3: "orgName", } -// Decode decodes AvailableMirror from json. -func (s *AvailableMirror) Decode(d *jx.Decoder) error { +// Decode decodes AcceptedInvitation from json. +func (s *AcceptedInvitation) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode AvailableMirror to nil") + return errors.New("invalid: unable to decode AcceptedInvitation to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "access": - requiredBitSet[0] |= 1 << 0 - if err := func() error { - if err := s.Access.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"access\"") - } - case "isArchived": + case "$schema": if err := func() error { - s.IsArchived.Reset() - if err := s.IsArchived.Decode(d); err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"isArchived\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "isPrivate": + case "membership": + requiredBitSet[0] |= 1 << 1 if err := func() error { - s.IsPrivate.Reset() - if err := s.IsPrivate.Decode(d); err != nil { + if err := s.Membership.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"isPrivate\"") + return errors.Wrap(err, "decode field \"membership\"") } - case "owner": - requiredBitSet[0] |= 1 << 3 + case "orgId": + requiredBitSet[0] |= 1 << 2 if err := func() error { v, err := d.Str() - s.Owner = string(v) + s.OrgId = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"owner\"") - } - case "pushedAt": - if err := func() error { - s.PushedAt.Reset() - if err := s.PushedAt.Decode(d, json.DecodeDateTime); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"pushedAt\"") + return errors.Wrap(err, "decode field \"orgId\"") } - case "repo": - requiredBitSet[0] |= 1 << 5 + case "orgName": + requiredBitSet[0] |= 1 << 3 if err := func() error { v, err := d.Str() - s.Repo = string(v) + s.OrgName = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"repo\"") - } - case "status": - requiredBitSet[0] |= 1 << 6 - if err := func() error { - if err := s.Status.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"status\"") + return errors.Wrap(err, "decode field \"orgName\"") } default: var elem jx.Raw @@ -758,12 +521,12 @@ func (s *AvailableMirror) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode AvailableMirror") + return errors.Wrap(err, "decode AcceptedInvitation") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b01101001, + 0b00001110, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -775,8 +538,8 @@ func (s *AvailableMirror) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfAvailableMirror) { - name = jsonFieldsNameOfAvailableMirror[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfAcceptedInvitation) { + name = jsonFieldsNameOfAcceptedInvitation[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -797,69 +560,27 @@ func (s *AvailableMirror) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *AvailableMirror) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *AvailableMirror) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes AvailableMirrorAccess as json. -func (s AvailableMirrorAccess) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes AvailableMirrorAccess from json. -func (s *AvailableMirrorAccess) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode AvailableMirrorAccess to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch AvailableMirrorAccess(v) { - case AvailableMirrorAccessRead: - *s = AvailableMirrorAccessRead - case AvailableMirrorAccessWrite: - *s = AvailableMirrorAccessWrite - case AvailableMirrorAccessAdmin: - *s = AvailableMirrorAccessAdmin - default: - *s = AvailableMirrorAccess(v) - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s AvailableMirrorAccess) MarshalJSON() ([]byte, error) { +func (s *AcceptedInvitation) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *AvailableMirrorAccess) UnmarshalJSON(data []byte) error { +func (s *AcceptedInvitation) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s AvailableMirrorAdditional) Encode(e *jx.Encoder) { +func (s AcceptedInvitationAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s AvailableMirrorAdditional) encodeFields(e *jx.Encoder) { +func (s AcceptedInvitationAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -869,10 +590,10 @@ func (s AvailableMirrorAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes AvailableMirrorAdditional from json. -func (s *AvailableMirrorAdditional) Decode(d *jx.Decoder) error { +// Decode decodes AcceptedInvitationAdditional from json. +func (s *AcceptedInvitationAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode AvailableMirrorAdditional to nil") + return errors.New("invalid: unable to decode AcceptedInvitationAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -890,76 +611,34 @@ func (s *AvailableMirrorAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode AvailableMirrorAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s AvailableMirrorAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *AvailableMirrorAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes AvailableMirrorStatus as json. -func (s AvailableMirrorStatus) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes AvailableMirrorStatus from json. -func (s *AvailableMirrorStatus) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode AvailableMirrorStatus to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch AvailableMirrorStatus(v) { - case AvailableMirrorStatusAvailable: - *s = AvailableMirrorStatusAvailable - case AvailableMirrorStatusMirrored: - *s = AvailableMirrorStatusMirrored - case AvailableMirrorStatusOwnerOnly: - *s = AvailableMirrorStatusOwnerOnly - default: - *s = AvailableMirrorStatus(v) + return errors.Wrap(err, "decode AcceptedInvitationAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s AvailableMirrorStatus) MarshalJSON() ([]byte, error) { +func (s AcceptedInvitationAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *AvailableMirrorStatus) UnmarshalJSON(data []byte) error { +func (s *AcceptedInvitationAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *Binding) Encode(e *jx.Encoder) { +func (s *AddOrgMemberInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *Binding) encodeFields(e *jx.Encoder) { +func (s *AddOrgMemberInputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -967,26 +646,18 @@ func (s *Binding) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("accountId") - e.Str(s.AccountId) - } - { - if len(s.AttributeFilter) != 0 { - e.FieldStart("attributeFilter") - e.Raw(s.AttributeFilter) - } - } - { - e.FieldStart("createdAt") - json.EncodeDateTime(e, s.CreatedAt) + e.FieldStart("provider") + e.Str(s.Provider) } { - e.FieldStart("id") - e.Str(s.ID) + e.FieldStart("providerUserId") + e.Str(s.ProviderUserId) } { - e.FieldStart("providerId") - e.Str(s.ProviderId) + if s.Role.Set { + e.FieldStart("role") + s.Role.Encode(e) + } } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -997,21 +668,20 @@ func (s *Binding) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfBinding = [6]string{ +var jsonFieldsNameOfAddOrgMemberInputBody = [4]string{ 0: "$schema", - 1: "accountId", - 2: "attributeFilter", - 3: "createdAt", - 4: "id", - 5: "providerId", + 1: "provider", + 2: "providerUserId", + 3: "role", } -// Decode decodes Binding from json. -func (s *Binding) Decode(d *jx.Decoder) error { +// Decode decodes AddOrgMemberInputBody from json. +func (s *AddOrgMemberInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode Binding to nil") + return errors.New("invalid: unable to decode AddOrgMemberInputBody to nil") } var requiredBitSet [1]uint8 + s.setDefaults() s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -1026,65 +696,39 @@ func (s *Binding) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "accountId": + case "provider": requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.AccountId = string(v) + s.Provider = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"accountId\"") + return errors.Wrap(err, "decode field \"provider\"") } - case "attributeFilter": + case "providerUserId": requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.RawAppend(nil) - s.AttributeFilter = jx.Raw(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"attributeFilter\"") - } - case "createdAt": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - v, err := json.DecodeDateTime(d) - s.CreatedAt = v - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"createdAt\"") - } - case "id": - requiredBitSet[0] |= 1 << 4 if err := func() error { v, err := d.Str() - s.ID = string(v) + s.ProviderUserId = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"id\"") + return errors.Wrap(err, "decode field \"providerUserId\"") } - case "providerId": - requiredBitSet[0] |= 1 << 5 + case "role": if err := func() error { - v, err := d.Str() - s.ProviderId = string(v) - if err != nil { + s.Role.Reset() + if err := s.Role.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"providerId\"") + return errors.Wrap(err, "decode field \"role\"") } default: var elem jx.Raw @@ -1102,12 +746,12 @@ func (s *Binding) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode Binding") + return errors.Wrap(err, "decode AddOrgMemberInputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00111110, + 0b00000110, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -1119,8 +763,8 @@ func (s *Binding) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfBinding) { - name = jsonFieldsNameOfBinding[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfAddOrgMemberInputBody) { + name = jsonFieldsNameOfAddOrgMemberInputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -1141,27 +785,27 @@ func (s *Binding) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *Binding) MarshalJSON() ([]byte, error) { +func (s *AddOrgMemberInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *Binding) UnmarshalJSON(data []byte) error { +func (s *AddOrgMemberInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s BindingAdditional) Encode(e *jx.Encoder) { +func (s AddOrgMemberInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s BindingAdditional) encodeFields(e *jx.Encoder) { +func (s AddOrgMemberInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -1171,10 +815,10 @@ func (s BindingAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes BindingAdditional from json. -func (s *BindingAdditional) Decode(d *jx.Decoder) error { +// Decode decodes AddOrgMemberInputBodyAdditional from json. +func (s *AddOrgMemberInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode BindingAdditional to nil") + return errors.New("invalid: unable to decode AddOrgMemberInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -1192,47 +836,103 @@ func (s *BindingAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode BindingAdditional") + return errors.Wrap(err, "decode AddOrgMemberInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s BindingAdditional) MarshalJSON() ([]byte, error) { +func (s AddOrgMemberInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *BindingAdditional) UnmarshalJSON(data []byte) error { +func (s *AddOrgMemberInputBodyAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes AddOrgMemberInputBodyRole as json. +func (s AddOrgMemberInputBodyRole) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes AddOrgMemberInputBodyRole from json. +func (s *AddOrgMemberInputBodyRole) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode AddOrgMemberInputBodyRole to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch AddOrgMemberInputBodyRole(v) { + case AddOrgMemberInputBodyRoleOwner: + *s = AddOrgMemberInputBodyRoleOwner + case AddOrgMemberInputBodyRoleAdmin: + *s = AddOrgMemberInputBodyRoleAdmin + case AddOrgMemberInputBodyRoleMember: + *s = AddOrgMemberInputBodyRoleMember + default: + *s = AddOrgMemberInputBodyRole(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s AddOrgMemberInputBodyRole) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *AddOrgMemberInputBodyRole) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *BranchProtection) Encode(e *jx.Encoder) { +func (s *AuditEvent) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *BranchProtection) encodeFields(e *jx.Encoder) { +func (s *AuditEvent) encodeFields(e *jx.Encoder) { { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) + e.FieldStart("actorId") + e.Str(s.ActorId) + } + { + e.FieldStart("eventType") + e.Str(s.EventType) + } + { + e.FieldStart("id") + e.Str(s.ID) + } + { + if s.IpAddress.Set { + e.FieldStart("ipAddress") + s.IpAddress.Encode(e) } } { - e.FieldStart("rules") - e.ArrStart() - for _, elem := range s.Rules { - elem.Encode(e) + if s.Metadata.Set { + e.FieldStart("metadata") + s.Metadata.Encode(e) } - e.ArrEnd() + } + { + e.FieldStart("occurredAt") + json.EncodeDateTime(e, s.OccurredAt) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -1243,48 +943,92 @@ func (s *BranchProtection) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfBranchProtection = [2]string{ - 0: "$schema", - 1: "rules", +var jsonFieldsNameOfAuditEvent = [6]string{ + 0: "actorId", + 1: "eventType", + 2: "id", + 3: "ipAddress", + 4: "metadata", + 5: "occurredAt", } -// Decode decodes BranchProtection from json. -func (s *BranchProtection) Decode(d *jx.Decoder) error { +// Decode decodes AuditEvent from json. +func (s *AuditEvent) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode BranchProtection to nil") + return errors.New("invalid: unable to decode AuditEvent to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "actorId": + requiredBitSet[0] |= 1 << 0 if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + v, err := d.Str() + s.ActorId = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"actorId\"") } - case "rules": + case "eventType": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Rules = make([]BranchRule, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem BranchRule - if err := elem.Decode(d); err != nil { - return err - } - s.Rules = append(s.Rules, elem) - return nil - }); err != nil { + v, err := d.Str() + s.EventType = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"rules\"") + return errors.Wrap(err, "decode field \"eventType\"") + } + case "id": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.ID = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"id\"") + } + case "ipAddress": + if err := func() error { + s.IpAddress.Reset() + if err := s.IpAddress.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"ipAddress\"") + } + case "metadata": + if err := func() error { + s.Metadata.Reset() + if err := s.Metadata.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"metadata\"") + } + case "occurredAt": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.OccurredAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"occurredAt\"") } default: var elem jx.Raw @@ -1302,12 +1046,12 @@ func (s *BranchProtection) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode BranchProtection") + return errors.Wrap(err, "decode AuditEvent") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00100111, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -1319,8 +1063,8 @@ func (s *BranchProtection) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfBranchProtection) { - name = jsonFieldsNameOfBranchProtection[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfAuditEvent) { + name = jsonFieldsNameOfAuditEvent[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -1341,27 +1085,27 @@ func (s *BranchProtection) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *BranchProtection) MarshalJSON() ([]byte, error) { +func (s *AuditEvent) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *BranchProtection) UnmarshalJSON(data []byte) error { +func (s *AuditEvent) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s BranchProtectionAdditional) Encode(e *jx.Encoder) { +func (s AuditEventAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s BranchProtectionAdditional) encodeFields(e *jx.Encoder) { +func (s AuditEventAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -1371,10 +1115,10 @@ func (s BranchProtectionAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes BranchProtectionAdditional from json. -func (s *BranchProtectionAdditional) Decode(d *jx.Decoder) error { +// Decode decodes AuditEventAdditional from json. +func (s *AuditEventAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode BranchProtectionAdditional to nil") + return errors.New("invalid: unable to decode AuditEventAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -1392,44 +1136,126 @@ func (s *BranchProtectionAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode BranchProtectionAdditional") + return errors.Wrap(err, "decode AuditEventAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s BranchProtectionAdditional) MarshalJSON() ([]byte, error) { +func (s AuditEventAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *BranchProtectionAdditional) UnmarshalJSON(data []byte) error { +func (s *AuditEventAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *BranchRule) Encode(e *jx.Encoder) { +func (s AuditEventMetadata) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s AuditEventMetadata) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes AuditEventMetadata from json. +func (s *AuditEventMetadata) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode AuditEventMetadata to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode AuditEventMetadata") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s AuditEventMetadata) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *AuditEventMetadata) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *AvailableMirror) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *BranchRule) encodeFields(e *jx.Encoder) { +func (s *AvailableMirror) encodeFields(e *jx.Encoder) { { - e.FieldStart("ref") - e.Str(s.Ref) + e.FieldStart("access") + s.Access.Encode(e) } { - if s.ServerSideMergeOnly.Set { - e.FieldStart("serverSideMergeOnly") - s.ServerSideMergeOnly.Encode(e) + if s.IsArchived.Set { + e.FieldStart("isArchived") + s.IsArchived.Encode(e) + } + } + { + if s.IsPrivate.Set { + e.FieldStart("isPrivate") + s.IsPrivate.Encode(e) + } + } + { + e.FieldStart("owner") + e.Str(s.Owner) + } + { + if s.PushedAt.Set { + e.FieldStart("pushedAt") + s.PushedAt.Encode(e, json.EncodeDateTime) } } + { + e.FieldStart("repo") + e.Str(s.Repo) + } + { + e.FieldStart("status") + s.Status.Encode(e) + } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -1439,42 +1265,99 @@ func (s *BranchRule) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfBranchRule = [2]string{ - 0: "ref", - 1: "serverSideMergeOnly", +var jsonFieldsNameOfAvailableMirror = [7]string{ + 0: "access", + 1: "isArchived", + 2: "isPrivate", + 3: "owner", + 4: "pushedAt", + 5: "repo", + 6: "status", } -// Decode decodes BranchRule from json. -func (s *BranchRule) Decode(d *jx.Decoder) error { +// Decode decodes AvailableMirror from json. +func (s *AvailableMirror) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode BranchRule to nil") + return errors.New("invalid: unable to decode AvailableMirror to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "ref": + case "access": requiredBitSet[0] |= 1 << 0 + if err := func() error { + if err := s.Access.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"access\"") + } + case "isArchived": + if err := func() error { + s.IsArchived.Reset() + if err := s.IsArchived.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"isArchived\"") + } + case "isPrivate": + if err := func() error { + s.IsPrivate.Reset() + if err := s.IsPrivate.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"isPrivate\"") + } + case "owner": + requiredBitSet[0] |= 1 << 3 if err := func() error { v, err := d.Str() - s.Ref = string(v) + s.Owner = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"ref\"") + return errors.Wrap(err, "decode field \"owner\"") } - case "serverSideMergeOnly": + case "pushedAt": if err := func() error { - s.ServerSideMergeOnly.Reset() - if err := s.ServerSideMergeOnly.Decode(d); err != nil { + s.PushedAt.Reset() + if err := s.PushedAt.Decode(d, json.DecodeDateTime); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"serverSideMergeOnly\"") + return errors.Wrap(err, "decode field \"pushedAt\"") + } + case "repo": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + v, err := d.Str() + s.Repo = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"repo\"") + } + case "status": + requiredBitSet[0] |= 1 << 6 + if err := func() error { + if err := s.Status.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"status\"") } default: var elem jx.Raw @@ -1492,12 +1375,12 @@ func (s *BranchRule) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode BranchRule") + return errors.Wrap(err, "decode AvailableMirror") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000001, + 0b01101001, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -1509,8 +1392,8 @@ func (s *BranchRule) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfBranchRule) { - name = jsonFieldsNameOfBranchRule[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfAvailableMirror) { + name = jsonFieldsNameOfAvailableMirror[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -1531,27 +1414,69 @@ func (s *BranchRule) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *BranchRule) MarshalJSON() ([]byte, error) { +func (s *AvailableMirror) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *BranchRule) UnmarshalJSON(data []byte) error { +func (s *AvailableMirror) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes AvailableMirrorAccess as json. +func (s AvailableMirrorAccess) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes AvailableMirrorAccess from json. +func (s *AvailableMirrorAccess) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode AvailableMirrorAccess to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch AvailableMirrorAccess(v) { + case AvailableMirrorAccessRead: + *s = AvailableMirrorAccessRead + case AvailableMirrorAccessWrite: + *s = AvailableMirrorAccessWrite + case AvailableMirrorAccessAdmin: + *s = AvailableMirrorAccessAdmin + default: + *s = AvailableMirrorAccess(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s AvailableMirrorAccess) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *AvailableMirrorAccess) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s BranchRuleAdditional) Encode(e *jx.Encoder) { +func (s AvailableMirrorAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s BranchRuleAdditional) encodeFields(e *jx.Encoder) { +func (s AvailableMirrorAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -1561,10 +1486,10 @@ func (s BranchRuleAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes BranchRuleAdditional from json. -func (s *BranchRuleAdditional) Decode(d *jx.Decoder) error { +// Decode decodes AvailableMirrorAdditional from json. +func (s *AvailableMirrorAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode BranchRuleAdditional to nil") + return errors.New("invalid: unable to decode AvailableMirrorAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -1582,115 +1507,103 @@ func (s *BranchRuleAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode BranchRuleAdditional") + return errors.Wrap(err, "decode AvailableMirrorAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s BranchRuleAdditional) MarshalJSON() ([]byte, error) { +func (s AvailableMirrorAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *BranchRuleAdditional) UnmarshalJSON(data []byte) error { +func (s *AvailableMirrorAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode implements json.Marshaler. -func (s *CIBuildView) Encode(e *jx.Encoder) { - e.ObjStart() - s.encodeFields(e) - e.ObjEnd() -} +// Encode encodes AvailableMirrorStatus as json. +func (s AvailableMirrorStatus) Encode(e *jx.Encoder) { + e.Str(string(s)) +} -// encodeFields encodes fields. -func (s *CIBuildView) encodeFields(e *jx.Encoder) { - { - e.FieldStart("bk_build_uuid") - e.Str(s.BkBuildUUID) - } - { - e.FieldStart("bk_organization") - e.Str(s.BkOrganization) - } - { - e.FieldStart("bk_pipeline") - e.Str(s.BkPipeline) - } - { - e.FieldStart("branch") - e.Str(s.Branch) - } - { - e.FieldStart("build_number") - e.Int64(s.BuildNumber) - } - { - e.FieldStart("commit") - e.Str(s.Commit) - } - { - if s.CreatedAt.Set { - e.FieldStart("created_at") - s.CreatedAt.Encode(e, json.EncodeDateTime) - } +// Decode decodes AvailableMirrorStatus from json. +func (s *AvailableMirrorStatus) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode AvailableMirrorStatus to nil") } - { - e.FieldStart("event_at") - json.EncodeDateTime(e, s.EventAt) + v, err := d.StrBytes() + if err != nil { + return err } - { - if s.FinishedAt.Set { - e.FieldStart("finished_at") - s.FinishedAt.Encode(e, json.EncodeDateTime) - } + // Try to use constant string. + switch AvailableMirrorStatus(v) { + case AvailableMirrorStatusAvailable: + *s = AvailableMirrorStatusAvailable + case AvailableMirrorStatusMirrored: + *s = AvailableMirrorStatusMirrored + case AvailableMirrorStatusOwnerOnly: + *s = AvailableMirrorStatusOwnerOnly + default: + *s = AvailableMirrorStatus(v) } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s AvailableMirrorStatus) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *AvailableMirrorStatus) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *Binding) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *Binding) encodeFields(e *jx.Encoder) { { - e.FieldStart("jobs") - e.ArrStart() - for _, elem := range s.Jobs { - elem.Encode(e) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) } - e.ArrEnd() - } - { - e.FieldStart("last_event") - e.Str(s.LastEvent) - } - { - e.FieldStart("message") - e.Str(s.Message) } { - e.FieldStart("stale") - e.Bool(s.Stale) + e.FieldStart("accountId") + e.Str(s.AccountId) } { - if s.StartedAt.Set { - e.FieldStart("started_at") - s.StartedAt.Encode(e, json.EncodeDateTime) + if len(s.AttributeFilter) != 0 { + e.FieldStart("attributeFilter") + e.Raw(s.AttributeFilter) } } { - e.FieldStart("state") - e.Str(s.State) - } - { - e.FieldStart("terminal") - e.Bool(s.Terminal) + e.FieldStart("createdAt") + json.EncodeDateTime(e, s.CreatedAt) } { - e.FieldStart("updated_at") - json.EncodeDateTime(e, s.UpdatedAt) + e.FieldStart("id") + e.Str(s.ID) } { - e.FieldStart("web_url") - e.Str(s.WebURL) + e.FieldStart("providerId") + e.Str(s.ProviderId) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -1701,252 +1614,94 @@ func (s *CIBuildView) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCIBuildView = [18]string{ - 0: "bk_build_uuid", - 1: "bk_organization", - 2: "bk_pipeline", - 3: "branch", - 4: "build_number", - 5: "commit", - 6: "created_at", - 7: "event_at", - 8: "finished_at", - 9: "jobs", - 10: "last_event", - 11: "message", - 12: "stale", - 13: "started_at", - 14: "state", - 15: "terminal", - 16: "updated_at", - 17: "web_url", +var jsonFieldsNameOfBinding = [6]string{ + 0: "$schema", + 1: "accountId", + 2: "attributeFilter", + 3: "createdAt", + 4: "id", + 5: "providerId", } -// Decode decodes CIBuildView from json. -func (s *CIBuildView) Decode(d *jx.Decoder) error { +// Decode decodes Binding from json. +func (s *Binding) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CIBuildView to nil") + return errors.New("invalid: unable to decode Binding to nil") } - var requiredBitSet [3]uint8 + var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "bk_build_uuid": - requiredBitSet[0] |= 1 << 0 + case "$schema": if err := func() error { - v, err := d.Str() - s.BkBuildUUID = string(v) - if err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"bk_build_uuid\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "bk_organization": + case "accountId": requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.BkOrganization = string(v) + s.AccountId = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"bk_organization\"") + return errors.Wrap(err, "decode field \"accountId\"") } - case "bk_pipeline": + case "attributeFilter": requiredBitSet[0] |= 1 << 2 if err := func() error { - v, err := d.Str() - s.BkPipeline = string(v) + v, err := d.RawAppend(nil) + s.AttributeFilter = jx.Raw(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"bk_pipeline\"") + return errors.Wrap(err, "decode field \"attributeFilter\"") } - case "branch": + case "createdAt": requiredBitSet[0] |= 1 << 3 - if err := func() error { - v, err := d.Str() - s.Branch = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"branch\"") - } - case "build_number": - requiredBitSet[0] |= 1 << 4 - if err := func() error { - v, err := d.Int64() - s.BuildNumber = int64(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"build_number\"") - } - case "commit": - requiredBitSet[0] |= 1 << 5 - if err := func() error { - v, err := d.Str() - s.Commit = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"commit\"") - } - case "created_at": - if err := func() error { - s.CreatedAt.Reset() - if err := s.CreatedAt.Decode(d, json.DecodeDateTime); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"created_at\"") - } - case "event_at": - requiredBitSet[0] |= 1 << 7 if err := func() error { v, err := json.DecodeDateTime(d) - s.EventAt = v - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"event_at\"") - } - case "finished_at": - if err := func() error { - s.FinishedAt.Reset() - if err := s.FinishedAt.Decode(d, json.DecodeDateTime); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"finished_at\"") - } - case "jobs": - requiredBitSet[1] |= 1 << 1 - if err := func() error { - s.Jobs = make([]CIJobView, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem CIJobView - if err := elem.Decode(d); err != nil { - return err - } - s.Jobs = append(s.Jobs, elem) - return nil - }); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"jobs\"") - } - case "last_event": - requiredBitSet[1] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.LastEvent = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"last_event\"") - } - case "message": - requiredBitSet[1] |= 1 << 3 - if err := func() error { - v, err := d.Str() - s.Message = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"message\"") - } - case "stale": - requiredBitSet[1] |= 1 << 4 - if err := func() error { - v, err := d.Bool() - s.Stale = bool(v) + s.CreatedAt = v if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"stale\"") - } - case "started_at": - if err := func() error { - s.StartedAt.Reset() - if err := s.StartedAt.Decode(d, json.DecodeDateTime); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"started_at\"") + return errors.Wrap(err, "decode field \"createdAt\"") } - case "state": - requiredBitSet[1] |= 1 << 6 + case "id": + requiredBitSet[0] |= 1 << 4 if err := func() error { v, err := d.Str() - s.State = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"state\"") - } - case "terminal": - requiredBitSet[1] |= 1 << 7 - if err := func() error { - v, err := d.Bool() - s.Terminal = bool(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"terminal\"") - } - case "updated_at": - requiredBitSet[2] |= 1 << 0 - if err := func() error { - v, err := json.DecodeDateTime(d) - s.UpdatedAt = v + s.ID = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"updated_at\"") + return errors.Wrap(err, "decode field \"id\"") } - case "web_url": - requiredBitSet[2] |= 1 << 1 + case "providerId": + requiredBitSet[0] |= 1 << 5 if err := func() error { v, err := d.Str() - s.WebURL = string(v) + s.ProviderId = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"web_url\"") + return errors.Wrap(err, "decode field \"providerId\"") } default: var elem jx.Raw @@ -1964,14 +1719,12 @@ func (s *CIBuildView) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CIBuildView") + return errors.Wrap(err, "decode Binding") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [3]uint8{ - 0b10111111, - 0b11011110, - 0b00000011, + for i, mask := range [1]uint8{ + 0b00111110, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -1983,8 +1736,8 @@ func (s *CIBuildView) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCIBuildView) { - name = jsonFieldsNameOfCIBuildView[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfBinding) { + name = jsonFieldsNameOfBinding[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -2005,27 +1758,27 @@ func (s *CIBuildView) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CIBuildView) MarshalJSON() ([]byte, error) { +func (s *Binding) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIBuildView) UnmarshalJSON(data []byte) error { +func (s *Binding) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CIBuildViewAdditional) Encode(e *jx.Encoder) { +func (s BindingAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CIBuildViewAdditional) encodeFields(e *jx.Encoder) { +func (s BindingAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -2035,10 +1788,10 @@ func (s CIBuildViewAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CIBuildViewAdditional from json. -func (s *CIBuildViewAdditional) Decode(d *jx.Decoder) error { +// Decode decodes BindingAdditional from json. +func (s *BindingAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CIBuildViewAdditional to nil") + return errors.New("invalid: unable to decode BindingAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -2056,71 +1809,47 @@ func (s *CIBuildViewAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CIBuildViewAdditional") + return errors.Wrap(err, "decode BindingAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CIBuildViewAdditional) MarshalJSON() ([]byte, error) { +func (s BindingAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIBuildViewAdditional) UnmarshalJSON(data []byte) error { +func (s *BindingAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CIJobView) Encode(e *jx.Encoder) { +func (s *BranchProtection) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CIJobView) encodeFields(e *jx.Encoder) { - { - e.FieldStart("bk_job_id") - e.Str(s.BkJobID) - } - { - if s.ExitStatus.Set { - e.FieldStart("exit_status") - s.ExitStatus.Encode(e) - } - } +func (s *BranchProtection) encodeFields(e *jx.Encoder) { { - if s.FinishedAt.Set { - e.FieldStart("finished_at") - s.FinishedAt.Encode(e, json.EncodeDateTime) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) } } { - e.FieldStart("name") - e.Str(s.Name) - } - { - if s.StartedAt.Set { - e.FieldStart("started_at") - s.StartedAt.Encode(e, json.EncodeDateTime) + e.FieldStart("rules") + e.ArrStart() + for _, elem := range s.Rules { + elem.Encode(e) } - } - { - e.FieldStart("state") - e.Str(s.State) - } - { - e.FieldStart("step_key") - e.Str(s.StepKey) - } - { - e.FieldStart("type") - e.Str(s.Type) + e.ArrEnd() } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -2131,139 +1860,71 @@ func (s *CIJobView) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCIJobView = [8]string{ - 0: "bk_job_id", - 1: "exit_status", - 2: "finished_at", - 3: "name", - 4: "started_at", - 5: "state", - 6: "step_key", - 7: "type", +var jsonFieldsNameOfBranchProtection = [2]string{ + 0: "$schema", + 1: "rules", } -// Decode decodes CIJobView from json. -func (s *CIJobView) Decode(d *jx.Decoder) error { +// Decode decodes BranchProtection from json. +func (s *BranchProtection) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CIJobView to nil") + return errors.New("invalid: unable to decode BranchProtection to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "bk_job_id": - requiredBitSet[0] |= 1 << 0 - if err := func() error { - v, err := d.Str() - s.BkJobID = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"bk_job_id\"") - } - case "exit_status": + case "$schema": if err := func() error { - s.ExitStatus.Reset() - if err := s.ExitStatus.Decode(d); err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"exit_status\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "finished_at": + case "rules": + requiredBitSet[0] |= 1 << 1 if err := func() error { - s.FinishedAt.Reset() - if err := s.FinishedAt.Decode(d, json.DecodeDateTime); err != nil { + s.Rules = make([]BranchRule, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem BranchRule + if err := elem.Decode(d); err != nil { + return err + } + s.Rules = append(s.Rules, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"finished_at\"") + return errors.Wrap(err, "decode field \"rules\"") } - case "name": - requiredBitSet[0] |= 1 << 3 + default: + var elem jx.Raw if err := func() error { - v, err := d.Str() - s.Name = string(v) + v, err := d.RawAppend(nil) + elem = jx.Raw(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"name\"") - } - case "started_at": - if err := func() error { - s.StartedAt.Reset() - if err := s.StartedAt.Decode(d, json.DecodeDateTime); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"started_at\"") - } - case "state": - requiredBitSet[0] |= 1 << 5 - if err := func() error { - v, err := d.Str() - s.State = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"state\"") - } - case "step_key": - requiredBitSet[0] |= 1 << 6 - if err := func() error { - v, err := d.Str() - s.StepKey = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"step_key\"") - } - case "type": - requiredBitSet[0] |= 1 << 7 - if err := func() error { - v, err := d.Str() - s.Type = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"type\"") - } - default: - var elem jx.Raw - if err := func() error { - v, err := d.RawAppend(nil) - elem = jx.Raw(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrapf(err, "decode field %q", k) + return errors.Wrapf(err, "decode field %q", k) } s.AdditionalProps[string(k)] = elem } return nil }); err != nil { - return errors.Wrap(err, "decode CIJobView") + return errors.Wrap(err, "decode BranchProtection") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b11101001, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -2275,8 +1936,8 @@ func (s *CIJobView) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCIJobView) { - name = jsonFieldsNameOfCIJobView[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfBranchProtection) { + name = jsonFieldsNameOfBranchProtection[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -2297,27 +1958,27 @@ func (s *CIJobView) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CIJobView) MarshalJSON() ([]byte, error) { +func (s *BranchProtection) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIJobView) UnmarshalJSON(data []byte) error { +func (s *BranchProtection) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CIJobViewAdditional) Encode(e *jx.Encoder) { +func (s BranchProtectionAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CIJobViewAdditional) encodeFields(e *jx.Encoder) { +func (s BranchProtectionAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -2327,10 +1988,10 @@ func (s CIJobViewAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CIJobViewAdditional from json. -func (s *CIJobViewAdditional) Decode(d *jx.Decoder) error { +// Decode decodes BranchProtectionAdditional from json. +func (s *BranchProtectionAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CIJobViewAdditional to nil") + return errors.New("invalid: unable to decode BranchProtectionAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -2348,66 +2009,42 @@ func (s *CIJobViewAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CIJobViewAdditional") + return errors.Wrap(err, "decode BranchProtectionAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CIJobViewAdditional) MarshalJSON() ([]byte, error) { +func (s BranchProtectionAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIJobViewAdditional) UnmarshalJSON(data []byte) error { +func (s *BranchProtectionAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CIProviderDescriptor) Encode(e *jx.Encoder) { +func (s *BranchRule) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CIProviderDescriptor) encodeFields(e *jx.Encoder) { - { - e.FieldStart("enrollable") - e.Bool(s.Enrollable) - } - { - e.FieldStart("fields") - e.ArrStart() - for _, elem := range s.Fields { - elem.Encode(e) - } - e.ArrEnd() - } - { - e.FieldStart("label") - e.Str(s.Label) - } - { - e.FieldStart("modes") - e.ArrStart() - for _, elem := range s.Modes { - elem.Encode(e) - } - e.ArrEnd() - } +func (s *BranchRule) encodeFields(e *jx.Encoder) { { - e.FieldStart("name") - e.Str(s.Name) + e.FieldStart("ref") + e.Str(s.Ref) } { - if s.Reason.Set { - e.FieldStart("reason") - s.Reason.Encode(e) + if s.ServerSideMergeOnly.Set { + e.FieldStart("serverSideMergeOnly") + s.ServerSideMergeOnly.Encode(e) } } for k, elem := range s.AdditionalProps { @@ -2419,106 +2056,42 @@ func (s *CIProviderDescriptor) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCIProviderDescriptor = [6]string{ - 0: "enrollable", - 1: "fields", - 2: "label", - 3: "modes", - 4: "name", - 5: "reason", +var jsonFieldsNameOfBranchRule = [2]string{ + 0: "ref", + 1: "serverSideMergeOnly", } -// Decode decodes CIProviderDescriptor from json. -func (s *CIProviderDescriptor) Decode(d *jx.Decoder) error { +// Decode decodes BranchRule from json. +func (s *BranchRule) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CIProviderDescriptor to nil") + return errors.New("invalid: unable to decode BranchRule to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "enrollable": + case "ref": requiredBitSet[0] |= 1 << 0 - if err := func() error { - v, err := d.Bool() - s.Enrollable = bool(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"enrollable\"") - } - case "fields": - requiredBitSet[0] |= 1 << 1 - if err := func() error { - s.Fields = make([]CIProviderField, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem CIProviderField - if err := elem.Decode(d); err != nil { - return err - } - s.Fields = append(s.Fields, elem) - return nil - }); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"fields\"") - } - case "label": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.Label = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"label\"") - } - case "modes": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - s.Modes = make([]CIProviderMode, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem CIProviderMode - if err := elem.Decode(d); err != nil { - return err - } - s.Modes = append(s.Modes, elem) - return nil - }); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"modes\"") - } - case "name": - requiredBitSet[0] |= 1 << 4 if err := func() error { v, err := d.Str() - s.Name = string(v) + s.Ref = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"name\"") + return errors.Wrap(err, "decode field \"ref\"") } - case "reason": + case "serverSideMergeOnly": if err := func() error { - s.Reason.Reset() - if err := s.Reason.Decode(d); err != nil { + s.ServerSideMergeOnly.Reset() + if err := s.ServerSideMergeOnly.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"reason\"") + return errors.Wrap(err, "decode field \"serverSideMergeOnly\"") } default: var elem jx.Raw @@ -2536,12 +2109,12 @@ func (s *CIProviderDescriptor) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CIProviderDescriptor") + return errors.Wrap(err, "decode BranchRule") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00011111, + 0b00000001, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -2553,8 +2126,8 @@ func (s *CIProviderDescriptor) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCIProviderDescriptor) { - name = jsonFieldsNameOfCIProviderDescriptor[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfBranchRule) { + name = jsonFieldsNameOfBranchRule[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -2575,27 +2148,27 @@ func (s *CIProviderDescriptor) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CIProviderDescriptor) MarshalJSON() ([]byte, error) { +func (s *BranchRule) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIProviderDescriptor) UnmarshalJSON(data []byte) error { +func (s *BranchRule) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CIProviderDescriptorAdditional) Encode(e *jx.Encoder) { +func (s BranchRuleAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CIProviderDescriptorAdditional) encodeFields(e *jx.Encoder) { +func (s BranchRuleAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -2605,10 +2178,10 @@ func (s CIProviderDescriptorAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CIProviderDescriptorAdditional from json. -func (s *CIProviderDescriptorAdditional) Decode(d *jx.Decoder) error { +// Decode decodes BranchRuleAdditional from json. +func (s *BranchRuleAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CIProviderDescriptorAdditional to nil") + return errors.New("invalid: unable to decode BranchRuleAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -2626,79 +2199,43 @@ func (s *CIProviderDescriptorAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CIProviderDescriptorAdditional") + return errors.Wrap(err, "decode BranchRuleAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CIProviderDescriptorAdditional) MarshalJSON() ([]byte, error) { +func (s BranchRuleAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIProviderDescriptorAdditional) UnmarshalJSON(data []byte) error { +func (s *BranchRuleAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CIProviderField) Encode(e *jx.Encoder) { +func (s *BranchRuleUpdate) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CIProviderField) encodeFields(e *jx.Encoder) { +func (s *BranchRuleUpdate) encodeFields(e *jx.Encoder) { { - if s.Help.Set { - e.FieldStart("help") - s.Help.Encode(e) - } - } - { - e.FieldStart("key") - e.Str(s.Key) - } - { - e.FieldStart("kind") - e.Str(s.Kind) - } - { - e.FieldStart("label") - e.Str(s.Label) - } - { - if s.Options != nil { - e.FieldStart("options") - e.ArrStart() - for _, elem := range s.Options { - elem.Encode(e) - } - e.ArrEnd() - } - } - { - if s.Placeholder.Set { - e.FieldStart("placeholder") - s.Placeholder.Encode(e) - } + e.FieldStart("ref") + e.Str(s.Ref) } { - e.FieldStart("required_in") - e.ArrStart() - for _, elem := range s.RequiredIn { - e.Str(elem) + if s.ServerSideMergeOnly.Set { + e.FieldStart("serverSideMergeOnly") + s.ServerSideMergeOnly.Encode(e) } - e.ArrEnd() - } - { - e.FieldStart("target") - e.Str(s.Target) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -2709,131 +2246,42 @@ func (s *CIProviderField) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCIProviderField = [8]string{ - 0: "help", - 1: "key", - 2: "kind", - 3: "label", - 4: "options", - 5: "placeholder", - 6: "required_in", - 7: "target", +var jsonFieldsNameOfBranchRuleUpdate = [2]string{ + 0: "ref", + 1: "serverSideMergeOnly", } -// Decode decodes CIProviderField from json. -func (s *CIProviderField) Decode(d *jx.Decoder) error { +// Decode decodes BranchRuleUpdate from json. +func (s *BranchRuleUpdate) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CIProviderField to nil") + return errors.New("invalid: unable to decode BranchRuleUpdate to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "help": - if err := func() error { - s.Help.Reset() - if err := s.Help.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"help\"") - } - case "key": - requiredBitSet[0] |= 1 << 1 - if err := func() error { - v, err := d.Str() - s.Key = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"key\"") - } - case "kind": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.Kind = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"kind\"") - } - case "label": - requiredBitSet[0] |= 1 << 3 + case "ref": + requiredBitSet[0] |= 1 << 0 if err := func() error { v, err := d.Str() - s.Label = string(v) + s.Ref = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"label\"") - } - case "options": - if err := func() error { - s.Options = make([]CIProviderOption, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem CIProviderOption - if err := elem.Decode(d); err != nil { - return err - } - s.Options = append(s.Options, elem) - return nil - }); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"options\"") - } - case "placeholder": - if err := func() error { - s.Placeholder.Reset() - if err := s.Placeholder.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"placeholder\"") - } - case "required_in": - requiredBitSet[0] |= 1 << 6 - if err := func() error { - s.RequiredIn = make([]string, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem string - v, err := d.Str() - elem = string(v) - if err != nil { - return err - } - s.RequiredIn = append(s.RequiredIn, elem) - return nil - }); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"required_in\"") + return errors.Wrap(err, "decode field \"ref\"") } - case "target": - requiredBitSet[0] |= 1 << 7 + case "serverSideMergeOnly": if err := func() error { - v, err := d.Str() - s.Target = string(v) - if err != nil { + s.ServerSideMergeOnly.Reset() + if err := s.ServerSideMergeOnly.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"target\"") + return errors.Wrap(err, "decode field \"serverSideMergeOnly\"") } default: var elem jx.Raw @@ -2851,12 +2299,12 @@ func (s *CIProviderField) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CIProviderField") + return errors.Wrap(err, "decode BranchRuleUpdate") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b11001110, + 0b00000001, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -2868,8 +2316,8 @@ func (s *CIProviderField) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCIProviderField) { - name = jsonFieldsNameOfCIProviderField[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfBranchRuleUpdate) { + name = jsonFieldsNameOfBranchRuleUpdate[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -2890,27 +2338,27 @@ func (s *CIProviderField) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CIProviderField) MarshalJSON() ([]byte, error) { +func (s *BranchRuleUpdate) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIProviderField) UnmarshalJSON(data []byte) error { +func (s *BranchRuleUpdate) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CIProviderFieldAdditional) Encode(e *jx.Encoder) { +func (s BranchRuleUpdateAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CIProviderFieldAdditional) encodeFields(e *jx.Encoder) { +func (s BranchRuleUpdateAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -2920,10 +2368,10 @@ func (s CIProviderFieldAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CIProviderFieldAdditional from json. -func (s *CIProviderFieldAdditional) Decode(d *jx.Decoder) error { +// Decode decodes BranchRuleUpdateAdditional from json. +func (s *BranchRuleUpdateAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CIProviderFieldAdditional to nil") + return errors.New("invalid: unable to decode BranchRuleUpdateAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -2941,53 +2389,115 @@ func (s *CIProviderFieldAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CIProviderFieldAdditional") + return errors.Wrap(err, "decode BranchRuleUpdateAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CIProviderFieldAdditional) MarshalJSON() ([]byte, error) { +func (s BranchRuleUpdateAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIProviderFieldAdditional) UnmarshalJSON(data []byte) error { +func (s *BranchRuleUpdateAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CIProviderMode) Encode(e *jx.Encoder) { +func (s *CIBuildView) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CIProviderMode) encodeFields(e *jx.Encoder) { +func (s *CIBuildView) encodeFields(e *jx.Encoder) { { - if s.Default.Set { - e.FieldStart("default") - s.Default.Encode(e) + e.FieldStart("bk_build_uuid") + e.Str(s.BkBuildUUID) + } + { + e.FieldStart("bk_organization") + e.Str(s.BkOrganization) + } + { + e.FieldStart("bk_pipeline") + e.Str(s.BkPipeline) + } + { + e.FieldStart("branch") + e.Str(s.Branch) + } + { + e.FieldStart("build_number") + e.Int64(s.BuildNumber) + } + { + e.FieldStart("commit") + e.Str(s.Commit) + } + { + if s.CreatedAt.Set { + e.FieldStart("created_at") + s.CreatedAt.Encode(e, json.EncodeDateTime) } } { - if s.Help.Set { - e.FieldStart("help") - s.Help.Encode(e) + e.FieldStart("event_at") + json.EncodeDateTime(e, s.EventAt) + } + { + if s.FinishedAt.Set { + e.FieldStart("finished_at") + s.FinishedAt.Encode(e, json.EncodeDateTime) } } { - e.FieldStart("key") - e.Str(s.Key) + e.FieldStart("jobs") + e.ArrStart() + for _, elem := range s.Jobs { + elem.Encode(e) + } + e.ArrEnd() } { - e.FieldStart("label") - e.Str(s.Label) + e.FieldStart("last_event") + e.Str(s.LastEvent) + } + { + e.FieldStart("message") + e.Str(s.Message) + } + { + e.FieldStart("stale") + e.Bool(s.Stale) + } + { + if s.StartedAt.Set { + e.FieldStart("started_at") + s.StartedAt.Encode(e, json.EncodeDateTime) + } + } + { + e.FieldStart("state") + e.Str(s.State) + } + { + e.FieldStart("terminal") + e.Bool(s.Terminal) + } + { + e.FieldStart("updated_at") + json.EncodeDateTime(e, s.UpdatedAt) + } + { + e.FieldStart("web_url") + e.Str(s.WebURL) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -2998,256 +2508,252 @@ func (s *CIProviderMode) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCIProviderMode = [4]string{ - 0: "default", - 1: "help", - 2: "key", - 3: "label", +var jsonFieldsNameOfCIBuildView = [18]string{ + 0: "bk_build_uuid", + 1: "bk_organization", + 2: "bk_pipeline", + 3: "branch", + 4: "build_number", + 5: "commit", + 6: "created_at", + 7: "event_at", + 8: "finished_at", + 9: "jobs", + 10: "last_event", + 11: "message", + 12: "stale", + 13: "started_at", + 14: "state", + 15: "terminal", + 16: "updated_at", + 17: "web_url", } -// Decode decodes CIProviderMode from json. -func (s *CIProviderMode) Decode(d *jx.Decoder) error { +// Decode decodes CIBuildView from json. +func (s *CIBuildView) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CIProviderMode to nil") + return errors.New("invalid: unable to decode CIBuildView to nil") } - var requiredBitSet [1]uint8 + var requiredBitSet [3]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "default": + case "bk_build_uuid": + requiredBitSet[0] |= 1 << 0 if err := func() error { - s.Default.Reset() - if err := s.Default.Decode(d); err != nil { + v, err := d.Str() + s.BkBuildUUID = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"default\"") + return errors.Wrap(err, "decode field \"bk_build_uuid\"") } - case "help": + case "bk_organization": + requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Help.Reset() - if err := s.Help.Decode(d); err != nil { + v, err := d.Str() + s.BkOrganization = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"help\"") + return errors.Wrap(err, "decode field \"bk_organization\"") } - case "key": + case "bk_pipeline": requiredBitSet[0] |= 1 << 2 if err := func() error { v, err := d.Str() - s.Key = string(v) + s.BkPipeline = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"key\"") + return errors.Wrap(err, "decode field \"bk_pipeline\"") } - case "label": + case "branch": requiredBitSet[0] |= 1 << 3 if err := func() error { v, err := d.Str() - s.Label = string(v) + s.Branch = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"label\"") + return errors.Wrap(err, "decode field \"branch\"") } - default: - var elem jx.Raw + case "build_number": + requiredBitSet[0] |= 1 << 4 if err := func() error { - v, err := d.RawAppend(nil) - elem = jx.Raw(v) + v, err := d.Int64() + s.BuildNumber = int64(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrapf(err, "decode field %q", k) + return errors.Wrap(err, "decode field \"build_number\"") } - s.AdditionalProps[string(k)] = elem - } - return nil - }); err != nil { - return errors.Wrap(err, "decode CIProviderMode") - } - // Validate required fields. - var failures []validate.FieldError - for i, mask := range [1]uint8{ - 0b00001100, - } { - if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { - // Mask only required fields and check equality to mask using XOR. - // - // If XOR result is not zero, result is not equal to expected, so some fields are missed. - // Bits of fields which would be set are actually bits of missed fields. - missed := bits.OnesCount8(result) - for bitN := 0; bitN < missed; bitN++ { - bitIdx := bits.TrailingZeros8(result) - fieldIdx := i*8 + bitIdx - var name string - if fieldIdx < len(jsonFieldsNameOfCIProviderMode) { - name = jsonFieldsNameOfCIProviderMode[fieldIdx] - } else { - name = strconv.Itoa(fieldIdx) + case "commit": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + v, err := d.Str() + s.Commit = string(v) + if err != nil { + return err } - failures = append(failures, validate.FieldError{ - Name: name, - Error: validate.ErrFieldRequired, - }) - // Reset bit. - result &^= 1 << bitIdx + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"commit\"") } - } - } - if len(failures) > 0 { - return &validate.Error{Fields: failures} - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s *CIProviderMode) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIProviderMode) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode implements json.Marshaler. -func (s CIProviderModeAdditional) Encode(e *jx.Encoder) { - e.ObjStart() - s.encodeFields(e) - e.ObjEnd() -} - -// encodeFields implements json.Marshaler. -func (s CIProviderModeAdditional) encodeFields(e *jx.Encoder) { - for k, elem := range s { - e.FieldStart(k) - - if len(elem) != 0 { - e.Raw(elem) - } - } -} - -// Decode decodes CIProviderModeAdditional from json. -func (s *CIProviderModeAdditional) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode CIProviderModeAdditional to nil") - } - m := s.init() - if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { - var elem jx.Raw - if err := func() error { - v, err := d.RawAppend(nil) - elem = jx.Raw(v) - if err != nil { - return err + case "created_at": + if err := func() error { + s.CreatedAt.Reset() + if err := s.CreatedAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"created_at\"") } - return nil - }(); err != nil { - return errors.Wrapf(err, "decode field %q", k) - } - m[string(k)] = elem - return nil - }); err != nil { - return errors.Wrap(err, "decode CIProviderModeAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s CIProviderModeAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIProviderModeAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode implements json.Marshaler. -func (s *CIProviderOption) Encode(e *jx.Encoder) { - e.ObjStart() - s.encodeFields(e) - e.ObjEnd() -} - -// encodeFields encodes fields. -func (s *CIProviderOption) encodeFields(e *jx.Encoder) { - { - e.FieldStart("label") - e.Str(s.Label) - } - { - e.FieldStart("value") - e.Str(s.Value) - } - for k, elem := range s.AdditionalProps { - e.FieldStart(k) - - if len(elem) != 0 { - e.Raw(elem) - } - } -} - -var jsonFieldsNameOfCIProviderOption = [2]string{ - 0: "label", - 1: "value", -} - -// Decode decodes CIProviderOption from json. -func (s *CIProviderOption) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode CIProviderOption to nil") - } - var requiredBitSet [1]uint8 - s.AdditionalProps = map[string]jx.Raw{} - - if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { - switch string(k) { - case "label": - requiredBitSet[0] |= 1 << 0 + case "event_at": + requiredBitSet[0] |= 1 << 7 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.EventAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"event_at\"") + } + case "finished_at": + if err := func() error { + s.FinishedAt.Reset() + if err := s.FinishedAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"finished_at\"") + } + case "jobs": + requiredBitSet[1] |= 1 << 1 + if err := func() error { + s.Jobs = make([]CIJobView, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem CIJobView + if err := elem.Decode(d); err != nil { + return err + } + s.Jobs = append(s.Jobs, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"jobs\"") + } + case "last_event": + requiredBitSet[1] |= 1 << 2 if err := func() error { v, err := d.Str() - s.Label = string(v) + s.LastEvent = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"label\"") + return errors.Wrap(err, "decode field \"last_event\"") } - case "value": - requiredBitSet[0] |= 1 << 1 + case "message": + requiredBitSet[1] |= 1 << 3 if err := func() error { v, err := d.Str() - s.Value = string(v) + s.Message = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"value\"") + return errors.Wrap(err, "decode field \"message\"") + } + case "stale": + requiredBitSet[1] |= 1 << 4 + if err := func() error { + v, err := d.Bool() + s.Stale = bool(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"stale\"") + } + case "started_at": + if err := func() error { + s.StartedAt.Reset() + if err := s.StartedAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"started_at\"") + } + case "state": + requiredBitSet[1] |= 1 << 6 + if err := func() error { + v, err := d.Str() + s.State = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"state\"") + } + case "terminal": + requiredBitSet[1] |= 1 << 7 + if err := func() error { + v, err := d.Bool() + s.Terminal = bool(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"terminal\"") + } + case "updated_at": + requiredBitSet[2] |= 1 << 0 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.UpdatedAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"updated_at\"") + } + case "web_url": + requiredBitSet[2] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.WebURL = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"web_url\"") } default: var elem jx.Raw @@ -3265,11 +2771,13 @@ func (s *CIProviderOption) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CIProviderOption") + return errors.Wrap(err, "decode CIBuildView") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [1]uint8{ + for i, mask := range [3]uint8{ + 0b10111111, + 0b11011110, 0b00000011, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { @@ -3282,8 +2790,8 @@ func (s *CIProviderOption) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCIProviderOption) { - name = jsonFieldsNameOfCIProviderOption[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCIBuildView) { + name = jsonFieldsNameOfCIBuildView[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -3304,27 +2812,27 @@ func (s *CIProviderOption) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CIProviderOption) MarshalJSON() ([]byte, error) { +func (s *CIBuildView) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIProviderOption) UnmarshalJSON(data []byte) error { +func (s *CIBuildView) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CIProviderOptionAdditional) Encode(e *jx.Encoder) { +func (s CIBuildViewAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CIProviderOptionAdditional) encodeFields(e *jx.Encoder) { +func (s CIBuildViewAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -3334,10 +2842,10 @@ func (s CIProviderOptionAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CIProviderOptionAdditional from json. -func (s *CIProviderOptionAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CIBuildViewAdditional from json. +func (s *CIBuildViewAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CIProviderOptionAdditional to nil") + return errors.New("invalid: unable to decode CIBuildViewAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -3355,45 +2863,167 @@ func (s *CIProviderOptionAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CIProviderOptionAdditional") + return errors.Wrap(err, "decode CIBuildViewAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CIProviderOptionAdditional) MarshalJSON() ([]byte, error) { +func (s CIBuildViewAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIProviderOptionAdditional) UnmarshalJSON(data []byte) error { +func (s *CIBuildViewAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CISetupBlock) Encode(e *jx.Encoder) { +func (s *CIDeliveryDetailView) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CISetupBlock) encodeFields(e *jx.Encoder) { +func (s *CIDeliveryDetailView) encodeFields(e *jx.Encoder) { { - e.FieldStart("content") - e.Str(s.Content) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } } { - e.FieldStart("format") - e.Str(s.Format) + if s.Account.Set { + e.FieldStart("account") + s.Account.Encode(e) + } } { - e.FieldStart("heading") - e.Str(s.Heading) + e.FieldStart("at") + json.EncodeDateTime(e, s.At) + } + { + if s.AttemptCount.Set { + e.FieldStart("attempt_count") + s.AttemptCount.Encode(e) + } + } + { + if s.CompletedAt.Set { + e.FieldStart("completed_at") + s.CompletedAt.Encode(e, json.EncodeDateTime) + } + } + { + e.FieldStart("direction") + e.Str(s.Direction) + } + { + if s.DisplayName.Set { + e.FieldStart("display_name") + s.DisplayName.Encode(e) + } + } + { + if s.DurationMs.Set { + e.FieldStart("duration_ms") + s.DurationMs.Encode(e) + } + } + { + if s.Event.Set { + e.FieldStart("event") + s.Event.Encode(e) + } + } + { + if s.HTTPStatus.Set { + e.FieldStart("http_status") + s.HTTPStatus.Encode(e) + } + } + { + e.FieldStart("id") + e.Str(s.ID) + } + { + if s.NewTarget.Set { + e.FieldStart("new_target") + s.NewTarget.Encode(e) + } + } + { + if s.OldTarget.Set { + e.FieldStart("old_target") + s.OldTarget.Encode(e) + } + } + { + e.FieldStart("outcome") + e.Str(s.Outcome) + } + { + if s.Payload.Set { + e.FieldStart("payload") + s.Payload.Encode(e) + } + } + { + if s.PayloadAbsent.Set { + e.FieldStart("payload_absent") + s.PayloadAbsent.Encode(e) + } + } + { + e.FieldStart("provider") + e.Str(s.Provider) + } + { + if s.Ref.Set { + e.FieldStart("ref") + s.Ref.Encode(e) + } + } + { + if s.RefOp.Set { + e.FieldStart("ref_op") + s.RefOp.Encode(e) + } + } + { + if s.RepoID.Set { + e.FieldStart("repo_id") + s.RepoID.Encode(e) + } + } + { + if s.State.Set { + e.FieldStart("state") + s.State.Encode(e) + } + } + { + if s.SubscriptionID.Set { + e.FieldStart("subscription_id") + s.SubscriptionID.Encode(e) + } + } + { + if s.Target.Set { + e.FieldStart("target") + s.Target.Encode(e) + } + } + { + if s.WireRequestID.Set { + e.FieldStart("wire_request_id") + s.WireRequestID.Encode(e) + } } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -3404,264 +3034,292 @@ func (s *CISetupBlock) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCISetupBlock = [3]string{ - 0: "content", - 1: "format", - 2: "heading", -} - -// Decode decodes CISetupBlock from json. -func (s *CISetupBlock) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode CISetupBlock to nil") +var jsonFieldsNameOfCIDeliveryDetailView = [24]string{ + 0: "$schema", + 1: "account", + 2: "at", + 3: "attempt_count", + 4: "completed_at", + 5: "direction", + 6: "display_name", + 7: "duration_ms", + 8: "event", + 9: "http_status", + 10: "id", + 11: "new_target", + 12: "old_target", + 13: "outcome", + 14: "payload", + 15: "payload_absent", + 16: "provider", + 17: "ref", + 18: "ref_op", + 19: "repo_id", + 20: "state", + 21: "subscription_id", + 22: "target", + 23: "wire_request_id", +} + +// Decode decodes CIDeliveryDetailView from json. +func (s *CIDeliveryDetailView) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode CIDeliveryDetailView to nil") } - var requiredBitSet [1]uint8 + var requiredBitSet [3]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "content": - requiredBitSet[0] |= 1 << 0 + case "$schema": if err := func() error { - v, err := d.Str() - s.Content = string(v) - if err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"content\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "format": - requiredBitSet[0] |= 1 << 1 + case "account": if err := func() error { - v, err := d.Str() - s.Format = string(v) - if err != nil { + s.Account.Reset() + if err := s.Account.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"format\"") + return errors.Wrap(err, "decode field \"account\"") } - case "heading": + case "at": requiredBitSet[0] |= 1 << 2 if err := func() error { - v, err := d.Str() - s.Heading = string(v) + v, err := json.DecodeDateTime(d) + s.At = v if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"heading\"") + return errors.Wrap(err, "decode field \"at\"") } - default: - var elem jx.Raw + case "attempt_count": if err := func() error { - v, err := d.RawAppend(nil) - elem = jx.Raw(v) + s.AttemptCount.Reset() + if err := s.AttemptCount.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"attempt_count\"") + } + case "completed_at": + if err := func() error { + s.CompletedAt.Reset() + if err := s.CompletedAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"completed_at\"") + } + case "direction": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + v, err := d.Str() + s.Direction = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrapf(err, "decode field %q", k) + return errors.Wrap(err, "decode field \"direction\"") } - s.AdditionalProps[string(k)] = elem - } - return nil - }); err != nil { - return errors.Wrap(err, "decode CISetupBlock") - } - // Validate required fields. - var failures []validate.FieldError - for i, mask := range [1]uint8{ - 0b00000111, - } { - if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { - // Mask only required fields and check equality to mask using XOR. - // - // If XOR result is not zero, result is not equal to expected, so some fields are missed. - // Bits of fields which would be set are actually bits of missed fields. - missed := bits.OnesCount8(result) - for bitN := 0; bitN < missed; bitN++ { - bitIdx := bits.TrailingZeros8(result) - fieldIdx := i*8 + bitIdx - var name string - if fieldIdx < len(jsonFieldsNameOfCISetupBlock) { - name = jsonFieldsNameOfCISetupBlock[fieldIdx] - } else { - name = strconv.Itoa(fieldIdx) + case "display_name": + if err := func() error { + s.DisplayName.Reset() + if err := s.DisplayName.Decode(d); err != nil { + return err } - failures = append(failures, validate.FieldError{ - Name: name, - Error: validate.ErrFieldRequired, - }) - // Reset bit. - result &^= 1 << bitIdx + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"display_name\"") } - } - } - if len(failures) > 0 { - return &validate.Error{Fields: failures} - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s *CISetupBlock) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CISetupBlock) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode implements json.Marshaler. -func (s CISetupBlockAdditional) Encode(e *jx.Encoder) { - e.ObjStart() - s.encodeFields(e) - e.ObjEnd() -} - -// encodeFields implements json.Marshaler. -func (s CISetupBlockAdditional) encodeFields(e *jx.Encoder) { - for k, elem := range s { - e.FieldStart(k) - - if len(elem) != 0 { - e.Raw(elem) - } - } -} - -// Decode decodes CISetupBlockAdditional from json. -func (s *CISetupBlockAdditional) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode CISetupBlockAdditional to nil") - } - m := s.init() - if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { - var elem jx.Raw - if err := func() error { - v, err := d.RawAppend(nil) - elem = jx.Raw(v) - if err != nil { - return err + case "duration_ms": + if err := func() error { + s.DurationMs.Reset() + if err := s.DurationMs.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"duration_ms\"") } - return nil - }(); err != nil { - return errors.Wrapf(err, "decode field %q", k) - } - m[string(k)] = elem - return nil - }); err != nil { - return errors.Wrap(err, "decode CISetupBlockAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s CISetupBlockAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CISetupBlockAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode implements json.Marshaler. -func (s *CIWebhookAuditActor) Encode(e *jx.Encoder) { - e.ObjStart() - s.encodeFields(e) - e.ObjEnd() -} - -// encodeFields encodes fields. -func (s *CIWebhookAuditActor) encodeFields(e *jx.Encoder) { - { - e.FieldStart("account_id") - e.Str(s.AccountID) - } - { - if s.Handle.Set { - e.FieldStart("handle") - s.Handle.Encode(e) - } - } - { - if s.HandleProvider.Set { - e.FieldStart("handle_provider") - s.HandleProvider.Encode(e) - } - } - for k, elem := range s.AdditionalProps { - e.FieldStart(k) - - if len(elem) != 0 { - e.Raw(elem) - } - } -} - -var jsonFieldsNameOfCIWebhookAuditActor = [3]string{ - 0: "account_id", - 1: "handle", - 2: "handle_provider", -} - -// Decode decodes CIWebhookAuditActor from json. -func (s *CIWebhookAuditActor) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode CIWebhookAuditActor to nil") - } - var requiredBitSet [1]uint8 - s.AdditionalProps = map[string]jx.Raw{} - - if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { - switch string(k) { - case "account_id": - requiredBitSet[0] |= 1 << 0 + case "event": + if err := func() error { + s.Event.Reset() + if err := s.Event.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"event\"") + } + case "http_status": + if err := func() error { + s.HTTPStatus.Reset() + if err := s.HTTPStatus.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"http_status\"") + } + case "id": + requiredBitSet[1] |= 1 << 2 if err := func() error { v, err := d.Str() - s.AccountID = string(v) + s.ID = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"account_id\"") + return errors.Wrap(err, "decode field \"id\"") } - case "handle": + case "new_target": if err := func() error { - s.Handle.Reset() - if err := s.Handle.Decode(d); err != nil { + s.NewTarget.Reset() + if err := s.NewTarget.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"handle\"") + return errors.Wrap(err, "decode field \"new_target\"") } - case "handle_provider": + case "old_target": if err := func() error { - s.HandleProvider.Reset() - if err := s.HandleProvider.Decode(d); err != nil { + s.OldTarget.Reset() + if err := s.OldTarget.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"handle_provider\"") + return errors.Wrap(err, "decode field \"old_target\"") + } + case "outcome": + requiredBitSet[1] |= 1 << 5 + if err := func() error { + v, err := d.Str() + s.Outcome = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"outcome\"") + } + case "payload": + if err := func() error { + s.Payload.Reset() + if err := s.Payload.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"payload\"") + } + case "payload_absent": + if err := func() error { + s.PayloadAbsent.Reset() + if err := s.PayloadAbsent.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"payload_absent\"") + } + case "provider": + requiredBitSet[2] |= 1 << 0 + if err := func() error { + v, err := d.Str() + s.Provider = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider\"") + } + case "ref": + if err := func() error { + s.Ref.Reset() + if err := s.Ref.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"ref\"") + } + case "ref_op": + if err := func() error { + s.RefOp.Reset() + if err := s.RefOp.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"ref_op\"") + } + case "repo_id": + if err := func() error { + s.RepoID.Reset() + if err := s.RepoID.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"repo_id\"") + } + case "state": + if err := func() error { + s.State.Reset() + if err := s.State.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"state\"") + } + case "subscription_id": + if err := func() error { + s.SubscriptionID.Reset() + if err := s.SubscriptionID.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"subscription_id\"") + } + case "target": + if err := func() error { + s.Target.Reset() + if err := s.Target.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"target\"") + } + case "wire_request_id": + if err := func() error { + s.WireRequestID.Reset() + if err := s.WireRequestID.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"wire_request_id\"") } default: var elem jx.Raw @@ -3679,11 +3337,13 @@ func (s *CIWebhookAuditActor) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CIWebhookAuditActor") + return errors.Wrap(err, "decode CIDeliveryDetailView") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [1]uint8{ + for i, mask := range [3]uint8{ + 0b00100100, + 0b00100100, 0b00000001, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { @@ -3696,8 +3356,8 @@ func (s *CIWebhookAuditActor) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCIWebhookAuditActor) { - name = jsonFieldsNameOfCIWebhookAuditActor[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCIDeliveryDetailView) { + name = jsonFieldsNameOfCIDeliveryDetailView[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -3718,27 +3378,27 @@ func (s *CIWebhookAuditActor) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CIWebhookAuditActor) MarshalJSON() ([]byte, error) { +func (s *CIDeliveryDetailView) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIWebhookAuditActor) UnmarshalJSON(data []byte) error { +func (s *CIDeliveryDetailView) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CIWebhookAuditActorAdditional) Encode(e *jx.Encoder) { +func (s CIDeliveryDetailViewAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CIWebhookAuditActorAdditional) encodeFields(e *jx.Encoder) { +func (s CIDeliveryDetailViewAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -3748,10 +3408,10 @@ func (s CIWebhookAuditActorAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CIWebhookAuditActorAdditional from json. -func (s *CIWebhookAuditActorAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CIDeliveryDetailViewAdditional from json. +func (s *CIDeliveryDetailViewAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CIWebhookAuditActorAdditional to nil") + return errors.New("invalid: unable to decode CIDeliveryDetailViewAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -3769,55 +3429,65 @@ func (s *CIWebhookAuditActorAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CIWebhookAuditActorAdditional") + return errors.Wrap(err, "decode CIDeliveryDetailViewAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CIWebhookAuditActorAdditional) MarshalJSON() ([]byte, error) { +func (s CIDeliveryDetailViewAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIWebhookAuditActorAdditional) UnmarshalJSON(data []byte) error { +func (s *CIDeliveryDetailViewAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CIWebhookAuditEventView) Encode(e *jx.Encoder) { +func (s *CIDeliveryPayloadView) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CIWebhookAuditEventView) encodeFields(e *jx.Encoder) { +func (s *CIDeliveryPayloadView) encodeFields(e *jx.Encoder) { { - e.FieldStart("actor") - s.Actor.Encode(e) + e.FieldStart("endpoint") + e.Str(s.Endpoint) } { - e.FieldStart("event_type") - e.Str(s.EventType) + e.FieldStart("from_attempt") + e.Int64(s.FromAttempt) } { - e.FieldStart("id") - e.Str(s.ID) + e.FieldStart("request_body") + e.Str(s.RequestBody) } { - if s.Metadata.Set { - e.FieldStart("metadata") - s.Metadata.Encode(e) - } + e.FieldStart("request_headers") + s.RequestHeaders.Encode(e) } { - e.FieldStart("occurred_at") - json.EncodeDateTime(e, s.OccurredAt) + e.FieldStart("request_truncated") + e.Bool(s.RequestTruncated) + } + { + e.FieldStart("response_body") + e.Str(s.ResponseBody) + } + { + e.FieldStart("response_present") + e.Bool(s.ResponsePresent) + } + { + e.FieldStart("response_truncated") + e.Bool(s.ResponseTruncated) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -3828,79 +3498,120 @@ func (s *CIWebhookAuditEventView) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCIWebhookAuditEventView = [5]string{ - 0: "actor", - 1: "event_type", - 2: "id", - 3: "metadata", - 4: "occurred_at", +var jsonFieldsNameOfCIDeliveryPayloadView = [8]string{ + 0: "endpoint", + 1: "from_attempt", + 2: "request_body", + 3: "request_headers", + 4: "request_truncated", + 5: "response_body", + 6: "response_present", + 7: "response_truncated", } -// Decode decodes CIWebhookAuditEventView from json. -func (s *CIWebhookAuditEventView) Decode(d *jx.Decoder) error { +// Decode decodes CIDeliveryPayloadView from json. +func (s *CIDeliveryPayloadView) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CIWebhookAuditEventView to nil") + return errors.New("invalid: unable to decode CIDeliveryPayloadView to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "actor": + case "endpoint": requiredBitSet[0] |= 1 << 0 if err := func() error { - if err := s.Actor.Decode(d); err != nil { + v, err := d.Str() + s.Endpoint = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"actor\"") + return errors.Wrap(err, "decode field \"endpoint\"") } - case "event_type": + case "from_attempt": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.EventType = string(v) + v, err := d.Int64() + s.FromAttempt = int64(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"event_type\"") + return errors.Wrap(err, "decode field \"from_attempt\"") } - case "id": + case "request_body": requiredBitSet[0] |= 1 << 2 if err := func() error { v, err := d.Str() - s.ID = string(v) + s.RequestBody = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"id\"") + return errors.Wrap(err, "decode field \"request_body\"") } - case "metadata": + case "request_headers": + requiredBitSet[0] |= 1 << 3 if err := func() error { - s.Metadata.Reset() - if err := s.Metadata.Decode(d); err != nil { + if err := s.RequestHeaders.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"metadata\"") + return errors.Wrap(err, "decode field \"request_headers\"") } - case "occurred_at": + case "request_truncated": requiredBitSet[0] |= 1 << 4 if err := func() error { - v, err := json.DecodeDateTime(d) - s.OccurredAt = v + v, err := d.Bool() + s.RequestTruncated = bool(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"occurred_at\"") + return errors.Wrap(err, "decode field \"request_truncated\"") + } + case "response_body": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + v, err := d.Str() + s.ResponseBody = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"response_body\"") + } + case "response_present": + requiredBitSet[0] |= 1 << 6 + if err := func() error { + v, err := d.Bool() + s.ResponsePresent = bool(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"response_present\"") + } + case "response_truncated": + requiredBitSet[0] |= 1 << 7 + if err := func() error { + v, err := d.Bool() + s.ResponseTruncated = bool(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"response_truncated\"") } default: var elem jx.Raw @@ -3918,12 +3629,12 @@ func (s *CIWebhookAuditEventView) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CIWebhookAuditEventView") + return errors.Wrap(err, "decode CIDeliveryPayloadView") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00010111, + 0b11111111, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -3935,8 +3646,8 @@ func (s *CIWebhookAuditEventView) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCIWebhookAuditEventView) { - name = jsonFieldsNameOfCIWebhookAuditEventView[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCIDeliveryPayloadView) { + name = jsonFieldsNameOfCIDeliveryPayloadView[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -3957,27 +3668,27 @@ func (s *CIWebhookAuditEventView) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CIWebhookAuditEventView) MarshalJSON() ([]byte, error) { +func (s *CIDeliveryPayloadView) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIWebhookAuditEventView) UnmarshalJSON(data []byte) error { +func (s *CIDeliveryPayloadView) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CIWebhookAuditEventViewAdditional) Encode(e *jx.Encoder) { +func (s CIDeliveryPayloadViewAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CIWebhookAuditEventViewAdditional) encodeFields(e *jx.Encoder) { +func (s CIDeliveryPayloadViewAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -3987,10 +3698,10 @@ func (s CIWebhookAuditEventViewAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CIWebhookAuditEventViewAdditional from json. -func (s *CIWebhookAuditEventViewAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CIDeliveryPayloadViewAdditional from json. +func (s *CIDeliveryPayloadViewAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CIWebhookAuditEventViewAdditional to nil") + return errors.New("invalid: unable to decode CIDeliveryPayloadViewAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -4008,54 +3719,52 @@ func (s *CIWebhookAuditEventViewAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CIWebhookAuditEventViewAdditional") + return errors.Wrap(err, "decode CIDeliveryPayloadViewAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CIWebhookAuditEventViewAdditional) MarshalJSON() ([]byte, error) { +func (s CIDeliveryPayloadViewAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIWebhookAuditEventViewAdditional) UnmarshalJSON(data []byte) error { +func (s *CIDeliveryPayloadViewAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CIWebhookAuditEventViewMetadata) Encode(e *jx.Encoder) { +func (s CIDeliveryPayloadViewRequestHeaders) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CIWebhookAuditEventViewMetadata) encodeFields(e *jx.Encoder) { +func (s CIDeliveryPayloadViewRequestHeaders) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) - if len(elem) != 0 { - e.Raw(elem) - } + e.Str(elem) } } -// Decode decodes CIWebhookAuditEventViewMetadata from json. -func (s *CIWebhookAuditEventViewMetadata) Decode(d *jx.Decoder) error { +// Decode decodes CIDeliveryPayloadViewRequestHeaders from json. +func (s *CIDeliveryPayloadViewRequestHeaders) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CIWebhookAuditEventViewMetadata to nil") + return errors.New("invalid: unable to decode CIDeliveryPayloadViewRequestHeaders to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { - var elem jx.Raw + var elem string if err := func() error { - v, err := d.RawAppend(nil) - elem = jx.Raw(v) + v, err := d.Str() + elem = string(v) if err != nil { return err } @@ -4066,91 +3775,149 @@ func (s *CIWebhookAuditEventViewMetadata) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CIWebhookAuditEventViewMetadata") + return errors.Wrap(err, "decode CIDeliveryPayloadViewRequestHeaders") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CIWebhookAuditEventViewMetadata) MarshalJSON() ([]byte, error) { +func (s CIDeliveryPayloadViewRequestHeaders) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIWebhookAuditEventViewMetadata) UnmarshalJSON(data []byte) error { +func (s *CIDeliveryPayloadViewRequestHeaders) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CIWebhookView) Encode(e *jx.Encoder) { +func (s *CIDeliveryView) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CIWebhookView) encodeFields(e *jx.Encoder) { +func (s *CIDeliveryView) encodeFields(e *jx.Encoder) { { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) + if s.Account.Set { + e.FieldStart("account") + s.Account.Encode(e) } } { - e.FieldStart("bk_organization") - e.Str(s.BkOrganization) + e.FieldStart("at") + json.EncodeDateTime(e, s.At) } { - e.FieldStart("bk_pipeline") - e.Str(s.BkPipeline) + if s.AttemptCount.Set { + e.FieldStart("attempt_count") + s.AttemptCount.Encode(e) + } } { - e.FieldStart("created_at") - json.EncodeDateTime(e, s.CreatedAt) + if s.CompletedAt.Set { + e.FieldStart("completed_at") + s.CompletedAt.Encode(e, json.EncodeDateTime) + } } { - e.FieldStart("display_name") - e.Str(s.DisplayName) + e.FieldStart("direction") + e.Str(s.Direction) } { - e.FieldStart("enabled") - e.Bool(s.Enabled) + if s.DisplayName.Set { + e.FieldStart("display_name") + s.DisplayName.Encode(e) + } } { - e.FieldStart("events") - e.ArrStart() - for _, elem := range s.Events { - e.Str(elem) + if s.DurationMs.Set { + e.FieldStart("duration_ms") + s.DurationMs.Encode(e) + } + } + { + if s.Event.Set { + e.FieldStart("event") + s.Event.Encode(e) + } + } + { + if s.HTTPStatus.Set { + e.FieldStart("http_status") + s.HTTPStatus.Encode(e) } - e.ArrEnd() } { e.FieldStart("id") e.Str(s.ID) } + { + if s.NewTarget.Set { + e.FieldStart("new_target") + s.NewTarget.Encode(e) + } + } + { + if s.OldTarget.Set { + e.FieldStart("old_target") + s.OldTarget.Encode(e) + } + } + { + e.FieldStart("outcome") + e.Str(s.Outcome) + } { e.FieldStart("provider") e.Str(s.Provider) } { - e.FieldStart("publish_checks") - e.Bool(s.PublishChecks) + if s.Ref.Set { + e.FieldStart("ref") + s.Ref.Encode(e) + } } { - e.FieldStart("ref_filter") - e.Str(s.RefFilter) + if s.RefOp.Set { + e.FieldStart("ref_op") + s.RefOp.Encode(e) + } } { - e.FieldStart("repo_id") - e.Str(s.RepoID) + if s.RepoID.Set { + e.FieldStart("repo_id") + s.RepoID.Encode(e) + } } { - e.FieldStart("updated_at") - json.EncodeDateTime(e, s.UpdatedAt) + if s.State.Set { + e.FieldStart("state") + s.State.Encode(e) + } + } + { + if s.SubscriptionID.Set { + e.FieldStart("subscription_id") + s.SubscriptionID.Encode(e) + } + } + { + if s.Target.Set { + e.FieldStart("target") + s.Target.Encode(e) + } + } + { + if s.WireRequestID.Set { + e.FieldStart("wire_request_id") + s.WireRequestID.Encode(e) + } } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -4161,124 +3928,136 @@ func (s *CIWebhookView) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCIWebhookView = [13]string{ - 0: "$schema", - 1: "bk_organization", - 2: "bk_pipeline", - 3: "created_at", - 4: "display_name", - 5: "enabled", - 6: "events", - 7: "id", - 8: "provider", - 9: "publish_checks", - 10: "ref_filter", - 11: "repo_id", - 12: "updated_at", +var jsonFieldsNameOfCIDeliveryView = [21]string{ + 0: "account", + 1: "at", + 2: "attempt_count", + 3: "completed_at", + 4: "direction", + 5: "display_name", + 6: "duration_ms", + 7: "event", + 8: "http_status", + 9: "id", + 10: "new_target", + 11: "old_target", + 12: "outcome", + 13: "provider", + 14: "ref", + 15: "ref_op", + 16: "repo_id", + 17: "state", + 18: "subscription_id", + 19: "target", + 20: "wire_request_id", } -// Decode decodes CIWebhookView from json. -func (s *CIWebhookView) Decode(d *jx.Decoder) error { +// Decode decodes CIDeliveryView from json. +func (s *CIDeliveryView) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CIWebhookView to nil") + return errors.New("invalid: unable to decode CIDeliveryView to nil") } - var requiredBitSet [2]uint8 + var requiredBitSet [3]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "account": if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + s.Account.Reset() + if err := s.Account.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"account\"") } - case "bk_organization": + case "at": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.BkOrganization = string(v) + v, err := json.DecodeDateTime(d) + s.At = v if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"bk_organization\"") + return errors.Wrap(err, "decode field \"at\"") } - case "bk_pipeline": - requiredBitSet[0] |= 1 << 2 + case "attempt_count": if err := func() error { - v, err := d.Str() - s.BkPipeline = string(v) - if err != nil { + s.AttemptCount.Reset() + if err := s.AttemptCount.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"bk_pipeline\"") + return errors.Wrap(err, "decode field \"attempt_count\"") } - case "created_at": - requiredBitSet[0] |= 1 << 3 + case "completed_at": if err := func() error { - v, err := json.DecodeDateTime(d) - s.CreatedAt = v - if err != nil { + s.CompletedAt.Reset() + if err := s.CompletedAt.Decode(d, json.DecodeDateTime); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"created_at\"") + return errors.Wrap(err, "decode field \"completed_at\"") } - case "display_name": + case "direction": requiredBitSet[0] |= 1 << 4 if err := func() error { v, err := d.Str() - s.DisplayName = string(v) + s.Direction = string(v) if err != nil { return err } return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"direction\"") + } + case "display_name": + if err := func() error { + s.DisplayName.Reset() + if err := s.DisplayName.Decode(d); err != nil { + return err + } + return nil }(); err != nil { return errors.Wrap(err, "decode field \"display_name\"") } - case "enabled": - requiredBitSet[0] |= 1 << 5 + case "duration_ms": if err := func() error { - v, err := d.Bool() - s.Enabled = bool(v) - if err != nil { + s.DurationMs.Reset() + if err := s.DurationMs.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"enabled\"") + return errors.Wrap(err, "decode field \"duration_ms\"") } - case "events": - requiredBitSet[0] |= 1 << 6 + case "event": if err := func() error { - s.Events = make([]string, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem string - v, err := d.Str() - elem = string(v) - if err != nil { - return err - } - s.Events = append(s.Events, elem) - return nil - }); err != nil { + s.Event.Reset() + if err := s.Event.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"events\"") + return errors.Wrap(err, "decode field \"event\"") + } + case "http_status": + if err := func() error { + s.HTTPStatus.Reset() + if err := s.HTTPStatus.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"http_status\"") } case "id": - requiredBitSet[0] |= 1 << 7 + requiredBitSet[1] |= 1 << 1 if err := func() error { v, err := d.Str() s.ID = string(v) @@ -4289,8 +4068,40 @@ func (s *CIWebhookView) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"id\"") } + case "new_target": + if err := func() error { + s.NewTarget.Reset() + if err := s.NewTarget.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"new_target\"") + } + case "old_target": + if err := func() error { + s.OldTarget.Reset() + if err := s.OldTarget.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"old_target\"") + } + case "outcome": + requiredBitSet[1] |= 1 << 4 + if err := func() error { + v, err := d.Str() + s.Outcome = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"outcome\"") + } case "provider": - requiredBitSet[1] |= 1 << 0 + requiredBitSet[1] |= 1 << 5 if err := func() error { v, err := d.Str() s.Provider = string(v) @@ -4301,53 +4112,75 @@ func (s *CIWebhookView) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"provider\"") } - case "publish_checks": - requiredBitSet[1] |= 1 << 1 + case "ref": if err := func() error { - v, err := d.Bool() - s.PublishChecks = bool(v) - if err != nil { + s.Ref.Reset() + if err := s.Ref.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"publish_checks\"") + return errors.Wrap(err, "decode field \"ref\"") } - case "ref_filter": - requiredBitSet[1] |= 1 << 2 + case "ref_op": if err := func() error { - v, err := d.Str() - s.RefFilter = string(v) - if err != nil { + s.RefOp.Reset() + if err := s.RefOp.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"ref_filter\"") + return errors.Wrap(err, "decode field \"ref_op\"") } case "repo_id": - requiredBitSet[1] |= 1 << 3 if err := func() error { - v, err := d.Str() - s.RepoID = string(v) - if err != nil { + s.RepoID.Reset() + if err := s.RepoID.Decode(d); err != nil { return err } return nil }(); err != nil { return errors.Wrap(err, "decode field \"repo_id\"") } - case "updated_at": - requiredBitSet[1] |= 1 << 4 + case "state": if err := func() error { - v, err := json.DecodeDateTime(d) - s.UpdatedAt = v - if err != nil { + s.State.Reset() + if err := s.State.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"updated_at\"") + return errors.Wrap(err, "decode field \"state\"") + } + case "subscription_id": + if err := func() error { + s.SubscriptionID.Reset() + if err := s.SubscriptionID.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"subscription_id\"") + } + case "target": + if err := func() error { + s.Target.Reset() + if err := s.Target.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"target\"") + } + case "wire_request_id": + if err := func() error { + s.WireRequestID.Reset() + if err := s.WireRequestID.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"wire_request_id\"") } default: var elem jx.Raw @@ -4365,13 +4198,14 @@ func (s *CIWebhookView) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CIWebhookView") + return errors.Wrap(err, "decode CIDeliveryView") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [2]uint8{ - 0b11111110, - 0b00011111, + for i, mask := range [3]uint8{ + 0b00010010, + 0b00110010, + 0b00000000, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -4383,8 +4217,8 @@ func (s *CIWebhookView) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCIWebhookView) { - name = jsonFieldsNameOfCIWebhookView[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCIDeliveryView) { + name = jsonFieldsNameOfCIDeliveryView[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -4405,27 +4239,27 @@ func (s *CIWebhookView) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CIWebhookView) MarshalJSON() ([]byte, error) { +func (s *CIDeliveryView) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIWebhookView) UnmarshalJSON(data []byte) error { +func (s *CIDeliveryView) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CIWebhookViewAdditional) Encode(e *jx.Encoder) { +func (s CIDeliveryViewAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CIWebhookViewAdditional) encodeFields(e *jx.Encoder) { +func (s CIDeliveryViewAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -4435,10 +4269,10 @@ func (s CIWebhookViewAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CIWebhookViewAdditional from json. -func (s *CIWebhookViewAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CIDeliveryViewAdditional from json. +func (s *CIDeliveryViewAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CIWebhookViewAdditional to nil") + return errors.New("invalid: unable to decode CIDeliveryViewAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -4456,55 +4290,71 @@ func (s *CIWebhookViewAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CIWebhookViewAdditional") + return errors.Wrap(err, "decode CIDeliveryViewAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CIWebhookViewAdditional) MarshalJSON() ([]byte, error) { +func (s CIDeliveryViewAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CIWebhookViewAdditional) UnmarshalJSON(data []byte) error { +func (s *CIDeliveryViewAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *Cluster) Encode(e *jx.Encoder) { +func (s *CIJobView) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *Cluster) encodeFields(e *jx.Encoder) { +func (s *CIJobView) encodeFields(e *jx.Encoder) { { - if s.ApiUrl.Set { - e.FieldStart("apiUrl") - s.ApiUrl.Encode(e) + e.FieldStart("bk_job_id") + e.Str(s.BkJobID) + } + { + if s.ExitStatus.Set { + e.FieldStart("exit_status") + s.ExitStatus.Encode(e) } } { - e.FieldStart("isDefault") - e.Bool(s.IsDefault) + if s.FinishedAt.Set { + e.FieldStart("finished_at") + s.FinishedAt.Encode(e, json.EncodeDateTime) + } } { - e.FieldStart("jurisdiction") - e.Str(s.Jurisdiction) + e.FieldStart("name") + e.Str(s.Name) } { - e.FieldStart("publicUrl") - e.Str(s.PublicUrl) + if s.StartedAt.Set { + e.FieldStart("started_at") + s.StartedAt.Encode(e, json.EncodeDateTime) + } } { - e.FieldStart("slug") - e.Str(s.Slug) + e.FieldStart("state") + e.Str(s.State) + } + { + e.FieldStart("step_key") + e.Str(s.StepKey) + } + { + e.FieldStart("type") + e.Str(s.Type) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -4515,81 +4365,116 @@ func (s *Cluster) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCluster = [5]string{ - 0: "apiUrl", - 1: "isDefault", - 2: "jurisdiction", - 3: "publicUrl", - 4: "slug", +var jsonFieldsNameOfCIJobView = [8]string{ + 0: "bk_job_id", + 1: "exit_status", + 2: "finished_at", + 3: "name", + 4: "started_at", + 5: "state", + 6: "step_key", + 7: "type", } -// Decode decodes Cluster from json. -func (s *Cluster) Decode(d *jx.Decoder) error { +// Decode decodes CIJobView from json. +func (s *CIJobView) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode Cluster to nil") + return errors.New("invalid: unable to decode CIJobView to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "apiUrl": + case "bk_job_id": + requiredBitSet[0] |= 1 << 0 if err := func() error { - s.ApiUrl.Reset() - if err := s.ApiUrl.Decode(d); err != nil { + v, err := d.Str() + s.BkJobID = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"apiUrl\"") + return errors.Wrap(err, "decode field \"bk_job_id\"") } - case "isDefault": - requiredBitSet[0] |= 1 << 1 + case "exit_status": if err := func() error { - v, err := d.Bool() - s.IsDefault = bool(v) + s.ExitStatus.Reset() + if err := s.ExitStatus.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"exit_status\"") + } + case "finished_at": + if err := func() error { + s.FinishedAt.Reset() + if err := s.FinishedAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"finished_at\"") + } + case "name": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.Name = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"isDefault\"") + return errors.Wrap(err, "decode field \"name\"") } - case "jurisdiction": - requiredBitSet[0] |= 1 << 2 + case "started_at": + if err := func() error { + s.StartedAt.Reset() + if err := s.StartedAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"started_at\"") + } + case "state": + requiredBitSet[0] |= 1 << 5 if err := func() error { v, err := d.Str() - s.Jurisdiction = string(v) + s.State = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"jurisdiction\"") + return errors.Wrap(err, "decode field \"state\"") } - case "publicUrl": - requiredBitSet[0] |= 1 << 3 + case "step_key": + requiredBitSet[0] |= 1 << 6 if err := func() error { v, err := d.Str() - s.PublicUrl = string(v) + s.StepKey = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"publicUrl\"") + return errors.Wrap(err, "decode field \"step_key\"") } - case "slug": - requiredBitSet[0] |= 1 << 4 + case "type": + requiredBitSet[0] |= 1 << 7 if err := func() error { v, err := d.Str() - s.Slug = string(v) + s.Type = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"slug\"") + return errors.Wrap(err, "decode field \"type\"") } default: var elem jx.Raw @@ -4607,12 +4492,12 @@ func (s *Cluster) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode Cluster") + return errors.Wrap(err, "decode CIJobView") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00011110, + 0b11101001, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -4624,8 +4509,8 @@ func (s *Cluster) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCluster) { - name = jsonFieldsNameOfCluster[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCIJobView) { + name = jsonFieldsNameOfCIJobView[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -4646,27 +4531,27 @@ func (s *Cluster) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *Cluster) MarshalJSON() ([]byte, error) { +func (s *CIJobView) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *Cluster) UnmarshalJSON(data []byte) error { +func (s *CIJobView) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ClusterAdditional) Encode(e *jx.Encoder) { +func (s CIJobViewAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ClusterAdditional) encodeFields(e *jx.Encoder) { +func (s CIJobViewAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -4676,10 +4561,10 @@ func (s ClusterAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ClusterAdditional from json. -func (s *ClusterAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CIJobViewAdditional from json. +func (s *CIJobViewAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ClusterAdditional to nil") + return errors.New("invalid: unable to decode CIJobViewAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -4697,43 +4582,67 @@ func (s *ClusterAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ClusterAdditional") + return errors.Wrap(err, "decode CIJobViewAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ClusterAdditional) MarshalJSON() ([]byte, error) { +func (s CIJobViewAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ClusterAdditional) UnmarshalJSON(data []byte) error { +func (s *CIJobViewAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CompleteOnboardingOutputBody) Encode(e *jx.Encoder) { +func (s *CIProviderDescriptor) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CompleteOnboardingOutputBody) encodeFields(e *jx.Encoder) { +func (s *CIProviderDescriptor) encodeFields(e *jx.Encoder) { { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) + e.FieldStart("enrollable") + e.Bool(s.Enrollable) + } + { + e.FieldStart("fields") + e.ArrStart() + for _, elem := range s.Fields { + elem.Encode(e) } + e.ArrEnd() } { - e.FieldStart("needsOnboarding") - e.Bool(s.NeedsOnboarding) + e.FieldStart("label") + e.Str(s.Label) + } + { + e.FieldStart("modes") + e.ArrStart() + for _, elem := range s.Modes { + elem.Encode(e) + } + e.ArrEnd() + } + { + e.FieldStart("name") + e.Str(s.Name) + } + { + if s.Reason.Set { + e.FieldStart("reason") + s.Reason.Encode(e) + } } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -4744,42 +4653,106 @@ func (s *CompleteOnboardingOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCompleteOnboardingOutputBody = [2]string{ - 0: "$schema", - 1: "needsOnboarding", +var jsonFieldsNameOfCIProviderDescriptor = [6]string{ + 0: "enrollable", + 1: "fields", + 2: "label", + 3: "modes", + 4: "name", + 5: "reason", } -// Decode decodes CompleteOnboardingOutputBody from json. -func (s *CompleteOnboardingOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes CIProviderDescriptor from json. +func (s *CIProviderDescriptor) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CompleteOnboardingOutputBody to nil") + return errors.New("invalid: unable to decode CIProviderDescriptor to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "enrollable": + requiredBitSet[0] |= 1 << 0 if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + v, err := d.Bool() + s.Enrollable = bool(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"enrollable\"") } - case "needsOnboarding": + case "fields": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Bool() - s.NeedsOnboarding = bool(v) + s.Fields = make([]CIProviderField, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem CIProviderField + if err := elem.Decode(d); err != nil { + return err + } + s.Fields = append(s.Fields, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"fields\"") + } + case "label": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.Label = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"needsOnboarding\"") + return errors.Wrap(err, "decode field \"label\"") + } + case "modes": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + s.Modes = make([]CIProviderMode, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem CIProviderMode + if err := elem.Decode(d); err != nil { + return err + } + s.Modes = append(s.Modes, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"modes\"") + } + case "name": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + v, err := d.Str() + s.Name = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"name\"") + } + case "reason": + if err := func() error { + s.Reason.Reset() + if err := s.Reason.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"reason\"") } default: var elem jx.Raw @@ -4797,12 +4770,12 @@ func (s *CompleteOnboardingOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CompleteOnboardingOutputBody") + return errors.Wrap(err, "decode CIProviderDescriptor") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00011111, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -4814,8 +4787,8 @@ func (s *CompleteOnboardingOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCompleteOnboardingOutputBody) { - name = jsonFieldsNameOfCompleteOnboardingOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCIProviderDescriptor) { + name = jsonFieldsNameOfCIProviderDescriptor[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -4836,27 +4809,27 @@ func (s *CompleteOnboardingOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CompleteOnboardingOutputBody) MarshalJSON() ([]byte, error) { +func (s *CIProviderDescriptor) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CompleteOnboardingOutputBody) UnmarshalJSON(data []byte) error { +func (s *CIProviderDescriptor) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CompleteOnboardingOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s CIProviderDescriptorAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CompleteOnboardingOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s CIProviderDescriptorAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -4866,10 +4839,10 @@ func (s CompleteOnboardingOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CompleteOnboardingOutputBodyAdditional from json. -func (s *CompleteOnboardingOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CIProviderDescriptorAdditional from json. +func (s *CIProviderDescriptorAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CompleteOnboardingOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode CIProviderDescriptorAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -4887,47 +4860,79 @@ func (s *CompleteOnboardingOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CompleteOnboardingOutputBodyAdditional") + return errors.Wrap(err, "decode CIProviderDescriptorAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CompleteOnboardingOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s CIProviderDescriptorAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CompleteOnboardingOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *CIProviderDescriptorAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ConnectOrgCIBuildkiteCredentialInputBody) Encode(e *jx.Encoder) { +func (s *CIProviderField) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ConnectOrgCIBuildkiteCredentialInputBody) encodeFields(e *jx.Encoder) { +func (s *CIProviderField) encodeFields(e *jx.Encoder) { { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) + if s.Help.Set { + e.FieldStart("help") + s.Help.Encode(e) } } { - e.FieldStart("bk_api_token") - e.Str(s.BkAPIToken) + e.FieldStart("key") + e.Str(s.Key) } { - e.FieldStart("bk_organization") - e.Str(s.BkOrganization) + e.FieldStart("kind") + e.Str(s.Kind) + } + { + e.FieldStart("label") + e.Str(s.Label) + } + { + if s.Options != nil { + e.FieldStart("options") + e.ArrStart() + for _, elem := range s.Options { + elem.Encode(e) + } + e.ArrEnd() + } + } + { + if s.Placeholder.Set { + e.FieldStart("placeholder") + s.Placeholder.Encode(e) + } + } + { + e.FieldStart("required_in") + e.ArrStart() + for _, elem := range s.RequiredIn { + e.Str(elem) + } + e.ArrEnd() + } + { + e.FieldStart("target") + e.Str(s.Target) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -4938,55 +4943,131 @@ func (s *ConnectOrgCIBuildkiteCredentialInputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfConnectOrgCIBuildkiteCredentialInputBody = [3]string{ - 0: "$schema", - 1: "bk_api_token", - 2: "bk_organization", -} - -// Decode decodes ConnectOrgCIBuildkiteCredentialInputBody from json. -func (s *ConnectOrgCIBuildkiteCredentialInputBody) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode ConnectOrgCIBuildkiteCredentialInputBody to nil") - } +var jsonFieldsNameOfCIProviderField = [8]string{ + 0: "help", + 1: "key", + 2: "kind", + 3: "label", + 4: "options", + 5: "placeholder", + 6: "required_in", + 7: "target", +} + +// Decode decodes CIProviderField from json. +func (s *CIProviderField) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode CIProviderField to nil") + } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "help": if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + s.Help.Reset() + if err := s.Help.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"help\"") } - case "bk_api_token": + case "key": requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.BkAPIToken = string(v) + s.Key = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"bk_api_token\"") + return errors.Wrap(err, "decode field \"key\"") } - case "bk_organization": + case "kind": requiredBitSet[0] |= 1 << 2 if err := func() error { v, err := d.Str() - s.BkOrganization = string(v) + s.Kind = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"bk_organization\"") + return errors.Wrap(err, "decode field \"kind\"") + } + case "label": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.Label = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"label\"") + } + case "options": + if err := func() error { + s.Options = make([]CIProviderOption, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem CIProviderOption + if err := elem.Decode(d); err != nil { + return err + } + s.Options = append(s.Options, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"options\"") + } + case "placeholder": + if err := func() error { + s.Placeholder.Reset() + if err := s.Placeholder.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"placeholder\"") + } + case "required_in": + requiredBitSet[0] |= 1 << 6 + if err := func() error { + s.RequiredIn = make([]string, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem string + v, err := d.Str() + elem = string(v) + if err != nil { + return err + } + s.RequiredIn = append(s.RequiredIn, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"required_in\"") + } + case "target": + requiredBitSet[0] |= 1 << 7 + if err := func() error { + v, err := d.Str() + s.Target = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"target\"") } default: var elem jx.Raw @@ -5004,12 +5085,12 @@ func (s *ConnectOrgCIBuildkiteCredentialInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ConnectOrgCIBuildkiteCredentialInputBody") + return errors.Wrap(err, "decode CIProviderField") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000110, + 0b11001110, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -5021,8 +5102,8 @@ func (s *ConnectOrgCIBuildkiteCredentialInputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfConnectOrgCIBuildkiteCredentialInputBody) { - name = jsonFieldsNameOfConnectOrgCIBuildkiteCredentialInputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCIProviderField) { + name = jsonFieldsNameOfCIProviderField[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -5043,27 +5124,27 @@ func (s *ConnectOrgCIBuildkiteCredentialInputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ConnectOrgCIBuildkiteCredentialInputBody) MarshalJSON() ([]byte, error) { +func (s *CIProviderField) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ConnectOrgCIBuildkiteCredentialInputBody) UnmarshalJSON(data []byte) error { +func (s *CIProviderField) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ConnectOrgCIBuildkiteCredentialInputBodyAdditional) Encode(e *jx.Encoder) { +func (s CIProviderFieldAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ConnectOrgCIBuildkiteCredentialInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s CIProviderFieldAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -5073,10 +5154,10 @@ func (s ConnectOrgCIBuildkiteCredentialInputBodyAdditional) encodeFields(e *jx.E } } -// Decode decodes ConnectOrgCIBuildkiteCredentialInputBodyAdditional from json. -func (s *ConnectOrgCIBuildkiteCredentialInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CIProviderFieldAdditional from json. +func (s *CIProviderFieldAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ConnectOrgCIBuildkiteCredentialInputBodyAdditional to nil") + return errors.New("invalid: unable to decode CIProviderFieldAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -5094,49 +5175,53 @@ func (s *ConnectOrgCIBuildkiteCredentialInputBodyAdditional) Decode(d *jx.Decode m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ConnectOrgCIBuildkiteCredentialInputBodyAdditional") + return errors.Wrap(err, "decode CIProviderFieldAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ConnectOrgCIBuildkiteCredentialInputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s CIProviderFieldAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ConnectOrgCIBuildkiteCredentialInputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *CIProviderFieldAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CreateBindingInputBody) Encode(e *jx.Encoder) { +func (s *CIProviderMode) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CreateBindingInputBody) encodeFields(e *jx.Encoder) { +func (s *CIProviderMode) encodeFields(e *jx.Encoder) { { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) + if s.Default.Set { + e.FieldStart("default") + s.Default.Encode(e) } } { - if len(s.AttributeFilter) != 0 { - e.FieldStart("attributeFilter") - e.Raw(s.AttributeFilter) + if s.Help.Set { + e.FieldStart("help") + s.Help.Encode(e) } } { - e.FieldStart("providerId") - e.Str(s.ProviderId) + e.FieldStart("key") + e.Str(s.Key) + } + { + e.FieldStart("label") + e.Str(s.Label) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -5147,54 +5232,66 @@ func (s *CreateBindingInputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCreateBindingInputBody = [3]string{ - 0: "$schema", - 1: "attributeFilter", - 2: "providerId", +var jsonFieldsNameOfCIProviderMode = [4]string{ + 0: "default", + 1: "help", + 2: "key", + 3: "label", } -// Decode decodes CreateBindingInputBody from json. -func (s *CreateBindingInputBody) Decode(d *jx.Decoder) error { +// Decode decodes CIProviderMode from json. +func (s *CIProviderMode) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateBindingInputBody to nil") + return errors.New("invalid: unable to decode CIProviderMode to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "default": if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + s.Default.Reset() + if err := s.Default.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"default\"") } - case "attributeFilter": + case "help": if err := func() error { - v, err := d.RawAppend(nil) - s.AttributeFilter = jx.Raw(v) - if err != nil { + s.Help.Reset() + if err := s.Help.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"attributeFilter\"") + return errors.Wrap(err, "decode field \"help\"") } - case "providerId": + case "key": requiredBitSet[0] |= 1 << 2 if err := func() error { v, err := d.Str() - s.ProviderId = string(v) + s.Key = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"providerId\"") + return errors.Wrap(err, "decode field \"key\"") + } + case "label": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.Label = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"label\"") } default: var elem jx.Raw @@ -5212,12 +5309,12 @@ func (s *CreateBindingInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CreateBindingInputBody") + return errors.Wrap(err, "decode CIProviderMode") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000100, + 0b00001100, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -5229,8 +5326,8 @@ func (s *CreateBindingInputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCreateBindingInputBody) { - name = jsonFieldsNameOfCreateBindingInputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCIProviderMode) { + name = jsonFieldsNameOfCIProviderMode[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -5251,27 +5348,27 @@ func (s *CreateBindingInputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CreateBindingInputBody) MarshalJSON() ([]byte, error) { +func (s *CIProviderMode) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateBindingInputBody) UnmarshalJSON(data []byte) error { +func (s *CIProviderMode) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CreateBindingInputBodyAdditional) Encode(e *jx.Encoder) { +func (s CIProviderModeAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CreateBindingInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s CIProviderModeAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -5281,10 +5378,10 @@ func (s CreateBindingInputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CreateBindingInputBodyAdditional from json. -func (s *CreateBindingInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CIProviderModeAdditional from json. +func (s *CIProviderModeAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateBindingInputBodyAdditional to nil") + return errors.New("invalid: unable to decode CIProviderModeAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -5302,55 +5399,41 @@ func (s *CreateBindingInputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CreateBindingInputBodyAdditional") + return errors.Wrap(err, "decode CIProviderModeAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CreateBindingInputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s CIProviderModeAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateBindingInputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *CIProviderModeAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CreateMirrorInputBody) Encode(e *jx.Encoder) { +func (s *CIProviderOption) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CreateMirrorInputBody) encodeFields(e *jx.Encoder) { - { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } - } - { - e.FieldStart("clusterHost") - e.Str(s.ClusterHost) - } - { - e.FieldStart("owner") - e.Str(s.Owner) - } +func (s *CIProviderOption) encodeFields(e *jx.Encoder) { { - e.FieldStart("provider") - s.Provider.Encode(e) + e.FieldStart("label") + e.Str(s.Label) } { - e.FieldStart("repo") - e.Str(s.Repo) + e.FieldStart("value") + e.Str(s.Value) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -5361,79 +5444,44 @@ func (s *CreateMirrorInputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCreateMirrorInputBody = [5]string{ - 0: "$schema", - 1: "clusterHost", - 2: "owner", - 3: "provider", - 4: "repo", +var jsonFieldsNameOfCIProviderOption = [2]string{ + 0: "label", + 1: "value", } -// Decode decodes CreateMirrorInputBody from json. -func (s *CreateMirrorInputBody) Decode(d *jx.Decoder) error { +// Decode decodes CIProviderOption from json. +func (s *CIProviderOption) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateMirrorInputBody to nil") + return errors.New("invalid: unable to decode CIProviderOption to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": - if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") - } - case "clusterHost": - requiredBitSet[0] |= 1 << 1 - if err := func() error { - v, err := d.Str() - s.ClusterHost = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"clusterHost\"") - } - case "owner": - requiredBitSet[0] |= 1 << 2 + case "label": + requiredBitSet[0] |= 1 << 0 if err := func() error { v, err := d.Str() - s.Owner = string(v) + s.Label = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"owner\"") - } - case "provider": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - if err := s.Provider.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"provider\"") + return errors.Wrap(err, "decode field \"label\"") } - case "repo": - requiredBitSet[0] |= 1 << 4 + case "value": + requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.Repo = string(v) + s.Value = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"repo\"") + return errors.Wrap(err, "decode field \"value\"") } default: var elem jx.Raw @@ -5451,12 +5499,12 @@ func (s *CreateMirrorInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CreateMirrorInputBody") + return errors.Wrap(err, "decode CIProviderOption") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00011110, + 0b00000011, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -5468,8 +5516,8 @@ func (s *CreateMirrorInputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCreateMirrorInputBody) { - name = jsonFieldsNameOfCreateMirrorInputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCIProviderOption) { + name = jsonFieldsNameOfCIProviderOption[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -5490,27 +5538,27 @@ func (s *CreateMirrorInputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CreateMirrorInputBody) MarshalJSON() ([]byte, error) { +func (s *CIProviderOption) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateMirrorInputBody) UnmarshalJSON(data []byte) error { +func (s *CIProviderOption) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CreateMirrorInputBodyAdditional) Encode(e *jx.Encoder) { +func (s CIProviderOptionAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CreateMirrorInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s CIProviderOptionAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -5520,10 +5568,10 @@ func (s CreateMirrorInputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CreateMirrorInputBodyAdditional from json. -func (s *CreateMirrorInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CIProviderOptionAdditional from json. +func (s *CIProviderOptionAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateMirrorInputBodyAdditional to nil") + return errors.New("invalid: unable to decode CIProviderOptionAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -5541,93 +5589,45 @@ func (s *CreateMirrorInputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CreateMirrorInputBodyAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s CreateMirrorInputBodyAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateMirrorInputBodyAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes CreateMirrorInputBodyProvider as json. -func (s CreateMirrorInputBodyProvider) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes CreateMirrorInputBodyProvider from json. -func (s *CreateMirrorInputBodyProvider) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode CreateMirrorInputBodyProvider to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch CreateMirrorInputBodyProvider(v) { - case CreateMirrorInputBodyProviderGithub: - *s = CreateMirrorInputBodyProviderGithub - default: - *s = CreateMirrorInputBodyProvider(v) + return errors.Wrap(err, "decode CIProviderOptionAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CreateMirrorInputBodyProvider) MarshalJSON() ([]byte, error) { +func (s CIProviderOptionAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateMirrorInputBodyProvider) UnmarshalJSON(data []byte) error { +func (s *CIProviderOptionAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CreateMirrorRequestInputBody) Encode(e *jx.Encoder) { +func (s *CISetupBlock) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CreateMirrorRequestInputBody) encodeFields(e *jx.Encoder) { - { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } - } - { - e.FieldStart("clusterHost") - e.Str(s.ClusterHost) - } +func (s *CISetupBlock) encodeFields(e *jx.Encoder) { { - e.FieldStart("owner") - e.Str(s.Owner) + e.FieldStart("content") + e.Str(s.Content) } { - e.FieldStart("provider") - s.Provider.Encode(e) + e.FieldStart("format") + e.Str(s.Format) } { - e.FieldStart("repo") - e.Str(s.Repo) + e.FieldStart("heading") + e.Str(s.Heading) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -5638,79 +5638,57 @@ func (s *CreateMirrorRequestInputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCreateMirrorRequestInputBody = [5]string{ - 0: "$schema", - 1: "clusterHost", - 2: "owner", - 3: "provider", - 4: "repo", +var jsonFieldsNameOfCISetupBlock = [3]string{ + 0: "content", + 1: "format", + 2: "heading", } -// Decode decodes CreateMirrorRequestInputBody from json. -func (s *CreateMirrorRequestInputBody) Decode(d *jx.Decoder) error { +// Decode decodes CISetupBlock from json. +func (s *CISetupBlock) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateMirrorRequestInputBody to nil") + return errors.New("invalid: unable to decode CISetupBlock to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": - if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") - } - case "clusterHost": - requiredBitSet[0] |= 1 << 1 + case "content": + requiredBitSet[0] |= 1 << 0 if err := func() error { v, err := d.Str() - s.ClusterHost = string(v) + s.Content = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"clusterHost\"") + return errors.Wrap(err, "decode field \"content\"") } - case "owner": - requiredBitSet[0] |= 1 << 2 + case "format": + requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.Owner = string(v) + s.Format = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"owner\"") - } - case "provider": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - if err := s.Provider.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"provider\"") + return errors.Wrap(err, "decode field \"format\"") } - case "repo": - requiredBitSet[0] |= 1 << 4 + case "heading": + requiredBitSet[0] |= 1 << 2 if err := func() error { v, err := d.Str() - s.Repo = string(v) + s.Heading = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"repo\"") + return errors.Wrap(err, "decode field \"heading\"") } default: var elem jx.Raw @@ -5728,12 +5706,12 @@ func (s *CreateMirrorRequestInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CreateMirrorRequestInputBody") + return errors.Wrap(err, "decode CISetupBlock") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00011110, + 0b00000111, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -5745,8 +5723,8 @@ func (s *CreateMirrorRequestInputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCreateMirrorRequestInputBody) { - name = jsonFieldsNameOfCreateMirrorRequestInputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCISetupBlock) { + name = jsonFieldsNameOfCISetupBlock[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -5767,27 +5745,27 @@ func (s *CreateMirrorRequestInputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CreateMirrorRequestInputBody) MarshalJSON() ([]byte, error) { +func (s *CISetupBlock) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateMirrorRequestInputBody) UnmarshalJSON(data []byte) error { +func (s *CISetupBlock) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CreateMirrorRequestInputBodyAdditional) Encode(e *jx.Encoder) { +func (s CISetupBlockAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CreateMirrorRequestInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s CISetupBlockAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -5797,10 +5775,10 @@ func (s CreateMirrorRequestInputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CreateMirrorRequestInputBodyAdditional from json. -func (s *CreateMirrorRequestInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CISetupBlockAdditional from json. +func (s *CISetupBlockAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateMirrorRequestInputBodyAdditional to nil") + return errors.New("invalid: unable to decode CISetupBlockAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -5818,81 +5796,49 @@ func (s *CreateMirrorRequestInputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CreateMirrorRequestInputBodyAdditional") + return errors.Wrap(err, "decode CISetupBlockAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CreateMirrorRequestInputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s CISetupBlockAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateMirrorRequestInputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *CISetupBlockAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes CreateMirrorRequestInputBodyProvider as json. -func (s CreateMirrorRequestInputBodyProvider) Encode(e *jx.Encoder) { - e.Str(string(s)) +// Encode implements json.Marshaler. +func (s *CIWebhookAuditActor) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() } -// Decode decodes CreateMirrorRequestInputBodyProvider from json. -func (s *CreateMirrorRequestInputBodyProvider) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode CreateMirrorRequestInputBodyProvider to nil") +// encodeFields encodes fields. +func (s *CIWebhookAuditActor) encodeFields(e *jx.Encoder) { + { + e.FieldStart("account_id") + e.Str(s.AccountID) } - v, err := d.StrBytes() - if err != nil { - return err + { + if s.Handle.Set { + e.FieldStart("handle") + s.Handle.Encode(e) + } } - // Try to use constant string. - switch CreateMirrorRequestInputBodyProvider(v) { - case CreateMirrorRequestInputBodyProviderGithub: - *s = CreateMirrorRequestInputBodyProviderGithub - default: - *s = CreateMirrorRequestInputBodyProvider(v) - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s CreateMirrorRequestInputBodyProvider) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateMirrorRequestInputBodyProvider) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode implements json.Marshaler. -func (s *CreateNativeMirrorInputBody) Encode(e *jx.Encoder) { - e.ObjStart() - s.encodeFields(e) - e.ObjEnd() -} - -// encodeFields encodes fields. -func (s *CreateNativeMirrorInputBody) encodeFields(e *jx.Encoder) { - { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } - } - { - e.FieldStart("clusterSlug") - e.Str(s.ClusterSlug) + { + if s.HandleProvider.Set { + e.FieldStart("handle_provider") + s.HandleProvider.Encode(e) + } } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -5903,42 +5849,53 @@ func (s *CreateNativeMirrorInputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCreateNativeMirrorInputBody = [2]string{ - 0: "$schema", - 1: "clusterSlug", +var jsonFieldsNameOfCIWebhookAuditActor = [3]string{ + 0: "account_id", + 1: "handle", + 2: "handle_provider", } -// Decode decodes CreateNativeMirrorInputBody from json. -func (s *CreateNativeMirrorInputBody) Decode(d *jx.Decoder) error { +// Decode decodes CIWebhookAuditActor from json. +func (s *CIWebhookAuditActor) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateNativeMirrorInputBody to nil") + return errors.New("invalid: unable to decode CIWebhookAuditActor to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "account_id": + requiredBitSet[0] |= 1 << 0 if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + v, err := d.Str() + s.AccountID = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"account_id\"") } - case "clusterSlug": - requiredBitSet[0] |= 1 << 1 + case "handle": if err := func() error { - v, err := d.Str() - s.ClusterSlug = string(v) - if err != nil { + s.Handle.Reset() + if err := s.Handle.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"clusterSlug\"") + return errors.Wrap(err, "decode field \"handle\"") + } + case "handle_provider": + if err := func() error { + s.HandleProvider.Reset() + if err := s.HandleProvider.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"handle_provider\"") } default: var elem jx.Raw @@ -5956,12 +5913,12 @@ func (s *CreateNativeMirrorInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CreateNativeMirrorInputBody") + return errors.Wrap(err, "decode CIWebhookAuditActor") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00000001, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -5973,8 +5930,8 @@ func (s *CreateNativeMirrorInputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCreateNativeMirrorInputBody) { - name = jsonFieldsNameOfCreateNativeMirrorInputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCIWebhookAuditActor) { + name = jsonFieldsNameOfCIWebhookAuditActor[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -5995,27 +5952,27 @@ func (s *CreateNativeMirrorInputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CreateNativeMirrorInputBody) MarshalJSON() ([]byte, error) { +func (s *CIWebhookAuditActor) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateNativeMirrorInputBody) UnmarshalJSON(data []byte) error { +func (s *CIWebhookAuditActor) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CreateNativeMirrorInputBodyAdditional) Encode(e *jx.Encoder) { +func (s CIWebhookAuditActorAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CreateNativeMirrorInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s CIWebhookAuditActorAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -6025,10 +5982,10 @@ func (s CreateNativeMirrorInputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CreateNativeMirrorInputBodyAdditional from json. -func (s *CreateNativeMirrorInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CIWebhookAuditActorAdditional from json. +func (s *CIWebhookAuditActorAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateNativeMirrorInputBodyAdditional to nil") + return errors.New("invalid: unable to decode CIWebhookAuditActorAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -6046,50 +6003,56 @@ func (s *CreateNativeMirrorInputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CreateNativeMirrorInputBodyAdditional") + return errors.Wrap(err, "decode CIWebhookAuditActorAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CreateNativeMirrorInputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s CIWebhookAuditActorAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateNativeMirrorInputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *CIWebhookAuditActorAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CreateOrgInputBody) Encode(e *jx.Encoder) { +func (s *CIWebhookAuditEventView) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CreateOrgInputBody) encodeFields(e *jx.Encoder) { +func (s *CIWebhookAuditEventView) encodeFields(e *jx.Encoder) { { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } + e.FieldStart("actor") + s.Actor.Encode(e) } { - e.FieldStart("name") - e.Str(s.Name) + e.FieldStart("event_type") + e.Str(s.EventType) } { - if s.Region.Set { - e.FieldStart("region") - s.Region.Encode(e) + e.FieldStart("id") + e.Str(s.ID) + } + { + if s.Metadata.Set { + e.FieldStart("metadata") + s.Metadata.Encode(e) } } + { + e.FieldStart("occurred_at") + json.EncodeDateTime(e, s.OccurredAt) + } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -6099,53 +6062,79 @@ func (s *CreateOrgInputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCreateOrgInputBody = [3]string{ - 0: "$schema", - 1: "name", - 2: "region", +var jsonFieldsNameOfCIWebhookAuditEventView = [5]string{ + 0: "actor", + 1: "event_type", + 2: "id", + 3: "metadata", + 4: "occurred_at", } -// Decode decodes CreateOrgInputBody from json. -func (s *CreateOrgInputBody) Decode(d *jx.Decoder) error { +// Decode decodes CIWebhookAuditEventView from json. +func (s *CIWebhookAuditEventView) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateOrgInputBody to nil") + return errors.New("invalid: unable to decode CIWebhookAuditEventView to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "actor": + requiredBitSet[0] |= 1 << 0 if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + if err := s.Actor.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"actor\"") } - case "name": + case "event_type": requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.Name = string(v) + s.EventType = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"name\"") + return errors.Wrap(err, "decode field \"event_type\"") } - case "region": + case "id": + requiredBitSet[0] |= 1 << 2 if err := func() error { - s.Region.Reset() - if err := s.Region.Decode(d); err != nil { + v, err := d.Str() + s.ID = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"region\"") + return errors.Wrap(err, "decode field \"id\"") + } + case "metadata": + if err := func() error { + s.Metadata.Reset() + if err := s.Metadata.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"metadata\"") + } + case "occurred_at": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.OccurredAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"occurred_at\"") } default: var elem jx.Raw @@ -6163,12 +6152,12 @@ func (s *CreateOrgInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CreateOrgInputBody") + return errors.Wrap(err, "decode CIWebhookAuditEventView") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00010111, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -6180,8 +6169,8 @@ func (s *CreateOrgInputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCreateOrgInputBody) { - name = jsonFieldsNameOfCreateOrgInputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCIWebhookAuditEventView) { + name = jsonFieldsNameOfCIWebhookAuditEventView[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -6202,27 +6191,27 @@ func (s *CreateOrgInputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CreateOrgInputBody) MarshalJSON() ([]byte, error) { +func (s *CIWebhookAuditEventView) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateOrgInputBody) UnmarshalJSON(data []byte) error { +func (s *CIWebhookAuditEventView) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CreateOrgInputBodyAdditional) Encode(e *jx.Encoder) { +func (s CIWebhookAuditEventViewAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CreateOrgInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s CIWebhookAuditEventViewAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -6232,10 +6221,10 @@ func (s CreateOrgInputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CreateOrgInputBodyAdditional from json. -func (s *CreateOrgInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CIWebhookAuditEventViewAdditional from json. +func (s *CIWebhookAuditEventViewAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateOrgInputBodyAdditional to nil") + return errors.New("invalid: unable to decode CIWebhookAuditEventViewAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -6253,215 +6242,34 @@ func (s *CreateOrgInputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CreateOrgInputBodyAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s CreateOrgInputBodyAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateOrgInputBodyAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode implements json.Marshaler. -func (s *CreateProjectInputBody) Encode(e *jx.Encoder) { - e.ObjStart() - s.encodeFields(e) - e.ObjEnd() -} - -// encodeFields encodes fields. -func (s *CreateProjectInputBody) encodeFields(e *jx.Encoder) { - { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } - } - { - e.FieldStart("name") - e.Str(s.Name) - } - { - e.FieldStart("ownerId") - e.Str(s.OwnerId) - } - { - e.FieldStart("ownerType") - s.OwnerType.Encode(e) - } - { - if s.Region.Set { - e.FieldStart("region") - s.Region.Encode(e) - } - } - for k, elem := range s.AdditionalProps { - e.FieldStart(k) - - if len(elem) != 0 { - e.Raw(elem) - } - } -} - -var jsonFieldsNameOfCreateProjectInputBody = [5]string{ - 0: "$schema", - 1: "name", - 2: "ownerId", - 3: "ownerType", - 4: "region", -} - -// Decode decodes CreateProjectInputBody from json. -func (s *CreateProjectInputBody) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode CreateProjectInputBody to nil") - } - var requiredBitSet [1]uint8 - s.AdditionalProps = map[string]jx.Raw{} - - if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { - switch string(k) { - case "$schema": - if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") - } - case "name": - requiredBitSet[0] |= 1 << 1 - if err := func() error { - v, err := d.Str() - s.Name = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"name\"") - } - case "ownerId": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.OwnerId = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"ownerId\"") - } - case "ownerType": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - if err := s.OwnerType.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"ownerType\"") - } - case "region": - if err := func() error { - s.Region.Reset() - if err := s.Region.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"region\"") - } - default: - var elem jx.Raw - if err := func() error { - v, err := d.RawAppend(nil) - elem = jx.Raw(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrapf(err, "decode field %q", k) - } - s.AdditionalProps[string(k)] = elem - } - return nil - }); err != nil { - return errors.Wrap(err, "decode CreateProjectInputBody") - } - // Validate required fields. - var failures []validate.FieldError - for i, mask := range [1]uint8{ - 0b00001110, - } { - if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { - // Mask only required fields and check equality to mask using XOR. - // - // If XOR result is not zero, result is not equal to expected, so some fields are missed. - // Bits of fields which would be set are actually bits of missed fields. - missed := bits.OnesCount8(result) - for bitN := 0; bitN < missed; bitN++ { - bitIdx := bits.TrailingZeros8(result) - fieldIdx := i*8 + bitIdx - var name string - if fieldIdx < len(jsonFieldsNameOfCreateProjectInputBody) { - name = jsonFieldsNameOfCreateProjectInputBody[fieldIdx] - } else { - name = strconv.Itoa(fieldIdx) - } - failures = append(failures, validate.FieldError{ - Name: name, - Error: validate.ErrFieldRequired, - }) - // Reset bit. - result &^= 1 << bitIdx - } - } - } - if len(failures) > 0 { - return &validate.Error{Fields: failures} + return errors.Wrap(err, "decode CIWebhookAuditEventViewAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s *CreateProjectInputBody) MarshalJSON() ([]byte, error) { +func (s CIWebhookAuditEventViewAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateProjectInputBody) UnmarshalJSON(data []byte) error { +func (s *CIWebhookAuditEventViewAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CreateProjectInputBodyAdditional) Encode(e *jx.Encoder) { +func (s CIWebhookAuditEventViewMetadata) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CreateProjectInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s CIWebhookAuditEventViewMetadata) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -6471,10 +6279,10 @@ func (s CreateProjectInputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CreateProjectInputBodyAdditional from json. -func (s *CreateProjectInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CIWebhookAuditEventViewMetadata from json. +func (s *CIWebhookAuditEventViewMetadata) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateProjectInputBodyAdditional to nil") + return errors.New("invalid: unable to decode CIWebhookAuditEventViewMetadata to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -6492,88 +6300,40 @@ func (s *CreateProjectInputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CreateProjectInputBodyAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s CreateProjectInputBodyAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateProjectInputBodyAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes CreateProjectInputBodyOwnerType as json. -func (s CreateProjectInputBodyOwnerType) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes CreateProjectInputBodyOwnerType from json. -func (s *CreateProjectInputBodyOwnerType) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode CreateProjectInputBodyOwnerType to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch CreateProjectInputBodyOwnerType(v) { - case CreateProjectInputBodyOwnerTypeOrg: - *s = CreateProjectInputBodyOwnerTypeOrg - case CreateProjectInputBodyOwnerTypeAccount: - *s = CreateProjectInputBodyOwnerTypeAccount - default: - *s = CreateProjectInputBodyOwnerType(v) + return errors.Wrap(err, "decode CIWebhookAuditEventViewMetadata") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CreateProjectInputBodyOwnerType) MarshalJSON() ([]byte, error) { +func (s CIWebhookAuditEventViewMetadata) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateProjectInputBodyOwnerType) UnmarshalJSON(data []byte) error { +func (s *CIWebhookAuditEventViewMetadata) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CreateRepoCIWebhookBody) Encode(e *jx.Encoder) { +func (s *CIWebhookView) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CreateRepoCIWebhookBody) encodeFields(e *jx.Encoder) { +func (s *CIWebhookView) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") s.Schema.Encode(e) } } - { - e.FieldStart("auth_plugin_ref") - e.Str(s.AuthPluginRef) - } - { - e.FieldStart("automation_id") - e.Str(s.AutomationID) - } { e.FieldStart("bk_organization") e.Str(s.BkOrganization) @@ -6582,10 +6342,6 @@ func (s *CreateRepoCIWebhookBody) encodeFields(e *jx.Encoder) { e.FieldStart("bk_pipeline") e.Str(s.BkPipeline) } - { - e.FieldStart("core_url") - e.Str(s.CoreURL) - } { e.FieldStart("created_at") json.EncodeDateTime(e, s.CreatedAt) @@ -6614,6 +6370,10 @@ func (s *CreateRepoCIWebhookBody) encodeFields(e *jx.Encoder) { e.FieldStart("provider") e.Str(s.Provider) } + { + e.FieldStart("provider_account") + e.Str(s.ProviderAccount) + } { e.FieldStart("publish_checks") e.Bool(s.PublishChecks) @@ -6627,10 +6387,12 @@ func (s *CreateRepoCIWebhookBody) encodeFields(e *jx.Encoder) { e.Str(s.RepoID) } { - if s.Setup.Set { - e.FieldStart("setup") - s.Setup.Encode(e) - } + e.FieldStart("repo_write") + e.Bool(s.RepoWrite) + } + { + e.FieldStart("target_ref") + e.Str(s.TargetRef) } { e.FieldStart("updated_at") @@ -6645,32 +6407,31 @@ func (s *CreateRepoCIWebhookBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCreateRepoCIWebhookBody = [17]string{ +var jsonFieldsNameOfCIWebhookView = [16]string{ 0: "$schema", - 1: "auth_plugin_ref", - 2: "automation_id", - 3: "bk_organization", - 4: "bk_pipeline", - 5: "core_url", - 6: "created_at", - 7: "display_name", - 8: "enabled", - 9: "events", - 10: "id", - 11: "provider", - 12: "publish_checks", - 13: "ref_filter", - 14: "repo_id", - 15: "setup", - 16: "updated_at", + 1: "bk_organization", + 2: "bk_pipeline", + 3: "created_at", + 4: "display_name", + 5: "enabled", + 6: "events", + 7: "id", + 8: "provider", + 9: "provider_account", + 10: "publish_checks", + 11: "ref_filter", + 12: "repo_id", + 13: "repo_write", + 14: "target_ref", + 15: "updated_at", } -// Decode decodes CreateRepoCIWebhookBody from json. -func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { +// Decode decodes CIWebhookView from json. +func (s *CIWebhookView) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateRepoCIWebhookBody to nil") + return errors.New("invalid: unable to decode CIWebhookView to nil") } - var requiredBitSet [3]uint8 + var requiredBitSet [2]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -6685,32 +6446,8 @@ func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "auth_plugin_ref": - requiredBitSet[0] |= 1 << 1 - if err := func() error { - v, err := d.Str() - s.AuthPluginRef = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"auth_plugin_ref\"") - } - case "automation_id": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.AutomationID = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"automation_id\"") - } case "bk_organization": - requiredBitSet[0] |= 1 << 3 + requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() s.BkOrganization = string(v) @@ -6722,7 +6459,7 @@ func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { return errors.Wrap(err, "decode field \"bk_organization\"") } case "bk_pipeline": - requiredBitSet[0] |= 1 << 4 + requiredBitSet[0] |= 1 << 2 if err := func() error { v, err := d.Str() s.BkPipeline = string(v) @@ -6733,20 +6470,8 @@ func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"bk_pipeline\"") } - case "core_url": - requiredBitSet[0] |= 1 << 5 - if err := func() error { - v, err := d.Str() - s.CoreURL = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"core_url\"") - } case "created_at": - requiredBitSet[0] |= 1 << 6 + requiredBitSet[0] |= 1 << 3 if err := func() error { v, err := json.DecodeDateTime(d) s.CreatedAt = v @@ -6758,7 +6483,7 @@ func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { return errors.Wrap(err, "decode field \"created_at\"") } case "display_name": - requiredBitSet[0] |= 1 << 7 + requiredBitSet[0] |= 1 << 4 if err := func() error { v, err := d.Str() s.DisplayName = string(v) @@ -6770,7 +6495,7 @@ func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { return errors.Wrap(err, "decode field \"display_name\"") } case "enabled": - requiredBitSet[1] |= 1 << 0 + requiredBitSet[0] |= 1 << 5 if err := func() error { v, err := d.Bool() s.Enabled = bool(v) @@ -6782,7 +6507,7 @@ func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { return errors.Wrap(err, "decode field \"enabled\"") } case "events": - requiredBitSet[1] |= 1 << 1 + requiredBitSet[0] |= 1 << 6 if err := func() error { s.Events = make([]string, 0) if err := d.Arr(func(d *jx.Decoder) error { @@ -6802,7 +6527,7 @@ func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { return errors.Wrap(err, "decode field \"events\"") } case "id": - requiredBitSet[1] |= 1 << 2 + requiredBitSet[0] |= 1 << 7 if err := func() error { v, err := d.Str() s.ID = string(v) @@ -6814,7 +6539,7 @@ func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { return errors.Wrap(err, "decode field \"id\"") } case "provider": - requiredBitSet[1] |= 1 << 3 + requiredBitSet[1] |= 1 << 0 if err := func() error { v, err := d.Str() s.Provider = string(v) @@ -6825,8 +6550,20 @@ func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"provider\"") } + case "provider_account": + requiredBitSet[1] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.ProviderAccount = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider_account\"") + } case "publish_checks": - requiredBitSet[1] |= 1 << 4 + requiredBitSet[1] |= 1 << 2 if err := func() error { v, err := d.Bool() s.PublishChecks = bool(v) @@ -6838,7 +6575,7 @@ func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { return errors.Wrap(err, "decode field \"publish_checks\"") } case "ref_filter": - requiredBitSet[1] |= 1 << 5 + requiredBitSet[1] |= 1 << 3 if err := func() error { v, err := d.Str() s.RefFilter = string(v) @@ -6850,7 +6587,7 @@ func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { return errors.Wrap(err, "decode field \"ref_filter\"") } case "repo_id": - requiredBitSet[1] |= 1 << 6 + requiredBitSet[1] |= 1 << 4 if err := func() error { v, err := d.Str() s.RepoID = string(v) @@ -6861,18 +6598,32 @@ func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"repo_id\"") } - case "setup": + case "repo_write": + requiredBitSet[1] |= 1 << 5 if err := func() error { - s.Setup.Reset() - if err := s.Setup.Decode(d); err != nil { + v, err := d.Bool() + s.RepoWrite = bool(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"setup\"") + return errors.Wrap(err, "decode field \"repo_write\"") + } + case "target_ref": + requiredBitSet[1] |= 1 << 6 + if err := func() error { + v, err := d.Str() + s.TargetRef = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"target_ref\"") } case "updated_at": - requiredBitSet[2] |= 1 << 0 + requiredBitSet[1] |= 1 << 7 if err := func() error { v, err := json.DecodeDateTime(d) s.UpdatedAt = v @@ -6899,14 +6650,13 @@ func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CreateRepoCIWebhookBody") + return errors.Wrap(err, "decode CIWebhookView") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [3]uint8{ + for i, mask := range [2]uint8{ 0b11111110, - 0b01111111, - 0b00000001, + 0b11111111, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -6918,8 +6668,8 @@ func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCreateRepoCIWebhookBody) { - name = jsonFieldsNameOfCreateRepoCIWebhookBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCIWebhookView) { + name = jsonFieldsNameOfCIWebhookView[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -6940,27 +6690,27 @@ func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CreateRepoCIWebhookBody) MarshalJSON() ([]byte, error) { +func (s *CIWebhookView) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateRepoCIWebhookBody) UnmarshalJSON(data []byte) error { +func (s *CIWebhookView) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CreateRepoCIWebhookBodyAdditional) Encode(e *jx.Encoder) { +func (s CIWebhookViewAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CreateRepoCIWebhookBodyAdditional) encodeFields(e *jx.Encoder) { +func (s CIWebhookViewAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -6970,10 +6720,10 @@ func (s CreateRepoCIWebhookBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CreateRepoCIWebhookBodyAdditional from json. -func (s *CreateRepoCIWebhookBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CIWebhookViewAdditional from json. +func (s *CIWebhookViewAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateRepoCIWebhookBodyAdditional to nil") + return errors.New("invalid: unable to decode CIWebhookViewAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -6991,125 +6741,55 @@ func (s *CreateRepoCIWebhookBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CreateRepoCIWebhookBodyAdditional") + return errors.Wrap(err, "decode CIWebhookViewAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CreateRepoCIWebhookBodyAdditional) MarshalJSON() ([]byte, error) { +func (s CIWebhookViewAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateRepoCIWebhookBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *CIWebhookViewAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CreateRepoCIWebhookInputBody) Encode(e *jx.Encoder) { +func (s *Cluster) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CreateRepoCIWebhookInputBody) encodeFields(e *jx.Encoder) { - { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } - } - { - if s.BkClusterID.Set { - e.FieldStart("bk_cluster_id") - s.BkClusterID.Encode(e) - } - } - { - if s.BkForceRescaffold.Set { - e.FieldStart("bk_force_rescaffold") - s.BkForceRescaffold.Encode(e) - } - } - { - if s.BkOrganization.Set { - e.FieldStart("bk_organization") - s.BkOrganization.Encode(e) - } - } - { - if s.BkPipeline.Set { - e.FieldStart("bk_pipeline") - s.BkPipeline.Encode(e) - } - } - { - if s.BkPipelineSelfManaged.Set { - e.FieldStart("bk_pipeline_self_managed") - s.BkPipelineSelfManaged.Encode(e) - } - } - { - if s.BkProvisioningToken.Set { - e.FieldStart("bk_provisioning_token") - s.BkProvisioningToken.Encode(e) - } - } - { - if s.Config.Set { - e.FieldStart("config") - s.Config.Encode(e) - } - } - { - if s.DisplayName.Set { - e.FieldStart("display_name") - s.DisplayName.Encode(e) - } - } - { - if s.Events != nil { - e.FieldStart("events") - e.ArrStart() - for _, elem := range s.Events { - e.Str(elem) - } - e.ArrEnd() - } - } +func (s *Cluster) encodeFields(e *jx.Encoder) { { - if s.Mode.Set { - e.FieldStart("mode") - s.Mode.Encode(e) + if s.ApiUrl.Set { + e.FieldStart("apiUrl") + s.ApiUrl.Encode(e) } } { - e.FieldStart("provider") - e.Str(s.Provider) + e.FieldStart("isDefault") + e.Bool(s.IsDefault) } { - if s.ProviderAccount.Set { - e.FieldStart("provider_account") - s.ProviderAccount.Encode(e) - } + e.FieldStart("jurisdiction") + e.Str(s.Jurisdiction) } { - if s.RefFilter.Set { - e.FieldStart("ref_filter") - s.RefFilter.Encode(e) - } + e.FieldStart("publicUrl") + e.Str(s.PublicUrl) } { - if s.TargetRef.Set { - e.FieldStart("target_ref") - s.TargetRef.Encode(e) - } + e.FieldStart("slug") + e.Str(s.Slug) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -7120,194 +6800,81 @@ func (s *CreateRepoCIWebhookInputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCreateRepoCIWebhookInputBody = [15]string{ - 0: "$schema", - 1: "bk_cluster_id", - 2: "bk_force_rescaffold", - 3: "bk_organization", - 4: "bk_pipeline", - 5: "bk_pipeline_self_managed", - 6: "bk_provisioning_token", - 7: "config", - 8: "display_name", - 9: "events", - 10: "mode", - 11: "provider", - 12: "provider_account", - 13: "ref_filter", - 14: "target_ref", +var jsonFieldsNameOfCluster = [5]string{ + 0: "apiUrl", + 1: "isDefault", + 2: "jurisdiction", + 3: "publicUrl", + 4: "slug", } -// Decode decodes CreateRepoCIWebhookInputBody from json. -func (s *CreateRepoCIWebhookInputBody) Decode(d *jx.Decoder) error { +// Decode decodes Cluster from json. +func (s *Cluster) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateRepoCIWebhookInputBody to nil") + return errors.New("invalid: unable to decode Cluster to nil") } - var requiredBitSet [2]uint8 + var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": - if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") - } - case "bk_cluster_id": - if err := func() error { - s.BkClusterID.Reset() - if err := s.BkClusterID.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"bk_cluster_id\"") - } - case "bk_force_rescaffold": - if err := func() error { - s.BkForceRescaffold.Reset() - if err := s.BkForceRescaffold.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"bk_force_rescaffold\"") - } - case "bk_organization": - if err := func() error { - s.BkOrganization.Reset() - if err := s.BkOrganization.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"bk_organization\"") - } - case "bk_pipeline": - if err := func() error { - s.BkPipeline.Reset() - if err := s.BkPipeline.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"bk_pipeline\"") - } - case "bk_pipeline_self_managed": - if err := func() error { - s.BkPipelineSelfManaged.Reset() - if err := s.BkPipelineSelfManaged.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"bk_pipeline_self_managed\"") - } - case "bk_provisioning_token": - if err := func() error { - s.BkProvisioningToken.Reset() - if err := s.BkProvisioningToken.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"bk_provisioning_token\"") - } - case "config": - if err := func() error { - s.Config.Reset() - if err := s.Config.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"config\"") - } - case "display_name": - if err := func() error { - s.DisplayName.Reset() - if err := s.DisplayName.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"display_name\"") - } - case "events": + case "apiUrl": if err := func() error { - s.Events = make([]string, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem string - v, err := d.Str() - elem = string(v) - if err != nil { - return err - } - s.Events = append(s.Events, elem) - return nil - }); err != nil { + s.ApiUrl.Reset() + if err := s.ApiUrl.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"events\"") + return errors.Wrap(err, "decode field \"apiUrl\"") } - case "mode": + case "isDefault": + requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Mode.Reset() - if err := s.Mode.Decode(d); err != nil { + v, err := d.Bool() + s.IsDefault = bool(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"mode\"") + return errors.Wrap(err, "decode field \"isDefault\"") } - case "provider": - requiredBitSet[1] |= 1 << 3 + case "jurisdiction": + requiredBitSet[0] |= 1 << 2 if err := func() error { v, err := d.Str() - s.Provider = string(v) + s.Jurisdiction = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"provider\"") - } - case "provider_account": - if err := func() error { - s.ProviderAccount.Reset() - if err := s.ProviderAccount.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"provider_account\"") + return errors.Wrap(err, "decode field \"jurisdiction\"") } - case "ref_filter": + case "publicUrl": + requiredBitSet[0] |= 1 << 3 if err := func() error { - s.RefFilter.Reset() - if err := s.RefFilter.Decode(d); err != nil { + v, err := d.Str() + s.PublicUrl = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"ref_filter\"") + return errors.Wrap(err, "decode field \"publicUrl\"") } - case "target_ref": + case "slug": + requiredBitSet[0] |= 1 << 4 if err := func() error { - s.TargetRef.Reset() - if err := s.TargetRef.Decode(d); err != nil { + v, err := d.Str() + s.Slug = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"target_ref\"") + return errors.Wrap(err, "decode field \"slug\"") } default: var elem jx.Raw @@ -7325,13 +6892,12 @@ func (s *CreateRepoCIWebhookInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CreateRepoCIWebhookInputBody") + return errors.Wrap(err, "decode Cluster") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [2]uint8{ - 0b00000000, - 0b00001000, + for i, mask := range [1]uint8{ + 0b00011110, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -7343,8 +6909,8 @@ func (s *CreateRepoCIWebhookInputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCreateRepoCIWebhookInputBody) { - name = jsonFieldsNameOfCreateRepoCIWebhookInputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCluster) { + name = jsonFieldsNameOfCluster[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -7365,27 +6931,27 @@ func (s *CreateRepoCIWebhookInputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CreateRepoCIWebhookInputBody) MarshalJSON() ([]byte, error) { +func (s *Cluster) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateRepoCIWebhookInputBody) UnmarshalJSON(data []byte) error { +func (s *Cluster) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CreateRepoCIWebhookInputBodyAdditional) Encode(e *jx.Encoder) { +func (s ClusterAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CreateRepoCIWebhookInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ClusterAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -7395,10 +6961,10 @@ func (s CreateRepoCIWebhookInputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CreateRepoCIWebhookInputBodyAdditional from json. -func (s *CreateRepoCIWebhookInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ClusterAdditional from json. +func (s *ClusterAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateRepoCIWebhookInputBodyAdditional to nil") + return errors.New("invalid: unable to decode ClusterAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -7416,90 +6982,34 @@ func (s *CreateRepoCIWebhookInputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CreateRepoCIWebhookInputBodyAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s CreateRepoCIWebhookInputBodyAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateRepoCIWebhookInputBodyAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode implements json.Marshaler. -func (s CreateRepoCIWebhookInputBodyConfig) Encode(e *jx.Encoder) { - e.ObjStart() - s.encodeFields(e) - e.ObjEnd() -} - -// encodeFields implements json.Marshaler. -func (s CreateRepoCIWebhookInputBodyConfig) encodeFields(e *jx.Encoder) { - for k, elem := range s { - e.FieldStart(k) - - e.Str(elem) - } -} - -// Decode decodes CreateRepoCIWebhookInputBodyConfig from json. -func (s *CreateRepoCIWebhookInputBodyConfig) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode CreateRepoCIWebhookInputBodyConfig to nil") - } - m := s.init() - if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { - var elem string - if err := func() error { - v, err := d.Str() - elem = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrapf(err, "decode field %q", k) - } - m[string(k)] = elem - return nil - }); err != nil { - return errors.Wrap(err, "decode CreateRepoCIWebhookInputBodyConfig") + return errors.Wrap(err, "decode ClusterAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CreateRepoCIWebhookInputBodyConfig) MarshalJSON() ([]byte, error) { +func (s ClusterAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateRepoCIWebhookInputBodyConfig) UnmarshalJSON(data []byte) error { +func (s *ClusterAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CreateRepoInputBody) Encode(e *jx.Encoder) { +func (s *CompleteOnboardingOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CreateRepoInputBody) encodeFields(e *jx.Encoder) { +func (s *CompleteOnboardingOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -7507,46 +7017,27 @@ func (s *CreateRepoInputBody) encodeFields(e *jx.Encoder) { } } { - if s.ClusterHost.Set { - e.FieldStart("clusterHost") - s.ClusterHost.Encode(e) - } + e.FieldStart("needsOnboarding") + e.Bool(s.NeedsOnboarding) } - { - e.FieldStart("name") - e.Str(s.Name) - } - { - if s.ObjectFormat.Set { - e.FieldStart("objectFormat") - s.ObjectFormat.Encode(e) - } - } - { - e.FieldStart("projectId") - e.Str(s.ProjectId) - } - for k, elem := range s.AdditionalProps { - e.FieldStart(k) - - if len(elem) != 0 { - e.Raw(elem) - } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } } } -var jsonFieldsNameOfCreateRepoInputBody = [5]string{ +var jsonFieldsNameOfCompleteOnboardingOutputBody = [2]string{ 0: "$schema", - 1: "clusterHost", - 2: "name", - 3: "objectFormat", - 4: "projectId", + 1: "needsOnboarding", } -// Decode decodes CreateRepoInputBody from json. -func (s *CreateRepoInputBody) Decode(d *jx.Decoder) error { +// Decode decodes CompleteOnboardingOutputBody from json. +func (s *CompleteOnboardingOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateRepoInputBody to nil") + return errors.New("invalid: unable to decode CompleteOnboardingOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -7563,49 +7054,17 @@ func (s *CreateRepoInputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "clusterHost": - if err := func() error { - s.ClusterHost.Reset() - if err := s.ClusterHost.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"clusterHost\"") - } - case "name": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.Name = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"name\"") - } - case "objectFormat": - if err := func() error { - s.ObjectFormat.Reset() - if err := s.ObjectFormat.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"objectFormat\"") - } - case "projectId": - requiredBitSet[0] |= 1 << 4 + case "needsOnboarding": + requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.ProjectId = string(v) + v, err := d.Bool() + s.NeedsOnboarding = bool(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"projectId\"") + return errors.Wrap(err, "decode field \"needsOnboarding\"") } default: var elem jx.Raw @@ -7623,12 +7082,12 @@ func (s *CreateRepoInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CreateRepoInputBody") + return errors.Wrap(err, "decode CompleteOnboardingOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00010100, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -7640,8 +7099,8 @@ func (s *CreateRepoInputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCreateRepoInputBody) { - name = jsonFieldsNameOfCreateRepoInputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCompleteOnboardingOutputBody) { + name = jsonFieldsNameOfCompleteOnboardingOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -7662,27 +7121,27 @@ func (s *CreateRepoInputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CreateRepoInputBody) MarshalJSON() ([]byte, error) { +func (s *CompleteOnboardingOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateRepoInputBody) UnmarshalJSON(data []byte) error { +func (s *CompleteOnboardingOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CreateRepoInputBodyAdditional) Encode(e *jx.Encoder) { +func (s CompleteOnboardingOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CreateRepoInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s CompleteOnboardingOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -7692,10 +7151,10 @@ func (s CreateRepoInputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CreateRepoInputBodyAdditional from json. -func (s *CreateRepoInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CompleteOnboardingOutputBodyAdditional from json. +func (s *CompleteOnboardingOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateRepoInputBodyAdditional to nil") + return errors.New("invalid: unable to decode CompleteOnboardingOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -7713,74 +7172,34 @@ func (s *CreateRepoInputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CreateRepoInputBodyAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s CreateRepoInputBodyAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateRepoInputBodyAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes CreateRepoInputBodyObjectFormat as json. -func (s CreateRepoInputBodyObjectFormat) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes CreateRepoInputBodyObjectFormat from json. -func (s *CreateRepoInputBodyObjectFormat) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode CreateRepoInputBodyObjectFormat to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch CreateRepoInputBodyObjectFormat(v) { - case CreateRepoInputBodyObjectFormatSHA1: - *s = CreateRepoInputBodyObjectFormatSHA1 - case CreateRepoInputBodyObjectFormatSHA256: - *s = CreateRepoInputBodyObjectFormatSHA256 - default: - *s = CreateRepoInputBodyObjectFormat(v) + return errors.Wrap(err, "decode CompleteOnboardingOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CreateRepoInputBodyObjectFormat) MarshalJSON() ([]byte, error) { +func (s CompleteOnboardingOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateRepoInputBodyObjectFormat) UnmarshalJSON(data []byte) error { +func (s *CompleteOnboardingOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CreateServiceAccountInputBody) Encode(e *jx.Encoder) { +func (s *ConnectOrgCIBuildkiteCredentialInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CreateServiceAccountInputBody) encodeFields(e *jx.Encoder) { +func (s *ConnectOrgCIBuildkiteCredentialInputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -7788,12 +7207,12 @@ func (s *CreateServiceAccountInputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("name") - e.Str(s.Name) + e.FieldStart("bk_api_token") + e.Str(s.BkAPIToken) } { - e.FieldStart("orgId") - e.Str(s.OrgId) + e.FieldStart("bk_organization") + e.Str(s.BkOrganization) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -7804,16 +7223,16 @@ func (s *CreateServiceAccountInputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCreateServiceAccountInputBody = [3]string{ +var jsonFieldsNameOfConnectOrgCIBuildkiteCredentialInputBody = [3]string{ 0: "$schema", - 1: "name", - 2: "orgId", + 1: "bk_api_token", + 2: "bk_organization", } -// Decode decodes CreateServiceAccountInputBody from json. -func (s *CreateServiceAccountInputBody) Decode(d *jx.Decoder) error { +// Decode decodes ConnectOrgCIBuildkiteCredentialInputBody from json. +func (s *ConnectOrgCIBuildkiteCredentialInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateServiceAccountInputBody to nil") + return errors.New("invalid: unable to decode ConnectOrgCIBuildkiteCredentialInputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -7830,29 +7249,29 @@ func (s *CreateServiceAccountInputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "name": + case "bk_api_token": requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.Name = string(v) + s.BkAPIToken = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"name\"") + return errors.Wrap(err, "decode field \"bk_api_token\"") } - case "orgId": + case "bk_organization": requiredBitSet[0] |= 1 << 2 if err := func() error { v, err := d.Str() - s.OrgId = string(v) + s.BkOrganization = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"orgId\"") + return errors.Wrap(err, "decode field \"bk_organization\"") } default: var elem jx.Raw @@ -7870,7 +7289,7 @@ func (s *CreateServiceAccountInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CreateServiceAccountInputBody") + return errors.Wrap(err, "decode ConnectOrgCIBuildkiteCredentialInputBody") } // Validate required fields. var failures []validate.FieldError @@ -7887,8 +7306,8 @@ func (s *CreateServiceAccountInputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCreateServiceAccountInputBody) { - name = jsonFieldsNameOfCreateServiceAccountInputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfConnectOrgCIBuildkiteCredentialInputBody) { + name = jsonFieldsNameOfConnectOrgCIBuildkiteCredentialInputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -7909,27 +7328,27 @@ func (s *CreateServiceAccountInputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CreateServiceAccountInputBody) MarshalJSON() ([]byte, error) { +func (s *ConnectOrgCIBuildkiteCredentialInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateServiceAccountInputBody) UnmarshalJSON(data []byte) error { +func (s *ConnectOrgCIBuildkiteCredentialInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CreateServiceAccountInputBodyAdditional) Encode(e *jx.Encoder) { +func (s ConnectOrgCIBuildkiteCredentialInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CreateServiceAccountInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ConnectOrgCIBuildkiteCredentialInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -7939,10 +7358,10 @@ func (s CreateServiceAccountInputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CreateServiceAccountInputBodyAdditional from json. -func (s *CreateServiceAccountInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ConnectOrgCIBuildkiteCredentialInputBodyAdditional from json. +func (s *ConnectOrgCIBuildkiteCredentialInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreateServiceAccountInputBodyAdditional to nil") + return errors.New("invalid: unable to decode ConnectOrgCIBuildkiteCredentialInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -7960,34 +7379,34 @@ func (s *CreateServiceAccountInputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CreateServiceAccountInputBodyAdditional") + return errors.Wrap(err, "decode ConnectOrgCIBuildkiteCredentialInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CreateServiceAccountInputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ConnectOrgCIBuildkiteCredentialInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreateServiceAccountInputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ConnectOrgCIBuildkiteCredentialInputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *CreatedMirror) Encode(e *jx.Encoder) { +func (s *ConnectOrgCIDepotOrganizationInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *CreatedMirror) encodeFields(e *jx.Encoder) { +func (s *ConnectOrgCIDepotOrganizationInputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -7995,28 +7414,8 @@ func (s *CreatedMirror) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("created") - e.Bool(s.Created) - } - { - e.FieldStart("empty") - e.Bool(s.Empty) - } - { - e.FieldStart("mirrorId") - e.Str(s.MirrorId) - } - { - e.FieldStart("mirrorUrl") - e.Str(s.MirrorUrl) - } - { - e.FieldStart("publicUrl") - e.Str(s.PublicUrl) - } - { - e.FieldStart("suspended") - e.Bool(s.Suspended) + e.FieldStart("account") + e.Str(s.Account) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -8027,20 +7426,15 @@ func (s *CreatedMirror) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCreatedMirror = [7]string{ +var jsonFieldsNameOfConnectOrgCIDepotOrganizationInputBody = [2]string{ 0: "$schema", - 1: "created", - 2: "empty", - 3: "mirrorId", - 4: "mirrorUrl", - 5: "publicUrl", - 6: "suspended", + 1: "account", } -// Decode decodes CreatedMirror from json. -func (s *CreatedMirror) Decode(d *jx.Decoder) error { +// Decode decodes ConnectOrgCIDepotOrganizationInputBody from json. +func (s *ConnectOrgCIDepotOrganizationInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreatedMirror to nil") + return errors.New("invalid: unable to decode ConnectOrgCIDepotOrganizationInputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -8057,77 +7451,17 @@ func (s *CreatedMirror) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "created": + case "account": requiredBitSet[0] |= 1 << 1 - if err := func() error { - v, err := d.Bool() - s.Created = bool(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"created\"") - } - case "empty": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Bool() - s.Empty = bool(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"empty\"") - } - case "mirrorId": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - v, err := d.Str() - s.MirrorId = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"mirrorId\"") - } - case "mirrorUrl": - requiredBitSet[0] |= 1 << 4 - if err := func() error { - v, err := d.Str() - s.MirrorUrl = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"mirrorUrl\"") - } - case "publicUrl": - requiredBitSet[0] |= 1 << 5 if err := func() error { v, err := d.Str() - s.PublicUrl = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"publicUrl\"") - } - case "suspended": - requiredBitSet[0] |= 1 << 6 - if err := func() error { - v, err := d.Bool() - s.Suspended = bool(v) + s.Account = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"suspended\"") + return errors.Wrap(err, "decode field \"account\"") } default: var elem jx.Raw @@ -8145,12 +7479,12 @@ func (s *CreatedMirror) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode CreatedMirror") + return errors.Wrap(err, "decode ConnectOrgCIDepotOrganizationInputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b01111110, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -8162,8 +7496,8 @@ func (s *CreatedMirror) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfCreatedMirror) { - name = jsonFieldsNameOfCreatedMirror[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfConnectOrgCIDepotOrganizationInputBody) { + name = jsonFieldsNameOfConnectOrgCIDepotOrganizationInputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -8184,27 +7518,27 @@ func (s *CreatedMirror) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *CreatedMirror) MarshalJSON() ([]byte, error) { +func (s *ConnectOrgCIDepotOrganizationInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreatedMirror) UnmarshalJSON(data []byte) error { +func (s *ConnectOrgCIDepotOrganizationInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s CreatedMirrorAdditional) Encode(e *jx.Encoder) { +func (s ConnectOrgCIDepotOrganizationInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s CreatedMirrorAdditional) encodeFields(e *jx.Encoder) { +func (s ConnectOrgCIDepotOrganizationInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -8214,10 +7548,10 @@ func (s CreatedMirrorAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes CreatedMirrorAdditional from json. -func (s *CreatedMirrorAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ConnectOrgCIDepotOrganizationInputBodyAdditional from json. +func (s *ConnectOrgCIDepotOrganizationInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode CreatedMirrorAdditional to nil") + return errors.New("invalid: unable to decode ConnectOrgCIDepotOrganizationInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -8235,53 +7569,49 @@ func (s *CreatedMirrorAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode CreatedMirrorAdditional") + return errors.Wrap(err, "decode ConnectOrgCIDepotOrganizationInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s CreatedMirrorAdditional) MarshalJSON() ([]byte, error) { +func (s ConnectOrgCIDepotOrganizationInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *CreatedMirrorAdditional) UnmarshalJSON(data []byte) error { +func (s *ConnectOrgCIDepotOrganizationInputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *DeletionBlocker) Encode(e *jx.Encoder) { +func (s *CreateBindingInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *DeletionBlocker) encodeFields(e *jx.Encoder) { - { - e.FieldStart("deletable") - e.Bool(s.Deletable) - } - { - e.FieldStart("id") - e.Str(s.ID) - } +func (s *CreateBindingInputBody) encodeFields(e *jx.Encoder) { { - e.FieldStart("kind") - s.Kind.Encode(e) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } } { - e.FieldStart("message") - e.Str(s.Message) + if len(s.AttributeFilter) != 0 { + e.FieldStart("attributeFilter") + e.Raw(s.AttributeFilter) + } } { - e.FieldStart("name") - e.Str(s.Name) + e.FieldStart("providerId") + e.Str(s.ProviderId) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -8292,81 +7622,54 @@ func (s *DeletionBlocker) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfDeletionBlocker = [5]string{ - 0: "deletable", - 1: "id", - 2: "kind", - 3: "message", - 4: "name", +var jsonFieldsNameOfCreateBindingInputBody = [3]string{ + 0: "$schema", + 1: "attributeFilter", + 2: "providerId", } -// Decode decodes DeletionBlocker from json. -func (s *DeletionBlocker) Decode(d *jx.Decoder) error { +// Decode decodes CreateBindingInputBody from json. +func (s *CreateBindingInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode DeletionBlocker to nil") + return errors.New("invalid: unable to decode CreateBindingInputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "deletable": - requiredBitSet[0] |= 1 << 0 + case "$schema": if err := func() error { - v, err := d.Bool() - s.Deletable = bool(v) - if err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"deletable\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "id": - requiredBitSet[0] |= 1 << 1 + case "attributeFilter": if err := func() error { - v, err := d.Str() - s.ID = string(v) + v, err := d.RawAppend(nil) + s.AttributeFilter = jx.Raw(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"id\"") + return errors.Wrap(err, "decode field \"attributeFilter\"") } - case "kind": + case "providerId": requiredBitSet[0] |= 1 << 2 - if err := func() error { - if err := s.Kind.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"kind\"") - } - case "message": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - v, err := d.Str() - s.Message = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"message\"") - } - case "name": - requiredBitSet[0] |= 1 << 4 if err := func() error { v, err := d.Str() - s.Name = string(v) + s.ProviderId = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"name\"") + return errors.Wrap(err, "decode field \"providerId\"") } default: var elem jx.Raw @@ -8384,12 +7687,12 @@ func (s *DeletionBlocker) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode DeletionBlocker") + return errors.Wrap(err, "decode CreateBindingInputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00011111, + 0b00000100, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -8401,8 +7704,8 @@ func (s *DeletionBlocker) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfDeletionBlocker) { - name = jsonFieldsNameOfDeletionBlocker[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCreateBindingInputBody) { + name = jsonFieldsNameOfCreateBindingInputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -8423,27 +7726,27 @@ func (s *DeletionBlocker) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *DeletionBlocker) MarshalJSON() ([]byte, error) { +func (s *CreateBindingInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *DeletionBlocker) UnmarshalJSON(data []byte) error { +func (s *CreateBindingInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s DeletionBlockerAdditional) Encode(e *jx.Encoder) { +func (s CreateBindingInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s DeletionBlockerAdditional) encodeFields(e *jx.Encoder) { +func (s CreateBindingInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -8453,10 +7756,10 @@ func (s DeletionBlockerAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes DeletionBlockerAdditional from json. -func (s *DeletionBlockerAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CreateBindingInputBodyAdditional from json. +func (s *CreateBindingInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode DeletionBlockerAdditional to nil") + return errors.New("invalid: unable to decode CreateBindingInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -8474,93 +7777,55 @@ func (s *DeletionBlockerAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode DeletionBlockerAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s DeletionBlockerAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *DeletionBlockerAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes DeletionBlockerKind as json. -func (s DeletionBlockerKind) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes DeletionBlockerKind from json. -func (s *DeletionBlockerKind) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode DeletionBlockerKind to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch DeletionBlockerKind(v) { - case DeletionBlockerKindOwnedOrg: - *s = DeletionBlockerKindOwnedOrg - default: - *s = DeletionBlockerKind(v) + return errors.Wrap(err, "decode CreateBindingInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s DeletionBlockerKind) MarshalJSON() ([]byte, error) { +func (s CreateBindingInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *DeletionBlockerKind) UnmarshalJSON(data []byte) error { +func (s *CreateBindingInputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *DeletionGrant) Encode(e *jx.Encoder) { +func (s *CreateMirrorRequestInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *DeletionGrant) encodeFields(e *jx.Encoder) { +func (s *CreateMirrorRequestInputBody) encodeFields(e *jx.Encoder) { { - if s.Jurisdiction.Set { - e.FieldStart("jurisdiction") - s.Jurisdiction.Encode(e) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) } } { - e.FieldStart("resourceId") - e.Str(s.ResourceId) + e.FieldStart("clusterHost") + e.Str(s.ClusterHost) } { - e.FieldStart("resourceName") - e.Str(s.ResourceName) + e.FieldStart("owner") + e.Str(s.Owner) } { - e.FieldStart("resourceType") - s.ResourceType.Encode(e) + e.FieldStart("provider") + s.Provider.Encode(e) } { - e.FieldStart("role") - e.Str(s.Role) + e.FieldStart("repo") + e.Str(s.Repo) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -8571,79 +7836,79 @@ func (s *DeletionGrant) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfDeletionGrant = [5]string{ - 0: "jurisdiction", - 1: "resourceId", - 2: "resourceName", - 3: "resourceType", - 4: "role", +var jsonFieldsNameOfCreateMirrorRequestInputBody = [5]string{ + 0: "$schema", + 1: "clusterHost", + 2: "owner", + 3: "provider", + 4: "repo", } -// Decode decodes DeletionGrant from json. -func (s *DeletionGrant) Decode(d *jx.Decoder) error { +// Decode decodes CreateMirrorRequestInputBody from json. +func (s *CreateMirrorRequestInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode DeletionGrant to nil") + return errors.New("invalid: unable to decode CreateMirrorRequestInputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "jurisdiction": + case "$schema": if err := func() error { - s.Jurisdiction.Reset() - if err := s.Jurisdiction.Decode(d); err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"jurisdiction\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "resourceId": + case "clusterHost": requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.ResourceId = string(v) + s.ClusterHost = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"resourceId\"") + return errors.Wrap(err, "decode field \"clusterHost\"") } - case "resourceName": + case "owner": requiredBitSet[0] |= 1 << 2 if err := func() error { v, err := d.Str() - s.ResourceName = string(v) + s.Owner = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"resourceName\"") + return errors.Wrap(err, "decode field \"owner\"") } - case "resourceType": + case "provider": requiredBitSet[0] |= 1 << 3 if err := func() error { - if err := s.ResourceType.Decode(d); err != nil { + if err := s.Provider.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"resourceType\"") + return errors.Wrap(err, "decode field \"provider\"") } - case "role": + case "repo": requiredBitSet[0] |= 1 << 4 if err := func() error { v, err := d.Str() - s.Role = string(v) + s.Repo = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"role\"") + return errors.Wrap(err, "decode field \"repo\"") } default: var elem jx.Raw @@ -8661,7 +7926,7 @@ func (s *DeletionGrant) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode DeletionGrant") + return errors.Wrap(err, "decode CreateMirrorRequestInputBody") } // Validate required fields. var failures []validate.FieldError @@ -8678,8 +7943,8 @@ func (s *DeletionGrant) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfDeletionGrant) { - name = jsonFieldsNameOfDeletionGrant[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCreateMirrorRequestInputBody) { + name = jsonFieldsNameOfCreateMirrorRequestInputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -8700,27 +7965,27 @@ func (s *DeletionGrant) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *DeletionGrant) MarshalJSON() ([]byte, error) { +func (s *CreateMirrorRequestInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *DeletionGrant) UnmarshalJSON(data []byte) error { +func (s *CreateMirrorRequestInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s DeletionGrantAdditional) Encode(e *jx.Encoder) { +func (s CreateMirrorRequestInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s DeletionGrantAdditional) encodeFields(e *jx.Encoder) { +func (s CreateMirrorRequestInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -8730,10 +7995,10 @@ func (s DeletionGrantAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes DeletionGrantAdditional from json. -func (s *DeletionGrantAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CreateMirrorRequestInputBodyAdditional from json. +func (s *CreateMirrorRequestInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode DeletionGrantAdditional to nil") + return errors.New("invalid: unable to decode CreateMirrorRequestInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -8751,81 +8016,81 @@ func (s *DeletionGrantAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode DeletionGrantAdditional") + return errors.Wrap(err, "decode CreateMirrorRequestInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s DeletionGrantAdditional) MarshalJSON() ([]byte, error) { +func (s CreateMirrorRequestInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *DeletionGrantAdditional) UnmarshalJSON(data []byte) error { +func (s *CreateMirrorRequestInputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes DeletionGrantResourceType as json. -func (s DeletionGrantResourceType) Encode(e *jx.Encoder) { +// Encode encodes CreateMirrorRequestInputBodyProvider as json. +func (s CreateMirrorRequestInputBodyProvider) Encode(e *jx.Encoder) { e.Str(string(s)) } -// Decode decodes DeletionGrantResourceType from json. -func (s *DeletionGrantResourceType) Decode(d *jx.Decoder) error { +// Decode decodes CreateMirrorRequestInputBodyProvider from json. +func (s *CreateMirrorRequestInputBodyProvider) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode DeletionGrantResourceType to nil") + return errors.New("invalid: unable to decode CreateMirrorRequestInputBodyProvider to nil") } v, err := d.StrBytes() if err != nil { return err } // Try to use constant string. - switch DeletionGrantResourceType(v) { - case DeletionGrantResourceTypeProject: - *s = DeletionGrantResourceTypeProject - case DeletionGrantResourceTypeRepo: - *s = DeletionGrantResourceTypeRepo + switch CreateMirrorRequestInputBodyProvider(v) { + case CreateMirrorRequestInputBodyProviderGithub: + *s = CreateMirrorRequestInputBodyProviderGithub default: - *s = DeletionGrantResourceType(v) + *s = CreateMirrorRequestInputBodyProvider(v) } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s DeletionGrantResourceType) MarshalJSON() ([]byte, error) { +func (s CreateMirrorRequestInputBodyProvider) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *DeletionGrantResourceType) UnmarshalJSON(data []byte) error { +func (s *CreateMirrorRequestInputBodyProvider) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *DeletionMembership) Encode(e *jx.Encoder) { +func (s *CreateNativeMirrorInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *DeletionMembership) encodeFields(e *jx.Encoder) { +func (s *CreateNativeMirrorInputBody) encodeFields(e *jx.Encoder) { { - e.FieldStart("name") - e.Str(s.Name) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } } { - e.FieldStart("orgId") - e.Str(s.OrgId) + e.FieldStart("clusterSlug") + e.Str(s.ClusterSlug) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -8836,44 +8101,42 @@ func (s *DeletionMembership) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfDeletionMembership = [2]string{ - 0: "name", - 1: "orgId", +var jsonFieldsNameOfCreateNativeMirrorInputBody = [2]string{ + 0: "$schema", + 1: "clusterSlug", } -// Decode decodes DeletionMembership from json. -func (s *DeletionMembership) Decode(d *jx.Decoder) error { +// Decode decodes CreateNativeMirrorInputBody from json. +func (s *CreateNativeMirrorInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode DeletionMembership to nil") + return errors.New("invalid: unable to decode CreateNativeMirrorInputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "name": - requiredBitSet[0] |= 1 << 0 + case "$schema": if err := func() error { - v, err := d.Str() - s.Name = string(v) - if err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"name\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "orgId": + case "clusterSlug": requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.OrgId = string(v) + s.ClusterSlug = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"orgId\"") + return errors.Wrap(err, "decode field \"clusterSlug\"") } default: var elem jx.Raw @@ -8891,12 +8154,12 @@ func (s *DeletionMembership) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode DeletionMembership") + return errors.Wrap(err, "decode CreateNativeMirrorInputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000011, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -8908,8 +8171,8 @@ func (s *DeletionMembership) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfDeletionMembership) { - name = jsonFieldsNameOfDeletionMembership[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCreateNativeMirrorInputBody) { + name = jsonFieldsNameOfCreateNativeMirrorInputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -8930,27 +8193,27 @@ func (s *DeletionMembership) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *DeletionMembership) MarshalJSON() ([]byte, error) { +func (s *CreateNativeMirrorInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *DeletionMembership) UnmarshalJSON(data []byte) error { +func (s *CreateNativeMirrorInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s DeletionMembershipAdditional) Encode(e *jx.Encoder) { +func (s CreateNativeMirrorInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s DeletionMembershipAdditional) encodeFields(e *jx.Encoder) { +func (s CreateNativeMirrorInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -8960,10 +8223,10 @@ func (s DeletionMembershipAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes DeletionMembershipAdditional from json. -func (s *DeletionMembershipAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CreateNativeMirrorInputBodyAdditional from json. +func (s *CreateNativeMirrorInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode DeletionMembershipAdditional to nil") + return errors.New("invalid: unable to decode CreateNativeMirrorInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -8981,48 +8244,50 @@ func (s *DeletionMembershipAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode DeletionMembershipAdditional") + return errors.Wrap(err, "decode CreateNativeMirrorInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s DeletionMembershipAdditional) MarshalJSON() ([]byte, error) { +func (s CreateNativeMirrorInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *DeletionMembershipAdditional) UnmarshalJSON(data []byte) error { +func (s *CreateNativeMirrorInputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *DeletionRepo) Encode(e *jx.Encoder) { +func (s *CreateOrgInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *DeletionRepo) encodeFields(e *jx.Encoder) { +func (s *CreateOrgInputBody) encodeFields(e *jx.Encoder) { { - if s.Cluster.Set { - e.FieldStart("cluster") - s.Cluster.Encode(e) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) } } - { - e.FieldStart("id") - e.Str(s.ID) - } { e.FieldStart("name") e.Str(s.Name) } + { + if s.Region.Set { + e.FieldStart("region") + s.Region.Encode(e) + } + } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -9032,55 +8297,53 @@ func (s *DeletionRepo) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfDeletionRepo = [3]string{ - 0: "cluster", - 1: "id", - 2: "name", +var jsonFieldsNameOfCreateOrgInputBody = [3]string{ + 0: "$schema", + 1: "name", + 2: "region", } -// Decode decodes DeletionRepo from json. -func (s *DeletionRepo) Decode(d *jx.Decoder) error { +// Decode decodes CreateOrgInputBody from json. +func (s *CreateOrgInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode DeletionRepo to nil") + return errors.New("invalid: unable to decode CreateOrgInputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "cluster": + case "$schema": if err := func() error { - s.Cluster.Reset() - if err := s.Cluster.Decode(d); err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"cluster\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "id": + case "name": requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.ID = string(v) + s.Name = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"id\"") + return errors.Wrap(err, "decode field \"name\"") } - case "name": - requiredBitSet[0] |= 1 << 2 + case "region": if err := func() error { - v, err := d.Str() - s.Name = string(v) - if err != nil { + s.Region.Reset() + if err := s.Region.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"name\"") + return errors.Wrap(err, "decode field \"region\"") } default: var elem jx.Raw @@ -9098,12 +8361,12 @@ func (s *DeletionRepo) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode DeletionRepo") + return errors.Wrap(err, "decode CreateOrgInputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000110, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -9115,8 +8378,8 @@ func (s *DeletionRepo) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfDeletionRepo) { - name = jsonFieldsNameOfDeletionRepo[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCreateOrgInputBody) { + name = jsonFieldsNameOfCreateOrgInputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -9137,27 +8400,27 @@ func (s *DeletionRepo) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *DeletionRepo) MarshalJSON() ([]byte, error) { +func (s *CreateOrgInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *DeletionRepo) UnmarshalJSON(data []byte) error { +func (s *CreateOrgInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s DeletionRepoAdditional) Encode(e *jx.Encoder) { +func (s CreateOrgInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s DeletionRepoAdditional) encodeFields(e *jx.Encoder) { +func (s CreateOrgInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -9167,10 +8430,10 @@ func (s DeletionRepoAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes DeletionRepoAdditional from json. -func (s *DeletionRepoAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CreateOrgInputBodyAdditional from json. +func (s *CreateOrgInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode DeletionRepoAdditional to nil") + return errors.New("invalid: unable to decode CreateOrgInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -9188,51 +8451,85 @@ func (s *DeletionRepoAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode DeletionRepoAdditional") + return errors.Wrap(err, "decode CreateOrgInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s DeletionRepoAdditional) MarshalJSON() ([]byte, error) { +func (s CreateOrgInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *DeletionRepoAdditional) UnmarshalJSON(data []byte) error { +func (s *CreateOrgInputBodyAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes CreateOrgInvitationCreated as json. +func (s *CreateOrgInvitationCreated) Encode(e *jx.Encoder) { + unwrapped := (*Invitation)(s) + + unwrapped.Encode(e) +} + +// Decode decodes CreateOrgInvitationCreated from json. +func (s *CreateOrgInvitationCreated) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode CreateOrgInvitationCreated to nil") + } + var unwrapped Invitation + if err := func() error { + if err := unwrapped.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "alias") + } + *s = CreateOrgInvitationCreated(unwrapped) + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *CreateOrgInvitationCreated) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *CreateOrgInvitationCreated) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ErrorDetail) Encode(e *jx.Encoder) { +func (s *CreateOrgInvitationInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ErrorDetail) encodeFields(e *jx.Encoder) { +func (s *CreateOrgInvitationInputBody) encodeFields(e *jx.Encoder) { { - if s.Location.Set { - e.FieldStart("location") - s.Location.Encode(e) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) } } { - if s.Message.Set { - e.FieldStart("message") - s.Message.Encode(e) - } + e.FieldStart("email") + e.Str(s.Email) } { - if len(s.Value) != 0 { - e.FieldStart("value") - e.Raw(s.Value) - } + e.FieldStart("role") + s.Role.Encode(e) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -9243,51 +8540,54 @@ func (s *ErrorDetail) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfErrorDetail = [3]string{ - 0: "location", - 1: "message", - 2: "value", +var jsonFieldsNameOfCreateOrgInvitationInputBody = [3]string{ + 0: "$schema", + 1: "email", + 2: "role", } -// Decode decodes ErrorDetail from json. -func (s *ErrorDetail) Decode(d *jx.Decoder) error { +// Decode decodes CreateOrgInvitationInputBody from json. +func (s *CreateOrgInvitationInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ErrorDetail to nil") + return errors.New("invalid: unable to decode CreateOrgInvitationInputBody to nil") } + var requiredBitSet [1]uint8 + s.setDefaults() s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "location": + case "$schema": if err := func() error { - s.Location.Reset() - if err := s.Location.Decode(d); err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"location\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "message": + case "email": + requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Message.Reset() - if err := s.Message.Decode(d); err != nil { + v, err := d.Str() + s.Email = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"message\"") + return errors.Wrap(err, "decode field \"email\"") } - case "value": + case "role": + requiredBitSet[0] |= 1 << 2 if err := func() error { - v, err := d.RawAppend(nil) - s.Value = jx.Raw(v) - if err != nil { + if err := s.Role.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"value\"") + return errors.Wrap(err, "decode field \"role\"") } default: var elem jx.Raw @@ -9305,34 +8605,66 @@ func (s *ErrorDetail) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ErrorDetail") + return errors.Wrap(err, "decode CreateOrgInvitationInputBody") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00000110, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfCreateOrgInvitationInputBody) { + name = jsonFieldsNameOfCreateOrgInvitationInputBody[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s *ErrorDetail) MarshalJSON() ([]byte, error) { +func (s *CreateOrgInvitationInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ErrorDetail) UnmarshalJSON(data []byte) error { +func (s *CreateOrgInvitationInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ErrorDetailAdditional) Encode(e *jx.Encoder) { +func (s CreateOrgInvitationInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ErrorDetailAdditional) encodeFields(e *jx.Encoder) { +func (s CreateOrgInvitationInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -9342,10 +8674,10 @@ func (s ErrorDetailAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ErrorDetailAdditional from json. -func (s *ErrorDetailAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CreateOrgInvitationInputBodyAdditional from json. +func (s *CreateOrgInvitationInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ErrorDetailAdditional to nil") + return errors.New("invalid: unable to decode CreateOrgInvitationInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -9363,34 +8695,114 @@ func (s *ErrorDetailAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ErrorDetailAdditional") + return errors.Wrap(err, "decode CreateOrgInvitationInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ErrorDetailAdditional) MarshalJSON() ([]byte, error) { +func (s CreateOrgInvitationInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ErrorDetailAdditional) UnmarshalJSON(data []byte) error { +func (s *CreateOrgInvitationInputBodyAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes CreateOrgInvitationInputBodyRole as json. +func (s CreateOrgInvitationInputBodyRole) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes CreateOrgInvitationInputBodyRole from json. +func (s *CreateOrgInvitationInputBodyRole) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode CreateOrgInvitationInputBodyRole to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch CreateOrgInvitationInputBodyRole(v) { + case CreateOrgInvitationInputBodyRoleOwner: + *s = CreateOrgInvitationInputBodyRoleOwner + case CreateOrgInvitationInputBodyRoleAdmin: + *s = CreateOrgInvitationInputBodyRoleAdmin + case CreateOrgInvitationInputBodyRoleMember: + *s = CreateOrgInvitationInputBodyRoleMember + default: + *s = CreateOrgInvitationInputBodyRole(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s CreateOrgInvitationInputBodyRole) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *CreateOrgInvitationInputBodyRole) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes CreateOrgInvitationOK as json. +func (s *CreateOrgInvitationOK) Encode(e *jx.Encoder) { + unwrapped := (*Invitation)(s) + + unwrapped.Encode(e) +} + +// Decode decodes CreateOrgInvitationOK from json. +func (s *CreateOrgInvitationOK) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode CreateOrgInvitationOK to nil") + } + var unwrapped Invitation + if err := func() error { + if err := unwrapped.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "alias") + } + *s = CreateOrgInvitationOK(unwrapped) + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *CreateOrgInvitationOK) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *CreateOrgInvitationOK) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ErrorModel) Encode(e *jx.Encoder) { +func (s *CreateProjectInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ErrorModel) encodeFields(e *jx.Encoder) { +func (s *CreateProjectInputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -9398,43 +8810,21 @@ func (s *ErrorModel) encodeFields(e *jx.Encoder) { } } { - if s.Detail.Set { - e.FieldStart("detail") - s.Detail.Encode(e) - } - } - { - if s.Errors != nil { - e.FieldStart("errors") - e.ArrStart() - for _, elem := range s.Errors { - elem.Encode(e) - } - e.ArrEnd() - } - } - { - if s.Instance.Set { - e.FieldStart("instance") - s.Instance.Encode(e) - } + e.FieldStart("name") + e.Str(s.Name) } { - if s.Status.Set { - e.FieldStart("status") - s.Status.Encode(e) - } + e.FieldStart("ownerId") + e.Str(s.OwnerId) } { - if s.Title.Set { - e.FieldStart("title") - s.Title.Encode(e) - } + e.FieldStart("ownerType") + s.OwnerType.Encode(e) } { - if s.Type.Set { - e.FieldStart("type") - s.Type.Encode(e) + if s.Region.Set { + e.FieldStart("region") + s.Region.Encode(e) } } for k, elem := range s.AdditionalProps { @@ -9446,22 +8836,20 @@ func (s *ErrorModel) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfErrorModel = [7]string{ +var jsonFieldsNameOfCreateProjectInputBody = [5]string{ 0: "$schema", - 1: "detail", - 2: "errors", - 3: "instance", - 4: "status", - 5: "title", - 6: "type", + 1: "name", + 2: "ownerId", + 3: "ownerType", + 4: "region", } -// Decode decodes ErrorModel from json. -func (s *ErrorModel) Decode(d *jx.Decoder) error { +// Decode decodes CreateProjectInputBody from json. +func (s *CreateProjectInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ErrorModel to nil") + return errors.New("invalid: unable to decode CreateProjectInputBody to nil") } - s.setDefaults() + var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -9476,72 +8864,49 @@ func (s *ErrorModel) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "detail": - if err := func() error { - s.Detail.Reset() - if err := s.Detail.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"detail\"") - } - case "errors": - if err := func() error { - s.Errors = make([]ErrorDetail, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem ErrorDetail - if err := elem.Decode(d); err != nil { - return err - } - s.Errors = append(s.Errors, elem) - return nil - }); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"errors\"") - } - case "instance": + case "name": + requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Instance.Reset() - if err := s.Instance.Decode(d); err != nil { + v, err := d.Str() + s.Name = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"instance\"") + return errors.Wrap(err, "decode field \"name\"") } - case "status": + case "ownerId": + requiredBitSet[0] |= 1 << 2 if err := func() error { - s.Status.Reset() - if err := s.Status.Decode(d); err != nil { + v, err := d.Str() + s.OwnerId = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"status\"") + return errors.Wrap(err, "decode field \"ownerId\"") } - case "title": + case "ownerType": + requiredBitSet[0] |= 1 << 3 if err := func() error { - s.Title.Reset() - if err := s.Title.Decode(d); err != nil { + if err := s.OwnerType.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"title\"") + return errors.Wrap(err, "decode field \"ownerType\"") } - case "type": + case "region": if err := func() error { - s.Type.Reset() - if err := s.Type.Decode(d); err != nil { + s.Region.Reset() + if err := s.Region.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"type\"") + return errors.Wrap(err, "decode field \"region\"") } default: var elem jx.Raw @@ -9559,34 +8924,66 @@ func (s *ErrorModel) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ErrorModel") + return errors.Wrap(err, "decode CreateProjectInputBody") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00001110, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfCreateProjectInputBody) { + name = jsonFieldsNameOfCreateProjectInputBody[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} } - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s *ErrorModel) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *CreateProjectInputBody) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ErrorModel) UnmarshalJSON(data []byte) error { +func (s *CreateProjectInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ErrorModelAdditional) Encode(e *jx.Encoder) { +func (s CreateProjectInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ErrorModelAdditional) encodeFields(e *jx.Encoder) { +func (s CreateProjectInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -9596,10 +8993,10 @@ func (s ErrorModelAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ErrorModelAdditional from json. -func (s *ErrorModelAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CreateProjectInputBodyAdditional from json. +func (s *CreateProjectInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ErrorModelAdditional to nil") + return errors.New("invalid: unable to decode CreateProjectInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -9617,42 +9014,162 @@ func (s *ErrorModelAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ErrorModelAdditional") + return errors.Wrap(err, "decode CreateProjectInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ErrorModelAdditional) MarshalJSON() ([]byte, error) { +func (s CreateProjectInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ErrorModelAdditional) UnmarshalJSON(data []byte) error { +func (s *CreateProjectInputBodyAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes CreateProjectInputBodyOwnerType as json. +func (s CreateProjectInputBodyOwnerType) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes CreateProjectInputBodyOwnerType from json. +func (s *CreateProjectInputBodyOwnerType) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode CreateProjectInputBodyOwnerType to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch CreateProjectInputBodyOwnerType(v) { + case CreateProjectInputBodyOwnerTypeOrg: + *s = CreateProjectInputBodyOwnerTypeOrg + case CreateProjectInputBodyOwnerTypeAccount: + *s = CreateProjectInputBodyOwnerTypeAccount + default: + *s = CreateProjectInputBodyOwnerType(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s CreateProjectInputBodyOwnerType) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *CreateProjectInputBodyOwnerType) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ForgeRepoIdentity) Encode(e *jx.Encoder) { +func (s *CreateRepoCIWebhookBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ForgeRepoIdentity) encodeFields(e *jx.Encoder) { +func (s *CreateRepoCIWebhookBody) encodeFields(e *jx.Encoder) { { - e.FieldStart("forge") - e.Str(s.Forge) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } + } + { + e.FieldStart("auth_plugin_ref") + e.Str(s.AuthPluginRef) + } + { + e.FieldStart("automation_id") + e.Str(s.AutomationID) + } + { + e.FieldStart("bk_organization") + e.Str(s.BkOrganization) + } + { + e.FieldStart("bk_pipeline") + e.Str(s.BkPipeline) + } + { + e.FieldStart("core_url") + e.Str(s.CoreURL) + } + { + e.FieldStart("created_at") + json.EncodeDateTime(e, s.CreatedAt) + } + { + e.FieldStart("display_name") + e.Str(s.DisplayName) + } + { + e.FieldStart("enabled") + e.Bool(s.Enabled) + } + { + e.FieldStart("events") + e.ArrStart() + for _, elem := range s.Events { + e.Str(elem) + } + e.ArrEnd() + } + { + e.FieldStart("id") + e.Str(s.ID) + } + { + e.FieldStart("provider") + e.Str(s.Provider) + } + { + e.FieldStart("provider_account") + e.Str(s.ProviderAccount) + } + { + e.FieldStart("publish_checks") + e.Bool(s.PublishChecks) + } + { + e.FieldStart("ref_filter") + e.Str(s.RefFilter) } { e.FieldStart("repo_id") e.Str(s.RepoID) } + { + e.FieldStart("repo_write") + e.Bool(s.RepoWrite) + } + { + if s.Setup.Set { + e.FieldStart("setup") + s.Setup.Encode(e) + } + } + { + e.FieldStart("target_ref") + e.Str(s.TargetRef) + } + { + e.FieldStart("updated_at") + json.EncodeDateTime(e, s.UpdatedAt) + } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -9662,35 +9179,227 @@ func (s *ForgeRepoIdentity) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfForgeRepoIdentity = [2]string{ - 0: "forge", - 1: "repo_id", +var jsonFieldsNameOfCreateRepoCIWebhookBody = [20]string{ + 0: "$schema", + 1: "auth_plugin_ref", + 2: "automation_id", + 3: "bk_organization", + 4: "bk_pipeline", + 5: "core_url", + 6: "created_at", + 7: "display_name", + 8: "enabled", + 9: "events", + 10: "id", + 11: "provider", + 12: "provider_account", + 13: "publish_checks", + 14: "ref_filter", + 15: "repo_id", + 16: "repo_write", + 17: "setup", + 18: "target_ref", + 19: "updated_at", } -// Decode decodes ForgeRepoIdentity from json. -func (s *ForgeRepoIdentity) Decode(d *jx.Decoder) error { +// Decode decodes CreateRepoCIWebhookBody from json. +func (s *CreateRepoCIWebhookBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ForgeRepoIdentity to nil") + return errors.New("invalid: unable to decode CreateRepoCIWebhookBody to nil") } - var requiredBitSet [1]uint8 + var requiredBitSet [3]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "forge": - requiredBitSet[0] |= 1 << 0 + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "auth_plugin_ref": + requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.Forge = string(v) + s.AuthPluginRef = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"forge\"") + return errors.Wrap(err, "decode field \"auth_plugin_ref\"") + } + case "automation_id": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.AutomationID = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"automation_id\"") + } + case "bk_organization": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.BkOrganization = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"bk_organization\"") + } + case "bk_pipeline": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + v, err := d.Str() + s.BkPipeline = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"bk_pipeline\"") + } + case "core_url": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + v, err := d.Str() + s.CoreURL = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"core_url\"") + } + case "created_at": + requiredBitSet[0] |= 1 << 6 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.CreatedAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"created_at\"") + } + case "display_name": + requiredBitSet[0] |= 1 << 7 + if err := func() error { + v, err := d.Str() + s.DisplayName = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"display_name\"") + } + case "enabled": + requiredBitSet[1] |= 1 << 0 + if err := func() error { + v, err := d.Bool() + s.Enabled = bool(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"enabled\"") + } + case "events": + requiredBitSet[1] |= 1 << 1 + if err := func() error { + s.Events = make([]string, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem string + v, err := d.Str() + elem = string(v) + if err != nil { + return err + } + s.Events = append(s.Events, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"events\"") + } + case "id": + requiredBitSet[1] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.ID = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"id\"") + } + case "provider": + requiredBitSet[1] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.Provider = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider\"") + } + case "provider_account": + requiredBitSet[1] |= 1 << 4 + if err := func() error { + v, err := d.Str() + s.ProviderAccount = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider_account\"") + } + case "publish_checks": + requiredBitSet[1] |= 1 << 5 + if err := func() error { + v, err := d.Bool() + s.PublishChecks = bool(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"publish_checks\"") + } + case "ref_filter": + requiredBitSet[1] |= 1 << 6 + if err := func() error { + v, err := d.Str() + s.RefFilter = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"ref_filter\"") } case "repo_id": - requiredBitSet[0] |= 1 << 1 + requiredBitSet[1] |= 1 << 7 if err := func() error { v, err := d.Str() s.RepoID = string(v) @@ -9701,6 +9410,52 @@ func (s *ForgeRepoIdentity) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"repo_id\"") } + case "repo_write": + requiredBitSet[2] |= 1 << 0 + if err := func() error { + v, err := d.Bool() + s.RepoWrite = bool(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"repo_write\"") + } + case "setup": + if err := func() error { + s.Setup.Reset() + if err := s.Setup.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"setup\"") + } + case "target_ref": + requiredBitSet[2] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.TargetRef = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"target_ref\"") + } + case "updated_at": + requiredBitSet[2] |= 1 << 3 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.UpdatedAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"updated_at\"") + } default: var elem jx.Raw if err := func() error { @@ -9717,12 +9472,14 @@ func (s *ForgeRepoIdentity) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ForgeRepoIdentity") + return errors.Wrap(err, "decode CreateRepoCIWebhookBody") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [1]uint8{ - 0b00000011, + for i, mask := range [3]uint8{ + 0b11111110, + 0b11111111, + 0b00001101, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -9734,8 +9491,8 @@ func (s *ForgeRepoIdentity) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfForgeRepoIdentity) { - name = jsonFieldsNameOfForgeRepoIdentity[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCreateRepoCIWebhookBody) { + name = jsonFieldsNameOfCreateRepoCIWebhookBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -9756,27 +9513,27 @@ func (s *ForgeRepoIdentity) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ForgeRepoIdentity) MarshalJSON() ([]byte, error) { +func (s *CreateRepoCIWebhookBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ForgeRepoIdentity) UnmarshalJSON(data []byte) error { +func (s *CreateRepoCIWebhookBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ForgeRepoIdentityAdditional) Encode(e *jx.Encoder) { +func (s CreateRepoCIWebhookBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ForgeRepoIdentityAdditional) encodeFields(e *jx.Encoder) { +func (s CreateRepoCIWebhookBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -9786,10 +9543,10 @@ func (s ForgeRepoIdentityAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ForgeRepoIdentityAdditional from json. -func (s *ForgeRepoIdentityAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CreateRepoCIWebhookBodyAdditional from json. +func (s *CreateRepoCIWebhookBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ForgeRepoIdentityAdditional to nil") + return errors.New("invalid: unable to decode CreateRepoCIWebhookBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -9807,34 +9564,34 @@ func (s *ForgeRepoIdentityAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ForgeRepoIdentityAdditional") + return errors.Wrap(err, "decode CreateRepoCIWebhookBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ForgeRepoIdentityAdditional) MarshalJSON() ([]byte, error) { +func (s CreateRepoCIWebhookBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ForgeRepoIdentityAdditional) UnmarshalJSON(data []byte) error { +func (s *CreateRepoCIWebhookBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *GetDeletionPreviewOutputBody) Encode(e *jx.Encoder) { +func (s *CreateRepoCIWebhookInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *GetDeletionPreviewOutputBody) encodeFields(e *jx.Encoder) { +func (s *CreateRepoCIWebhookInputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -9842,48 +9599,124 @@ func (s *GetDeletionPreviewOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("blocked") - e.Bool(s.Blocked) + if s.BkClusterID.Set { + e.FieldStart("bk_cluster_id") + s.BkClusterID.Encode(e) + } } { - e.FieldStart("blockers") - e.ArrStart() - for _, elem := range s.Blockers { - elem.Encode(e) + if s.BkForceRescaffold.Set { + e.FieldStart("bk_force_rescaffold") + s.BkForceRescaffold.Encode(e) } - e.ArrEnd() } { - e.FieldStart("willDelete") - s.WillDelete.Encode(e) + if s.BkOrganization.Set { + e.FieldStart("bk_organization") + s.BkOrganization.Encode(e) + } } { - e.FieldStart("willUnlink") - s.WillUnlink.Encode(e) + if s.BkPipeline.Set { + e.FieldStart("bk_pipeline") + s.BkPipeline.Encode(e) + } } - for k, elem := range s.AdditionalProps { - e.FieldStart(k) - - if len(elem) != 0 { - e.Raw(elem) + { + if s.BkPipelineSelfManaged.Set { + e.FieldStart("bk_pipeline_self_managed") + s.BkPipelineSelfManaged.Encode(e) } } -} - -var jsonFieldsNameOfGetDeletionPreviewOutputBody = [5]string{ - 0: "$schema", - 1: "blocked", - 2: "blockers", - 3: "willDelete", - 4: "willUnlink", -} - -// Decode decodes GetDeletionPreviewOutputBody from json. -func (s *GetDeletionPreviewOutputBody) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode GetDeletionPreviewOutputBody to nil") + { + if s.BkProvisioningToken.Set { + e.FieldStart("bk_provisioning_token") + s.BkProvisioningToken.Encode(e) + } } - var requiredBitSet [1]uint8 + { + if s.Config.Set { + e.FieldStart("config") + s.Config.Encode(e) + } + } + { + if s.DisplayName.Set { + e.FieldStart("display_name") + s.DisplayName.Encode(e) + } + } + { + if s.Events != nil { + e.FieldStart("events") + e.ArrStart() + for _, elem := range s.Events { + e.Str(elem) + } + e.ArrEnd() + } + } + { + if s.Mode.Set { + e.FieldStart("mode") + s.Mode.Encode(e) + } + } + { + e.FieldStart("provider") + e.Str(s.Provider) + } + { + if s.ProviderAccount.Set { + e.FieldStart("provider_account") + s.ProviderAccount.Encode(e) + } + } + { + if s.RefFilter.Set { + e.FieldStart("ref_filter") + s.RefFilter.Encode(e) + } + } + { + if s.TargetRef.Set { + e.FieldStart("target_ref") + s.TargetRef.Encode(e) + } + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfCreateRepoCIWebhookInputBody = [15]string{ + 0: "$schema", + 1: "bk_cluster_id", + 2: "bk_force_rescaffold", + 3: "bk_organization", + 4: "bk_pipeline", + 5: "bk_pipeline_self_managed", + 6: "bk_provisioning_token", + 7: "config", + 8: "display_name", + 9: "events", + 10: "mode", + 11: "provider", + 12: "provider_account", + 13: "ref_filter", + 14: "target_ref", +} + +// Decode decodes CreateRepoCIWebhookInputBody from json. +func (s *CreateRepoCIWebhookInputBody) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode CreateRepoCIWebhookInputBody to nil") + } + var requiredBitSet [2]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -9898,55 +9731,156 @@ func (s *GetDeletionPreviewOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "blocked": - requiredBitSet[0] |= 1 << 1 + case "bk_cluster_id": if err := func() error { - v, err := d.Bool() - s.Blocked = bool(v) - if err != nil { + s.BkClusterID.Reset() + if err := s.BkClusterID.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"blocked\"") + return errors.Wrap(err, "decode field \"bk_cluster_id\"") } - case "blockers": - requiredBitSet[0] |= 1 << 2 + case "bk_force_rescaffold": if err := func() error { - s.Blockers = make([]DeletionBlocker, 0) + s.BkForceRescaffold.Reset() + if err := s.BkForceRescaffold.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"bk_force_rescaffold\"") + } + case "bk_organization": + if err := func() error { + s.BkOrganization.Reset() + if err := s.BkOrganization.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"bk_organization\"") + } + case "bk_pipeline": + if err := func() error { + s.BkPipeline.Reset() + if err := s.BkPipeline.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"bk_pipeline\"") + } + case "bk_pipeline_self_managed": + if err := func() error { + s.BkPipelineSelfManaged.Reset() + if err := s.BkPipelineSelfManaged.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"bk_pipeline_self_managed\"") + } + case "bk_provisioning_token": + if err := func() error { + s.BkProvisioningToken.Reset() + if err := s.BkProvisioningToken.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"bk_provisioning_token\"") + } + case "config": + if err := func() error { + s.Config.Reset() + if err := s.Config.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"config\"") + } + case "display_name": + if err := func() error { + s.DisplayName.Reset() + if err := s.DisplayName.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"display_name\"") + } + case "events": + if err := func() error { + s.Events = make([]string, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem DeletionBlocker - if err := elem.Decode(d); err != nil { + var elem string + v, err := d.Str() + elem = string(v) + if err != nil { return err } - s.Blockers = append(s.Blockers, elem) + s.Events = append(s.Events, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"blockers\"") + return errors.Wrap(err, "decode field \"events\"") } - case "willDelete": - requiredBitSet[0] |= 1 << 3 + case "mode": if err := func() error { - if err := s.WillDelete.Decode(d); err != nil { + s.Mode.Reset() + if err := s.Mode.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"willDelete\"") + return errors.Wrap(err, "decode field \"mode\"") } - case "willUnlink": - requiredBitSet[0] |= 1 << 4 + case "provider": + requiredBitSet[1] |= 1 << 3 if err := func() error { - if err := s.WillUnlink.Decode(d); err != nil { + v, err := d.Str() + s.Provider = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"willUnlink\"") + return errors.Wrap(err, "decode field \"provider\"") + } + case "provider_account": + if err := func() error { + s.ProviderAccount.Reset() + if err := s.ProviderAccount.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider_account\"") + } + case "ref_filter": + if err := func() error { + s.RefFilter.Reset() + if err := s.RefFilter.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"ref_filter\"") + } + case "target_ref": + if err := func() error { + s.TargetRef.Reset() + if err := s.TargetRef.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"target_ref\"") } default: var elem jx.Raw @@ -9964,12 +9898,13 @@ func (s *GetDeletionPreviewOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode GetDeletionPreviewOutputBody") + return errors.Wrap(err, "decode CreateRepoCIWebhookInputBody") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [1]uint8{ - 0b00011110, + for i, mask := range [2]uint8{ + 0b00000000, + 0b00001000, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -9981,8 +9916,8 @@ func (s *GetDeletionPreviewOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfGetDeletionPreviewOutputBody) { - name = jsonFieldsNameOfGetDeletionPreviewOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCreateRepoCIWebhookInputBody) { + name = jsonFieldsNameOfCreateRepoCIWebhookInputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -10003,27 +9938,27 @@ func (s *GetDeletionPreviewOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *GetDeletionPreviewOutputBody) MarshalJSON() ([]byte, error) { +func (s *CreateRepoCIWebhookInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetDeletionPreviewOutputBody) UnmarshalJSON(data []byte) error { +func (s *CreateRepoCIWebhookInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s GetDeletionPreviewOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s CreateRepoCIWebhookInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s GetDeletionPreviewOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s CreateRepoCIWebhookInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -10033,10 +9968,10 @@ func (s GetDeletionPreviewOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes GetDeletionPreviewOutputBodyAdditional from json. -func (s *GetDeletionPreviewOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CreateRepoCIWebhookInputBodyAdditional from json. +func (s *CreateRepoCIWebhookInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GetDeletionPreviewOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode CreateRepoCIWebhookInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -10054,34 +9989,90 @@ func (s *GetDeletionPreviewOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode GetDeletionPreviewOutputBodyAdditional") + return errors.Wrap(err, "decode CreateRepoCIWebhookInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GetDeletionPreviewOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s CreateRepoCIWebhookInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetDeletionPreviewOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *CreateRepoCIWebhookInputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *GetMeOutputBody) Encode(e *jx.Encoder) { +func (s CreateRepoCIWebhookInputBodyConfig) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s CreateRepoCIWebhookInputBodyConfig) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + e.Str(elem) + } +} + +// Decode decodes CreateRepoCIWebhookInputBodyConfig from json. +func (s *CreateRepoCIWebhookInputBodyConfig) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode CreateRepoCIWebhookInputBodyConfig to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem string + if err := func() error { + v, err := d.Str() + elem = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode CreateRepoCIWebhookInputBodyConfig") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s CreateRepoCIWebhookInputBodyConfig) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *CreateRepoCIWebhookInputBodyConfig) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *CreateRepoInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *GetMeOutputBody) encodeFields(e *jx.Encoder) { +func (s *CreateRepoInputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -10089,42 +10080,24 @@ func (s *GetMeOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("auth") - s.Auth.Encode(e) - } - { - if s.Deletion.Set { - e.FieldStart("deletion") - s.Deletion.Encode(e) - } - } - { - e.FieldStart("global") - s.Global.Encode(e) - } - { - if s.Jurisdiction.Set { - e.FieldStart("jurisdiction") - s.Jurisdiction.Encode(e) + if s.ClusterHost.Set { + e.FieldStart("clusterHost") + s.ClusterHost.Encode(e) } } { - if s.Mode.Set { - e.FieldStart("mode") - s.Mode.Encode(e) - } + e.FieldStart("name") + e.Str(s.Name) } { - if s.Regional.Set { - e.FieldStart("regional") - s.Regional.Encode(e) + if s.ObjectFormat.Set { + e.FieldStart("objectFormat") + s.ObjectFormat.Encode(e) } } { - if s.RegionalUnavailable.Set { - e.FieldStart("regionalUnavailable") - s.RegionalUnavailable.Encode(e) - } + e.FieldStart("projectId") + e.Str(s.ProjectId) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -10135,21 +10108,18 @@ func (s *GetMeOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfGetMeOutputBody = [8]string{ +var jsonFieldsNameOfCreateRepoInputBody = [5]string{ 0: "$schema", - 1: "auth", - 2: "deletion", - 3: "global", - 4: "jurisdiction", - 5: "mode", - 6: "regional", - 7: "regionalUnavailable", + 1: "clusterHost", + 2: "name", + 3: "objectFormat", + 4: "projectId", } -// Decode decodes GetMeOutputBody from json. -func (s *GetMeOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes CreateRepoInputBody from json. +func (s *CreateRepoInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GetMeOutputBody to nil") + return errors.New("invalid: unable to decode CreateRepoInputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -10166,75 +10136,49 @@ func (s *GetMeOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "auth": - requiredBitSet[0] |= 1 << 1 - if err := func() error { - if err := s.Auth.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"auth\"") - } - case "deletion": - if err := func() error { - s.Deletion.Reset() - if err := s.Deletion.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"deletion\"") - } - case "global": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - if err := s.Global.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"global\"") - } - case "jurisdiction": + case "clusterHost": if err := func() error { - s.Jurisdiction.Reset() - if err := s.Jurisdiction.Decode(d); err != nil { + s.ClusterHost.Reset() + if err := s.ClusterHost.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"jurisdiction\"") + return errors.Wrap(err, "decode field \"clusterHost\"") } - case "mode": + case "name": + requiredBitSet[0] |= 1 << 2 if err := func() error { - s.Mode.Reset() - if err := s.Mode.Decode(d); err != nil { + v, err := d.Str() + s.Name = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"mode\"") + return errors.Wrap(err, "decode field \"name\"") } - case "regional": + case "objectFormat": if err := func() error { - s.Regional.Reset() - if err := s.Regional.Decode(d); err != nil { + s.ObjectFormat.Reset() + if err := s.ObjectFormat.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"regional\"") + return errors.Wrap(err, "decode field \"objectFormat\"") } - case "regionalUnavailable": + case "projectId": + requiredBitSet[0] |= 1 << 4 if err := func() error { - s.RegionalUnavailable.Reset() - if err := s.RegionalUnavailable.Decode(d); err != nil { + v, err := d.Str() + s.ProjectId = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"regionalUnavailable\"") + return errors.Wrap(err, "decode field \"projectId\"") } default: var elem jx.Raw @@ -10252,12 +10196,12 @@ func (s *GetMeOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode GetMeOutputBody") + return errors.Wrap(err, "decode CreateRepoInputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00001010, + 0b00010100, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -10269,8 +10213,8 @@ func (s *GetMeOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfGetMeOutputBody) { - name = jsonFieldsNameOfGetMeOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCreateRepoInputBody) { + name = jsonFieldsNameOfCreateRepoInputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -10291,27 +10235,27 @@ func (s *GetMeOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *GetMeOutputBody) MarshalJSON() ([]byte, error) { +func (s *CreateRepoInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetMeOutputBody) UnmarshalJSON(data []byte) error { +func (s *CreateRepoInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s GetMeOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s CreateRepoInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s GetMeOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s CreateRepoInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -10321,10 +10265,10 @@ func (s GetMeOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes GetMeOutputBodyAdditional from json. -func (s *GetMeOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CreateRepoInputBodyAdditional from json. +func (s *CreateRepoInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GetMeOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode CreateRepoInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -10342,74 +10286,74 @@ func (s *GetMeOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode GetMeOutputBodyAdditional") + return errors.Wrap(err, "decode CreateRepoInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GetMeOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s CreateRepoInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetMeOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *CreateRepoInputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes GetMeOutputBodyMode as json. -func (s GetMeOutputBodyMode) Encode(e *jx.Encoder) { +// Encode encodes CreateRepoInputBodyObjectFormat as json. +func (s CreateRepoInputBodyObjectFormat) Encode(e *jx.Encoder) { e.Str(string(s)) } -// Decode decodes GetMeOutputBodyMode from json. -func (s *GetMeOutputBodyMode) Decode(d *jx.Decoder) error { +// Decode decodes CreateRepoInputBodyObjectFormat from json. +func (s *CreateRepoInputBodyObjectFormat) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GetMeOutputBodyMode to nil") + return errors.New("invalid: unable to decode CreateRepoInputBodyObjectFormat to nil") } v, err := d.StrBytes() if err != nil { return err } // Try to use constant string. - switch GetMeOutputBodyMode(v) { - case GetMeOutputBodyModeGlobal: - *s = GetMeOutputBodyModeGlobal - case GetMeOutputBodyModeRegional: - *s = GetMeOutputBodyModeRegional + switch CreateRepoInputBodyObjectFormat(v) { + case CreateRepoInputBodyObjectFormatSHA1: + *s = CreateRepoInputBodyObjectFormatSHA1 + case CreateRepoInputBodyObjectFormatSHA256: + *s = CreateRepoInputBodyObjectFormatSHA256 default: - *s = GetMeOutputBodyMode(v) + *s = CreateRepoInputBodyObjectFormat(v) } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GetMeOutputBodyMode) MarshalJSON() ([]byte, error) { +func (s CreateRepoInputBodyObjectFormat) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetMeOutputBodyMode) UnmarshalJSON(data []byte) error { +func (s *CreateRepoInputBodyObjectFormat) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *GetOnboardingStatusOutputBody) Encode(e *jx.Encoder) { +func (s *CreateServiceAccountInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *GetOnboardingStatusOutputBody) encodeFields(e *jx.Encoder) { +func (s *CreateServiceAccountInputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -10417,13 +10361,13 @@ func (s *GetOnboardingStatusOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("cliLoggedIn") - e.Bool(s.CliLoggedIn) + e.FieldStart("name") + e.Str(s.Name) } { - e.FieldStart("needsOnboarding") - e.Bool(s.NeedsOnboarding) - } + e.FieldStart("orgId") + e.Str(s.OrgId) + } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -10433,16 +10377,16 @@ func (s *GetOnboardingStatusOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfGetOnboardingStatusOutputBody = [3]string{ +var jsonFieldsNameOfCreateServiceAccountInputBody = [3]string{ 0: "$schema", - 1: "cliLoggedIn", - 2: "needsOnboarding", + 1: "name", + 2: "orgId", } -// Decode decodes GetOnboardingStatusOutputBody from json. -func (s *GetOnboardingStatusOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes CreateServiceAccountInputBody from json. +func (s *CreateServiceAccountInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GetOnboardingStatusOutputBody to nil") + return errors.New("invalid: unable to decode CreateServiceAccountInputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -10459,29 +10403,29 @@ func (s *GetOnboardingStatusOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "cliLoggedIn": + case "name": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Bool() - s.CliLoggedIn = bool(v) + v, err := d.Str() + s.Name = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"cliLoggedIn\"") + return errors.Wrap(err, "decode field \"name\"") } - case "needsOnboarding": + case "orgId": requiredBitSet[0] |= 1 << 2 if err := func() error { - v, err := d.Bool() - s.NeedsOnboarding = bool(v) + v, err := d.Str() + s.OrgId = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"needsOnboarding\"") + return errors.Wrap(err, "decode field \"orgId\"") } default: var elem jx.Raw @@ -10499,7 +10443,7 @@ func (s *GetOnboardingStatusOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode GetOnboardingStatusOutputBody") + return errors.Wrap(err, "decode CreateServiceAccountInputBody") } // Validate required fields. var failures []validate.FieldError @@ -10516,8 +10460,8 @@ func (s *GetOnboardingStatusOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfGetOnboardingStatusOutputBody) { - name = jsonFieldsNameOfGetOnboardingStatusOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCreateServiceAccountInputBody) { + name = jsonFieldsNameOfCreateServiceAccountInputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -10538,27 +10482,27 @@ func (s *GetOnboardingStatusOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *GetOnboardingStatusOutputBody) MarshalJSON() ([]byte, error) { +func (s *CreateServiceAccountInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetOnboardingStatusOutputBody) UnmarshalJSON(data []byte) error { +func (s *CreateServiceAccountInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s GetOnboardingStatusOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s CreateServiceAccountInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s GetOnboardingStatusOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s CreateServiceAccountInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -10568,10 +10512,10 @@ func (s GetOnboardingStatusOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes GetOnboardingStatusOutputBodyAdditional from json. -func (s *GetOnboardingStatusOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CreateServiceAccountInputBodyAdditional from json. +func (s *CreateServiceAccountInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GetOnboardingStatusOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode CreateServiceAccountInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -10589,34 +10533,34 @@ func (s *GetOnboardingStatusOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode GetOnboardingStatusOutputBodyAdditional") + return errors.Wrap(err, "decode CreateServiceAccountInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GetOnboardingStatusOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s CreateServiceAccountInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetOnboardingStatusOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *CreateServiceAccountInputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *GetPermissionsOutputBody) Encode(e *jx.Encoder) { +func (s *CreatedOrg) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *GetPermissionsOutputBody) encodeFields(e *jx.Encoder) { +func (s *CreatedOrg) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -10624,28 +10568,38 @@ func (s *GetPermissionsOutputBody) encodeFields(e *jx.Encoder) { } } { - if s.Explain.Set { - e.FieldStart("explain") - s.Explain.Encode(e) + if s.Capabilities.Set { + e.FieldStart("capabilities") + s.Capabilities.Encode(e) } } { - if s.Permissions != nil { - e.FieldStart("permissions") - e.ArrStart() - for _, elem := range s.Permissions { - elem.Encode(e) - } - e.ArrEnd() + if s.CommitToken.Set { + e.FieldStart("commitToken") + s.CommitToken.Encode(e) } } { - e.FieldStart("resourceId") - e.Str(s.ResourceId) + e.FieldStart("createdAt") + json.EncodeDateTime(e, s.CreatedAt) } { - e.FieldStart("resourceType") - e.Str(s.ResourceType) + e.FieldStart("id") + e.Str(s.ID) + } + { + e.FieldStart("name") + e.Str(s.Name) + } + { + e.FieldStart("region") + e.Str(s.Region) + } + { + if s.WorkosOrganizationId.Set { + e.FieldStart("workosOrganizationId") + s.WorkosOrganizationId.Encode(e) + } } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -10656,18 +10610,21 @@ func (s *GetPermissionsOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfGetPermissionsOutputBody = [5]string{ +var jsonFieldsNameOfCreatedOrg = [8]string{ 0: "$schema", - 1: "explain", - 2: "permissions", - 3: "resourceId", - 4: "resourceType", + 1: "capabilities", + 2: "commitToken", + 3: "createdAt", + 4: "id", + 5: "name", + 6: "region", + 7: "workosOrganizationId", } -// Decode decodes GetPermissionsOutputBody from json. -func (s *GetPermissionsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes CreatedOrg from json. +func (s *CreatedOrg) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GetPermissionsOutputBody to nil") + return errors.New("invalid: unable to decode CreatedOrg to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -10684,56 +10641,83 @@ func (s *GetPermissionsOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "explain": + case "capabilities": if err := func() error { - s.Explain.Reset() - if err := s.Explain.Decode(d); err != nil { + s.Capabilities.Reset() + if err := s.Capabilities.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"explain\"") + return errors.Wrap(err, "decode field \"capabilities\"") } - case "permissions": + case "commitToken": if err := func() error { - s.Permissions = make([]GetPermissionsOutputBodyPermissionsItem, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem GetPermissionsOutputBodyPermissionsItem - if err := elem.Decode(d); err != nil { - return err - } - s.Permissions = append(s.Permissions, elem) - return nil - }); err != nil { + s.CommitToken.Reset() + if err := s.CommitToken.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"permissions\"") + return errors.Wrap(err, "decode field \"commitToken\"") } - case "resourceId": + case "createdAt": requiredBitSet[0] |= 1 << 3 if err := func() error { - v, err := d.Str() - s.ResourceId = string(v) + v, err := json.DecodeDateTime(d) + s.CreatedAt = v if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"resourceId\"") + return errors.Wrap(err, "decode field \"createdAt\"") } - case "resourceType": + case "id": requiredBitSet[0] |= 1 << 4 if err := func() error { v, err := d.Str() - s.ResourceType = string(v) + s.ID = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"resourceType\"") + return errors.Wrap(err, "decode field \"id\"") + } + case "name": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + v, err := d.Str() + s.Name = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"name\"") + } + case "region": + requiredBitSet[0] |= 1 << 6 + if err := func() error { + v, err := d.Str() + s.Region = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"region\"") + } + case "workosOrganizationId": + if err := func() error { + s.WorkosOrganizationId.Reset() + if err := s.WorkosOrganizationId.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"workosOrganizationId\"") } default: var elem jx.Raw @@ -10751,12 +10735,12 @@ func (s *GetPermissionsOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode GetPermissionsOutputBody") + return errors.Wrap(err, "decode CreatedOrg") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00011000, + 0b01111000, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -10768,8 +10752,8 @@ func (s *GetPermissionsOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfGetPermissionsOutputBody) { - name = jsonFieldsNameOfGetPermissionsOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCreatedOrg) { + name = jsonFieldsNameOfCreatedOrg[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -10790,27 +10774,27 @@ func (s *GetPermissionsOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *GetPermissionsOutputBody) MarshalJSON() ([]byte, error) { +func (s *CreatedOrg) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetPermissionsOutputBody) UnmarshalJSON(data []byte) error { +func (s *CreatedOrg) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s GetPermissionsOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s CreatedOrgAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s GetPermissionsOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s CreatedOrgAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -10820,10 +10804,10 @@ func (s GetPermissionsOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes GetPermissionsOutputBodyAdditional from json. -func (s *GetPermissionsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CreatedOrgAdditional from json. +func (s *CreatedOrgAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GetPermissionsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode CreatedOrgAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -10841,155 +10825,99 @@ func (s *GetPermissionsOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode GetPermissionsOutputBodyAdditional") + return errors.Wrap(err, "decode CreatedOrgAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GetPermissionsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s CreatedOrgAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetPermissionsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *CreatedOrgAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s GetPermissionsOutputBodyExplain) Encode(e *jx.Encoder) { +func (s *CreatedProject) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } -// encodeFields implements json.Marshaler. -func (s GetPermissionsOutputBodyExplain) encodeFields(e *jx.Encoder) { - for k, elem := range s { - e.FieldStart(k) - - if len(elem) != 0 { - e.Raw(elem) +// encodeFields encodes fields. +func (s *CreatedProject) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) } } -} - -// Decode decodes GetPermissionsOutputBodyExplain from json. -func (s *GetPermissionsOutputBodyExplain) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode GetPermissionsOutputBodyExplain to nil") + { + if s.ApiUrl.Set { + e.FieldStart("apiUrl") + s.ApiUrl.Encode(e) + } } - m := s.init() - if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { - var elem jx.Raw - if err := func() error { - v, err := d.RawAppend(nil) - elem = jx.Raw(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrapf(err, "decode field %q", k) + { + if s.Capabilities.Set { + e.FieldStart("capabilities") + s.Capabilities.Encode(e) } - m[string(k)] = elem - return nil - }); err != nil { - return errors.Wrap(err, "decode GetPermissionsOutputBodyExplain") } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s GetPermissionsOutputBodyExplain) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetPermissionsOutputBodyExplain) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes GetPermissionsOutputBodyPermissionsItem as json. -func (s GetPermissionsOutputBodyPermissionsItem) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes GetPermissionsOutputBodyPermissionsItem from json. -func (s *GetPermissionsOutputBodyPermissionsItem) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode GetPermissionsOutputBodyPermissionsItem to nil") + { + if s.CommitToken.Set { + e.FieldStart("commitToken") + s.CommitToken.Encode(e) + } } - v, err := d.StrBytes() - if err != nil { - return err + { + e.FieldStart("createdAt") + json.EncodeDateTime(e, s.CreatedAt) } - // Try to use constant string. - switch GetPermissionsOutputBodyPermissionsItem(v) { - case GetPermissionsOutputBodyPermissionsItemManage: - *s = GetPermissionsOutputBodyPermissionsItemManage - case GetPermissionsOutputBodyPermissionsItemView: - *s = GetPermissionsOutputBodyPermissionsItemView - case GetPermissionsOutputBodyPermissionsItemRead: - *s = GetPermissionsOutputBodyPermissionsItemRead - case GetPermissionsOutputBodyPermissionsItemWrite: - *s = GetPermissionsOutputBodyPermissionsItemWrite - case GetPermissionsOutputBodyPermissionsItemPush: - *s = GetPermissionsOutputBodyPermissionsItemPush - case GetPermissionsOutputBodyPermissionsItemPull: - *s = GetPermissionsOutputBodyPermissionsItemPull - case GetPermissionsOutputBodyPermissionsItemCreateRepo: - *s = GetPermissionsOutputBodyPermissionsItemCreateRepo - case GetPermissionsOutputBodyPermissionsItemAdmin: - *s = GetPermissionsOutputBodyPermissionsItemAdmin - case GetPermissionsOutputBodyPermissionsItemAdminRead: - *s = GetPermissionsOutputBodyPermissionsItemAdminRead - default: - *s = GetPermissionsOutputBodyPermissionsItem(v) + { + e.FieldStart("id") + e.Str(s.ID) } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s GetPermissionsOutputBodyPermissionsItem) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetPermissionsOutputBodyPermissionsItem) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode implements json.Marshaler. -func (s *GetRepoVisibilityOutputBody) Encode(e *jx.Encoder) { - e.ObjStart() - s.encodeFields(e) - e.ObjEnd() -} - -// encodeFields encodes fields. -func (s *GetRepoVisibilityOutputBody) encodeFields(e *jx.Encoder) { { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) + e.FieldStart("name") + e.Str(s.Name) + } + { + e.FieldStart("ownerId") + e.Str(s.OwnerId) + } + { + if s.OwnerName.Set { + e.FieldStart("ownerName") + s.OwnerName.Encode(e) } } { - e.FieldStart("visibility") - s.Visibility.Encode(e) + e.FieldStart("ownerType") + s.OwnerType.Encode(e) + } + { + if s.PrimaryProcessingCell.Set { + e.FieldStart("primaryProcessingCell") + s.PrimaryProcessingCell.Encode(e) + } + } + { + e.FieldStart("region") + e.Str(s.Region) + } + { + if s.RepositoryCount.Set { + e.FieldStart("repositoryCount") + s.RepositoryCount.Encode(e) + } } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -11000,17 +10928,28 @@ func (s *GetRepoVisibilityOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfGetRepoVisibilityOutputBody = [2]string{ - 0: "$schema", - 1: "visibility", +var jsonFieldsNameOfCreatedProject = [13]string{ + 0: "$schema", + 1: "apiUrl", + 2: "capabilities", + 3: "commitToken", + 4: "createdAt", + 5: "id", + 6: "name", + 7: "ownerId", + 8: "ownerName", + 9: "ownerType", + 10: "primaryProcessingCell", + 11: "region", + 12: "repositoryCount", } -// Decode decodes GetRepoVisibilityOutputBody from json. -func (s *GetRepoVisibilityOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes CreatedProject from json. +func (s *CreatedProject) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GetRepoVisibilityOutputBody to nil") + return errors.New("invalid: unable to decode CreatedProject to nil") } - var requiredBitSet [1]uint8 + var requiredBitSet [2]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -11025,15 +10964,135 @@ func (s *GetRepoVisibilityOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "visibility": - requiredBitSet[0] |= 1 << 1 + case "apiUrl": if err := func() error { - if err := s.Visibility.Decode(d); err != nil { + s.ApiUrl.Reset() + if err := s.ApiUrl.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"visibility\"") + return errors.Wrap(err, "decode field \"apiUrl\"") + } + case "capabilities": + if err := func() error { + s.Capabilities.Reset() + if err := s.Capabilities.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"capabilities\"") + } + case "commitToken": + if err := func() error { + s.CommitToken.Reset() + if err := s.CommitToken.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"commitToken\"") + } + case "createdAt": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.CreatedAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"createdAt\"") + } + case "id": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + v, err := d.Str() + s.ID = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"id\"") + } + case "name": + requiredBitSet[0] |= 1 << 6 + if err := func() error { + v, err := d.Str() + s.Name = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"name\"") + } + case "ownerId": + requiredBitSet[0] |= 1 << 7 + if err := func() error { + v, err := d.Str() + s.OwnerId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"ownerId\"") + } + case "ownerName": + if err := func() error { + s.OwnerName.Reset() + if err := s.OwnerName.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"ownerName\"") + } + case "ownerType": + requiredBitSet[1] |= 1 << 1 + if err := func() error { + if err := s.OwnerType.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"ownerType\"") + } + case "primaryProcessingCell": + if err := func() error { + s.PrimaryProcessingCell.Reset() + if err := s.PrimaryProcessingCell.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"primaryProcessingCell\"") + } + case "region": + requiredBitSet[1] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.Region = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"region\"") + } + case "repositoryCount": + if err := func() error { + s.RepositoryCount.Reset() + if err := s.RepositoryCount.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"repositoryCount\"") } default: var elem jx.Raw @@ -11051,12 +11110,13 @@ func (s *GetRepoVisibilityOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode GetRepoVisibilityOutputBody") + return errors.Wrap(err, "decode CreatedProject") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [1]uint8{ - 0b00000010, + for i, mask := range [2]uint8{ + 0b11110000, + 0b00001010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -11068,8 +11128,8 @@ func (s *GetRepoVisibilityOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfGetRepoVisibilityOutputBody) { - name = jsonFieldsNameOfGetRepoVisibilityOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCreatedProject) { + name = jsonFieldsNameOfCreatedProject[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -11090,27 +11150,27 @@ func (s *GetRepoVisibilityOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *GetRepoVisibilityOutputBody) MarshalJSON() ([]byte, error) { +func (s *CreatedProject) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetRepoVisibilityOutputBody) UnmarshalJSON(data []byte) error { +func (s *CreatedProject) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s GetRepoVisibilityOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s CreatedProjectAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s GetRepoVisibilityOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s CreatedProjectAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -11120,10 +11180,10 @@ func (s GetRepoVisibilityOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes GetRepoVisibilityOutputBodyAdditional from json. -func (s *GetRepoVisibilityOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CreatedProjectAdditional from json. +func (s *CreatedProjectAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GetRepoVisibilityOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode CreatedProjectAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -11141,74 +11201,74 @@ func (s *GetRepoVisibilityOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode GetRepoVisibilityOutputBodyAdditional") + return errors.Wrap(err, "decode CreatedProjectAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GetRepoVisibilityOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s CreatedProjectAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetRepoVisibilityOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *CreatedProjectAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes GetRepoVisibilityOutputBodyVisibility as json. -func (s GetRepoVisibilityOutputBodyVisibility) Encode(e *jx.Encoder) { +// Encode encodes CreatedProjectOwnerType as json. +func (s CreatedProjectOwnerType) Encode(e *jx.Encoder) { e.Str(string(s)) } -// Decode decodes GetRepoVisibilityOutputBodyVisibility from json. -func (s *GetRepoVisibilityOutputBodyVisibility) Decode(d *jx.Decoder) error { +// Decode decodes CreatedProjectOwnerType from json. +func (s *CreatedProjectOwnerType) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GetRepoVisibilityOutputBodyVisibility to nil") + return errors.New("invalid: unable to decode CreatedProjectOwnerType to nil") } v, err := d.StrBytes() if err != nil { return err } // Try to use constant string. - switch GetRepoVisibilityOutputBodyVisibility(v) { - case GetRepoVisibilityOutputBodyVisibilityPublic: - *s = GetRepoVisibilityOutputBodyVisibilityPublic - case GetRepoVisibilityOutputBodyVisibilityPrivate: - *s = GetRepoVisibilityOutputBodyVisibilityPrivate + switch CreatedProjectOwnerType(v) { + case CreatedProjectOwnerTypeOrg: + *s = CreatedProjectOwnerTypeOrg + case CreatedProjectOwnerTypeAccount: + *s = CreatedProjectOwnerTypeAccount default: - *s = GetRepoVisibilityOutputBodyVisibility(v) + *s = CreatedProjectOwnerType(v) } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GetRepoVisibilityOutputBodyVisibility) MarshalJSON() ([]byte, error) { +func (s CreatedProjectOwnerType) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetRepoVisibilityOutputBodyVisibility) UnmarshalJSON(data []byte) error { +func (s *CreatedProjectOwnerType) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *GetTopologyOutputBody) Encode(e *jx.Encoder) { +func (s *CreatedRepo) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *GetTopologyOutputBody) encodeFields(e *jx.Encoder) { +func (s *CreatedRepo) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -11216,87 +11276,447 @@ func (s *GetTopologyOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("jurisdictions") - e.ArrStart() - for _, elem := range s.Jurisdictions { - elem.Encode(e) + if s.Capabilities.Set { + e.FieldStart("capabilities") + s.Capabilities.Encode(e) } - e.ArrEnd() } - for k, elem := range s.AdditionalProps { - e.FieldStart(k) - - if len(elem) != 0 { - e.Raw(elem) + { + if s.ClusterHost.Set { + e.FieldStart("clusterHost") + s.ClusterHost.Encode(e) } } -} - -var jsonFieldsNameOfGetTopologyOutputBody = [2]string{ - 0: "$schema", - 1: "jurisdictions", -} - -// Decode decodes GetTopologyOutputBody from json. -func (s *GetTopologyOutputBody) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode GetTopologyOutputBody to nil") + { + if s.ClusterSlug.Set { + e.FieldStart("clusterSlug") + s.ClusterSlug.Encode(e) + } } - var requiredBitSet [1]uint8 - s.AdditionalProps = map[string]jx.Raw{} - - if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { - switch string(k) { - case "$schema": - if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") - } - case "jurisdictions": - requiredBitSet[0] |= 1 << 1 - if err := func() error { - s.Jurisdictions = make([]TopologyJurisdiction, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem TopologyJurisdiction - if err := elem.Decode(d); err != nil { - return err - } - s.Jurisdictions = append(s.Jurisdictions, elem) - return nil - }); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"jurisdictions\"") - } - default: - var elem jx.Raw - if err := func() error { - v, err := d.RawAppend(nil) - elem = jx.Raw(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrapf(err, "decode field %q", k) - } - s.AdditionalProps[string(k)] = elem + { + if s.CommitToken.Set { + e.FieldStart("commitToken") + s.CommitToken.Encode(e) } - return nil - }); err != nil { - return errors.Wrap(err, "decode GetTopologyOutputBody") } - // Validate required fields. - var failures []validate.FieldError - for i, mask := range [1]uint8{ - 0b00000010, + { + if s.Foreign.Set { + e.FieldStart("foreign") + s.Foreign.Encode(e) + } + } + { + if s.FullName.Set { + e.FieldStart("fullName") + s.FullName.Encode(e) + } + } + { + e.FieldStart("id") + e.Str(s.ID) + } + { + if s.Jurisdiction.Set { + e.FieldStart("jurisdiction") + s.Jurisdiction.Encode(e) + } + } + { + if s.MirrorSuspended.Set { + e.FieldStart("mirrorSuspended") + s.MirrorSuspended.Encode(e) + } + } + { + if s.MirrorSuspendedAt.Set { + e.FieldStart("mirrorSuspendedAt") + s.MirrorSuspendedAt.Encode(e) + } + } + { + e.FieldStart("name") + e.Str(s.Name) + } + { + if s.ObjectFormat.Set { + e.FieldStart("objectFormat") + s.ObjectFormat.Encode(e) + } + } + { + e.FieldStart("owningProjectId") + e.Str(s.OwningProjectId) + } + { + if s.Path.Set { + e.FieldStart("path") + s.Path.Encode(e) + } + } + { + if s.Placements != nil { + e.FieldStart("placements") + e.ArrStart() + for _, elem := range s.Placements { + elem.Encode(e) + } + e.ArrEnd() + } + } + { + if s.Primaries.Set { + e.FieldStart("primaries") + s.Primaries.Encode(e) + } + } + { + if s.Provider.Set { + e.FieldStart("provider") + s.Provider.Encode(e) + } + } + { + if s.ProvisionAttempts.Set { + e.FieldStart("provisionAttempts") + s.ProvisionAttempts.Encode(e) + } + } + { + if s.ProvisionReason.Set { + e.FieldStart("provisionReason") + s.ProvisionReason.Encode(e) + } + } + { + if s.RepoGroupId.Set { + e.FieldStart("repoGroupId") + s.RepoGroupId.Encode(e) + } + } + { + if s.State.Set { + e.FieldStart("state") + s.State.Encode(e) + } + } + { + if s.Visibility.Set { + e.FieldStart("visibility") + s.Visibility.Encode(e) + } + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfCreatedRepo = [23]string{ + 0: "$schema", + 1: "capabilities", + 2: "clusterHost", + 3: "clusterSlug", + 4: "commitToken", + 5: "foreign", + 6: "fullName", + 7: "id", + 8: "jurisdiction", + 9: "mirrorSuspended", + 10: "mirrorSuspendedAt", + 11: "name", + 12: "objectFormat", + 13: "owningProjectId", + 14: "path", + 15: "placements", + 16: "primaries", + 17: "provider", + 18: "provisionAttempts", + 19: "provisionReason", + 20: "repoGroupId", + 21: "state", + 22: "visibility", +} + +// Decode decodes CreatedRepo from json. +func (s *CreatedRepo) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode CreatedRepo to nil") + } + var requiredBitSet [3]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "capabilities": + if err := func() error { + s.Capabilities.Reset() + if err := s.Capabilities.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"capabilities\"") + } + case "clusterHost": + if err := func() error { + s.ClusterHost.Reset() + if err := s.ClusterHost.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"clusterHost\"") + } + case "clusterSlug": + if err := func() error { + s.ClusterSlug.Reset() + if err := s.ClusterSlug.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"clusterSlug\"") + } + case "commitToken": + if err := func() error { + s.CommitToken.Reset() + if err := s.CommitToken.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"commitToken\"") + } + case "foreign": + if err := func() error { + s.Foreign.Reset() + if err := s.Foreign.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"foreign\"") + } + case "fullName": + if err := func() error { + s.FullName.Reset() + if err := s.FullName.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"fullName\"") + } + case "id": + requiredBitSet[0] |= 1 << 7 + if err := func() error { + v, err := d.Str() + s.ID = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"id\"") + } + case "jurisdiction": + if err := func() error { + s.Jurisdiction.Reset() + if err := s.Jurisdiction.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"jurisdiction\"") + } + case "mirrorSuspended": + if err := func() error { + s.MirrorSuspended.Reset() + if err := s.MirrorSuspended.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"mirrorSuspended\"") + } + case "mirrorSuspendedAt": + if err := func() error { + s.MirrorSuspendedAt.Reset() + if err := s.MirrorSuspendedAt.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"mirrorSuspendedAt\"") + } + case "name": + requiredBitSet[1] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.Name = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"name\"") + } + case "objectFormat": + if err := func() error { + s.ObjectFormat.Reset() + if err := s.ObjectFormat.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"objectFormat\"") + } + case "owningProjectId": + requiredBitSet[1] |= 1 << 5 + if err := func() error { + v, err := d.Str() + s.OwningProjectId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"owningProjectId\"") + } + case "path": + if err := func() error { + s.Path.Reset() + if err := s.Path.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"path\"") + } + case "placements": + if err := func() error { + s.Placements = make([]RepoPlacement, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem RepoPlacement + if err := elem.Decode(d); err != nil { + return err + } + s.Placements = append(s.Placements, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"placements\"") + } + case "primaries": + if err := func() error { + s.Primaries.Reset() + if err := s.Primaries.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"primaries\"") + } + case "provider": + if err := func() error { + s.Provider.Reset() + if err := s.Provider.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider\"") + } + case "provisionAttempts": + if err := func() error { + s.ProvisionAttempts.Reset() + if err := s.ProvisionAttempts.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provisionAttempts\"") + } + case "provisionReason": + if err := func() error { + s.ProvisionReason.Reset() + if err := s.ProvisionReason.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provisionReason\"") + } + case "repoGroupId": + if err := func() error { + s.RepoGroupId.Reset() + if err := s.RepoGroupId.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"repoGroupId\"") + } + case "state": + if err := func() error { + s.State.Reset() + if err := s.State.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"state\"") + } + case "visibility": + if err := func() error { + s.Visibility.Reset() + if err := s.Visibility.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"visibility\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode CreatedRepo") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [3]uint8{ + 0b10000000, + 0b00101000, + 0b00000000, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -11308,8 +11728,8 @@ func (s *GetTopologyOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfGetTopologyOutputBody) { - name = jsonFieldsNameOfGetTopologyOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfCreatedRepo) { + name = jsonFieldsNameOfCreatedRepo[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -11330,27 +11750,27 @@ func (s *GetTopologyOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *GetTopologyOutputBody) MarshalJSON() ([]byte, error) { +func (s *CreatedRepo) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetTopologyOutputBody) UnmarshalJSON(data []byte) error { +func (s *CreatedRepo) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s GetTopologyOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s CreatedRepoAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s GetTopologyOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s CreatedRepoAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -11360,10 +11780,10 @@ func (s GetTopologyOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes GetTopologyOutputBodyAdditional from json. -func (s *GetTopologyOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes CreatedRepoAdditional from json. +func (s *CreatedRepoAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GetTopologyOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode CreatedRepoAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -11381,49 +11801,53 @@ func (s *GetTopologyOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode GetTopologyOutputBodyAdditional") + return errors.Wrap(err, "decode CreatedRepoAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GetTopologyOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s CreatedRepoAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetTopologyOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *CreatedRepoAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *GetVersionOutputBody) Encode(e *jx.Encoder) { +func (s *DeletionBlocker) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *GetVersionOutputBody) encodeFields(e *jx.Encoder) { +func (s *DeletionBlocker) encodeFields(e *jx.Encoder) { { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } + e.FieldStart("deletable") + e.Bool(s.Deletable) } { - if s.Mode.Set { - e.FieldStart("mode") - s.Mode.Encode(e) - } + e.FieldStart("id") + e.Str(s.ID) } { - e.FieldStart("version") - e.Str(s.Version) + e.FieldStart("kind") + s.Kind.Encode(e) + } + { + e.FieldStart("message") + e.Str(s.Message) + } + { + e.FieldStart("name") + e.Str(s.Name) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -11434,53 +11858,81 @@ func (s *GetVersionOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfGetVersionOutputBody = [3]string{ - 0: "$schema", - 1: "mode", - 2: "version", +var jsonFieldsNameOfDeletionBlocker = [5]string{ + 0: "deletable", + 1: "id", + 2: "kind", + 3: "message", + 4: "name", } -// Decode decodes GetVersionOutputBody from json. -func (s *GetVersionOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes DeletionBlocker from json. +func (s *DeletionBlocker) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GetVersionOutputBody to nil") + return errors.New("invalid: unable to decode DeletionBlocker to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "deletable": + requiredBitSet[0] |= 1 << 0 if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + v, err := d.Bool() + s.Deletable = bool(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"deletable\"") } - case "mode": + case "id": + requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Mode.Reset() - if err := s.Mode.Decode(d); err != nil { + v, err := d.Str() + s.ID = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"mode\"") + return errors.Wrap(err, "decode field \"id\"") } - case "version": + case "kind": requiredBitSet[0] |= 1 << 2 + if err := func() error { + if err := s.Kind.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"kind\"") + } + case "message": + requiredBitSet[0] |= 1 << 3 if err := func() error { v, err := d.Str() - s.Version = string(v) + s.Message = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"version\"") + return errors.Wrap(err, "decode field \"message\"") + } + case "name": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + v, err := d.Str() + s.Name = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"name\"") } default: var elem jx.Raw @@ -11498,12 +11950,12 @@ func (s *GetVersionOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode GetVersionOutputBody") + return errors.Wrap(err, "decode DeletionBlocker") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000100, + 0b00011111, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -11515,8 +11967,8 @@ func (s *GetVersionOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfGetVersionOutputBody) { - name = jsonFieldsNameOfGetVersionOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfDeletionBlocker) { + name = jsonFieldsNameOfDeletionBlocker[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -11537,27 +11989,27 @@ func (s *GetVersionOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *GetVersionOutputBody) MarshalJSON() ([]byte, error) { +func (s *DeletionBlocker) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetVersionOutputBody) UnmarshalJSON(data []byte) error { +func (s *DeletionBlocker) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s GetVersionOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s DeletionBlockerAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s GetVersionOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s DeletionBlockerAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -11567,10 +12019,10 @@ func (s GetVersionOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes GetVersionOutputBodyAdditional from json. -func (s *GetVersionOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes DeletionBlockerAdditional from json. +func (s *DeletionBlockerAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GetVersionOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode DeletionBlockerAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -11588,97 +12040,93 @@ func (s *GetVersionOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode GetVersionOutputBodyAdditional") + return errors.Wrap(err, "decode DeletionBlockerAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GetVersionOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s DeletionBlockerAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetVersionOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *DeletionBlockerAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes GetVersionOutputBodyMode as json. -func (s GetVersionOutputBodyMode) Encode(e *jx.Encoder) { +// Encode encodes DeletionBlockerKind as json. +func (s DeletionBlockerKind) Encode(e *jx.Encoder) { e.Str(string(s)) } -// Decode decodes GetVersionOutputBodyMode from json. -func (s *GetVersionOutputBodyMode) Decode(d *jx.Decoder) error { +// Decode decodes DeletionBlockerKind from json. +func (s *DeletionBlockerKind) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GetVersionOutputBodyMode to nil") + return errors.New("invalid: unable to decode DeletionBlockerKind to nil") } v, err := d.StrBytes() if err != nil { return err } // Try to use constant string. - switch GetVersionOutputBodyMode(v) { - case GetVersionOutputBodyModeGlobal: - *s = GetVersionOutputBodyModeGlobal - case GetVersionOutputBodyModeRegional: - *s = GetVersionOutputBodyModeRegional + switch DeletionBlockerKind(v) { + case DeletionBlockerKindOwnedOrg: + *s = DeletionBlockerKindOwnedOrg default: - *s = GetVersionOutputBodyMode(v) + *s = DeletionBlockerKind(v) } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GetVersionOutputBodyMode) MarshalJSON() ([]byte, error) { +func (s DeletionBlockerKind) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GetVersionOutputBodyMode) UnmarshalJSON(data []byte) error { +func (s *DeletionBlockerKind) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *GrantProjectAccessInputBody) Encode(e *jx.Encoder) { +func (s *DeletionGrant) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *GrantProjectAccessInputBody) encodeFields(e *jx.Encoder) { +func (s *DeletionGrant) encodeFields(e *jx.Encoder) { { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) + if s.Jurisdiction.Set { + e.FieldStart("jurisdiction") + s.Jurisdiction.Encode(e) } } { - if s.GranteeType.Set { - e.FieldStart("granteeType") - s.GranteeType.Encode(e) - } + e.FieldStart("resourceId") + e.Str(s.ResourceId) } { - e.FieldStart("provider") - e.Str(s.Provider) + e.FieldStart("resourceName") + e.Str(s.ResourceName) } { - e.FieldStart("providerUserId") - e.Str(s.ProviderUserId) + e.FieldStart("resourceType") + s.ResourceType.Encode(e) } { e.FieldStart("role") - s.Role.Encode(e) + e.Str(s.Role) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -11689,73 +12137,74 @@ func (s *GrantProjectAccessInputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfGrantProjectAccessInputBody = [5]string{ - 0: "$schema", - 1: "granteeType", - 2: "provider", - 3: "providerUserId", +var jsonFieldsNameOfDeletionGrant = [5]string{ + 0: "jurisdiction", + 1: "resourceId", + 2: "resourceName", + 3: "resourceType", 4: "role", } -// Decode decodes GrantProjectAccessInputBody from json. -func (s *GrantProjectAccessInputBody) Decode(d *jx.Decoder) error { +// Decode decodes DeletionGrant from json. +func (s *DeletionGrant) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GrantProjectAccessInputBody to nil") + return errors.New("invalid: unable to decode DeletionGrant to nil") } var requiredBitSet [1]uint8 - s.setDefaults() s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "jurisdiction": if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + s.Jurisdiction.Reset() + if err := s.Jurisdiction.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"jurisdiction\"") } - case "granteeType": + case "resourceId": + requiredBitSet[0] |= 1 << 1 if err := func() error { - s.GranteeType.Reset() - if err := s.GranteeType.Decode(d); err != nil { + v, err := d.Str() + s.ResourceId = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"granteeType\"") + return errors.Wrap(err, "decode field \"resourceId\"") } - case "provider": + case "resourceName": requiredBitSet[0] |= 1 << 2 if err := func() error { v, err := d.Str() - s.Provider = string(v) + s.ResourceName = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"provider\"") + return errors.Wrap(err, "decode field \"resourceName\"") } - case "providerUserId": + case "resourceType": requiredBitSet[0] |= 1 << 3 if err := func() error { - v, err := d.Str() - s.ProviderUserId = string(v) - if err != nil { + if err := s.ResourceType.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"providerUserId\"") + return errors.Wrap(err, "decode field \"resourceType\"") } case "role": requiredBitSet[0] |= 1 << 4 if err := func() error { - if err := s.Role.Decode(d); err != nil { + v, err := d.Str() + s.Role = string(v) + if err != nil { return err } return nil @@ -11778,12 +12227,12 @@ func (s *GrantProjectAccessInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode GrantProjectAccessInputBody") + return errors.Wrap(err, "decode DeletionGrant") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00011100, + 0b00011110, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -11795,8 +12244,8 @@ func (s *GrantProjectAccessInputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfGrantProjectAccessInputBody) { - name = jsonFieldsNameOfGrantProjectAccessInputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfDeletionGrant) { + name = jsonFieldsNameOfDeletionGrant[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -11817,27 +12266,27 @@ func (s *GrantProjectAccessInputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *GrantProjectAccessInputBody) MarshalJSON() ([]byte, error) { +func (s *DeletionGrant) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantProjectAccessInputBody) UnmarshalJSON(data []byte) error { +func (s *DeletionGrant) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s GrantProjectAccessInputBodyAdditional) Encode(e *jx.Encoder) { +func (s DeletionGrantAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s GrantProjectAccessInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s DeletionGrantAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -11847,10 +12296,10 @@ func (s GrantProjectAccessInputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes GrantProjectAccessInputBodyAdditional from json. -func (s *GrantProjectAccessInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes DeletionGrantAdditional from json. +func (s *DeletionGrantAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GrantProjectAccessInputBodyAdditional to nil") + return errors.New("invalid: unable to decode DeletionGrantAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -11868,123 +12317,81 @@ func (s *GrantProjectAccessInputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode GrantProjectAccessInputBodyAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s GrantProjectAccessInputBodyAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantProjectAccessInputBodyAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes GrantProjectAccessInputBodyGranteeType as json. -func (s GrantProjectAccessInputBodyGranteeType) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes GrantProjectAccessInputBodyGranteeType from json. -func (s *GrantProjectAccessInputBodyGranteeType) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode GrantProjectAccessInputBodyGranteeType to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch GrantProjectAccessInputBodyGranteeType(v) { - case GrantProjectAccessInputBodyGranteeTypeAccount: - *s = GrantProjectAccessInputBodyGranteeTypeAccount - default: - *s = GrantProjectAccessInputBodyGranteeType(v) + return errors.Wrap(err, "decode DeletionGrantAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GrantProjectAccessInputBodyGranteeType) MarshalJSON() ([]byte, error) { +func (s DeletionGrantAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantProjectAccessInputBodyGranteeType) UnmarshalJSON(data []byte) error { +func (s *DeletionGrantAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes GrantProjectAccessInputBodyRole as json. -func (s GrantProjectAccessInputBodyRole) Encode(e *jx.Encoder) { +// Encode encodes DeletionGrantResourceType as json. +func (s DeletionGrantResourceType) Encode(e *jx.Encoder) { e.Str(string(s)) } -// Decode decodes GrantProjectAccessInputBodyRole from json. -func (s *GrantProjectAccessInputBodyRole) Decode(d *jx.Decoder) error { +// Decode decodes DeletionGrantResourceType from json. +func (s *DeletionGrantResourceType) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GrantProjectAccessInputBodyRole to nil") + return errors.New("invalid: unable to decode DeletionGrantResourceType to nil") } v, err := d.StrBytes() if err != nil { return err } // Try to use constant string. - switch GrantProjectAccessInputBodyRole(v) { - case GrantProjectAccessInputBodyRoleReader: - *s = GrantProjectAccessInputBodyRoleReader - case GrantProjectAccessInputBodyRoleWriter: - *s = GrantProjectAccessInputBodyRoleWriter - case GrantProjectAccessInputBodyRoleAdmin: - *s = GrantProjectAccessInputBodyRoleAdmin + switch DeletionGrantResourceType(v) { + case DeletionGrantResourceTypeProject: + *s = DeletionGrantResourceTypeProject + case DeletionGrantResourceTypeRepo: + *s = DeletionGrantResourceTypeRepo default: - *s = GrantProjectAccessInputBodyRole(v) + *s = DeletionGrantResourceType(v) } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GrantProjectAccessInputBodyRole) MarshalJSON() ([]byte, error) { +func (s DeletionGrantResourceType) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantProjectAccessInputBodyRole) UnmarshalJSON(data []byte) error { +func (s *DeletionGrantResourceType) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *GrantProjectAccessOutputBody) Encode(e *jx.Encoder) { +func (s *DeletionMembership) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *GrantProjectAccessOutputBody) encodeFields(e *jx.Encoder) { +func (s *DeletionMembership) encodeFields(e *jx.Encoder) { { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } + e.FieldStart("name") + e.Str(s.Name) } { - e.FieldStart("status") - e.Str(s.Status) + e.FieldStart("orgId") + e.Str(s.OrgId) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -11995,42 +12402,44 @@ func (s *GrantProjectAccessOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfGrantProjectAccessOutputBody = [2]string{ - 0: "$schema", - 1: "status", +var jsonFieldsNameOfDeletionMembership = [2]string{ + 0: "name", + 1: "orgId", } -// Decode decodes GrantProjectAccessOutputBody from json. -func (s *GrantProjectAccessOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes DeletionMembership from json. +func (s *DeletionMembership) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GrantProjectAccessOutputBody to nil") + return errors.New("invalid: unable to decode DeletionMembership to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "name": + requiredBitSet[0] |= 1 << 0 if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + v, err := d.Str() + s.Name = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"name\"") } - case "status": + case "orgId": requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.Status = string(v) + s.OrgId = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"status\"") + return errors.Wrap(err, "decode field \"orgId\"") } default: var elem jx.Raw @@ -12048,12 +12457,12 @@ func (s *GrantProjectAccessOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode GrantProjectAccessOutputBody") + return errors.Wrap(err, "decode DeletionMembership") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00000011, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -12065,8 +12474,8 @@ func (s *GrantProjectAccessOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfGrantProjectAccessOutputBody) { - name = jsonFieldsNameOfGrantProjectAccessOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfDeletionMembership) { + name = jsonFieldsNameOfDeletionMembership[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -12087,27 +12496,27 @@ func (s *GrantProjectAccessOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *GrantProjectAccessOutputBody) MarshalJSON() ([]byte, error) { +func (s *DeletionMembership) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantProjectAccessOutputBody) UnmarshalJSON(data []byte) error { +func (s *DeletionMembership) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s GrantProjectAccessOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s DeletionMembershipAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s GrantProjectAccessOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s DeletionMembershipAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -12117,10 +12526,10 @@ func (s GrantProjectAccessOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes GrantProjectAccessOutputBodyAdditional from json. -func (s *GrantProjectAccessOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes DeletionMembershipAdditional from json. +func (s *DeletionMembershipAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GrantProjectAccessOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode DeletionMembershipAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -12138,57 +12547,47 @@ func (s *GrantProjectAccessOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode GrantProjectAccessOutputBodyAdditional") + return errors.Wrap(err, "decode DeletionMembershipAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GrantProjectAccessOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s DeletionMembershipAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantProjectAccessOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *DeletionMembershipAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *GrantRepoAccessInputBody) Encode(e *jx.Encoder) { +func (s *DeletionRepo) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *GrantRepoAccessInputBody) encodeFields(e *jx.Encoder) { - { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } - } +func (s *DeletionRepo) encodeFields(e *jx.Encoder) { { - if s.GranteeType.Set { - e.FieldStart("granteeType") - s.GranteeType.Encode(e) + if s.Cluster.Set { + e.FieldStart("cluster") + s.Cluster.Encode(e) } } { - e.FieldStart("provider") - e.Str(s.Provider) - } - { - e.FieldStart("providerUserId") - e.Str(s.ProviderUserId) + e.FieldStart("id") + e.Str(s.ID) } { - e.FieldStart("role") - s.Role.Encode(e) + e.FieldStart("name") + e.Str(s.Name) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -12199,78 +12598,55 @@ func (s *GrantRepoAccessInputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfGrantRepoAccessInputBody = [5]string{ - 0: "$schema", - 1: "granteeType", - 2: "provider", - 3: "providerUserId", - 4: "role", +var jsonFieldsNameOfDeletionRepo = [3]string{ + 0: "cluster", + 1: "id", + 2: "name", } -// Decode decodes GrantRepoAccessInputBody from json. -func (s *GrantRepoAccessInputBody) Decode(d *jx.Decoder) error { +// Decode decodes DeletionRepo from json. +func (s *DeletionRepo) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GrantRepoAccessInputBody to nil") + return errors.New("invalid: unable to decode DeletionRepo to nil") } var requiredBitSet [1]uint8 - s.setDefaults() s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": - if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") - } - case "granteeType": + case "cluster": if err := func() error { - s.GranteeType.Reset() - if err := s.GranteeType.Decode(d); err != nil { + s.Cluster.Reset() + if err := s.Cluster.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"granteeType\"") + return errors.Wrap(err, "decode field \"cluster\"") } - case "provider": - requiredBitSet[0] |= 1 << 2 + case "id": + requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.Provider = string(v) + s.ID = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"provider\"") + return errors.Wrap(err, "decode field \"id\"") } - case "providerUserId": - requiredBitSet[0] |= 1 << 3 + case "name": + requiredBitSet[0] |= 1 << 2 if err := func() error { v, err := d.Str() - s.ProviderUserId = string(v) + s.Name = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"providerUserId\"") - } - case "role": - requiredBitSet[0] |= 1 << 4 - if err := func() error { - if err := s.Role.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"role\"") + return errors.Wrap(err, "decode field \"name\"") } default: var elem jx.Raw @@ -12288,12 +12664,12 @@ func (s *GrantRepoAccessInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode GrantRepoAccessInputBody") + return errors.Wrap(err, "decode DeletionRepo") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00011100, + 0b00000110, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -12305,8 +12681,8 @@ func (s *GrantRepoAccessInputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfGrantRepoAccessInputBody) { - name = jsonFieldsNameOfGrantRepoAccessInputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfDeletionRepo) { + name = jsonFieldsNameOfDeletionRepo[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -12327,27 +12703,27 @@ func (s *GrantRepoAccessInputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *GrantRepoAccessInputBody) MarshalJSON() ([]byte, error) { +func (s *DeletionRepo) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantRepoAccessInputBody) UnmarshalJSON(data []byte) error { +func (s *DeletionRepo) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s GrantRepoAccessInputBodyAdditional) Encode(e *jx.Encoder) { +func (s DeletionRepoAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s GrantRepoAccessInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s DeletionRepoAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -12357,10 +12733,10 @@ func (s GrantRepoAccessInputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes GrantRepoAccessInputBodyAdditional from json. -func (s *GrantRepoAccessInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes DeletionRepoAdditional from json. +func (s *DeletionRepoAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GrantRepoAccessInputBodyAdditional to nil") + return errors.New("invalid: unable to decode DeletionRepoAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -12378,123 +12754,51 @@ func (s *GrantRepoAccessInputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode GrantRepoAccessInputBodyAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s GrantRepoAccessInputBodyAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantRepoAccessInputBodyAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes GrantRepoAccessInputBodyGranteeType as json. -func (s GrantRepoAccessInputBodyGranteeType) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes GrantRepoAccessInputBodyGranteeType from json. -func (s *GrantRepoAccessInputBodyGranteeType) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode GrantRepoAccessInputBodyGranteeType to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch GrantRepoAccessInputBodyGranteeType(v) { - case GrantRepoAccessInputBodyGranteeTypeAccount: - *s = GrantRepoAccessInputBodyGranteeTypeAccount - default: - *s = GrantRepoAccessInputBodyGranteeType(v) - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s GrantRepoAccessInputBodyGranteeType) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantRepoAccessInputBodyGranteeType) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes GrantRepoAccessInputBodyRole as json. -func (s GrantRepoAccessInputBodyRole) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes GrantRepoAccessInputBodyRole from json. -func (s *GrantRepoAccessInputBodyRole) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode GrantRepoAccessInputBodyRole to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch GrantRepoAccessInputBodyRole(v) { - case GrantRepoAccessInputBodyRoleReader: - *s = GrantRepoAccessInputBodyRoleReader - case GrantRepoAccessInputBodyRoleWriter: - *s = GrantRepoAccessInputBodyRoleWriter - case GrantRepoAccessInputBodyRoleAdmin: - *s = GrantRepoAccessInputBodyRoleAdmin - default: - *s = GrantRepoAccessInputBodyRole(v) + return errors.Wrap(err, "decode DeletionRepoAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GrantRepoAccessInputBodyRole) MarshalJSON() ([]byte, error) { +func (s DeletionRepoAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantRepoAccessInputBodyRole) UnmarshalJSON(data []byte) error { +func (s *DeletionRepoAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *GrantRepoAccessOutputBody) Encode(e *jx.Encoder) { +func (s *ErrorDetail) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *GrantRepoAccessOutputBody) encodeFields(e *jx.Encoder) { +func (s *ErrorDetail) encodeFields(e *jx.Encoder) { { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) + if s.Location.Set { + e.FieldStart("location") + s.Location.Encode(e) } } { - e.FieldStart("status") - e.Str(s.Status) + if s.Message.Set { + e.FieldStart("message") + s.Message.Encode(e) + } + } + { + if len(s.Value) != 0 { + e.FieldStart("value") + e.Raw(s.Value) + } } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -12505,42 +12809,51 @@ func (s *GrantRepoAccessOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfGrantRepoAccessOutputBody = [2]string{ - 0: "$schema", - 1: "status", +var jsonFieldsNameOfErrorDetail = [3]string{ + 0: "location", + 1: "message", + 2: "value", } -// Decode decodes GrantRepoAccessOutputBody from json. -func (s *GrantRepoAccessOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes ErrorDetail from json. +func (s *ErrorDetail) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GrantRepoAccessOutputBody to nil") + return errors.New("invalid: unable to decode ErrorDetail to nil") } - var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "location": if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + s.Location.Reset() + if err := s.Location.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"location\"") } - case "status": - requiredBitSet[0] |= 1 << 1 + case "message": if err := func() error { - v, err := d.Str() - s.Status = string(v) + s.Message.Reset() + if err := s.Message.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"message\"") + } + case "value": + if err := func() error { + v, err := d.RawAppend(nil) + s.Value = jx.Raw(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"status\"") + return errors.Wrap(err, "decode field \"value\"") } default: var elem jx.Raw @@ -12558,66 +12871,34 @@ func (s *GrantRepoAccessOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode GrantRepoAccessOutputBody") - } - // Validate required fields. - var failures []validate.FieldError - for i, mask := range [1]uint8{ - 0b00000010, - } { - if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { - // Mask only required fields and check equality to mask using XOR. - // - // If XOR result is not zero, result is not equal to expected, so some fields are missed. - // Bits of fields which would be set are actually bits of missed fields. - missed := bits.OnesCount8(result) - for bitN := 0; bitN < missed; bitN++ { - bitIdx := bits.TrailingZeros8(result) - fieldIdx := i*8 + bitIdx - var name string - if fieldIdx < len(jsonFieldsNameOfGrantRepoAccessOutputBody) { - name = jsonFieldsNameOfGrantRepoAccessOutputBody[fieldIdx] - } else { - name = strconv.Itoa(fieldIdx) - } - failures = append(failures, validate.FieldError{ - Name: name, - Error: validate.ErrFieldRequired, - }) - // Reset bit. - result &^= 1 << bitIdx - } - } - } - if len(failures) > 0 { - return &validate.Error{Fields: failures} + return errors.Wrap(err, "decode ErrorDetail") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s *GrantRepoAccessOutputBody) MarshalJSON() ([]byte, error) { +func (s *ErrorDetail) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantRepoAccessOutputBody) UnmarshalJSON(data []byte) error { +func (s *ErrorDetail) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s GrantRepoAccessOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s ErrorDetailAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s GrantRepoAccessOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ErrorDetailAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -12627,10 +12908,10 @@ func (s GrantRepoAccessOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes GrantRepoAccessOutputBodyAdditional from json. -func (s *GrantRepoAccessOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ErrorDetailAdditional from json. +func (s *ErrorDetailAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GrantRepoAccessOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode ErrorDetailAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -12648,34 +12929,34 @@ func (s *GrantRepoAccessOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode GrantRepoAccessOutputBodyAdditional") + return errors.Wrap(err, "decode ErrorDetailAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GrantRepoAccessOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ErrorDetailAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantRepoAccessOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ErrorDetailAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *GrantServiceAccountAccessInputBody) Encode(e *jx.Encoder) { +func (s *ErrorModel) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *GrantServiceAccountAccessInputBody) encodeFields(e *jx.Encoder) { +func (s *ErrorModel) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -12683,16 +12964,44 @@ func (s *GrantServiceAccountAccessInputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("resourceId") - e.Str(s.ResourceId) + if s.Detail.Set { + e.FieldStart("detail") + s.Detail.Encode(e) + } } { - e.FieldStart("resourceType") - s.ResourceType.Encode(e) - } + if s.Errors != nil { + e.FieldStart("errors") + e.ArrStart() + for _, elem := range s.Errors { + elem.Encode(e) + } + e.ArrEnd() + } + } { - e.FieldStart("role") - s.Role.Encode(e) + if s.Instance.Set { + e.FieldStart("instance") + s.Instance.Encode(e) + } + } + { + if s.Status.Set { + e.FieldStart("status") + s.Status.Encode(e) + } + } + { + if s.Title.Set { + e.FieldStart("title") + s.Title.Encode(e) + } + } + { + if s.Type.Set { + e.FieldStart("type") + s.Type.Encode(e) + } } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -12703,19 +13012,22 @@ func (s *GrantServiceAccountAccessInputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfGrantServiceAccountAccessInputBody = [4]string{ +var jsonFieldsNameOfErrorModel = [7]string{ 0: "$schema", - 1: "resourceId", - 2: "resourceType", - 3: "role", + 1: "detail", + 2: "errors", + 3: "instance", + 4: "status", + 5: "title", + 6: "type", } -// Decode decodes GrantServiceAccountAccessInputBody from json. -func (s *GrantServiceAccountAccessInputBody) Decode(d *jx.Decoder) error { +// Decode decodes ErrorModel from json. +func (s *ErrorModel) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GrantServiceAccountAccessInputBody to nil") + return errors.New("invalid: unable to decode ErrorModel to nil") } - var requiredBitSet [1]uint8 + s.setDefaults() s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -12730,37 +13042,72 @@ func (s *GrantServiceAccountAccessInputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "resourceId": - requiredBitSet[0] |= 1 << 1 + case "detail": if err := func() error { - v, err := d.Str() - s.ResourceId = string(v) - if err != nil { + s.Detail.Reset() + if err := s.Detail.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"resourceId\"") + return errors.Wrap(err, "decode field \"detail\"") } - case "resourceType": - requiredBitSet[0] |= 1 << 2 + case "errors": if err := func() error { - if err := s.ResourceType.Decode(d); err != nil { + s.Errors = make([]ErrorDetail, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem ErrorDetail + if err := elem.Decode(d); err != nil { + return err + } + s.Errors = append(s.Errors, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"resourceType\"") + return errors.Wrap(err, "decode field \"errors\"") } - case "role": - requiredBitSet[0] |= 1 << 3 + case "instance": if err := func() error { - if err := s.Role.Decode(d); err != nil { + s.Instance.Reset() + if err := s.Instance.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"role\"") + return errors.Wrap(err, "decode field \"instance\"") + } + case "status": + if err := func() error { + s.Status.Reset() + if err := s.Status.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"status\"") + } + case "title": + if err := func() error { + s.Title.Reset() + if err := s.Title.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"title\"") + } + case "type": + if err := func() error { + s.Type.Reset() + if err := s.Type.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"type\"") } default: var elem jx.Raw @@ -12778,66 +13125,34 @@ func (s *GrantServiceAccountAccessInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode GrantServiceAccountAccessInputBody") - } - // Validate required fields. - var failures []validate.FieldError - for i, mask := range [1]uint8{ - 0b00001110, - } { - if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { - // Mask only required fields and check equality to mask using XOR. - // - // If XOR result is not zero, result is not equal to expected, so some fields are missed. - // Bits of fields which would be set are actually bits of missed fields. - missed := bits.OnesCount8(result) - for bitN := 0; bitN < missed; bitN++ { - bitIdx := bits.TrailingZeros8(result) - fieldIdx := i*8 + bitIdx - var name string - if fieldIdx < len(jsonFieldsNameOfGrantServiceAccountAccessInputBody) { - name = jsonFieldsNameOfGrantServiceAccountAccessInputBody[fieldIdx] - } else { - name = strconv.Itoa(fieldIdx) - } - failures = append(failures, validate.FieldError{ - Name: name, - Error: validate.ErrFieldRequired, - }) - // Reset bit. - result &^= 1 << bitIdx - } - } - } - if len(failures) > 0 { - return &validate.Error{Fields: failures} + return errors.Wrap(err, "decode ErrorModel") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s *GrantServiceAccountAccessInputBody) MarshalJSON() ([]byte, error) { +func (s *ErrorModel) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantServiceAccountAccessInputBody) UnmarshalJSON(data []byte) error { +func (s *ErrorModel) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s GrantServiceAccountAccessInputBodyAdditional) Encode(e *jx.Encoder) { +func (s ErrorModelAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s GrantServiceAccountAccessInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ErrorModelAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -12847,10 +13162,10 @@ func (s GrantServiceAccountAccessInputBodyAdditional) encodeFields(e *jx.Encoder } } -// Decode decodes GrantServiceAccountAccessInputBodyAdditional from json. -func (s *GrantServiceAccountAccessInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ErrorModelAdditional from json. +func (s *ErrorModelAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GrantServiceAccountAccessInputBodyAdditional to nil") + return errors.New("invalid: unable to decode ErrorModelAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -12868,125 +13183,41 @@ func (s *GrantServiceAccountAccessInputBodyAdditional) Decode(d *jx.Decoder) err m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode GrantServiceAccountAccessInputBodyAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s GrantServiceAccountAccessInputBodyAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantServiceAccountAccessInputBodyAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes GrantServiceAccountAccessInputBodyResourceType as json. -func (s GrantServiceAccountAccessInputBodyResourceType) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes GrantServiceAccountAccessInputBodyResourceType from json. -func (s *GrantServiceAccountAccessInputBodyResourceType) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode GrantServiceAccountAccessInputBodyResourceType to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch GrantServiceAccountAccessInputBodyResourceType(v) { - case GrantServiceAccountAccessInputBodyResourceTypeRepo: - *s = GrantServiceAccountAccessInputBodyResourceTypeRepo - case GrantServiceAccountAccessInputBodyResourceTypeProject: - *s = GrantServiceAccountAccessInputBodyResourceTypeProject - default: - *s = GrantServiceAccountAccessInputBodyResourceType(v) - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s GrantServiceAccountAccessInputBodyResourceType) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantServiceAccountAccessInputBodyResourceType) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes GrantServiceAccountAccessInputBodyRole as json. -func (s GrantServiceAccountAccessInputBodyRole) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes GrantServiceAccountAccessInputBodyRole from json. -func (s *GrantServiceAccountAccessInputBodyRole) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode GrantServiceAccountAccessInputBodyRole to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch GrantServiceAccountAccessInputBodyRole(v) { - case GrantServiceAccountAccessInputBodyRoleReader: - *s = GrantServiceAccountAccessInputBodyRoleReader - case GrantServiceAccountAccessInputBodyRoleWriter: - *s = GrantServiceAccountAccessInputBodyRoleWriter - case GrantServiceAccountAccessInputBodyRoleAdmin: - *s = GrantServiceAccountAccessInputBodyRoleAdmin - default: - *s = GrantServiceAccountAccessInputBodyRole(v) + return errors.Wrap(err, "decode ErrorModelAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GrantServiceAccountAccessInputBodyRole) MarshalJSON() ([]byte, error) { +func (s ErrorModelAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantServiceAccountAccessInputBodyRole) UnmarshalJSON(data []byte) error { +func (s *ErrorModelAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *GrantServiceAccountAccessOutputBody) Encode(e *jx.Encoder) { +func (s *ForgeRepoIdentity) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *GrantServiceAccountAccessOutputBody) encodeFields(e *jx.Encoder) { +func (s *ForgeRepoIdentity) encodeFields(e *jx.Encoder) { { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } + e.FieldStart("forge") + e.Str(s.Forge) } { - e.FieldStart("status") - e.Str(s.Status) + e.FieldStart("repo_id") + e.Str(s.RepoID) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -12997,42 +13228,44 @@ func (s *GrantServiceAccountAccessOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfGrantServiceAccountAccessOutputBody = [2]string{ - 0: "$schema", - 1: "status", +var jsonFieldsNameOfForgeRepoIdentity = [2]string{ + 0: "forge", + 1: "repo_id", } -// Decode decodes GrantServiceAccountAccessOutputBody from json. -func (s *GrantServiceAccountAccessOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes ForgeRepoIdentity from json. +func (s *ForgeRepoIdentity) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GrantServiceAccountAccessOutputBody to nil") + return errors.New("invalid: unable to decode ForgeRepoIdentity to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "forge": + requiredBitSet[0] |= 1 << 0 if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + v, err := d.Str() + s.Forge = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"forge\"") } - case "status": + case "repo_id": requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.Status = string(v) + s.RepoID = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"status\"") + return errors.Wrap(err, "decode field \"repo_id\"") } default: var elem jx.Raw @@ -13050,12 +13283,12 @@ func (s *GrantServiceAccountAccessOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode GrantServiceAccountAccessOutputBody") + return errors.Wrap(err, "decode ForgeRepoIdentity") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00000011, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -13067,8 +13300,8 @@ func (s *GrantServiceAccountAccessOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfGrantServiceAccountAccessOutputBody) { - name = jsonFieldsNameOfGrantServiceAccountAccessOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfForgeRepoIdentity) { + name = jsonFieldsNameOfForgeRepoIdentity[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -13089,27 +13322,27 @@ func (s *GrantServiceAccountAccessOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *GrantServiceAccountAccessOutputBody) MarshalJSON() ([]byte, error) { +func (s *ForgeRepoIdentity) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantServiceAccountAccessOutputBody) UnmarshalJSON(data []byte) error { +func (s *ForgeRepoIdentity) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s GrantServiceAccountAccessOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s ForgeRepoIdentityAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s GrantServiceAccountAccessOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ForgeRepoIdentityAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -13119,10 +13352,10 @@ func (s GrantServiceAccountAccessOutputBodyAdditional) encodeFields(e *jx.Encode } } -// Decode decodes GrantServiceAccountAccessOutputBodyAdditional from json. -func (s *GrantServiceAccountAccessOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ForgeRepoIdentityAdditional from json. +func (s *ForgeRepoIdentityAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode GrantServiceAccountAccessOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode ForgeRepoIdentityAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -13140,34 +13373,34 @@ func (s *GrantServiceAccountAccessOutputBodyAdditional) Decode(d *jx.Decoder) er m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode GrantServiceAccountAccessOutputBodyAdditional") + return errors.Wrap(err, "decode ForgeRepoIdentityAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s GrantServiceAccountAccessOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ForgeRepoIdentityAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *GrantServiceAccountAccessOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ForgeRepoIdentityAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListAuditEventsOutputBody) Encode(e *jx.Encoder) { +func (s *GetDeletionPreviewOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListAuditEventsOutputBody) encodeFields(e *jx.Encoder) { +func (s *GetDeletionPreviewOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -13175,18 +13408,24 @@ func (s *ListAuditEventsOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("events") + e.FieldStart("blocked") + e.Bool(s.Blocked) + } + { + e.FieldStart("blockers") e.ArrStart() - for _, elem := range s.Events { + for _, elem := range s.Blockers { elem.Encode(e) } e.ArrEnd() } { - if s.NextPageToken.Set { - e.FieldStart("nextPageToken") - s.NextPageToken.Encode(e) - } + e.FieldStart("willDelete") + s.WillDelete.Encode(e) + } + { + e.FieldStart("willUnlink") + s.WillUnlink.Encode(e) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -13197,16 +13436,18 @@ func (s *ListAuditEventsOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListAuditEventsOutputBody = [3]string{ +var jsonFieldsNameOfGetDeletionPreviewOutputBody = [5]string{ 0: "$schema", - 1: "events", - 2: "nextPageToken", + 1: "blocked", + 2: "blockers", + 3: "willDelete", + 4: "willUnlink", } -// Decode decodes ListAuditEventsOutputBody from json. -func (s *ListAuditEventsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes GetDeletionPreviewOutputBody from json. +func (s *GetDeletionPreviewOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListAuditEventsOutputBody to nil") + return errors.New("invalid: unable to decode GetDeletionPreviewOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -13223,33 +13464,55 @@ func (s *ListAuditEventsOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "events": + case "blocked": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Events = make([]AuditEvent, 0) + v, err := d.Bool() + s.Blocked = bool(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"blocked\"") + } + case "blockers": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + s.Blockers = make([]DeletionBlocker, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem AuditEvent + var elem DeletionBlocker if err := elem.Decode(d); err != nil { return err } - s.Events = append(s.Events, elem) + s.Blockers = append(s.Blockers, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"events\"") + return errors.Wrap(err, "decode field \"blockers\"") } - case "nextPageToken": + case "willDelete": + requiredBitSet[0] |= 1 << 3 if err := func() error { - s.NextPageToken.Reset() - if err := s.NextPageToken.Decode(d); err != nil { + if err := s.WillDelete.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"nextPageToken\"") + return errors.Wrap(err, "decode field \"willDelete\"") + } + case "willUnlink": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + if err := s.WillUnlink.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"willUnlink\"") } default: var elem jx.Raw @@ -13267,12 +13530,12 @@ func (s *ListAuditEventsOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListAuditEventsOutputBody") + return errors.Wrap(err, "decode GetDeletionPreviewOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00011110, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -13284,8 +13547,8 @@ func (s *ListAuditEventsOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListAuditEventsOutputBody) { - name = jsonFieldsNameOfListAuditEventsOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfGetDeletionPreviewOutputBody) { + name = jsonFieldsNameOfGetDeletionPreviewOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -13306,27 +13569,27 @@ func (s *ListAuditEventsOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListAuditEventsOutputBody) MarshalJSON() ([]byte, error) { +func (s *GetDeletionPreviewOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListAuditEventsOutputBody) UnmarshalJSON(data []byte) error { +func (s *GetDeletionPreviewOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListAuditEventsOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s GetDeletionPreviewOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListAuditEventsOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s GetDeletionPreviewOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -13336,10 +13599,10 @@ func (s ListAuditEventsOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListAuditEventsOutputBodyAdditional from json. -func (s *ListAuditEventsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes GetDeletionPreviewOutputBodyAdditional from json. +func (s *GetDeletionPreviewOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListAuditEventsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode GetDeletionPreviewOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -13357,34 +13620,34 @@ func (s *ListAuditEventsOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListAuditEventsOutputBodyAdditional") + return errors.Wrap(err, "decode GetDeletionPreviewOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListAuditEventsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s GetDeletionPreviewOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListAuditEventsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *GetDeletionPreviewOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListAvailableMirrorsOutputBody) Encode(e *jx.Encoder) { +func (s *GetMeOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListAvailableMirrorsOutputBody) encodeFields(e *jx.Encoder) { +func (s *GetMeOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -13392,12 +13655,42 @@ func (s *ListAvailableMirrorsOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("available") - e.ArrStart() - for _, elem := range s.Available { - elem.Encode(e) + e.FieldStart("auth") + s.Auth.Encode(e) + } + { + if s.Deletion.Set { + e.FieldStart("deletion") + s.Deletion.Encode(e) + } + } + { + e.FieldStart("global") + s.Global.Encode(e) + } + { + if s.Jurisdiction.Set { + e.FieldStart("jurisdiction") + s.Jurisdiction.Encode(e) + } + } + { + if s.Mode.Set { + e.FieldStart("mode") + s.Mode.Encode(e) + } + } + { + if s.Regional.Set { + e.FieldStart("regional") + s.Regional.Encode(e) + } + } + { + if s.RegionalUnavailable.Set { + e.FieldStart("regionalUnavailable") + s.RegionalUnavailable.Encode(e) } - e.ArrEnd() } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -13408,15 +13701,21 @@ func (s *ListAvailableMirrorsOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListAvailableMirrorsOutputBody = [2]string{ +var jsonFieldsNameOfGetMeOutputBody = [8]string{ 0: "$schema", - 1: "available", + 1: "auth", + 2: "deletion", + 3: "global", + 4: "jurisdiction", + 5: "mode", + 6: "regional", + 7: "regionalUnavailable", } -// Decode decodes ListAvailableMirrorsOutputBody from json. -func (s *ListAvailableMirrorsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes GetMeOutputBody from json. +func (s *GetMeOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListAvailableMirrorsOutputBody to nil") + return errors.New("invalid: unable to decode GetMeOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -13433,46 +13732,98 @@ func (s *ListAvailableMirrorsOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "available": + case "auth": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Available = make([]AvailableMirror, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem AvailableMirror - if err := elem.Decode(d); err != nil { - return err - } - s.Available = append(s.Available, elem) - return nil - }); err != nil { + if err := s.Auth.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"available\"") + return errors.Wrap(err, "decode field \"auth\"") } - default: - var elem jx.Raw + case "deletion": if err := func() error { - v, err := d.RawAppend(nil) - elem = jx.Raw(v) - if err != nil { + s.Deletion.Reset() + if err := s.Deletion.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrapf(err, "decode field %q", k) + return errors.Wrap(err, "decode field \"deletion\"") } - s.AdditionalProps[string(k)] = elem - } - return nil - }); err != nil { - return errors.Wrap(err, "decode ListAvailableMirrorsOutputBody") + case "global": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + if err := s.Global.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"global\"") + } + case "jurisdiction": + if err := func() error { + s.Jurisdiction.Reset() + if err := s.Jurisdiction.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"jurisdiction\"") + } + case "mode": + if err := func() error { + s.Mode.Reset() + if err := s.Mode.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"mode\"") + } + case "regional": + if err := func() error { + s.Regional.Reset() + if err := s.Regional.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"regional\"") + } + case "regionalUnavailable": + if err := func() error { + s.RegionalUnavailable.Reset() + if err := s.RegionalUnavailable.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"regionalUnavailable\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode GetMeOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00001010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -13484,8 +13835,8 @@ func (s *ListAvailableMirrorsOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListAvailableMirrorsOutputBody) { - name = jsonFieldsNameOfListAvailableMirrorsOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfGetMeOutputBody) { + name = jsonFieldsNameOfGetMeOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -13506,27 +13857,27 @@ func (s *ListAvailableMirrorsOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListAvailableMirrorsOutputBody) MarshalJSON() ([]byte, error) { +func (s *GetMeOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListAvailableMirrorsOutputBody) UnmarshalJSON(data []byte) error { +func (s *GetMeOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListAvailableMirrorsOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s GetMeOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListAvailableMirrorsOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s GetMeOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -13536,10 +13887,10 @@ func (s ListAvailableMirrorsOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListAvailableMirrorsOutputBodyAdditional from json. -func (s *ListAvailableMirrorsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes GetMeOutputBodyAdditional from json. +func (s *GetMeOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListAvailableMirrorsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode GetMeOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -13557,34 +13908,74 @@ func (s *ListAvailableMirrorsOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListAvailableMirrorsOutputBodyAdditional") + return errors.Wrap(err, "decode GetMeOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListAvailableMirrorsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s GetMeOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListAvailableMirrorsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *GetMeOutputBodyAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes GetMeOutputBodyMode as json. +func (s GetMeOutputBodyMode) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes GetMeOutputBodyMode from json. +func (s *GetMeOutputBodyMode) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode GetMeOutputBodyMode to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch GetMeOutputBodyMode(v) { + case GetMeOutputBodyModeGlobal: + *s = GetMeOutputBodyModeGlobal + case GetMeOutputBodyModeRegional: + *s = GetMeOutputBodyModeRegional + default: + *s = GetMeOutputBodyMode(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s GetMeOutputBodyMode) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *GetMeOutputBodyMode) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListBindingsOutputBody) Encode(e *jx.Encoder) { +func (s *GetOnboardingStatusOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListBindingsOutputBody) encodeFields(e *jx.Encoder) { +func (s *GetOnboardingStatusOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -13592,18 +13983,12 @@ func (s *ListBindingsOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("bindings") - e.ArrStart() - for _, elem := range s.Bindings { - elem.Encode(e) - } - e.ArrEnd() + e.FieldStart("cliLoggedIn") + e.Bool(s.CliLoggedIn) } { - if s.NextPageToken.Set { - e.FieldStart("nextPageToken") - s.NextPageToken.Encode(e) - } + e.FieldStart("needsOnboarding") + e.Bool(s.NeedsOnboarding) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -13614,16 +13999,16 @@ func (s *ListBindingsOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListBindingsOutputBody = [3]string{ +var jsonFieldsNameOfGetOnboardingStatusOutputBody = [3]string{ 0: "$schema", - 1: "bindings", - 2: "nextPageToken", + 1: "cliLoggedIn", + 2: "needsOnboarding", } -// Decode decodes ListBindingsOutputBody from json. -func (s *ListBindingsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes GetOnboardingStatusOutputBody from json. +func (s *GetOnboardingStatusOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListBindingsOutputBody to nil") + return errors.New("invalid: unable to decode GetOnboardingStatusOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -13640,33 +14025,29 @@ func (s *ListBindingsOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "bindings": + case "cliLoggedIn": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Bindings = make([]Binding, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem Binding - if err := elem.Decode(d); err != nil { - return err - } - s.Bindings = append(s.Bindings, elem) - return nil - }); err != nil { + v, err := d.Bool() + s.CliLoggedIn = bool(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"bindings\"") + return errors.Wrap(err, "decode field \"cliLoggedIn\"") } - case "nextPageToken": + case "needsOnboarding": + requiredBitSet[0] |= 1 << 2 if err := func() error { - s.NextPageToken.Reset() - if err := s.NextPageToken.Decode(d); err != nil { + v, err := d.Bool() + s.NeedsOnboarding = bool(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"nextPageToken\"") + return errors.Wrap(err, "decode field \"needsOnboarding\"") } default: var elem jx.Raw @@ -13684,12 +14065,12 @@ func (s *ListBindingsOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListBindingsOutputBody") + return errors.Wrap(err, "decode GetOnboardingStatusOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00000110, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -13701,8 +14082,8 @@ func (s *ListBindingsOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListBindingsOutputBody) { - name = jsonFieldsNameOfListBindingsOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfGetOnboardingStatusOutputBody) { + name = jsonFieldsNameOfGetOnboardingStatusOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -13723,27 +14104,27 @@ func (s *ListBindingsOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListBindingsOutputBody) MarshalJSON() ([]byte, error) { +func (s *GetOnboardingStatusOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListBindingsOutputBody) UnmarshalJSON(data []byte) error { +func (s *GetOnboardingStatusOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListBindingsOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s GetOnboardingStatusOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListBindingsOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s GetOnboardingStatusOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -13753,10 +14134,10 @@ func (s ListBindingsOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListBindingsOutputBodyAdditional from json. -func (s *ListBindingsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes GetOnboardingStatusOutputBodyAdditional from json. +func (s *GetOnboardingStatusOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListBindingsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode GetOnboardingStatusOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -13774,34 +14155,34 @@ func (s *ListBindingsOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListBindingsOutputBodyAdditional") + return errors.Wrap(err, "decode GetOnboardingStatusOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListBindingsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s GetOnboardingStatusOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListBindingsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *GetOnboardingStatusOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListClustersOutputBody) Encode(e *jx.Encoder) { +func (s *GetRepoVisibilityOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListClustersOutputBody) encodeFields(e *jx.Encoder) { +func (s *GetRepoVisibilityOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -13809,12 +14190,8 @@ func (s *ListClustersOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("clusters") - e.ArrStart() - for _, elem := range s.Clusters { - elem.Encode(e) - } - e.ArrEnd() + e.FieldStart("visibility") + s.Visibility.Encode(e) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -13825,15 +14202,15 @@ func (s *ListClustersOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListClustersOutputBody = [2]string{ +var jsonFieldsNameOfGetRepoVisibilityOutputBody = [2]string{ 0: "$schema", - 1: "clusters", + 1: "visibility", } -// Decode decodes ListClustersOutputBody from json. -func (s *ListClustersOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes GetRepoVisibilityOutputBody from json. +func (s *GetRepoVisibilityOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListClustersOutputBody to nil") + return errors.New("invalid: unable to decode GetRepoVisibilityOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -13850,23 +14227,15 @@ func (s *ListClustersOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "clusters": + case "visibility": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Clusters = make([]Cluster, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem Cluster - if err := elem.Decode(d); err != nil { - return err - } - s.Clusters = append(s.Clusters, elem) - return nil - }); err != nil { + if err := s.Visibility.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"clusters\"") + return errors.Wrap(err, "decode field \"visibility\"") } default: var elem jx.Raw @@ -13884,7 +14253,7 @@ func (s *ListClustersOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListClustersOutputBody") + return errors.Wrap(err, "decode GetRepoVisibilityOutputBody") } // Validate required fields. var failures []validate.FieldError @@ -13901,8 +14270,8 @@ func (s *ListClustersOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListClustersOutputBody) { - name = jsonFieldsNameOfListClustersOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfGetRepoVisibilityOutputBody) { + name = jsonFieldsNameOfGetRepoVisibilityOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -13923,27 +14292,27 @@ func (s *ListClustersOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListClustersOutputBody) MarshalJSON() ([]byte, error) { +func (s *GetRepoVisibilityOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListClustersOutputBody) UnmarshalJSON(data []byte) error { +func (s *GetRepoVisibilityOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListClustersOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s GetRepoVisibilityOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListClustersOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s GetRepoVisibilityOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -13953,10 +14322,10 @@ func (s ListClustersOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListClustersOutputBodyAdditional from json. -func (s *ListClustersOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes GetRepoVisibilityOutputBodyAdditional from json. +func (s *GetRepoVisibilityOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListClustersOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode GetRepoVisibilityOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -13974,34 +14343,74 @@ func (s *ListClustersOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListClustersOutputBodyAdditional") + return errors.Wrap(err, "decode GetRepoVisibilityOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListClustersOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s GetRepoVisibilityOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListClustersOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *GetRepoVisibilityOutputBodyAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes GetRepoVisibilityOutputBodyVisibility as json. +func (s GetRepoVisibilityOutputBodyVisibility) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes GetRepoVisibilityOutputBodyVisibility from json. +func (s *GetRepoVisibilityOutputBodyVisibility) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode GetRepoVisibilityOutputBodyVisibility to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch GetRepoVisibilityOutputBodyVisibility(v) { + case GetRepoVisibilityOutputBodyVisibilityPublic: + *s = GetRepoVisibilityOutputBodyVisibilityPublic + case GetRepoVisibilityOutputBodyVisibilityPrivate: + *s = GetRepoVisibilityOutputBodyVisibilityPrivate + default: + *s = GetRepoVisibilityOutputBodyVisibility(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s GetRepoVisibilityOutputBodyVisibility) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *GetRepoVisibilityOutputBodyVisibility) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListMirrorCollaboratorsOutputBody) Encode(e *jx.Encoder) { +func (s *GetTopologyOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListMirrorCollaboratorsOutputBody) encodeFields(e *jx.Encoder) { +func (s *GetTopologyOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -14009,9 +14418,9 @@ func (s *ListMirrorCollaboratorsOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("collaborators") + e.FieldStart("jurisdictions") e.ArrStart() - for _, elem := range s.Collaborators { + for _, elem := range s.Jurisdictions { elem.Encode(e) } e.ArrEnd() @@ -14025,15 +14434,15 @@ func (s *ListMirrorCollaboratorsOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListMirrorCollaboratorsOutputBody = [2]string{ +var jsonFieldsNameOfGetTopologyOutputBody = [2]string{ 0: "$schema", - 1: "collaborators", + 1: "jurisdictions", } -// Decode decodes ListMirrorCollaboratorsOutputBody from json. -func (s *ListMirrorCollaboratorsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes GetTopologyOutputBody from json. +func (s *GetTopologyOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListMirrorCollaboratorsOutputBody to nil") + return errors.New("invalid: unable to decode GetTopologyOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -14050,23 +14459,23 @@ func (s *ListMirrorCollaboratorsOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "collaborators": + case "jurisdictions": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Collaborators = make([]MirrorCollaborator, 0) + s.Jurisdictions = make([]TopologyJurisdiction, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem MirrorCollaborator + var elem TopologyJurisdiction if err := elem.Decode(d); err != nil { return err } - s.Collaborators = append(s.Collaborators, elem) + s.Jurisdictions = append(s.Jurisdictions, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"collaborators\"") + return errors.Wrap(err, "decode field \"jurisdictions\"") } default: var elem jx.Raw @@ -14084,7 +14493,7 @@ func (s *ListMirrorCollaboratorsOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListMirrorCollaboratorsOutputBody") + return errors.Wrap(err, "decode GetTopologyOutputBody") } // Validate required fields. var failures []validate.FieldError @@ -14101,8 +14510,8 @@ func (s *ListMirrorCollaboratorsOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListMirrorCollaboratorsOutputBody) { - name = jsonFieldsNameOfListMirrorCollaboratorsOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfGetTopologyOutputBody) { + name = jsonFieldsNameOfGetTopologyOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -14123,27 +14532,27 @@ func (s *ListMirrorCollaboratorsOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListMirrorCollaboratorsOutputBody) MarshalJSON() ([]byte, error) { +func (s *GetTopologyOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListMirrorCollaboratorsOutputBody) UnmarshalJSON(data []byte) error { +func (s *GetTopologyOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListMirrorCollaboratorsOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s GetTopologyOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListMirrorCollaboratorsOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s GetTopologyOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -14153,10 +14562,10 @@ func (s ListMirrorCollaboratorsOutputBodyAdditional) encodeFields(e *jx.Encoder) } } -// Decode decodes ListMirrorCollaboratorsOutputBodyAdditional from json. -func (s *ListMirrorCollaboratorsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes GetTopologyOutputBodyAdditional from json. +func (s *GetTopologyOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListMirrorCollaboratorsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode GetTopologyOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -14174,34 +14583,34 @@ func (s *ListMirrorCollaboratorsOutputBodyAdditional) Decode(d *jx.Decoder) erro m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListMirrorCollaboratorsOutputBodyAdditional") + return errors.Wrap(err, "decode GetTopologyOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListMirrorCollaboratorsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s GetTopologyOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListMirrorCollaboratorsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *GetTopologyOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListMirrorsOutputBody) Encode(e *jx.Encoder) { +func (s *GetVersionOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListMirrorsOutputBody) encodeFields(e *jx.Encoder) { +func (s *GetVersionOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -14209,18 +14618,14 @@ func (s *ListMirrorsOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("mirrors") - e.ArrStart() - for _, elem := range s.Mirrors { - elem.Encode(e) + if s.Mode.Set { + e.FieldStart("mode") + s.Mode.Encode(e) } - e.ArrEnd() } { - if s.NextPageToken.Set { - e.FieldStart("nextPageToken") - s.NextPageToken.Encode(e) - } + e.FieldStart("version") + e.Str(s.Version) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -14231,16 +14636,16 @@ func (s *ListMirrorsOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListMirrorsOutputBody = [3]string{ +var jsonFieldsNameOfGetVersionOutputBody = [3]string{ 0: "$schema", - 1: "mirrors", - 2: "nextPageToken", + 1: "mode", + 2: "version", } -// Decode decodes ListMirrorsOutputBody from json. -func (s *ListMirrorsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes GetVersionOutputBody from json. +func (s *GetVersionOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListMirrorsOutputBody to nil") + return errors.New("invalid: unable to decode GetVersionOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -14257,33 +14662,27 @@ func (s *ListMirrorsOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "mirrors": - requiredBitSet[0] |= 1 << 1 + case "mode": if err := func() error { - s.Mirrors = make([]Mirror, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem Mirror - if err := elem.Decode(d); err != nil { - return err - } - s.Mirrors = append(s.Mirrors, elem) - return nil - }); err != nil { + s.Mode.Reset() + if err := s.Mode.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"mirrors\"") + return errors.Wrap(err, "decode field \"mode\"") } - case "nextPageToken": + case "version": + requiredBitSet[0] |= 1 << 2 if err := func() error { - s.NextPageToken.Reset() - if err := s.NextPageToken.Decode(d); err != nil { + v, err := d.Str() + s.Version = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"nextPageToken\"") + return errors.Wrap(err, "decode field \"version\"") } default: var elem jx.Raw @@ -14301,12 +14700,12 @@ func (s *ListMirrorsOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListMirrorsOutputBody") + return errors.Wrap(err, "decode GetVersionOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00000100, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -14318,8 +14717,8 @@ func (s *ListMirrorsOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListMirrorsOutputBody) { - name = jsonFieldsNameOfListMirrorsOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfGetVersionOutputBody) { + name = jsonFieldsNameOfGetVersionOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -14340,27 +14739,27 @@ func (s *ListMirrorsOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListMirrorsOutputBody) MarshalJSON() ([]byte, error) { +func (s *GetVersionOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListMirrorsOutputBody) UnmarshalJSON(data []byte) error { +func (s *GetVersionOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListMirrorsOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s GetVersionOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListMirrorsOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s GetVersionOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -14370,10 +14769,10 @@ func (s ListMirrorsOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListMirrorsOutputBodyAdditional from json. -func (s *ListMirrorsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes GetVersionOutputBodyAdditional from json. +func (s *GetVersionOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListMirrorsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode GetVersionOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -14391,50 +14790,92 @@ func (s *ListMirrorsOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListMirrorsOutputBodyAdditional") + return errors.Wrap(err, "decode GetVersionOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListMirrorsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s GetVersionOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListMirrorsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *GetVersionOutputBodyAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes GetVersionOutputBodyMode as json. +func (s GetVersionOutputBodyMode) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes GetVersionOutputBodyMode from json. +func (s *GetVersionOutputBodyMode) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode GetVersionOutputBodyMode to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch GetVersionOutputBodyMode(v) { + case GetVersionOutputBodyModeGlobal: + *s = GetVersionOutputBodyModeGlobal + case GetVersionOutputBodyModeRegional: + *s = GetVersionOutputBodyModeRegional + default: + *s = GetVersionOutputBodyMode(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s GetVersionOutputBodyMode) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *GetVersionOutputBodyMode) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListNativeMirrorsOutputBody) Encode(e *jx.Encoder) { +func (s *GitHubInstallation) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListNativeMirrorsOutputBody) encodeFields(e *jx.Encoder) { +func (s *GitHubInstallation) encodeFields(e *jx.Encoder) { { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } + e.FieldStart("accountLogin") + e.Str(s.AccountLogin) } { - e.FieldStart("nativeMirrors") - e.ArrStart() - for _, elem := range s.NativeMirrors { - elem.Encode(e) - } - e.ArrEnd() + e.FieldStart("accountType") + s.AccountType.Encode(e) } - for k, elem := range s.AdditionalProps { - e.FieldStart(k) + { + e.FieldStart("id") + e.Str(s.ID) + } + { + e.FieldStart("state") + s.State.Encode(e) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) if len(elem) != 0 { e.Raw(elem) @@ -14442,48 +14883,66 @@ func (s *ListNativeMirrorsOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListNativeMirrorsOutputBody = [2]string{ - 0: "$schema", - 1: "nativeMirrors", +var jsonFieldsNameOfGitHubInstallation = [4]string{ + 0: "accountLogin", + 1: "accountType", + 2: "id", + 3: "state", } -// Decode decodes ListNativeMirrorsOutputBody from json. -func (s *ListNativeMirrorsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes GitHubInstallation from json. +func (s *GitHubInstallation) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListNativeMirrorsOutputBody to nil") + return errors.New("invalid: unable to decode GitHubInstallation to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "accountLogin": + requiredBitSet[0] |= 1 << 0 if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + v, err := d.Str() + s.AccountLogin = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"accountLogin\"") } - case "nativeMirrors": + case "accountType": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.NativeMirrors = make([]NativeMirrorPlacement, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem NativeMirrorPlacement - if err := elem.Decode(d); err != nil { - return err - } - s.NativeMirrors = append(s.NativeMirrors, elem) - return nil - }); err != nil { + if err := s.AccountType.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"nativeMirrors\"") + return errors.Wrap(err, "decode field \"accountType\"") + } + case "id": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.ID = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"id\"") + } + case "state": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + if err := s.State.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"state\"") } default: var elem jx.Raw @@ -14501,12 +14960,12 @@ func (s *ListNativeMirrorsOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListNativeMirrorsOutputBody") + return errors.Wrap(err, "decode GitHubInstallation") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00001111, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -14518,8 +14977,8 @@ func (s *ListNativeMirrorsOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListNativeMirrorsOutputBody) { - name = jsonFieldsNameOfListNativeMirrorsOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfGitHubInstallation) { + name = jsonFieldsNameOfGitHubInstallation[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -14540,27 +14999,67 @@ func (s *ListNativeMirrorsOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListNativeMirrorsOutputBody) MarshalJSON() ([]byte, error) { +func (s *GitHubInstallation) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListNativeMirrorsOutputBody) UnmarshalJSON(data []byte) error { +func (s *GitHubInstallation) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes GitHubInstallationAccountType as json. +func (s GitHubInstallationAccountType) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes GitHubInstallationAccountType from json. +func (s *GitHubInstallationAccountType) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode GitHubInstallationAccountType to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch GitHubInstallationAccountType(v) { + case GitHubInstallationAccountTypeUser: + *s = GitHubInstallationAccountTypeUser + case GitHubInstallationAccountTypeOrganization: + *s = GitHubInstallationAccountTypeOrganization + default: + *s = GitHubInstallationAccountType(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s GitHubInstallationAccountType) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *GitHubInstallationAccountType) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListNativeMirrorsOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s GitHubInstallationAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListNativeMirrorsOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s GitHubInstallationAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -14570,10 +15069,10 @@ func (s ListNativeMirrorsOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListNativeMirrorsOutputBodyAdditional from json. -func (s *ListNativeMirrorsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes GitHubInstallationAdditional from json. +func (s *GitHubInstallationAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListNativeMirrorsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode GitHubInstallationAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -14591,53 +15090,87 @@ func (s *ListNativeMirrorsOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListNativeMirrorsOutputBodyAdditional") + return errors.Wrap(err, "decode GitHubInstallationAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListNativeMirrorsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s GitHubInstallationAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListNativeMirrorsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *GitHubInstallationAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes GitHubInstallationState as json. +func (s GitHubInstallationState) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes GitHubInstallationState from json. +func (s *GitHubInstallationState) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode GitHubInstallationState to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch GitHubInstallationState(v) { + case GitHubInstallationStateActive: + *s = GitHubInstallationStateActive + case GitHubInstallationStateSuspended: + *s = GitHubInstallationStateSuspended + default: + *s = GitHubInstallationState(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s GitHubInstallationState) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *GitHubInstallationState) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListOIDCProvidersOutputBody) Encode(e *jx.Encoder) { +func (s *GitHubInstallations) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListOIDCProvidersOutputBody) encodeFields(e *jx.Encoder) { - { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } - } +func (s *GitHubInstallations) encodeFields(e *jx.Encoder) { { - if s.NextPageToken.Set { - e.FieldStart("nextPageToken") - s.NextPageToken.Encode(e) + if s.Items != nil { + e.FieldStart("items") + e.ArrStart() + for _, elem := range s.Items { + elem.Encode(e) + } + e.ArrEnd() } } { - e.FieldStart("providers") - e.ArrStart() - for _, elem := range s.Providers { - elem.Encode(e) - } - e.ArrEnd() + e.FieldStart("status") + s.Status.Encode(e) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -14648,59 +15181,47 @@ func (s *ListOIDCProvidersOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListOIDCProvidersOutputBody = [3]string{ - 0: "$schema", - 1: "nextPageToken", - 2: "providers", +var jsonFieldsNameOfGitHubInstallations = [2]string{ + 0: "items", + 1: "status", } -// Decode decodes ListOIDCProvidersOutputBody from json. -func (s *ListOIDCProvidersOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes GitHubInstallations from json. +func (s *GitHubInstallations) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListOIDCProvidersOutputBody to nil") + return errors.New("invalid: unable to decode GitHubInstallations to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": - if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") - } - case "nextPageToken": - if err := func() error { - s.NextPageToken.Reset() - if err := s.NextPageToken.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"nextPageToken\"") - } - case "providers": - requiredBitSet[0] |= 1 << 2 + case "items": if err := func() error { - s.Providers = make([]OIDCProvider, 0) + s.Items = make([]GitHubInstallation, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem OIDCProvider + var elem GitHubInstallation if err := elem.Decode(d); err != nil { return err } - s.Providers = append(s.Providers, elem) + s.Items = append(s.Items, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"providers\"") + return errors.Wrap(err, "decode field \"items\"") + } + case "status": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + if err := s.Status.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"status\"") } default: var elem jx.Raw @@ -14718,12 +15239,12 @@ func (s *ListOIDCProvidersOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListOIDCProvidersOutputBody") + return errors.Wrap(err, "decode GitHubInstallations") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000100, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -14735,8 +15256,8 @@ func (s *ListOIDCProvidersOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListOIDCProvidersOutputBody) { - name = jsonFieldsNameOfListOIDCProvidersOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfGitHubInstallations) { + name = jsonFieldsNameOfGitHubInstallations[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -14757,27 +15278,27 @@ func (s *ListOIDCProvidersOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListOIDCProvidersOutputBody) MarshalJSON() ([]byte, error) { +func (s *GitHubInstallations) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListOIDCProvidersOutputBody) UnmarshalJSON(data []byte) error { +func (s *GitHubInstallations) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListOIDCProvidersOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s GitHubInstallationsAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListOIDCProvidersOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s GitHubInstallationsAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -14787,10 +15308,10 @@ func (s ListOIDCProvidersOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListOIDCProvidersOutputBodyAdditional from json. -func (s *ListOIDCProvidersOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes GitHubInstallationsAdditional from json. +func (s *GitHubInstallationsAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListOIDCProvidersOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode GitHubInstallationsAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -14808,34 +15329,74 @@ func (s *ListOIDCProvidersOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListOIDCProvidersOutputBodyAdditional") + return errors.Wrap(err, "decode GitHubInstallationsAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListOIDCProvidersOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s GitHubInstallationsAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListOIDCProvidersOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *GitHubInstallationsAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes GitHubInstallationsStatus as json. +func (s GitHubInstallationsStatus) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes GitHubInstallationsStatus from json. +func (s *GitHubInstallationsStatus) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode GitHubInstallationsStatus to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch GitHubInstallationsStatus(v) { + case GitHubInstallationsStatusOk: + *s = GitHubInstallationsStatusOk + case GitHubInstallationsStatusUnavailable: + *s = GitHubInstallationsStatusUnavailable + default: + *s = GitHubInstallationsStatus(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s GitHubInstallationsStatus) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *GitHubInstallationsStatus) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListOrgCIBuildkiteClustersOutputBody) Encode(e *jx.Encoder) { +func (s *GrantAccessBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListOrgCIBuildkiteClustersOutputBody) encodeFields(e *jx.Encoder) { +func (s *GrantAccessBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -14843,12 +15404,32 @@ func (s *ListOrgCIBuildkiteClustersOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("clusters") - e.ArrStart() - for _, elem := range s.Clusters { - elem.Encode(e) + if s.AccountId.Set { + e.FieldStart("accountId") + s.AccountId.Encode(e) + } + } + { + if s.GranteeType.Set { + e.FieldStart("granteeType") + s.GranteeType.Encode(e) + } + } + { + if s.Provider.Set { + e.FieldStart("provider") + s.Provider.Encode(e) } - e.ArrEnd() + } + { + if s.ProviderUserId.Set { + e.FieldStart("providerUserId") + s.ProviderUserId.Encode(e) + } + } + { + e.FieldStart("role") + s.Role.Encode(e) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -14859,17 +15440,22 @@ func (s *ListOrgCIBuildkiteClustersOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListOrgCIBuildkiteClustersOutputBody = [2]string{ +var jsonFieldsNameOfGrantAccessBody = [6]string{ 0: "$schema", - 1: "clusters", + 1: "accountId", + 2: "granteeType", + 3: "provider", + 4: "providerUserId", + 5: "role", } -// Decode decodes ListOrgCIBuildkiteClustersOutputBody from json. -func (s *ListOrgCIBuildkiteClustersOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes GrantAccessBody from json. +func (s *GrantAccessBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListOrgCIBuildkiteClustersOutputBody to nil") + return errors.New("invalid: unable to decode GrantAccessBody to nil") } var requiredBitSet [1]uint8 + s.setDefaults() s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -14884,23 +15470,55 @@ func (s *ListOrgCIBuildkiteClustersOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "clusters": - requiredBitSet[0] |= 1 << 1 + case "accountId": if err := func() error { - s.Clusters = make([]OrgCIBuildkiteClusterView, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem OrgCIBuildkiteClusterView - if err := elem.Decode(d); err != nil { - return err - } - s.Clusters = append(s.Clusters, elem) - return nil - }); err != nil { + s.AccountId.Reset() + if err := s.AccountId.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"clusters\"") + return errors.Wrap(err, "decode field \"accountId\"") + } + case "granteeType": + if err := func() error { + s.GranteeType.Reset() + if err := s.GranteeType.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"granteeType\"") + } + case "provider": + if err := func() error { + s.Provider.Reset() + if err := s.Provider.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider\"") + } + case "providerUserId": + if err := func() error { + s.ProviderUserId.Reset() + if err := s.ProviderUserId.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"providerUserId\"") + } + case "role": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + if err := s.Role.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"role\"") } default: var elem jx.Raw @@ -14918,12 +15536,12 @@ func (s *ListOrgCIBuildkiteClustersOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListOrgCIBuildkiteClustersOutputBody") + return errors.Wrap(err, "decode GrantAccessBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00100000, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -14935,8 +15553,8 @@ func (s *ListOrgCIBuildkiteClustersOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListOrgCIBuildkiteClustersOutputBody) { - name = jsonFieldsNameOfListOrgCIBuildkiteClustersOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfGrantAccessBody) { + name = jsonFieldsNameOfGrantAccessBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -14957,27 +15575,27 @@ func (s *ListOrgCIBuildkiteClustersOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListOrgCIBuildkiteClustersOutputBody) MarshalJSON() ([]byte, error) { +func (s *GrantAccessBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListOrgCIBuildkiteClustersOutputBody) UnmarshalJSON(data []byte) error { +func (s *GrantAccessBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListOrgCIBuildkiteClustersOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s GrantAccessBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListOrgCIBuildkiteClustersOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s GrantAccessBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -14987,10 +15605,10 @@ func (s ListOrgCIBuildkiteClustersOutputBodyAdditional) encodeFields(e *jx.Encod } } -// Decode decodes ListOrgCIBuildkiteClustersOutputBodyAdditional from json. -func (s *ListOrgCIBuildkiteClustersOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes GrantAccessBodyAdditional from json. +func (s *GrantAccessBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListOrgCIBuildkiteClustersOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode GrantAccessBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -15008,34 +15626,114 @@ func (s *ListOrgCIBuildkiteClustersOutputBodyAdditional) Decode(d *jx.Decoder) e m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListOrgCIBuildkiteClustersOutputBodyAdditional") + return errors.Wrap(err, "decode GrantAccessBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListOrgCIBuildkiteClustersOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s GrantAccessBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListOrgCIBuildkiteClustersOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *GrantAccessBodyAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes GrantAccessBodyGranteeType as json. +func (s GrantAccessBodyGranteeType) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes GrantAccessBodyGranteeType from json. +func (s *GrantAccessBodyGranteeType) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode GrantAccessBodyGranteeType to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch GrantAccessBodyGranteeType(v) { + case GrantAccessBodyGranteeTypeAccount: + *s = GrantAccessBodyGranteeTypeAccount + default: + *s = GrantAccessBodyGranteeType(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s GrantAccessBodyGranteeType) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *GrantAccessBodyGranteeType) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes GrantAccessBodyRole as json. +func (s GrantAccessBodyRole) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes GrantAccessBodyRole from json. +func (s *GrantAccessBodyRole) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode GrantAccessBodyRole to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch GrantAccessBodyRole(v) { + case GrantAccessBodyRoleReader: + *s = GrantAccessBodyRoleReader + case GrantAccessBodyRoleWriter: + *s = GrantAccessBodyRoleWriter + case GrantAccessBodyRoleAdmin: + *s = GrantAccessBodyRoleAdmin + default: + *s = GrantAccessBodyRole(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s GrantAccessBodyRole) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *GrantAccessBodyRole) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListOrgCIBuildkiteCredentialsOutputBody) Encode(e *jx.Encoder) { +func (s *GrantProjectAccessOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListOrgCIBuildkiteCredentialsOutputBody) encodeFields(e *jx.Encoder) { +func (s *GrantProjectAccessOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -15043,12 +15741,8 @@ func (s *ListOrgCIBuildkiteCredentialsOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("credentials") - e.ArrStart() - for _, elem := range s.Credentials { - elem.Encode(e) - } - e.ArrEnd() + e.FieldStart("status") + e.Str(s.Status) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -15059,15 +15753,15 @@ func (s *ListOrgCIBuildkiteCredentialsOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListOrgCIBuildkiteCredentialsOutputBody = [2]string{ +var jsonFieldsNameOfGrantProjectAccessOutputBody = [2]string{ 0: "$schema", - 1: "credentials", + 1: "status", } -// Decode decodes ListOrgCIBuildkiteCredentialsOutputBody from json. -func (s *ListOrgCIBuildkiteCredentialsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes GrantProjectAccessOutputBody from json. +func (s *GrantProjectAccessOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListOrgCIBuildkiteCredentialsOutputBody to nil") + return errors.New("invalid: unable to decode GrantProjectAccessOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -15084,23 +15778,17 @@ func (s *ListOrgCIBuildkiteCredentialsOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "credentials": + case "status": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Credentials = make([]OrgCIBuildkiteCredentialView, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem OrgCIBuildkiteCredentialView - if err := elem.Decode(d); err != nil { - return err - } - s.Credentials = append(s.Credentials, elem) - return nil - }); err != nil { + v, err := d.Str() + s.Status = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"credentials\"") + return errors.Wrap(err, "decode field \"status\"") } default: var elem jx.Raw @@ -15118,7 +15806,7 @@ func (s *ListOrgCIBuildkiteCredentialsOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListOrgCIBuildkiteCredentialsOutputBody") + return errors.Wrap(err, "decode GrantProjectAccessOutputBody") } // Validate required fields. var failures []validate.FieldError @@ -15135,8 +15823,8 @@ func (s *ListOrgCIBuildkiteCredentialsOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListOrgCIBuildkiteCredentialsOutputBody) { - name = jsonFieldsNameOfListOrgCIBuildkiteCredentialsOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfGrantProjectAccessOutputBody) { + name = jsonFieldsNameOfGrantProjectAccessOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -15157,27 +15845,27 @@ func (s *ListOrgCIBuildkiteCredentialsOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListOrgCIBuildkiteCredentialsOutputBody) MarshalJSON() ([]byte, error) { +func (s *GrantProjectAccessOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListOrgCIBuildkiteCredentialsOutputBody) UnmarshalJSON(data []byte) error { +func (s *GrantProjectAccessOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListOrgCIBuildkiteCredentialsOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s GrantProjectAccessOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListOrgCIBuildkiteCredentialsOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s GrantProjectAccessOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -15187,10 +15875,10 @@ func (s ListOrgCIBuildkiteCredentialsOutputBodyAdditional) encodeFields(e *jx.En } } -// Decode decodes ListOrgCIBuildkiteCredentialsOutputBodyAdditional from json. -func (s *ListOrgCIBuildkiteCredentialsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes GrantProjectAccessOutputBodyAdditional from json. +func (s *GrantProjectAccessOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListOrgCIBuildkiteCredentialsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode GrantProjectAccessOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -15208,34 +15896,34 @@ func (s *ListOrgCIBuildkiteCredentialsOutputBodyAdditional) Decode(d *jx.Decoder m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListOrgCIBuildkiteCredentialsOutputBodyAdditional") + return errors.Wrap(err, "decode GrantProjectAccessOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListOrgCIBuildkiteCredentialsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s GrantProjectAccessOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListOrgCIBuildkiteCredentialsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *GrantProjectAccessOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListOrgMembersOutputBody) Encode(e *jx.Encoder) { +func (s *GrantRepoAccessOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListOrgMembersOutputBody) encodeFields(e *jx.Encoder) { +func (s *GrantRepoAccessOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -15243,18 +15931,8 @@ func (s *ListOrgMembersOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("members") - e.ArrStart() - for _, elem := range s.Members { - elem.Encode(e) - } - e.ArrEnd() - } - { - if s.NextPageToken.Set { - e.FieldStart("nextPageToken") - s.NextPageToken.Encode(e) - } + e.FieldStart("status") + e.Str(s.Status) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -15265,16 +15943,15 @@ func (s *ListOrgMembersOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListOrgMembersOutputBody = [3]string{ +var jsonFieldsNameOfGrantRepoAccessOutputBody = [2]string{ 0: "$schema", - 1: "members", - 2: "nextPageToken", + 1: "status", } -// Decode decodes ListOrgMembersOutputBody from json. -func (s *ListOrgMembersOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes GrantRepoAccessOutputBody from json. +func (s *GrantRepoAccessOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListOrgMembersOutputBody to nil") + return errors.New("invalid: unable to decode GrantRepoAccessOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -15291,33 +15968,17 @@ func (s *ListOrgMembersOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "members": + case "status": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Members = make([]Membership, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem Membership - if err := elem.Decode(d); err != nil { - return err - } - s.Members = append(s.Members, elem) - return nil - }); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"members\"") - } - case "nextPageToken": - if err := func() error { - s.NextPageToken.Reset() - if err := s.NextPageToken.Decode(d); err != nil { + v, err := d.Str() + s.Status = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"nextPageToken\"") + return errors.Wrap(err, "decode field \"status\"") } default: var elem jx.Raw @@ -15335,7 +15996,7 @@ func (s *ListOrgMembersOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListOrgMembersOutputBody") + return errors.Wrap(err, "decode GrantRepoAccessOutputBody") } // Validate required fields. var failures []validate.FieldError @@ -15352,8 +16013,8 @@ func (s *ListOrgMembersOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListOrgMembersOutputBody) { - name = jsonFieldsNameOfListOrgMembersOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfGrantRepoAccessOutputBody) { + name = jsonFieldsNameOfGrantRepoAccessOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -15374,27 +16035,27 @@ func (s *ListOrgMembersOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListOrgMembersOutputBody) MarshalJSON() ([]byte, error) { +func (s *GrantRepoAccessOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListOrgMembersOutputBody) UnmarshalJSON(data []byte) error { +func (s *GrantRepoAccessOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListOrgMembersOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s GrantRepoAccessOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListOrgMembersOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s GrantRepoAccessOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -15404,10 +16065,10 @@ func (s ListOrgMembersOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListOrgMembersOutputBodyAdditional from json. -func (s *ListOrgMembersOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes GrantRepoAccessOutputBodyAdditional from json. +func (s *GrantRepoAccessOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListOrgMembersOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode GrantRepoAccessOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -15425,34 +16086,34 @@ func (s *ListOrgMembersOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListOrgMembersOutputBodyAdditional") + return errors.Wrap(err, "decode GrantRepoAccessOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListOrgMembersOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s GrantRepoAccessOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListOrgMembersOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *GrantRepoAccessOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListOrgProjectsOutputBody) Encode(e *jx.Encoder) { +func (s *GrantServiceAccountAccessInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListOrgProjectsOutputBody) encodeFields(e *jx.Encoder) { +func (s *GrantServiceAccountAccessInputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -15460,26 +16121,16 @@ func (s *ListOrgProjectsOutputBody) encodeFields(e *jx.Encoder) { } } { - if s.NextPageToken.Set { - e.FieldStart("nextPageToken") - s.NextPageToken.Encode(e) - } + e.FieldStart("resourceId") + e.Str(s.ResourceId) } { - if s.Project.Set { - e.FieldStart("project") - s.Project.Encode(e) - } + e.FieldStart("resourceType") + s.ResourceType.Encode(e) } { - if s.Projects != nil { - e.FieldStart("projects") - e.ArrStart() - for _, elem := range s.Projects { - elem.Encode(e) - } - e.ArrEnd() - } + e.FieldStart("role") + s.Role.Encode(e) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -15490,18 +16141,19 @@ func (s *ListOrgProjectsOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListOrgProjectsOutputBody = [4]string{ +var jsonFieldsNameOfGrantServiceAccountAccessInputBody = [4]string{ 0: "$schema", - 1: "nextPageToken", - 2: "project", - 3: "projects", + 1: "resourceId", + 2: "resourceType", + 3: "role", } -// Decode decodes ListOrgProjectsOutputBody from json. -func (s *ListOrgProjectsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes GrantServiceAccountAccessInputBody from json. +func (s *GrantServiceAccountAccessInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListOrgProjectsOutputBody to nil") + return errors.New("invalid: unable to decode GrantServiceAccountAccessInputBody to nil") } + var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -15516,42 +16168,37 @@ func (s *ListOrgProjectsOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "nextPageToken": + case "resourceId": + requiredBitSet[0] |= 1 << 1 if err := func() error { - s.NextPageToken.Reset() - if err := s.NextPageToken.Decode(d); err != nil { + v, err := d.Str() + s.ResourceId = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"nextPageToken\"") + return errors.Wrap(err, "decode field \"resourceId\"") } - case "project": + case "resourceType": + requiredBitSet[0] |= 1 << 2 if err := func() error { - s.Project.Reset() - if err := s.Project.Decode(d); err != nil { + if err := s.ResourceType.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"project\"") + return errors.Wrap(err, "decode field \"resourceType\"") } - case "projects": + case "role": + requiredBitSet[0] |= 1 << 3 if err := func() error { - s.Projects = make([]Project, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem Project - if err := elem.Decode(d); err != nil { - return err - } - s.Projects = append(s.Projects, elem) - return nil - }); err != nil { + if err := s.Role.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"projects\"") + return errors.Wrap(err, "decode field \"role\"") } default: var elem jx.Raw @@ -15569,34 +16216,66 @@ func (s *ListOrgProjectsOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListOrgProjectsOutputBody") + return errors.Wrap(err, "decode GrantServiceAccountAccessInputBody") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00001110, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfGrantServiceAccountAccessInputBody) { + name = jsonFieldsNameOfGrantServiceAccountAccessInputBody[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s *ListOrgProjectsOutputBody) MarshalJSON() ([]byte, error) { +func (s *GrantServiceAccountAccessInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListOrgProjectsOutputBody) UnmarshalJSON(data []byte) error { +func (s *GrantServiceAccountAccessInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListOrgProjectsOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s GrantServiceAccountAccessInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListOrgProjectsOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s GrantServiceAccountAccessInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -15606,10 +16285,10 @@ func (s ListOrgProjectsOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListOrgProjectsOutputBodyAdditional from json. -func (s *ListOrgProjectsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes GrantServiceAccountAccessInputBodyAdditional from json. +func (s *GrantServiceAccountAccessInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListOrgProjectsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode GrantServiceAccountAccessInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -15627,236 +16306,116 @@ func (s *ListOrgProjectsOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListOrgProjectsOutputBodyAdditional") + return errors.Wrap(err, "decode GrantServiceAccountAccessInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListOrgProjectsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s GrantServiceAccountAccessInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListOrgProjectsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *GrantServiceAccountAccessInputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode implements json.Marshaler. -func (s *ListOrgsOutputBody) Encode(e *jx.Encoder) { - e.ObjStart() - s.encodeFields(e) - e.ObjEnd() -} - -// encodeFields encodes fields. -func (s *ListOrgsOutputBody) encodeFields(e *jx.Encoder) { - { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } - } - { - if s.NextPageToken.Set { - e.FieldStart("nextPageToken") - s.NextPageToken.Encode(e) - } - } - { - if s.Org.Set { - e.FieldStart("org") - s.Org.Encode(e) - } - } - { - if s.Orgs != nil { - e.FieldStart("orgs") - e.ArrStart() - for _, elem := range s.Orgs { - elem.Encode(e) - } - e.ArrEnd() - } - } - for k, elem := range s.AdditionalProps { - e.FieldStart(k) - - if len(elem) != 0 { - e.Raw(elem) - } - } -} - -var jsonFieldsNameOfListOrgsOutputBody = [4]string{ - 0: "$schema", - 1: "nextPageToken", - 2: "org", - 3: "orgs", +// Encode encodes GrantServiceAccountAccessInputBodyResourceType as json. +func (s GrantServiceAccountAccessInputBodyResourceType) Encode(e *jx.Encoder) { + e.Str(string(s)) } -// Decode decodes ListOrgsOutputBody from json. -func (s *ListOrgsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes GrantServiceAccountAccessInputBodyResourceType from json. +func (s *GrantServiceAccountAccessInputBodyResourceType) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListOrgsOutputBody to nil") + return errors.New("invalid: unable to decode GrantServiceAccountAccessInputBodyResourceType to nil") } - s.AdditionalProps = map[string]jx.Raw{} - - if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { - switch string(k) { - case "$schema": - if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") - } - case "nextPageToken": - if err := func() error { - s.NextPageToken.Reset() - if err := s.NextPageToken.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"nextPageToken\"") - } - case "org": - if err := func() error { - s.Org.Reset() - if err := s.Org.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"org\"") - } - case "orgs": - if err := func() error { - s.Orgs = make([]Org, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem Org - if err := elem.Decode(d); err != nil { - return err - } - s.Orgs = append(s.Orgs, elem) - return nil - }); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"orgs\"") - } - default: - var elem jx.Raw - if err := func() error { - v, err := d.RawAppend(nil) - elem = jx.Raw(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrapf(err, "decode field %q", k) - } - s.AdditionalProps[string(k)] = elem - } - return nil - }); err != nil { - return errors.Wrap(err, "decode ListOrgsOutputBody") + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch GrantServiceAccountAccessInputBodyResourceType(v) { + case GrantServiceAccountAccessInputBodyResourceTypeRepo: + *s = GrantServiceAccountAccessInputBodyResourceTypeRepo + case GrantServiceAccountAccessInputBodyResourceTypeProject: + *s = GrantServiceAccountAccessInputBodyResourceTypeProject + default: + *s = GrantServiceAccountAccessInputBodyResourceType(v) } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s *ListOrgsOutputBody) MarshalJSON() ([]byte, error) { +func (s GrantServiceAccountAccessInputBodyResourceType) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListOrgsOutputBody) UnmarshalJSON(data []byte) error { +func (s *GrantServiceAccountAccessInputBodyResourceType) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode implements json.Marshaler. -func (s ListOrgsOutputBodyAdditional) Encode(e *jx.Encoder) { - e.ObjStart() - s.encodeFields(e) - e.ObjEnd() -} - -// encodeFields implements json.Marshaler. -func (s ListOrgsOutputBodyAdditional) encodeFields(e *jx.Encoder) { - for k, elem := range s { - e.FieldStart(k) - - if len(elem) != 0 { - e.Raw(elem) - } - } +// Encode encodes GrantServiceAccountAccessInputBodyRole as json. +func (s GrantServiceAccountAccessInputBodyRole) Encode(e *jx.Encoder) { + e.Str(string(s)) } -// Decode decodes ListOrgsOutputBodyAdditional from json. -func (s *ListOrgsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes GrantServiceAccountAccessInputBodyRole from json. +func (s *GrantServiceAccountAccessInputBodyRole) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListOrgsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode GrantServiceAccountAccessInputBodyRole to nil") } - m := s.init() - if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { - var elem jx.Raw - if err := func() error { - v, err := d.RawAppend(nil) - elem = jx.Raw(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrapf(err, "decode field %q", k) - } - m[string(k)] = elem - return nil - }); err != nil { - return errors.Wrap(err, "decode ListOrgsOutputBodyAdditional") + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch GrantServiceAccountAccessInputBodyRole(v) { + case GrantServiceAccountAccessInputBodyRoleReader: + *s = GrantServiceAccountAccessInputBodyRoleReader + case GrantServiceAccountAccessInputBodyRoleWriter: + *s = GrantServiceAccountAccessInputBodyRoleWriter + case GrantServiceAccountAccessInputBodyRoleAdmin: + *s = GrantServiceAccountAccessInputBodyRoleAdmin + default: + *s = GrantServiceAccountAccessInputBodyRole(v) } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListOrgsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s GrantServiceAccountAccessInputBodyRole) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListOrgsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *GrantServiceAccountAccessInputBodyRole) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListProjectMembersOutputBody) Encode(e *jx.Encoder) { +func (s *GrantServiceAccountAccessOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListProjectMembersOutputBody) encodeFields(e *jx.Encoder) { +func (s *GrantServiceAccountAccessOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -15864,18 +16423,8 @@ func (s *ListProjectMembersOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("members") - e.ArrStart() - for _, elem := range s.Members { - elem.Encode(e) - } - e.ArrEnd() - } - { - if s.NextPageToken.Set { - e.FieldStart("nextPageToken") - s.NextPageToken.Encode(e) - } + e.FieldStart("status") + e.Str(s.Status) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -15886,16 +16435,15 @@ func (s *ListProjectMembersOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListProjectMembersOutputBody = [3]string{ +var jsonFieldsNameOfGrantServiceAccountAccessOutputBody = [2]string{ 0: "$schema", - 1: "members", - 2: "nextPageToken", + 1: "status", } -// Decode decodes ListProjectMembersOutputBody from json. -func (s *ListProjectMembersOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes GrantServiceAccountAccessOutputBody from json. +func (s *GrantServiceAccountAccessOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListProjectMembersOutputBody to nil") + return errors.New("invalid: unable to decode GrantServiceAccountAccessOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -15912,33 +16460,17 @@ func (s *ListProjectMembersOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "members": + case "status": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Members = make([]ProjectGrant, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem ProjectGrant - if err := elem.Decode(d); err != nil { - return err - } - s.Members = append(s.Members, elem) - return nil - }); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"members\"") - } - case "nextPageToken": - if err := func() error { - s.NextPageToken.Reset() - if err := s.NextPageToken.Decode(d); err != nil { + v, err := d.Str() + s.Status = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"nextPageToken\"") + return errors.Wrap(err, "decode field \"status\"") } default: var elem jx.Raw @@ -15956,7 +16488,7 @@ func (s *ListProjectMembersOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListProjectMembersOutputBody") + return errors.Wrap(err, "decode GrantServiceAccountAccessOutputBody") } // Validate required fields. var failures []validate.FieldError @@ -15973,8 +16505,8 @@ func (s *ListProjectMembersOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListProjectMembersOutputBody) { - name = jsonFieldsNameOfListProjectMembersOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfGrantServiceAccountAccessOutputBody) { + name = jsonFieldsNameOfGrantServiceAccountAccessOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -15995,27 +16527,27 @@ func (s *ListProjectMembersOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListProjectMembersOutputBody) MarshalJSON() ([]byte, error) { +func (s *GrantServiceAccountAccessOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListProjectMembersOutputBody) UnmarshalJSON(data []byte) error { +func (s *GrantServiceAccountAccessOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListProjectMembersOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s GrantServiceAccountAccessOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListProjectMembersOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s GrantServiceAccountAccessOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -16025,10 +16557,10 @@ func (s ListProjectMembersOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListProjectMembersOutputBodyAdditional from json. -func (s *ListProjectMembersOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes GrantServiceAccountAccessOutputBodyAdditional from json. +func (s *GrantServiceAccountAccessOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListProjectMembersOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode GrantServiceAccountAccessOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -16046,34 +16578,34 @@ func (s *ListProjectMembersOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListProjectMembersOutputBodyAdditional") + return errors.Wrap(err, "decode GrantServiceAccountAccessOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListProjectMembersOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s GrantServiceAccountAccessOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListProjectMembersOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *GrantServiceAccountAccessOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListProjectReposOutputBody) Encode(e *jx.Encoder) { +func (s *Invitation) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListProjectReposOutputBody) encodeFields(e *jx.Encoder) { +func (s *Invitation) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -16081,27 +16613,51 @@ func (s *ListProjectReposOutputBody) encodeFields(e *jx.Encoder) { } } { - if s.NextPageToken.Set { - e.FieldStart("nextPageToken") - s.NextPageToken.Encode(e) + if s.AcceptedAt.Set { + e.FieldStart("acceptedAt") + s.AcceptedAt.Encode(e, json.EncodeDateTime) } } { - if s.Repo.Set { - e.FieldStart("repo") - s.Repo.Encode(e) + if s.AcceptedBy.Set { + e.FieldStart("acceptedBy") + s.AcceptedBy.Encode(e) } } { - if s.Repos != nil { - e.FieldStart("repos") - e.ArrStart() - for _, elem := range s.Repos { - elem.Encode(e) - } - e.ArrEnd() + e.FieldStart("createdAt") + json.EncodeDateTime(e, s.CreatedAt) + } + { + e.FieldStart("email") + e.Str(s.Email) + } + { + e.FieldStart("expiresAt") + json.EncodeDateTime(e, s.ExpiresAt) + } + { + e.FieldStart("id") + e.Str(s.ID) + } + { + e.FieldStart("invitedBy") + e.Str(s.InvitedBy) + } + { + if s.RevokedAt.Set { + e.FieldStart("revokedAt") + s.RevokedAt.Encode(e, json.EncodeDateTime) } } + { + e.FieldStart("role") + e.Str(s.Role) + } + { + e.FieldStart("status") + e.Str(s.Status) + } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -16111,18 +16667,26 @@ func (s *ListProjectReposOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListProjectReposOutputBody = [4]string{ - 0: "$schema", - 1: "nextPageToken", - 2: "repo", - 3: "repos", +var jsonFieldsNameOfInvitation = [11]string{ + 0: "$schema", + 1: "acceptedAt", + 2: "acceptedBy", + 3: "createdAt", + 4: "email", + 5: "expiresAt", + 6: "id", + 7: "invitedBy", + 8: "revokedAt", + 9: "role", + 10: "status", } -// Decode decodes ListProjectReposOutputBody from json. -func (s *ListProjectReposOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes Invitation from json. +func (s *Invitation) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListProjectReposOutputBody to nil") + return errors.New("invalid: unable to decode Invitation to nil") } + var requiredBitSet [2]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -16137,42 +16701,119 @@ func (s *ListProjectReposOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "nextPageToken": + case "acceptedAt": if err := func() error { - s.NextPageToken.Reset() - if err := s.NextPageToken.Decode(d); err != nil { + s.AcceptedAt.Reset() + if err := s.AcceptedAt.Decode(d, json.DecodeDateTime); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"nextPageToken\"") + return errors.Wrap(err, "decode field \"acceptedAt\"") } - case "repo": + case "acceptedBy": if err := func() error { - s.Repo.Reset() - if err := s.Repo.Decode(d); err != nil { + s.AcceptedBy.Reset() + if err := s.AcceptedBy.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"repo\"") + return errors.Wrap(err, "decode field \"acceptedBy\"") } - case "repos": + case "createdAt": + requiredBitSet[0] |= 1 << 3 if err := func() error { - s.Repos = make([]Repo, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem Repo - if err := elem.Decode(d); err != nil { - return err - } - s.Repos = append(s.Repos, elem) - return nil - }); err != nil { + v, err := json.DecodeDateTime(d) + s.CreatedAt = v + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"repos\"") + return errors.Wrap(err, "decode field \"createdAt\"") + } + case "email": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + v, err := d.Str() + s.Email = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"email\"") + } + case "expiresAt": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.ExpiresAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"expiresAt\"") + } + case "id": + requiredBitSet[0] |= 1 << 6 + if err := func() error { + v, err := d.Str() + s.ID = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"id\"") + } + case "invitedBy": + requiredBitSet[0] |= 1 << 7 + if err := func() error { + v, err := d.Str() + s.InvitedBy = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"invitedBy\"") + } + case "revokedAt": + if err := func() error { + s.RevokedAt.Reset() + if err := s.RevokedAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"revokedAt\"") + } + case "role": + requiredBitSet[1] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.Role = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"role\"") + } + case "status": + requiredBitSet[1] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.Status = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"status\"") } default: var elem jx.Raw @@ -16190,34 +16831,67 @@ func (s *ListProjectReposOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListProjectReposOutputBody") + return errors.Wrap(err, "decode Invitation") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [2]uint8{ + 0b11111000, + 0b00000110, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfInvitation) { + name = jsonFieldsNameOfInvitation[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s *ListProjectReposOutputBody) MarshalJSON() ([]byte, error) { +func (s *Invitation) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListProjectReposOutputBody) UnmarshalJSON(data []byte) error { +func (s *Invitation) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListProjectReposOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s InvitationAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListProjectReposOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s InvitationAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -16227,10 +16901,10 @@ func (s ListProjectReposOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListProjectReposOutputBodyAdditional from json. -func (s *ListProjectReposOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes InvitationAdditional from json. +func (s *InvitationAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListProjectReposOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode InvitationAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -16248,34 +16922,34 @@ func (s *ListProjectReposOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListProjectReposOutputBodyAdditional") + return errors.Wrap(err, "decode InvitationAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListProjectReposOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s InvitationAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListProjectReposOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *InvitationAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListProjectsOutputBody) Encode(e *jx.Encoder) { +func (s *ListAuditEventsOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListProjectsOutputBody) encodeFields(e *jx.Encoder) { +func (s *ListAuditEventsOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -16283,25 +16957,17 @@ func (s *ListProjectsOutputBody) encodeFields(e *jx.Encoder) { } } { - if s.NextPageToken.Set { - e.FieldStart("nextPageToken") - s.NextPageToken.Encode(e) - } - } - { - if s.Project.Set { - e.FieldStart("project") - s.Project.Encode(e) + e.FieldStart("events") + e.ArrStart() + for _, elem := range s.Events { + elem.Encode(e) } + e.ArrEnd() } { - if s.Projects != nil { - e.FieldStart("projects") - e.ArrStart() - for _, elem := range s.Projects { - elem.Encode(e) - } - e.ArrEnd() + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) } } for k, elem := range s.AdditionalProps { @@ -16313,18 +16979,18 @@ func (s *ListProjectsOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListProjectsOutputBody = [4]string{ +var jsonFieldsNameOfListAuditEventsOutputBody = [3]string{ 0: "$schema", - 1: "nextPageToken", - 2: "project", - 3: "projects", + 1: "events", + 2: "nextPageToken", } -// Decode decodes ListProjectsOutputBody from json. -func (s *ListProjectsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes ListAuditEventsOutputBody from json. +func (s *ListAuditEventsOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListProjectsOutputBody to nil") + return errors.New("invalid: unable to decode ListAuditEventsOutputBody to nil") } + var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -16339,42 +17005,33 @@ func (s *ListProjectsOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "nextPageToken": - if err := func() error { - s.NextPageToken.Reset() - if err := s.NextPageToken.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"nextPageToken\"") - } - case "project": - if err := func() error { - s.Project.Reset() - if err := s.Project.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"project\"") - } - case "projects": + case "events": + requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Projects = make([]Project, 0) + s.Events = make([]AuditEvent, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem Project + var elem AuditEvent if err := elem.Decode(d); err != nil { return err } - s.Projects = append(s.Projects, elem) + s.Events = append(s.Events, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"projects\"") + return errors.Wrap(err, "decode field \"events\"") + } + case "nextPageToken": + if err := func() error { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"nextPageToken\"") } default: var elem jx.Raw @@ -16392,34 +17049,66 @@ func (s *ListProjectsOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListProjectsOutputBody") + return errors.Wrap(err, "decode ListAuditEventsOutputBody") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00000010, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfListAuditEventsOutputBody) { + name = jsonFieldsNameOfListAuditEventsOutputBody[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s *ListProjectsOutputBody) MarshalJSON() ([]byte, error) { +func (s *ListAuditEventsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListProjectsOutputBody) UnmarshalJSON(data []byte) error { +func (s *ListAuditEventsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListProjectsOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s ListAuditEventsOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListProjectsOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ListAuditEventsOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -16429,10 +17118,10 @@ func (s ListProjectsOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListProjectsOutputBodyAdditional from json. -func (s *ListProjectsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListAuditEventsOutputBodyAdditional from json. +func (s *ListAuditEventsOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListProjectsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode ListAuditEventsOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -16450,34 +17139,34 @@ func (s *ListProjectsOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListProjectsOutputBodyAdditional") + return errors.Wrap(err, "decode ListAuditEventsOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListProjectsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ListAuditEventsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListProjectsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ListAuditEventsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListRepoCIBuildsOutputBody) Encode(e *jx.Encoder) { +func (s *ListAvailableMirrorsOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListRepoCIBuildsOutputBody) encodeFields(e *jx.Encoder) { +func (s *ListAvailableMirrorsOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -16485,13 +17174,17 @@ func (s *ListRepoCIBuildsOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("builds") + e.FieldStart("available") e.ArrStart() - for _, elem := range s.Builds { + for _, elem := range s.Available { elem.Encode(e) } e.ArrEnd() } + { + e.FieldStart("githubInstallations") + s.GithubInstallations.Encode(e) + } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -16501,15 +17194,16 @@ func (s *ListRepoCIBuildsOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListRepoCIBuildsOutputBody = [2]string{ +var jsonFieldsNameOfListAvailableMirrorsOutputBody = [3]string{ 0: "$schema", - 1: "builds", + 1: "available", + 2: "githubInstallations", } -// Decode decodes ListRepoCIBuildsOutputBody from json. -func (s *ListRepoCIBuildsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes ListAvailableMirrorsOutputBody from json. +func (s *ListAvailableMirrorsOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListRepoCIBuildsOutputBody to nil") + return errors.New("invalid: unable to decode ListAvailableMirrorsOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -16526,23 +17220,33 @@ func (s *ListRepoCIBuildsOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "builds": + case "available": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Builds = make([]CIBuildView, 0) + s.Available = make([]AvailableMirror, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem CIBuildView + var elem AvailableMirror if err := elem.Decode(d); err != nil { return err } - s.Builds = append(s.Builds, elem) + s.Available = append(s.Available, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"builds\"") + return errors.Wrap(err, "decode field \"available\"") + } + case "githubInstallations": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + if err := s.GithubInstallations.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"githubInstallations\"") } default: var elem jx.Raw @@ -16560,12 +17264,12 @@ func (s *ListRepoCIBuildsOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListRepoCIBuildsOutputBody") + return errors.Wrap(err, "decode ListAvailableMirrorsOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00000110, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -16577,8 +17281,8 @@ func (s *ListRepoCIBuildsOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListRepoCIBuildsOutputBody) { - name = jsonFieldsNameOfListRepoCIBuildsOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListAvailableMirrorsOutputBody) { + name = jsonFieldsNameOfListAvailableMirrorsOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -16599,27 +17303,27 @@ func (s *ListRepoCIBuildsOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListRepoCIBuildsOutputBody) MarshalJSON() ([]byte, error) { +func (s *ListAvailableMirrorsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListRepoCIBuildsOutputBody) UnmarshalJSON(data []byte) error { +func (s *ListAvailableMirrorsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListRepoCIBuildsOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s ListAvailableMirrorsOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListRepoCIBuildsOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ListAvailableMirrorsOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -16629,10 +17333,10 @@ func (s ListRepoCIBuildsOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListRepoCIBuildsOutputBodyAdditional from json. -func (s *ListRepoCIBuildsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListAvailableMirrorsOutputBodyAdditional from json. +func (s *ListAvailableMirrorsOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListRepoCIBuildsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode ListAvailableMirrorsOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -16650,34 +17354,34 @@ func (s *ListRepoCIBuildsOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListRepoCIBuildsOutputBodyAdditional") + return errors.Wrap(err, "decode ListAvailableMirrorsOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListRepoCIBuildsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ListAvailableMirrorsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListRepoCIBuildsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ListAvailableMirrorsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListRepoCIProvidersOutputBody) Encode(e *jx.Encoder) { +func (s *ListBindingsOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListRepoCIProvidersOutputBody) encodeFields(e *jx.Encoder) { +func (s *ListBindingsOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -16685,13 +17389,19 @@ func (s *ListRepoCIProvidersOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("providers") + e.FieldStart("bindings") e.ArrStart() - for _, elem := range s.Providers { + for _, elem := range s.Bindings { elem.Encode(e) } e.ArrEnd() } + { + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) + } + } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -16701,15 +17411,16 @@ func (s *ListRepoCIProvidersOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListRepoCIProvidersOutputBody = [2]string{ +var jsonFieldsNameOfListBindingsOutputBody = [3]string{ 0: "$schema", - 1: "providers", + 1: "bindings", + 2: "nextPageToken", } -// Decode decodes ListRepoCIProvidersOutputBody from json. -func (s *ListRepoCIProvidersOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes ListBindingsOutputBody from json. +func (s *ListBindingsOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListRepoCIProvidersOutputBody to nil") + return errors.New("invalid: unable to decode ListBindingsOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -16726,23 +17437,33 @@ func (s *ListRepoCIProvidersOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "providers": + case "bindings": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Providers = make([]CIProviderDescriptor, 0) + s.Bindings = make([]Binding, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem CIProviderDescriptor + var elem Binding if err := elem.Decode(d); err != nil { return err } - s.Providers = append(s.Providers, elem) + s.Bindings = append(s.Bindings, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"providers\"") + return errors.Wrap(err, "decode field \"bindings\"") + } + case "nextPageToken": + if err := func() error { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"nextPageToken\"") } default: var elem jx.Raw @@ -16760,7 +17481,7 @@ func (s *ListRepoCIProvidersOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListRepoCIProvidersOutputBody") + return errors.Wrap(err, "decode ListBindingsOutputBody") } // Validate required fields. var failures []validate.FieldError @@ -16777,8 +17498,8 @@ func (s *ListRepoCIProvidersOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListRepoCIProvidersOutputBody) { - name = jsonFieldsNameOfListRepoCIProvidersOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListBindingsOutputBody) { + name = jsonFieldsNameOfListBindingsOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -16799,27 +17520,27 @@ func (s *ListRepoCIProvidersOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListRepoCIProvidersOutputBody) MarshalJSON() ([]byte, error) { +func (s *ListBindingsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListRepoCIProvidersOutputBody) UnmarshalJSON(data []byte) error { +func (s *ListBindingsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListRepoCIProvidersOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s ListBindingsOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListRepoCIProvidersOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ListBindingsOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -16829,10 +17550,10 @@ func (s ListRepoCIProvidersOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListRepoCIProvidersOutputBodyAdditional from json. -func (s *ListRepoCIProvidersOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListBindingsOutputBodyAdditional from json. +func (s *ListBindingsOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListRepoCIProvidersOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode ListBindingsOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -16850,34 +17571,34 @@ func (s *ListRepoCIProvidersOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListRepoCIProvidersOutputBodyAdditional") + return errors.Wrap(err, "decode ListBindingsOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListRepoCIProvidersOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ListBindingsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListRepoCIProvidersOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ListBindingsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListRepoCIWebhookAuditOutputBody) Encode(e *jx.Encoder) { +func (s *ListClustersOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListRepoCIWebhookAuditOutputBody) encodeFields(e *jx.Encoder) { +func (s *ListClustersOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -16885,9 +17606,9 @@ func (s *ListRepoCIWebhookAuditOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("events") + e.FieldStart("clusters") e.ArrStart() - for _, elem := range s.Events { + for _, elem := range s.Clusters { elem.Encode(e) } e.ArrEnd() @@ -16901,15 +17622,15 @@ func (s *ListRepoCIWebhookAuditOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListRepoCIWebhookAuditOutputBody = [2]string{ +var jsonFieldsNameOfListClustersOutputBody = [2]string{ 0: "$schema", - 1: "events", + 1: "clusters", } -// Decode decodes ListRepoCIWebhookAuditOutputBody from json. -func (s *ListRepoCIWebhookAuditOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes ListClustersOutputBody from json. +func (s *ListClustersOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListRepoCIWebhookAuditOutputBody to nil") + return errors.New("invalid: unable to decode ListClustersOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -16926,23 +17647,23 @@ func (s *ListRepoCIWebhookAuditOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "events": + case "clusters": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Events = make([]CIWebhookAuditEventView, 0) + s.Clusters = make([]Cluster, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem CIWebhookAuditEventView + var elem Cluster if err := elem.Decode(d); err != nil { return err } - s.Events = append(s.Events, elem) + s.Clusters = append(s.Clusters, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"events\"") + return errors.Wrap(err, "decode field \"clusters\"") } default: var elem jx.Raw @@ -16960,7 +17681,7 @@ func (s *ListRepoCIWebhookAuditOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListRepoCIWebhookAuditOutputBody") + return errors.Wrap(err, "decode ListClustersOutputBody") } // Validate required fields. var failures []validate.FieldError @@ -16977,8 +17698,8 @@ func (s *ListRepoCIWebhookAuditOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListRepoCIWebhookAuditOutputBody) { - name = jsonFieldsNameOfListRepoCIWebhookAuditOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListClustersOutputBody) { + name = jsonFieldsNameOfListClustersOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -16999,27 +17720,27 @@ func (s *ListRepoCIWebhookAuditOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListRepoCIWebhookAuditOutputBody) MarshalJSON() ([]byte, error) { +func (s *ListClustersOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListRepoCIWebhookAuditOutputBody) UnmarshalJSON(data []byte) error { +func (s *ListClustersOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListRepoCIWebhookAuditOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s ListClustersOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListRepoCIWebhookAuditOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ListClustersOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -17029,10 +17750,10 @@ func (s ListRepoCIWebhookAuditOutputBodyAdditional) encodeFields(e *jx.Encoder) } } -// Decode decodes ListRepoCIWebhookAuditOutputBodyAdditional from json. -func (s *ListRepoCIWebhookAuditOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListClustersOutputBodyAdditional from json. +func (s *ListClustersOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListRepoCIWebhookAuditOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode ListClustersOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -17050,34 +17771,34 @@ func (s *ListRepoCIWebhookAuditOutputBodyAdditional) Decode(d *jx.Decoder) error m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListRepoCIWebhookAuditOutputBodyAdditional") + return errors.Wrap(err, "decode ListClustersOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListRepoCIWebhookAuditOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ListClustersOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListRepoCIWebhookAuditOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ListClustersOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListRepoCIWebhooksOutputBody) Encode(e *jx.Encoder) { +func (s *ListMirrorCollaboratorsOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListRepoCIWebhooksOutputBody) encodeFields(e *jx.Encoder) { +func (s *ListMirrorCollaboratorsOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -17085,9 +17806,9 @@ func (s *ListRepoCIWebhooksOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("subscriptions") + e.FieldStart("collaborators") e.ArrStart() - for _, elem := range s.Subscriptions { + for _, elem := range s.Collaborators { elem.Encode(e) } e.ArrEnd() @@ -17101,15 +17822,15 @@ func (s *ListRepoCIWebhooksOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListRepoCIWebhooksOutputBody = [2]string{ +var jsonFieldsNameOfListMirrorCollaboratorsOutputBody = [2]string{ 0: "$schema", - 1: "subscriptions", + 1: "collaborators", } -// Decode decodes ListRepoCIWebhooksOutputBody from json. -func (s *ListRepoCIWebhooksOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes ListMirrorCollaboratorsOutputBody from json. +func (s *ListMirrorCollaboratorsOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListRepoCIWebhooksOutputBody to nil") + return errors.New("invalid: unable to decode ListMirrorCollaboratorsOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -17126,23 +17847,23 @@ func (s *ListRepoCIWebhooksOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "subscriptions": + case "collaborators": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Subscriptions = make([]CIWebhookView, 0) + s.Collaborators = make([]MirrorCollaborator, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem CIWebhookView + var elem MirrorCollaborator if err := elem.Decode(d); err != nil { return err } - s.Subscriptions = append(s.Subscriptions, elem) + s.Collaborators = append(s.Collaborators, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"subscriptions\"") + return errors.Wrap(err, "decode field \"collaborators\"") } default: var elem jx.Raw @@ -17160,7 +17881,7 @@ func (s *ListRepoCIWebhooksOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListRepoCIWebhooksOutputBody") + return errors.Wrap(err, "decode ListMirrorCollaboratorsOutputBody") } // Validate required fields. var failures []validate.FieldError @@ -17177,8 +17898,8 @@ func (s *ListRepoCIWebhooksOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListRepoCIWebhooksOutputBody) { - name = jsonFieldsNameOfListRepoCIWebhooksOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListMirrorCollaboratorsOutputBody) { + name = jsonFieldsNameOfListMirrorCollaboratorsOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -17199,27 +17920,27 @@ func (s *ListRepoCIWebhooksOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListRepoCIWebhooksOutputBody) MarshalJSON() ([]byte, error) { +func (s *ListMirrorCollaboratorsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListRepoCIWebhooksOutputBody) UnmarshalJSON(data []byte) error { +func (s *ListMirrorCollaboratorsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListRepoCIWebhooksOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s ListMirrorCollaboratorsOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListRepoCIWebhooksOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ListMirrorCollaboratorsOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -17229,10 +17950,10 @@ func (s ListRepoCIWebhooksOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListRepoCIWebhooksOutputBodyAdditional from json. -func (s *ListRepoCIWebhooksOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListMirrorCollaboratorsOutputBodyAdditional from json. +func (s *ListMirrorCollaboratorsOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListRepoCIWebhooksOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode ListMirrorCollaboratorsOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -17250,34 +17971,34 @@ func (s *ListRepoCIWebhooksOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListRepoCIWebhooksOutputBodyAdditional") + return errors.Wrap(err, "decode ListMirrorCollaboratorsOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListRepoCIWebhooksOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ListMirrorCollaboratorsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListRepoCIWebhooksOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ListMirrorCollaboratorsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListRepoCollaboratorsOutputBody) Encode(e *jx.Encoder) { +func (s *ListMirrorsOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListRepoCollaboratorsOutputBody) encodeFields(e *jx.Encoder) { +func (s *ListMirrorsOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -17285,9 +18006,9 @@ func (s *ListRepoCollaboratorsOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("collaborators") + e.FieldStart("mirrors") e.ArrStart() - for _, elem := range s.Collaborators { + for _, elem := range s.Mirrors { elem.Encode(e) } e.ArrEnd() @@ -17307,16 +18028,16 @@ func (s *ListRepoCollaboratorsOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListRepoCollaboratorsOutputBody = [3]string{ +var jsonFieldsNameOfListMirrorsOutputBody = [3]string{ 0: "$schema", - 1: "collaborators", + 1: "mirrors", 2: "nextPageToken", } -// Decode decodes ListRepoCollaboratorsOutputBody from json. -func (s *ListRepoCollaboratorsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes ListMirrorsOutputBody from json. +func (s *ListMirrorsOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListRepoCollaboratorsOutputBody to nil") + return errors.New("invalid: unable to decode ListMirrorsOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -17333,23 +18054,23 @@ func (s *ListRepoCollaboratorsOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "collaborators": + case "mirrors": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Collaborators = make([]RepoCollaborator, 0) + s.Mirrors = make([]Mirror, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem RepoCollaborator + var elem Mirror if err := elem.Decode(d); err != nil { return err } - s.Collaborators = append(s.Collaborators, elem) + s.Mirrors = append(s.Mirrors, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"collaborators\"") + return errors.Wrap(err, "decode field \"mirrors\"") } case "nextPageToken": if err := func() error { @@ -17377,7 +18098,7 @@ func (s *ListRepoCollaboratorsOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListRepoCollaboratorsOutputBody") + return errors.Wrap(err, "decode ListMirrorsOutputBody") } // Validate required fields. var failures []validate.FieldError @@ -17394,8 +18115,8 @@ func (s *ListRepoCollaboratorsOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListRepoCollaboratorsOutputBody) { - name = jsonFieldsNameOfListRepoCollaboratorsOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListMirrorsOutputBody) { + name = jsonFieldsNameOfListMirrorsOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -17416,27 +18137,27 @@ func (s *ListRepoCollaboratorsOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListRepoCollaboratorsOutputBody) MarshalJSON() ([]byte, error) { +func (s *ListMirrorsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListRepoCollaboratorsOutputBody) UnmarshalJSON(data []byte) error { +func (s *ListMirrorsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListRepoCollaboratorsOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s ListMirrorsOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListRepoCollaboratorsOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ListMirrorsOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -17446,10 +18167,10 @@ func (s ListRepoCollaboratorsOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListRepoCollaboratorsOutputBodyAdditional from json. -func (s *ListRepoCollaboratorsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListMirrorsOutputBodyAdditional from json. +func (s *ListMirrorsOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListRepoCollaboratorsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode ListMirrorsOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -17467,34 +18188,34 @@ func (s *ListRepoCollaboratorsOutputBodyAdditional) Decode(d *jx.Decoder) error m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListRepoCollaboratorsOutputBodyAdditional") + return errors.Wrap(err, "decode ListMirrorsOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListRepoCollaboratorsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ListMirrorsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListRepoCollaboratorsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ListMirrorsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListRepoGrantsOutputBody) Encode(e *jx.Encoder) { +func (s *ListNativeMirrorsOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListRepoGrantsOutputBody) encodeFields(e *jx.Encoder) { +func (s *ListNativeMirrorsOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -17502,19 +18223,13 @@ func (s *ListRepoGrantsOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("grants") + e.FieldStart("nativeMirrors") e.ArrStart() - for _, elem := range s.Grants { + for _, elem := range s.NativeMirrors { elem.Encode(e) } e.ArrEnd() } - { - if s.NextPageToken.Set { - e.FieldStart("nextPageToken") - s.NextPageToken.Encode(e) - } - } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -17524,16 +18239,15 @@ func (s *ListRepoGrantsOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListRepoGrantsOutputBody = [3]string{ +var jsonFieldsNameOfListNativeMirrorsOutputBody = [2]string{ 0: "$schema", - 1: "grants", - 2: "nextPageToken", + 1: "nativeMirrors", } -// Decode decodes ListRepoGrantsOutputBody from json. -func (s *ListRepoGrantsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes ListNativeMirrorsOutputBody from json. +func (s *ListNativeMirrorsOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListRepoGrantsOutputBody to nil") + return errors.New("invalid: unable to decode ListNativeMirrorsOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -17550,33 +18264,23 @@ func (s *ListRepoGrantsOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "grants": + case "nativeMirrors": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Grants = make([]RepoGrant, 0) + s.NativeMirrors = make([]NativeMirrorPlacement, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem RepoGrant + var elem NativeMirrorPlacement if err := elem.Decode(d); err != nil { return err } - s.Grants = append(s.Grants, elem) + s.NativeMirrors = append(s.NativeMirrors, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"grants\"") - } - case "nextPageToken": - if err := func() error { - s.NextPageToken.Reset() - if err := s.NextPageToken.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"nextPageToken\"") + return errors.Wrap(err, "decode field \"nativeMirrors\"") } default: var elem jx.Raw @@ -17594,7 +18298,7 @@ func (s *ListRepoGrantsOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListRepoGrantsOutputBody") + return errors.Wrap(err, "decode ListNativeMirrorsOutputBody") } // Validate required fields. var failures []validate.FieldError @@ -17611,8 +18315,8 @@ func (s *ListRepoGrantsOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListRepoGrantsOutputBody) { - name = jsonFieldsNameOfListRepoGrantsOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListNativeMirrorsOutputBody) { + name = jsonFieldsNameOfListNativeMirrorsOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -17633,27 +18337,27 @@ func (s *ListRepoGrantsOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListRepoGrantsOutputBody) MarshalJSON() ([]byte, error) { +func (s *ListNativeMirrorsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListRepoGrantsOutputBody) UnmarshalJSON(data []byte) error { +func (s *ListNativeMirrorsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListRepoGrantsOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s ListNativeMirrorsOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListRepoGrantsOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ListNativeMirrorsOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -17663,10 +18367,10 @@ func (s ListRepoGrantsOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListRepoGrantsOutputBodyAdditional from json. -func (s *ListRepoGrantsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListNativeMirrorsOutputBodyAdditional from json. +func (s *ListNativeMirrorsOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListRepoGrantsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode ListNativeMirrorsOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -17684,46 +18388,40 @@ func (s *ListRepoGrantsOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListRepoGrantsOutputBodyAdditional") + return errors.Wrap(err, "decode ListNativeMirrorsOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListRepoGrantsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ListNativeMirrorsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListRepoGrantsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ListNativeMirrorsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListReposOutputBody) Encode(e *jx.Encoder) { +func (s *ListOIDCProvidersOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListReposOutputBody) encodeFields(e *jx.Encoder) { +func (s *ListOIDCProvidersOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") s.Schema.Encode(e) } } - { - if s.CandidatesIncomplete.Set { - e.FieldStart("candidatesIncomplete") - s.CandidatesIncomplete.Encode(e) - } - } { if s.NextPageToken.Set { e.FieldStart("nextPageToken") @@ -17731,17 +18429,13 @@ func (s *ListReposOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("repos") + e.FieldStart("providers") e.ArrStart() - for _, elem := range s.Repos { + for _, elem := range s.Providers { elem.Encode(e) } e.ArrEnd() } - { - e.FieldStart("truncated") - e.Bool(s.Truncated) - } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -17751,18 +18445,16 @@ func (s *ListReposOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListReposOutputBody = [5]string{ +var jsonFieldsNameOfListOIDCProvidersOutputBody = [3]string{ 0: "$schema", - 1: "candidatesIncomplete", - 2: "nextPageToken", - 3: "repos", - 4: "truncated", + 1: "nextPageToken", + 2: "providers", } -// Decode decodes ListReposOutputBody from json. -func (s *ListReposOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes ListOIDCProvidersOutputBody from json. +func (s *ListOIDCProvidersOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListReposOutputBody to nil") + return errors.New("invalid: unable to decode ListOIDCProvidersOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -17779,16 +18471,6 @@ func (s *ListReposOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "candidatesIncomplete": - if err := func() error { - s.CandidatesIncomplete.Reset() - if err := s.CandidatesIncomplete.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"candidatesIncomplete\"") - } case "nextPageToken": if err := func() error { s.NextPageToken.Reset() @@ -17799,35 +18481,23 @@ func (s *ListReposOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"nextPageToken\"") } - case "repos": - requiredBitSet[0] |= 1 << 3 + case "providers": + requiredBitSet[0] |= 1 << 2 if err := func() error { - s.Repos = make([]RepoIndexEntry, 0) + s.Providers = make([]OIDCProvider, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem RepoIndexEntry + var elem OIDCProvider if err := elem.Decode(d); err != nil { return err } - s.Repos = append(s.Repos, elem) + s.Providers = append(s.Providers, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"repos\"") - } - case "truncated": - requiredBitSet[0] |= 1 << 4 - if err := func() error { - v, err := d.Bool() - s.Truncated = bool(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"truncated\"") + return errors.Wrap(err, "decode field \"providers\"") } default: var elem jx.Raw @@ -17845,12 +18515,12 @@ func (s *ListReposOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListReposOutputBody") + return errors.Wrap(err, "decode ListOIDCProvidersOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00011000, + 0b00000100, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -17862,8 +18532,8 @@ func (s *ListReposOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListReposOutputBody) { - name = jsonFieldsNameOfListReposOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListOIDCProvidersOutputBody) { + name = jsonFieldsNameOfListOIDCProvidersOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -17884,27 +18554,27 @@ func (s *ListReposOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListReposOutputBody) MarshalJSON() ([]byte, error) { +func (s *ListOIDCProvidersOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListReposOutputBody) UnmarshalJSON(data []byte) error { +func (s *ListOIDCProvidersOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListReposOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s ListOIDCProvidersOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListReposOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ListOIDCProvidersOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -17914,10 +18584,10 @@ func (s ListReposOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListReposOutputBodyAdditional from json. -func (s *ListReposOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListOIDCProvidersOutputBodyAdditional from json. +func (s *ListOIDCProvidersOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListReposOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode ListOIDCProvidersOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -17935,34 +18605,34 @@ func (s *ListReposOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListReposOutputBodyAdditional") + return errors.Wrap(err, "decode ListOIDCProvidersOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListReposOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ListOIDCProvidersOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListReposOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ListOIDCProvidersOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListServiceAccountGrantsOutputBody) Encode(e *jx.Encoder) { +func (s *ListOrgCIBuildkiteClustersOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListServiceAccountGrantsOutputBody) encodeFields(e *jx.Encoder) { +func (s *ListOrgCIBuildkiteClustersOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -17970,19 +18640,13 @@ func (s *ListServiceAccountGrantsOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("grants") + e.FieldStart("clusters") e.ArrStart() - for _, elem := range s.Grants { + for _, elem := range s.Clusters { elem.Encode(e) } e.ArrEnd() } - { - if s.NextPageToken.Set { - e.FieldStart("nextPageToken") - s.NextPageToken.Encode(e) - } - } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -17992,16 +18656,15 @@ func (s *ListServiceAccountGrantsOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListServiceAccountGrantsOutputBody = [3]string{ +var jsonFieldsNameOfListOrgCIBuildkiteClustersOutputBody = [2]string{ 0: "$schema", - 1: "grants", - 2: "nextPageToken", + 1: "clusters", } -// Decode decodes ListServiceAccountGrantsOutputBody from json. -func (s *ListServiceAccountGrantsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes ListOrgCIBuildkiteClustersOutputBody from json. +func (s *ListOrgCIBuildkiteClustersOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListServiceAccountGrantsOutputBody to nil") + return errors.New("invalid: unable to decode ListOrgCIBuildkiteClustersOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -18018,33 +18681,23 @@ func (s *ListServiceAccountGrantsOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "grants": + case "clusters": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Grants = make([]ServiceAccountGrant, 0) + s.Clusters = make([]OrgCIBuildkiteClusterView, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem ServiceAccountGrant + var elem OrgCIBuildkiteClusterView if err := elem.Decode(d); err != nil { return err } - s.Grants = append(s.Grants, elem) + s.Clusters = append(s.Clusters, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"grants\"") - } - case "nextPageToken": - if err := func() error { - s.NextPageToken.Reset() - if err := s.NextPageToken.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"nextPageToken\"") + return errors.Wrap(err, "decode field \"clusters\"") } default: var elem jx.Raw @@ -18062,7 +18715,7 @@ func (s *ListServiceAccountGrantsOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListServiceAccountGrantsOutputBody") + return errors.Wrap(err, "decode ListOrgCIBuildkiteClustersOutputBody") } // Validate required fields. var failures []validate.FieldError @@ -18079,8 +18732,8 @@ func (s *ListServiceAccountGrantsOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListServiceAccountGrantsOutputBody) { - name = jsonFieldsNameOfListServiceAccountGrantsOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListOrgCIBuildkiteClustersOutputBody) { + name = jsonFieldsNameOfListOrgCIBuildkiteClustersOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -18101,27 +18754,27 @@ func (s *ListServiceAccountGrantsOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListServiceAccountGrantsOutputBody) MarshalJSON() ([]byte, error) { +func (s *ListOrgCIBuildkiteClustersOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListServiceAccountGrantsOutputBody) UnmarshalJSON(data []byte) error { +func (s *ListOrgCIBuildkiteClustersOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListServiceAccountGrantsOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s ListOrgCIBuildkiteClustersOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListServiceAccountGrantsOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ListOrgCIBuildkiteClustersOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -18131,10 +18784,10 @@ func (s ListServiceAccountGrantsOutputBodyAdditional) encodeFields(e *jx.Encoder } } -// Decode decodes ListServiceAccountGrantsOutputBodyAdditional from json. -func (s *ListServiceAccountGrantsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListOrgCIBuildkiteClustersOutputBodyAdditional from json. +func (s *ListOrgCIBuildkiteClustersOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListServiceAccountGrantsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode ListOrgCIBuildkiteClustersOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -18152,34 +18805,34 @@ func (s *ListServiceAccountGrantsOutputBodyAdditional) Decode(d *jx.Decoder) err m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListServiceAccountGrantsOutputBodyAdditional") + return errors.Wrap(err, "decode ListOrgCIBuildkiteClustersOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListServiceAccountGrantsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ListOrgCIBuildkiteClustersOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListServiceAccountGrantsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ListOrgCIBuildkiteClustersOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ListServiceAccountsOutputBody) Encode(e *jx.Encoder) { +func (s *ListOrgCIBuildkiteCredentialsOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ListServiceAccountsOutputBody) encodeFields(e *jx.Encoder) { +func (s *ListOrgCIBuildkiteCredentialsOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -18187,15 +18840,9 @@ func (s *ListServiceAccountsOutputBody) encodeFields(e *jx.Encoder) { } } { - if s.NextPageToken.Set { - e.FieldStart("nextPageToken") - s.NextPageToken.Encode(e) - } - } - { - e.FieldStart("serviceAccounts") + e.FieldStart("credentials") e.ArrStart() - for _, elem := range s.ServiceAccounts { + for _, elem := range s.Credentials { elem.Encode(e) } e.ArrEnd() @@ -18209,16 +18856,15 @@ func (s *ListServiceAccountsOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfListServiceAccountsOutputBody = [3]string{ +var jsonFieldsNameOfListOrgCIBuildkiteCredentialsOutputBody = [2]string{ 0: "$schema", - 1: "nextPageToken", - 2: "serviceAccounts", + 1: "credentials", } -// Decode decodes ListServiceAccountsOutputBody from json. -func (s *ListServiceAccountsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes ListOrgCIBuildkiteCredentialsOutputBody from json. +func (s *ListOrgCIBuildkiteCredentialsOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListServiceAccountsOutputBody to nil") + return errors.New("invalid: unable to decode ListOrgCIBuildkiteCredentialsOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -18235,33 +18881,23 @@ func (s *ListServiceAccountsOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "nextPageToken": - if err := func() error { - s.NextPageToken.Reset() - if err := s.NextPageToken.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"nextPageToken\"") - } - case "serviceAccounts": - requiredBitSet[0] |= 1 << 2 + case "credentials": + requiredBitSet[0] |= 1 << 1 if err := func() error { - s.ServiceAccounts = make([]ServiceAccountWithGrants, 0) + s.Credentials = make([]OrgCIBuildkiteCredentialView, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem ServiceAccountWithGrants + var elem OrgCIBuildkiteCredentialView if err := elem.Decode(d); err != nil { return err } - s.ServiceAccounts = append(s.ServiceAccounts, elem) + s.Credentials = append(s.Credentials, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"serviceAccounts\"") + return errors.Wrap(err, "decode field \"credentials\"") } default: var elem jx.Raw @@ -18279,12 +18915,12 @@ func (s *ListServiceAccountsOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ListServiceAccountsOutputBody") + return errors.Wrap(err, "decode ListOrgCIBuildkiteCredentialsOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000100, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -18296,8 +18932,8 @@ func (s *ListServiceAccountsOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfListServiceAccountsOutputBody) { - name = jsonFieldsNameOfListServiceAccountsOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListOrgCIBuildkiteCredentialsOutputBody) { + name = jsonFieldsNameOfListOrgCIBuildkiteCredentialsOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -18318,27 +18954,27 @@ func (s *ListServiceAccountsOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ListServiceAccountsOutputBody) MarshalJSON() ([]byte, error) { +func (s *ListOrgCIBuildkiteCredentialsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListServiceAccountsOutputBody) UnmarshalJSON(data []byte) error { +func (s *ListOrgCIBuildkiteCredentialsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ListServiceAccountsOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s ListOrgCIBuildkiteCredentialsOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ListServiceAccountsOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ListOrgCIBuildkiteCredentialsOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -18348,10 +18984,10 @@ func (s ListServiceAccountsOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ListServiceAccountsOutputBodyAdditional from json. -func (s *ListServiceAccountsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListOrgCIBuildkiteCredentialsOutputBodyAdditional from json. +func (s *ListOrgCIBuildkiteCredentialsOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ListServiceAccountsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode ListOrgCIBuildkiteCredentialsOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -18369,34 +19005,34 @@ func (s *ListServiceAccountsOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ListServiceAccountsOutputBodyAdditional") + return errors.Wrap(err, "decode ListOrgCIBuildkiteCredentialsOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ListServiceAccountsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ListOrgCIBuildkiteCredentialsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ListServiceAccountsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ListOrgCIBuildkiteCredentialsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *LookupBySlugOutputBody) Encode(e *jx.Encoder) { +func (s *ListOrgCIDepotOrganizationsOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *LookupBySlugOutputBody) encodeFields(e *jx.Encoder) { +func (s *ListOrgCIDepotOrganizationsOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -18404,24 +19040,12 @@ func (s *LookupBySlugOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("cell") - e.Str(s.Cell) - } - { - e.FieldStart("jurisdiction") - e.Str(s.Jurisdiction) - } - { - e.FieldStart("owner") - e.Str(s.Owner) - } - { - e.FieldStart("repo") - e.Str(s.Repo) - } - { - e.FieldStart("repoId") - e.Str(s.RepoId) + e.FieldStart("connections") + e.ArrStart() + for _, elem := range s.Connections { + elem.Encode(e) + } + e.ArrEnd() } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -18432,19 +19056,15 @@ func (s *LookupBySlugOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfLookupBySlugOutputBody = [6]string{ +var jsonFieldsNameOfListOrgCIDepotOrganizationsOutputBody = [2]string{ 0: "$schema", - 1: "cell", - 2: "jurisdiction", - 3: "owner", - 4: "repo", - 5: "repoId", + 1: "connections", } -// Decode decodes LookupBySlugOutputBody from json. -func (s *LookupBySlugOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes ListOrgCIDepotOrganizationsOutputBody from json. +func (s *ListOrgCIDepotOrganizationsOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode LookupBySlugOutputBody to nil") + return errors.New("invalid: unable to decode ListOrgCIDepotOrganizationsOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -18461,65 +19081,23 @@ func (s *LookupBySlugOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "cell": + case "connections": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.Cell = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"cell\"") - } - case "jurisdiction": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.Jurisdiction = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"jurisdiction\"") - } - case "owner": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - v, err := d.Str() - s.Owner = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"owner\"") - } - case "repo": - requiredBitSet[0] |= 1 << 4 - if err := func() error { - v, err := d.Str() - s.Repo = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"repo\"") - } - case "repoId": - requiredBitSet[0] |= 1 << 5 - if err := func() error { - v, err := d.Str() - s.RepoId = string(v) - if err != nil { + s.Connections = make([]OrgCIDepotConnectionView, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem OrgCIDepotConnectionView + if err := elem.Decode(d); err != nil { + return err + } + s.Connections = append(s.Connections, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"repoId\"") + return errors.Wrap(err, "decode field \"connections\"") } default: var elem jx.Raw @@ -18537,12 +19115,12 @@ func (s *LookupBySlugOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode LookupBySlugOutputBody") + return errors.Wrap(err, "decode ListOrgCIDepotOrganizationsOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00111110, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -18554,8 +19132,8 @@ func (s *LookupBySlugOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfLookupBySlugOutputBody) { - name = jsonFieldsNameOfLookupBySlugOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListOrgCIDepotOrganizationsOutputBody) { + name = jsonFieldsNameOfListOrgCIDepotOrganizationsOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -18576,27 +19154,27 @@ func (s *LookupBySlugOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *LookupBySlugOutputBody) MarshalJSON() ([]byte, error) { +func (s *ListOrgCIDepotOrganizationsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *LookupBySlugOutputBody) UnmarshalJSON(data []byte) error { +func (s *ListOrgCIDepotOrganizationsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s LookupBySlugOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s ListOrgCIDepotOrganizationsOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s LookupBySlugOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ListOrgCIDepotOrganizationsOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -18606,10 +19184,10 @@ func (s LookupBySlugOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes LookupBySlugOutputBodyAdditional from json. -func (s *LookupBySlugOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListOrgCIDepotOrganizationsOutputBodyAdditional from json. +func (s *ListOrgCIDepotOrganizationsOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode LookupBySlugOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode ListOrgCIDepotOrganizationsOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -18627,41 +19205,53 @@ func (s *LookupBySlugOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode LookupBySlugOutputBodyAdditional") + return errors.Wrap(err, "decode ListOrgCIDepotOrganizationsOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s LookupBySlugOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ListOrgCIDepotOrganizationsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *LookupBySlugOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ListOrgCIDepotOrganizationsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *MeAuth) Encode(e *jx.Encoder) { +func (s *ListOrgInvitationsOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *MeAuth) encodeFields(e *jx.Encoder) { +func (s *ListOrgInvitationsOutputBody) encodeFields(e *jx.Encoder) { { - e.FieldStart("provider") - e.Str(s.Provider) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } } { - e.FieldStart("providerUserId") - e.Str(s.ProviderUserId) + e.FieldStart("invitations") + e.ArrStart() + for _, elem := range s.Invitations { + elem.Encode(e) + } + e.ArrEnd() + } + { + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) + } } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -18672,67 +19262,82 @@ func (s *MeAuth) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfMeAuth = [2]string{ - 0: "provider", - 1: "providerUserId", +var jsonFieldsNameOfListOrgInvitationsOutputBody = [3]string{ + 0: "$schema", + 1: "invitations", + 2: "nextPageToken", } -// Decode decodes MeAuth from json. -func (s *MeAuth) Decode(d *jx.Decoder) error { +// Decode decodes ListOrgInvitationsOutputBody from json. +func (s *ListOrgInvitationsOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MeAuth to nil") + return errors.New("invalid: unable to decode ListOrgInvitationsOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "provider": - requiredBitSet[0] |= 1 << 0 + case "$schema": if err := func() error { - v, err := d.Str() - s.Provider = string(v) - if err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"provider\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "providerUserId": + case "invitations": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.ProviderUserId = string(v) - if err != nil { + s.Invitations = make([]Invitation, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem Invitation + if err := elem.Decode(d); err != nil { + return err + } + s.Invitations = append(s.Invitations, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"providerUserId\"") + return errors.Wrap(err, "decode field \"invitations\"") } - default: - var elem jx.Raw + case "nextPageToken": if err := func() error { - v, err := d.RawAppend(nil) - elem = jx.Raw(v) - if err != nil { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrapf(err, "decode field %q", k) + return errors.Wrap(err, "decode field \"nextPageToken\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) } s.AdditionalProps[string(k)] = elem } return nil }); err != nil { - return errors.Wrap(err, "decode MeAuth") + return errors.Wrap(err, "decode ListOrgInvitationsOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000011, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -18744,8 +19349,8 @@ func (s *MeAuth) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfMeAuth) { - name = jsonFieldsNameOfMeAuth[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListOrgInvitationsOutputBody) { + name = jsonFieldsNameOfListOrgInvitationsOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -18766,27 +19371,27 @@ func (s *MeAuth) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *MeAuth) MarshalJSON() ([]byte, error) { +func (s *ListOrgInvitationsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MeAuth) UnmarshalJSON(data []byte) error { +func (s *ListOrgInvitationsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s MeAuthAdditional) Encode(e *jx.Encoder) { +func (s ListOrgInvitationsOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s MeAuthAdditional) encodeFields(e *jx.Encoder) { +func (s ListOrgInvitationsOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -18796,10 +19401,10 @@ func (s MeAuthAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes MeAuthAdditional from json. -func (s *MeAuthAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListOrgInvitationsOutputBodyAdditional from json. +func (s *ListOrgInvitationsOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MeAuthAdditional to nil") + return errors.New("invalid: unable to decode ListOrgInvitationsOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -18817,41 +19422,53 @@ func (s *MeAuthAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode MeAuthAdditional") + return errors.Wrap(err, "decode ListOrgInvitationsOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s MeAuthAdditional) MarshalJSON() ([]byte, error) { +func (s ListOrgInvitationsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MeAuthAdditional) UnmarshalJSON(data []byte) error { +func (s *ListOrgInvitationsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *MeDeletion) Encode(e *jx.Encoder) { +func (s *ListOrgMembersOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *MeDeletion) encodeFields(e *jx.Encoder) { +func (s *ListOrgMembersOutputBody) encodeFields(e *jx.Encoder) { { - e.FieldStart("cooldownEndsAt") - json.EncodeDateTime(e, s.CooldownEndsAt) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } } { - e.FieldStart("requestedAt") - json.EncodeDateTime(e, s.RequestedAt) + e.FieldStart("members") + e.ArrStart() + for _, elem := range s.Members { + elem.Encode(e) + } + e.ArrEnd() + } + { + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) + } } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -18862,44 +19479,59 @@ func (s *MeDeletion) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfMeDeletion = [2]string{ - 0: "cooldownEndsAt", - 1: "requestedAt", +var jsonFieldsNameOfListOrgMembersOutputBody = [3]string{ + 0: "$schema", + 1: "members", + 2: "nextPageToken", } -// Decode decodes MeDeletion from json. -func (s *MeDeletion) Decode(d *jx.Decoder) error { +// Decode decodes ListOrgMembersOutputBody from json. +func (s *ListOrgMembersOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MeDeletion to nil") + return errors.New("invalid: unable to decode ListOrgMembersOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "cooldownEndsAt": - requiredBitSet[0] |= 1 << 0 + case "$schema": if err := func() error { - v, err := json.DecodeDateTime(d) - s.CooldownEndsAt = v - if err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"cooldownEndsAt\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "requestedAt": + case "members": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := json.DecodeDateTime(d) - s.RequestedAt = v - if err != nil { + s.Members = make([]Membership, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem Membership + if err := elem.Decode(d); err != nil { + return err + } + s.Members = append(s.Members, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"requestedAt\"") + return errors.Wrap(err, "decode field \"members\"") + } + case "nextPageToken": + if err := func() error { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"nextPageToken\"") } default: var elem jx.Raw @@ -18917,12 +19549,12 @@ func (s *MeDeletion) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode MeDeletion") + return errors.Wrap(err, "decode ListOrgMembersOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000011, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -18934,8 +19566,8 @@ func (s *MeDeletion) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfMeDeletion) { - name = jsonFieldsNameOfMeDeletion[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListOrgMembersOutputBody) { + name = jsonFieldsNameOfListOrgMembersOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -18956,27 +19588,27 @@ func (s *MeDeletion) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *MeDeletion) MarshalJSON() ([]byte, error) { +func (s *ListOrgMembersOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MeDeletion) UnmarshalJSON(data []byte) error { +func (s *ListOrgMembersOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s MeDeletionAdditional) Encode(e *jx.Encoder) { +func (s ListOrgMembersOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s MeDeletionAdditional) encodeFields(e *jx.Encoder) { +func (s ListOrgMembersOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -18986,10 +19618,10 @@ func (s MeDeletionAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes MeDeletionAdditional from json. -func (s *MeDeletionAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListOrgMembersOutputBodyAdditional from json. +func (s *ListOrgMembersOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MeDeletionAdditional to nil") + return errors.New("invalid: unable to decode ListOrgMembersOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -19007,68 +19639,58 @@ func (s *MeDeletionAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode MeDeletionAdditional") + return errors.Wrap(err, "decode ListOrgMembersOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s MeDeletionAdditional) MarshalJSON() ([]byte, error) { +func (s ListOrgMembersOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MeDeletionAdditional) UnmarshalJSON(data []byte) error { +func (s *ListOrgMembersOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *MeGlobal) Encode(e *jx.Encoder) { +func (s *ListOrgPeopleOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *MeGlobal) encodeFields(e *jx.Encoder) { - { - e.FieldStart("accountId") - e.Str(s.AccountId) - } - { - if s.AvatarUrl.Set { - e.FieldStart("avatarUrl") - s.AvatarUrl.Encode(e) - } - } - { - e.FieldStart("createdAt") - json.EncodeDateTime(e, s.CreatedAt) - } +func (s *ListOrgPeopleOutputBody) encodeFields(e *jx.Encoder) { { - if s.Handle.Set { - e.FieldStart("handle") - s.Handle.Encode(e) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) } } { - e.FieldStart("handles") + e.FieldStart("items") e.ArrStart() - for _, elem := range s.Handles { + for _, elem := range s.Items { elem.Encode(e) } e.ArrEnd() } { - if s.HomeJurisdiction.Set { - e.FieldStart("homeJurisdiction") - s.HomeJurisdiction.Encode(e) + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) } } + { + e.FieldStart("totalCount") + e.Int64(s.TotalCount) + } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -19078,96 +19700,72 @@ func (s *MeGlobal) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfMeGlobal = [6]string{ - 0: "accountId", - 1: "avatarUrl", - 2: "createdAt", - 3: "handle", - 4: "handles", - 5: "homeJurisdiction", +var jsonFieldsNameOfListOrgPeopleOutputBody = [4]string{ + 0: "$schema", + 1: "items", + 2: "nextPageToken", + 3: "totalCount", } -// Decode decodes MeGlobal from json. -func (s *MeGlobal) Decode(d *jx.Decoder) error { +// Decode decodes ListOrgPeopleOutputBody from json. +func (s *ListOrgPeopleOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MeGlobal to nil") + return errors.New("invalid: unable to decode ListOrgPeopleOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "accountId": - requiredBitSet[0] |= 1 << 0 - if err := func() error { - v, err := d.Str() - s.AccountId = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"accountId\"") - } - case "avatarUrl": - if err := func() error { - s.AvatarUrl.Reset() - if err := s.AvatarUrl.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"avatarUrl\"") - } - case "createdAt": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := json.DecodeDateTime(d) - s.CreatedAt = v - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"createdAt\"") - } - case "handle": + case "$schema": if err := func() error { - s.Handle.Reset() - if err := s.Handle.Decode(d); err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"handle\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "handles": - requiredBitSet[0] |= 1 << 4 + case "items": + requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Handles = make([]MeIdentityHandle, 0) + s.Items = make([]OrgPersonSummary, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem MeIdentityHandle + var elem OrgPersonSummary if err := elem.Decode(d); err != nil { return err } - s.Handles = append(s.Handles, elem) + s.Items = append(s.Items, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"handles\"") + return errors.Wrap(err, "decode field \"items\"") } - case "homeJurisdiction": + case "nextPageToken": if err := func() error { - s.HomeJurisdiction.Reset() - if err := s.HomeJurisdiction.Decode(d); err != nil { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"homeJurisdiction\"") + return errors.Wrap(err, "decode field \"nextPageToken\"") + } + case "totalCount": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Int64() + s.TotalCount = int64(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"totalCount\"") } default: var elem jx.Raw @@ -19185,12 +19783,12 @@ func (s *MeGlobal) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode MeGlobal") + return errors.Wrap(err, "decode ListOrgPeopleOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00010101, + 0b00001010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -19202,8 +19800,8 @@ func (s *MeGlobal) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfMeGlobal) { - name = jsonFieldsNameOfMeGlobal[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListOrgPeopleOutputBody) { + name = jsonFieldsNameOfListOrgPeopleOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -19224,27 +19822,27 @@ func (s *MeGlobal) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *MeGlobal) MarshalJSON() ([]byte, error) { +func (s *ListOrgPeopleOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MeGlobal) UnmarshalJSON(data []byte) error { +func (s *ListOrgPeopleOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s MeGlobalAdditional) Encode(e *jx.Encoder) { +func (s ListOrgPeopleOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s MeGlobalAdditional) encodeFields(e *jx.Encoder) { +func (s ListOrgPeopleOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -19254,10 +19852,10 @@ func (s MeGlobalAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes MeGlobalAdditional from json. -func (s *MeGlobalAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListOrgPeopleOutputBodyAdditional from json. +func (s *ListOrgPeopleOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MeGlobalAdditional to nil") + return errors.New("invalid: unable to decode ListOrgPeopleOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -19275,51 +19873,61 @@ func (s *MeGlobalAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode MeGlobalAdditional") + return errors.Wrap(err, "decode ListOrgPeopleOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s MeGlobalAdditional) MarshalJSON() ([]byte, error) { +func (s ListOrgPeopleOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MeGlobalAdditional) UnmarshalJSON(data []byte) error { +func (s *ListOrgPeopleOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *MeIdentityHandle) Encode(e *jx.Encoder) { +func (s *ListOrgProjectsOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *MeIdentityHandle) encodeFields(e *jx.Encoder) { +func (s *ListOrgProjectsOutputBody) encodeFields(e *jx.Encoder) { { - if s.Email.Set { - e.FieldStart("email") - s.Email.Encode(e) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) } } { - e.FieldStart("handle") - e.Str(s.Handle) + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) + } } { - e.FieldStart("provider") - e.Str(s.Provider) + if s.Project.Set { + e.FieldStart("project") + s.Project.Encode(e) + } } { - e.FieldStart("providerUserId") - e.Str(s.ProviderUserId) + if s.Projects != nil { + e.FieldStart("projects") + e.ArrStart() + for _, elem := range s.Projects { + elem.Encode(e) + } + e.ArrEnd() + } } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -19330,68 +19938,68 @@ func (s *MeIdentityHandle) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfMeIdentityHandle = [4]string{ - 0: "email", - 1: "handle", - 2: "provider", - 3: "providerUserId", +var jsonFieldsNameOfListOrgProjectsOutputBody = [4]string{ + 0: "$schema", + 1: "nextPageToken", + 2: "project", + 3: "projects", } -// Decode decodes MeIdentityHandle from json. -func (s *MeIdentityHandle) Decode(d *jx.Decoder) error { +// Decode decodes ListOrgProjectsOutputBody from json. +func (s *ListOrgProjectsOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MeIdentityHandle to nil") + return errors.New("invalid: unable to decode ListOrgProjectsOutputBody to nil") } - var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "email": + case "$schema": if err := func() error { - s.Email.Reset() - if err := s.Email.Decode(d); err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"email\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "handle": - requiredBitSet[0] |= 1 << 1 + case "nextPageToken": if err := func() error { - v, err := d.Str() - s.Handle = string(v) - if err != nil { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"handle\"") + return errors.Wrap(err, "decode field \"nextPageToken\"") } - case "provider": - requiredBitSet[0] |= 1 << 2 + case "project": if err := func() error { - v, err := d.Str() - s.Provider = string(v) - if err != nil { + s.Project.Reset() + if err := s.Project.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"provider\"") + return errors.Wrap(err, "decode field \"project\"") } - case "providerUserId": - requiredBitSet[0] |= 1 << 3 + case "projects": if err := func() error { - v, err := d.Str() - s.ProviderUserId = string(v) - if err != nil { + s.Projects = make([]Project, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem Project + if err := elem.Decode(d); err != nil { + return err + } + s.Projects = append(s.Projects, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"providerUserId\"") + return errors.Wrap(err, "decode field \"projects\"") } default: var elem jx.Raw @@ -19409,66 +20017,34 @@ func (s *MeIdentityHandle) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode MeIdentityHandle") - } - // Validate required fields. - var failures []validate.FieldError - for i, mask := range [1]uint8{ - 0b00001110, - } { - if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { - // Mask only required fields and check equality to mask using XOR. - // - // If XOR result is not zero, result is not equal to expected, so some fields are missed. - // Bits of fields which would be set are actually bits of missed fields. - missed := bits.OnesCount8(result) - for bitN := 0; bitN < missed; bitN++ { - bitIdx := bits.TrailingZeros8(result) - fieldIdx := i*8 + bitIdx - var name string - if fieldIdx < len(jsonFieldsNameOfMeIdentityHandle) { - name = jsonFieldsNameOfMeIdentityHandle[fieldIdx] - } else { - name = strconv.Itoa(fieldIdx) - } - failures = append(failures, validate.FieldError{ - Name: name, - Error: validate.ErrFieldRequired, - }) - // Reset bit. - result &^= 1 << bitIdx - } - } - } - if len(failures) > 0 { - return &validate.Error{Fields: failures} + return errors.Wrap(err, "decode ListOrgProjectsOutputBody") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s *MeIdentityHandle) MarshalJSON() ([]byte, error) { +func (s *ListOrgProjectsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MeIdentityHandle) UnmarshalJSON(data []byte) error { +func (s *ListOrgProjectsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s MeIdentityHandleAdditional) Encode(e *jx.Encoder) { +func (s ListOrgProjectsOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s MeIdentityHandleAdditional) encodeFields(e *jx.Encoder) { +func (s ListOrgProjectsOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -19478,10 +20054,10 @@ func (s MeIdentityHandleAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes MeIdentityHandleAdditional from json. -func (s *MeIdentityHandleAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListOrgProjectsOutputBodyAdditional from json. +func (s *ListOrgProjectsOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MeIdentityHandleAdditional to nil") + return errors.New("invalid: unable to decode ListOrgProjectsOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -19499,62 +20075,60 @@ func (s *MeIdentityHandleAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode MeIdentityHandleAdditional") + return errors.Wrap(err, "decode ListOrgProjectsOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s MeIdentityHandleAdditional) MarshalJSON() ([]byte, error) { +func (s ListOrgProjectsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MeIdentityHandleAdditional) UnmarshalJSON(data []byte) error { +func (s *ListOrgProjectsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *MeRegional) Encode(e *jx.Encoder) { +func (s *ListOrgsOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *MeRegional) encodeFields(e *jx.Encoder) { - { - if s.Bio.Set { - e.FieldStart("bio") - s.Bio.Encode(e) - } - } +func (s *ListOrgsOutputBody) encodeFields(e *jx.Encoder) { { - if s.Company.Set { - e.FieldStart("company") - s.Company.Encode(e) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) } } { - if s.DisplayName.Set { - e.FieldStart("displayName") - s.DisplayName.Encode(e) + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) } } { - if s.Email.Set { - e.FieldStart("email") - s.Email.Encode(e) + if s.Org.Set { + e.FieldStart("org") + s.Org.Encode(e) } } { - if s.Location.Set { - e.FieldStart("location") - s.Location.Encode(e) + if s.Orgs != nil { + e.FieldStart("orgs") + e.ArrStart() + for _, elem := range s.Orgs { + elem.Encode(e) + } + e.ArrEnd() } } for k, elem := range s.AdditionalProps { @@ -19566,72 +20140,68 @@ func (s *MeRegional) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfMeRegional = [5]string{ - 0: "bio", - 1: "company", - 2: "displayName", - 3: "email", - 4: "location", +var jsonFieldsNameOfListOrgsOutputBody = [4]string{ + 0: "$schema", + 1: "nextPageToken", + 2: "org", + 3: "orgs", } -// Decode decodes MeRegional from json. -func (s *MeRegional) Decode(d *jx.Decoder) error { +// Decode decodes ListOrgsOutputBody from json. +func (s *ListOrgsOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MeRegional to nil") + return errors.New("invalid: unable to decode ListOrgsOutputBody to nil") } s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "bio": - if err := func() error { - s.Bio.Reset() - if err := s.Bio.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"bio\"") - } - case "company": + case "$schema": if err := func() error { - s.Company.Reset() - if err := s.Company.Decode(d); err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"company\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "displayName": + case "nextPageToken": if err := func() error { - s.DisplayName.Reset() - if err := s.DisplayName.Decode(d); err != nil { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"displayName\"") + return errors.Wrap(err, "decode field \"nextPageToken\"") } - case "email": + case "org": if err := func() error { - s.Email.Reset() - if err := s.Email.Decode(d); err != nil { + s.Org.Reset() + if err := s.Org.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"email\"") + return errors.Wrap(err, "decode field \"org\"") } - case "location": + case "orgs": if err := func() error { - s.Location.Reset() - if err := s.Location.Decode(d); err != nil { + s.Orgs = make([]Org, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem Org + if err := elem.Decode(d); err != nil { + return err + } + s.Orgs = append(s.Orgs, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"location\"") + return errors.Wrap(err, "decode field \"orgs\"") } default: var elem jx.Raw @@ -19649,34 +20219,34 @@ func (s *MeRegional) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode MeRegional") + return errors.Wrap(err, "decode ListOrgsOutputBody") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s *MeRegional) MarshalJSON() ([]byte, error) { +func (s *ListOrgsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MeRegional) UnmarshalJSON(data []byte) error { +func (s *ListOrgsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s MeRegionalAdditional) Encode(e *jx.Encoder) { +func (s ListOrgsOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s MeRegionalAdditional) encodeFields(e *jx.Encoder) { +func (s ListOrgsOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -19686,10 +20256,10 @@ func (s MeRegionalAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes MeRegionalAdditional from json. -func (s *MeRegionalAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListOrgsOutputBodyAdditional from json. +func (s *ListOrgsOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MeRegionalAdditional to nil") + return errors.New("invalid: unable to decode ListOrgsOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -19707,49 +20277,53 @@ func (s *MeRegionalAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode MeRegionalAdditional") + return errors.Wrap(err, "decode ListOrgsOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s MeRegionalAdditional) MarshalJSON() ([]byte, error) { +func (s ListOrgsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MeRegionalAdditional) UnmarshalJSON(data []byte) error { +func (s *ListOrgsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *MeRegionalUnavailable) Encode(e *jx.Encoder) { +func (s *ListProjectMembersOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *MeRegionalUnavailable) encodeFields(e *jx.Encoder) { - { - e.FieldStart("error") - s.Error.Encode(e) - } +func (s *ListProjectMembersOutputBody) encodeFields(e *jx.Encoder) { { - e.FieldStart("homeCoreUrl") - e.Str(s.HomeCoreUrl) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } } { - e.FieldStart("jurisdiction") - e.Str(s.Jurisdiction) + e.FieldStart("members") + e.ArrStart() + for _, elem := range s.Members { + elem.Encode(e) + } + e.ArrEnd() } { - e.FieldStart("message") - e.Str(s.Message) + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) + } } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -19760,68 +20334,59 @@ func (s *MeRegionalUnavailable) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfMeRegionalUnavailable = [4]string{ - 0: "error", - 1: "homeCoreUrl", - 2: "jurisdiction", - 3: "message", +var jsonFieldsNameOfListProjectMembersOutputBody = [3]string{ + 0: "$schema", + 1: "members", + 2: "nextPageToken", } -// Decode decodes MeRegionalUnavailable from json. -func (s *MeRegionalUnavailable) Decode(d *jx.Decoder) error { +// Decode decodes ListProjectMembersOutputBody from json. +func (s *ListProjectMembersOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MeRegionalUnavailable to nil") + return errors.New("invalid: unable to decode ListProjectMembersOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "error": - requiredBitSet[0] |= 1 << 0 + case "$schema": if err := func() error { - if err := s.Error.Decode(d); err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"error\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "homeCoreUrl": + case "members": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.HomeCoreUrl = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"homeCoreUrl\"") - } - case "jurisdiction": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.Jurisdiction = string(v) - if err != nil { + s.Members = make([]ProjectGrant, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem ProjectGrant + if err := elem.Decode(d); err != nil { + return err + } + s.Members = append(s.Members, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"jurisdiction\"") + return errors.Wrap(err, "decode field \"members\"") } - case "message": - requiredBitSet[0] |= 1 << 3 + case "nextPageToken": if err := func() error { - v, err := d.Str() - s.Message = string(v) - if err != nil { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"message\"") + return errors.Wrap(err, "decode field \"nextPageToken\"") } default: var elem jx.Raw @@ -19839,12 +20404,12 @@ func (s *MeRegionalUnavailable) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode MeRegionalUnavailable") + return errors.Wrap(err, "decode ListProjectMembersOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00001111, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -19856,8 +20421,8 @@ func (s *MeRegionalUnavailable) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfMeRegionalUnavailable) { - name = jsonFieldsNameOfMeRegionalUnavailable[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListProjectMembersOutputBody) { + name = jsonFieldsNameOfListProjectMembersOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -19878,27 +20443,27 @@ func (s *MeRegionalUnavailable) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *MeRegionalUnavailable) MarshalJSON() ([]byte, error) { +func (s *ListProjectMembersOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MeRegionalUnavailable) UnmarshalJSON(data []byte) error { +func (s *ListProjectMembersOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s MeRegionalUnavailableAdditional) Encode(e *jx.Encoder) { +func (s ListProjectMembersOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s MeRegionalUnavailableAdditional) encodeFields(e *jx.Encoder) { +func (s ListProjectMembersOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -19908,10 +20473,10 @@ func (s MeRegionalUnavailableAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes MeRegionalUnavailableAdditional from json. -func (s *MeRegionalUnavailableAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListProjectMembersOutputBodyAdditional from json. +func (s *ListProjectMembersOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MeRegionalUnavailableAdditional to nil") + return errors.New("invalid: unable to decode ListProjectMembersOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -19929,72 +20494,34 @@ func (s *MeRegionalUnavailableAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode MeRegionalUnavailableAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s MeRegionalUnavailableAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MeRegionalUnavailableAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes MeRegionalUnavailableError as json. -func (s MeRegionalUnavailableError) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes MeRegionalUnavailableError from json. -func (s *MeRegionalUnavailableError) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode MeRegionalUnavailableError to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch MeRegionalUnavailableError(v) { - case MeRegionalUnavailableErrorForeignJurisdiction: - *s = MeRegionalUnavailableErrorForeignJurisdiction - default: - *s = MeRegionalUnavailableError(v) + return errors.Wrap(err, "decode ListProjectMembersOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s MeRegionalUnavailableError) MarshalJSON() ([]byte, error) { +func (s ListProjectMembersOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MeRegionalUnavailableError) UnmarshalJSON(data []byte) error { +func (s *ListProjectMembersOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *Membership) Encode(e *jx.Encoder) { +func (s *ListProjectReposOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *Membership) encodeFields(e *jx.Encoder) { +func (s *ListProjectReposOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -20002,45 +20529,25 @@ func (s *Membership) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("accountId") - e.Str(s.AccountId) - } - { - e.FieldStart("createdAt") - json.EncodeDateTime(e, s.CreatedAt) - } - { - if s.Handle.Set { - e.FieldStart("handle") - s.Handle.Encode(e) + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) } } { - e.FieldStart("id") - e.Str(s.ID) - } - { - e.FieldStart("orgId") - e.Str(s.OrgId) - } - { - if s.Provider.Set { - e.FieldStart("provider") - s.Provider.Encode(e) + if s.Repo.Set { + e.FieldStart("repo") + s.Repo.Encode(e) } } { - e.FieldStart("role") - e.Str(s.Role) - } - { - e.FieldStart("status") - e.Str(s.Status) - } - { - if s.WorkosOrgMembershipId.Set { - e.FieldStart("workosOrgMembershipId") - s.WorkosOrgMembershipId.Encode(e) + if s.Repos != nil { + e.FieldStart("repos") + e.ArrStart() + for _, elem := range s.Repos { + elem.Encode(e) + } + e.ArrEnd() } } for k, elem := range s.AdditionalProps { @@ -20052,25 +20559,18 @@ func (s *Membership) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfMembership = [10]string{ +var jsonFieldsNameOfListProjectReposOutputBody = [4]string{ 0: "$schema", - 1: "accountId", - 2: "createdAt", - 3: "handle", - 4: "id", - 5: "orgId", - 6: "provider", - 7: "role", - 8: "status", - 9: "workosOrgMembershipId", + 1: "nextPageToken", + 2: "repo", + 3: "repos", } -// Decode decodes Membership from json. -func (s *Membership) Decode(d *jx.Decoder) error { +// Decode decodes ListProjectReposOutputBody from json. +func (s *ListProjectReposOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode Membership to nil") + return errors.New("invalid: unable to decode ListProjectReposOutputBody to nil") } - var requiredBitSet [2]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -20085,107 +20585,42 @@ func (s *Membership) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "accountId": - requiredBitSet[0] |= 1 << 1 - if err := func() error { - v, err := d.Str() - s.AccountId = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"accountId\"") - } - case "createdAt": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := json.DecodeDateTime(d) - s.CreatedAt = v - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"createdAt\"") - } - case "handle": - if err := func() error { - s.Handle.Reset() - if err := s.Handle.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"handle\"") - } - case "id": - requiredBitSet[0] |= 1 << 4 - if err := func() error { - v, err := d.Str() - s.ID = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"id\"") - } - case "orgId": - requiredBitSet[0] |= 1 << 5 - if err := func() error { - v, err := d.Str() - s.OrgId = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"orgId\"") - } - case "provider": - if err := func() error { - s.Provider.Reset() - if err := s.Provider.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"provider\"") - } - case "role": - requiredBitSet[0] |= 1 << 7 + case "nextPageToken": if err := func() error { - v, err := d.Str() - s.Role = string(v) - if err != nil { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"role\"") + return errors.Wrap(err, "decode field \"nextPageToken\"") } - case "status": - requiredBitSet[1] |= 1 << 0 + case "repo": if err := func() error { - v, err := d.Str() - s.Status = string(v) - if err != nil { + s.Repo.Reset() + if err := s.Repo.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"status\"") + return errors.Wrap(err, "decode field \"repo\"") } - case "workosOrgMembershipId": + case "repos": if err := func() error { - s.WorkosOrgMembershipId.Reset() - if err := s.WorkosOrgMembershipId.Decode(d); err != nil { + s.Repos = make([]Repo, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem Repo + if err := elem.Decode(d); err != nil { + return err + } + s.Repos = append(s.Repos, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"workosOrgMembershipId\"") + return errors.Wrap(err, "decode field \"repos\"") } default: var elem jx.Raw @@ -20203,67 +20638,34 @@ func (s *Membership) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode Membership") - } - // Validate required fields. - var failures []validate.FieldError - for i, mask := range [2]uint8{ - 0b10110110, - 0b00000001, - } { - if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { - // Mask only required fields and check equality to mask using XOR. - // - // If XOR result is not zero, result is not equal to expected, so some fields are missed. - // Bits of fields which would be set are actually bits of missed fields. - missed := bits.OnesCount8(result) - for bitN := 0; bitN < missed; bitN++ { - bitIdx := bits.TrailingZeros8(result) - fieldIdx := i*8 + bitIdx - var name string - if fieldIdx < len(jsonFieldsNameOfMembership) { - name = jsonFieldsNameOfMembership[fieldIdx] - } else { - name = strconv.Itoa(fieldIdx) - } - failures = append(failures, validate.FieldError{ - Name: name, - Error: validate.ErrFieldRequired, - }) - // Reset bit. - result &^= 1 << bitIdx - } - } - } - if len(failures) > 0 { - return &validate.Error{Fields: failures} + return errors.Wrap(err, "decode ListProjectReposOutputBody") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s *Membership) MarshalJSON() ([]byte, error) { +func (s *ListProjectReposOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *Membership) UnmarshalJSON(data []byte) error { +func (s *ListProjectReposOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s MembershipAdditional) Encode(e *jx.Encoder) { +func (s ListProjectReposOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s MembershipAdditional) encodeFields(e *jx.Encoder) { +func (s ListProjectReposOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -20273,10 +20675,10 @@ func (s MembershipAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes MembershipAdditional from json. -func (s *MembershipAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListProjectReposOutputBodyAdditional from json. +func (s *ListProjectReposOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MembershipAdditional to nil") + return errors.New("invalid: unable to decode ListProjectReposOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -20294,34 +20696,34 @@ func (s *MembershipAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode MembershipAdditional") + return errors.Wrap(err, "decode ListProjectReposOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s MembershipAdditional) MarshalJSON() ([]byte, error) { +func (s ListProjectReposOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MembershipAdditional) UnmarshalJSON(data []byte) error { +func (s *ListProjectReposOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *MintOrgCIGitHubActionsCredentialInputBody) Encode(e *jx.Encoder) { +func (s *ListProjectsOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *MintOrgCIGitHubActionsCredentialInputBody) encodeFields(e *jx.Encoder) { +func (s *ListProjectsOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -20329,13 +20731,25 @@ func (s *MintOrgCIGitHubActionsCredentialInputBody) encodeFields(e *jx.Encoder) } } { - e.FieldStart("account") - e.Str(s.Account) + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) + } } { - if s.APIToken.Set { - e.FieldStart("api_token") - s.APIToken.Encode(e) + if s.Project.Set { + e.FieldStart("project") + s.Project.Encode(e) + } + } + { + if s.Projects != nil { + e.FieldStart("projects") + e.ArrStart() + for _, elem := range s.Projects { + elem.Encode(e) + } + e.ArrEnd() } } for k, elem := range s.AdditionalProps { @@ -20347,18 +20761,18 @@ func (s *MintOrgCIGitHubActionsCredentialInputBody) encodeFields(e *jx.Encoder) } } -var jsonFieldsNameOfMintOrgCIGitHubActionsCredentialInputBody = [3]string{ +var jsonFieldsNameOfListProjectsOutputBody = [4]string{ 0: "$schema", - 1: "account", - 2: "api_token", + 1: "nextPageToken", + 2: "project", + 3: "projects", } -// Decode decodes MintOrgCIGitHubActionsCredentialInputBody from json. -func (s *MintOrgCIGitHubActionsCredentialInputBody) Decode(d *jx.Decoder) error { +// Decode decodes ListProjectsOutputBody from json. +func (s *ListProjectsOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MintOrgCIGitHubActionsCredentialInputBody to nil") + return errors.New("invalid: unable to decode ListProjectsOutputBody to nil") } - var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -20373,27 +20787,42 @@ func (s *MintOrgCIGitHubActionsCredentialInputBody) Decode(d *jx.Decoder) error }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "account": - requiredBitSet[0] |= 1 << 1 + case "nextPageToken": if err := func() error { - v, err := d.Str() - s.Account = string(v) - if err != nil { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"account\"") + return errors.Wrap(err, "decode field \"nextPageToken\"") } - case "api_token": + case "project": if err := func() error { - s.APIToken.Reset() - if err := s.APIToken.Decode(d); err != nil { + s.Project.Reset() + if err := s.Project.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"api_token\"") + return errors.Wrap(err, "decode field \"project\"") + } + case "projects": + if err := func() error { + s.Projects = make([]Project, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem Project + if err := elem.Decode(d); err != nil { + return err + } + s.Projects = append(s.Projects, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"projects\"") } default: var elem jx.Raw @@ -20411,66 +20840,34 @@ func (s *MintOrgCIGitHubActionsCredentialInputBody) Decode(d *jx.Decoder) error } return nil }); err != nil { - return errors.Wrap(err, "decode MintOrgCIGitHubActionsCredentialInputBody") - } - // Validate required fields. - var failures []validate.FieldError - for i, mask := range [1]uint8{ - 0b00000010, - } { - if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { - // Mask only required fields and check equality to mask using XOR. - // - // If XOR result is not zero, result is not equal to expected, so some fields are missed. - // Bits of fields which would be set are actually bits of missed fields. - missed := bits.OnesCount8(result) - for bitN := 0; bitN < missed; bitN++ { - bitIdx := bits.TrailingZeros8(result) - fieldIdx := i*8 + bitIdx - var name string - if fieldIdx < len(jsonFieldsNameOfMintOrgCIGitHubActionsCredentialInputBody) { - name = jsonFieldsNameOfMintOrgCIGitHubActionsCredentialInputBody[fieldIdx] - } else { - name = strconv.Itoa(fieldIdx) - } - failures = append(failures, validate.FieldError{ - Name: name, - Error: validate.ErrFieldRequired, - }) - // Reset bit. - result &^= 1 << bitIdx - } - } - } - if len(failures) > 0 { - return &validate.Error{Fields: failures} + return errors.Wrap(err, "decode ListProjectsOutputBody") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s *MintOrgCIGitHubActionsCredentialInputBody) MarshalJSON() ([]byte, error) { +func (s *ListProjectsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MintOrgCIGitHubActionsCredentialInputBody) UnmarshalJSON(data []byte) error { +func (s *ListProjectsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s MintOrgCIGitHubActionsCredentialInputBodyAdditional) Encode(e *jx.Encoder) { +func (s ListProjectsOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s MintOrgCIGitHubActionsCredentialInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ListProjectsOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -20480,10 +20877,10 @@ func (s MintOrgCIGitHubActionsCredentialInputBodyAdditional) encodeFields(e *jx. } } -// Decode decodes MintOrgCIGitHubActionsCredentialInputBodyAdditional from json. -func (s *MintOrgCIGitHubActionsCredentialInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListProjectsOutputBodyAdditional from json. +func (s *ListProjectsOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MintOrgCIGitHubActionsCredentialInputBodyAdditional to nil") + return errors.New("invalid: unable to decode ListProjectsOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -20501,34 +20898,34 @@ func (s *MintOrgCIGitHubActionsCredentialInputBodyAdditional) Decode(d *jx.Decod m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode MintOrgCIGitHubActionsCredentialInputBodyAdditional") + return errors.Wrap(err, "decode ListProjectsOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s MintOrgCIGitHubActionsCredentialInputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ListProjectsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MintOrgCIGitHubActionsCredentialInputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ListProjectsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *Mirror) Encode(e *jx.Encoder) { +func (s *ListRepoCIBuildsOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *Mirror) encodeFields(e *jx.Encoder) { +func (s *ListRepoCIBuildsOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -20536,70 +20933,12 @@ func (s *Mirror) encodeFields(e *jx.Encoder) { } } { - if s.Cell.Set { - e.FieldStart("cell") - s.Cell.Encode(e) - } - } - { - e.FieldStart("clusterHost") - e.Str(s.ClusterHost) - } - { - e.FieldStart("createdAt") - json.EncodeDateTime(e, s.CreatedAt) - } - { - if s.InstallationId.Set { - e.FieldStart("installationId") - s.InstallationId.Encode(e) - } - } - { - if s.IsArchived.Set { - e.FieldStart("isArchived") - s.IsArchived.Encode(e) - } - } - { - if s.IsPrivate.Set { - e.FieldStart("isPrivate") - s.IsPrivate.Encode(e) - } - } - { - if s.Jurisdiction.Set { - e.FieldStart("jurisdiction") - s.Jurisdiction.Encode(e) - } - } - { - e.FieldStart("mirrorId") - e.Str(s.MirrorId) - } - { - e.FieldStart("owner") - e.Str(s.Owner) - } - { - e.FieldStart("provider") - e.Str(s.Provider) - } - { - e.FieldStart("repo") - e.Str(s.Repo) - } - { - if s.Status.Set { - e.FieldStart("status") - s.Status.Encode(e) - } - } - { - if s.SuspendedAt.Set { - e.FieldStart("suspendedAt") - s.SuspendedAt.Encode(e, json.EncodeDateTime) + e.FieldStart("builds") + e.ArrStart() + for _, elem := range s.Builds { + elem.Encode(e) } + e.ArrEnd() } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -20610,29 +20949,17 @@ func (s *Mirror) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfMirror = [14]string{ - 0: "$schema", - 1: "cell", - 2: "clusterHost", - 3: "createdAt", - 4: "installationId", - 5: "isArchived", - 6: "isPrivate", - 7: "jurisdiction", - 8: "mirrorId", - 9: "owner", - 10: "provider", - 11: "repo", - 12: "status", - 13: "suspendedAt", +var jsonFieldsNameOfListRepoCIBuildsOutputBody = [2]string{ + 0: "$schema", + 1: "builds", } -// Decode decodes Mirror from json. -func (s *Mirror) Decode(d *jx.Decoder) error { +// Decode decodes ListRepoCIBuildsOutputBody from json. +func (s *ListRepoCIBuildsOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode Mirror to nil") + return errors.New("invalid: unable to decode ListRepoCIBuildsOutputBody to nil") } - var requiredBitSet [2]uint8 + var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -20647,147 +20974,23 @@ func (s *Mirror) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "cell": - if err := func() error { - s.Cell.Reset() - if err := s.Cell.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"cell\"") - } - case "clusterHost": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.ClusterHost = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"clusterHost\"") - } - case "createdAt": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - v, err := json.DecodeDateTime(d) - s.CreatedAt = v - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"createdAt\"") - } - case "installationId": - if err := func() error { - s.InstallationId.Reset() - if err := s.InstallationId.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"installationId\"") - } - case "isArchived": - if err := func() error { - s.IsArchived.Reset() - if err := s.IsArchived.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"isArchived\"") - } - case "isPrivate": - if err := func() error { - s.IsPrivate.Reset() - if err := s.IsPrivate.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"isPrivate\"") - } - case "jurisdiction": - if err := func() error { - s.Jurisdiction.Reset() - if err := s.Jurisdiction.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"jurisdiction\"") - } - case "mirrorId": - requiredBitSet[1] |= 1 << 0 - if err := func() error { - v, err := d.Str() - s.MirrorId = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"mirrorId\"") - } - case "owner": - requiredBitSet[1] |= 1 << 1 - if err := func() error { - v, err := d.Str() - s.Owner = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"owner\"") - } - case "provider": - requiredBitSet[1] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.Provider = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"provider\"") - } - case "repo": - requiredBitSet[1] |= 1 << 3 - if err := func() error { - v, err := d.Str() - s.Repo = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"repo\"") - } - case "status": - if err := func() error { - s.Status.Reset() - if err := s.Status.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"status\"") - } - case "suspendedAt": + case "builds": + requiredBitSet[0] |= 1 << 1 if err := func() error { - s.SuspendedAt.Reset() - if err := s.SuspendedAt.Decode(d, json.DecodeDateTime); err != nil { + s.Builds = make([]CIBuildView, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem CIBuildView + if err := elem.Decode(d); err != nil { + return err + } + s.Builds = append(s.Builds, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"suspendedAt\"") + return errors.Wrap(err, "decode field \"builds\"") } default: var elem jx.Raw @@ -20805,13 +21008,12 @@ func (s *Mirror) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode Mirror") + return errors.Wrap(err, "decode ListRepoCIBuildsOutputBody") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [2]uint8{ - 0b00001100, - 0b00001111, + for i, mask := range [1]uint8{ + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -20823,8 +21025,8 @@ func (s *Mirror) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfMirror) { - name = jsonFieldsNameOfMirror[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListRepoCIBuildsOutputBody) { + name = jsonFieldsNameOfListRepoCIBuildsOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -20845,27 +21047,27 @@ func (s *Mirror) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *Mirror) MarshalJSON() ([]byte, error) { +func (s *ListRepoCIBuildsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *Mirror) UnmarshalJSON(data []byte) error { +func (s *ListRepoCIBuildsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s MirrorAdditional) Encode(e *jx.Encoder) { +func (s ListRepoCIBuildsOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s MirrorAdditional) encodeFields(e *jx.Encoder) { +func (s ListRepoCIBuildsOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -20875,10 +21077,10 @@ func (s MirrorAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes MirrorAdditional from json. -func (s *MirrorAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListRepoCIBuildsOutputBodyAdditional from json. +func (s *ListRepoCIBuildsOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MirrorAdditional to nil") + return errors.New("invalid: unable to decode ListRepoCIBuildsOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -20896,47 +21098,47 @@ func (s *MirrorAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode MirrorAdditional") + return errors.Wrap(err, "decode ListRepoCIBuildsOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s MirrorAdditional) MarshalJSON() ([]byte, error) { +func (s ListRepoCIBuildsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MirrorAdditional) UnmarshalJSON(data []byte) error { +func (s *ListRepoCIBuildsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *MirrorCollaborator) Encode(e *jx.Encoder) { +func (s *ListRepoCIDeliveriesOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *MirrorCollaborator) encodeFields(e *jx.Encoder) { - { - e.FieldStart("accountId") - e.Str(s.AccountId) - } +func (s *ListRepoCIDeliveriesOutputBody) encodeFields(e *jx.Encoder) { { - if s.Handle.Set { - e.FieldStart("handle") - s.Handle.Encode(e) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) } } { - e.FieldStart("role") - e.Str(s.Role) + e.FieldStart("deliveries") + e.ArrStart() + for _, elem := range s.Deliveries { + elem.Encode(e) + } + e.ArrEnd() } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -20947,55 +21149,48 @@ func (s *MirrorCollaborator) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfMirrorCollaborator = [3]string{ - 0: "accountId", - 1: "handle", - 2: "role", +var jsonFieldsNameOfListRepoCIDeliveriesOutputBody = [2]string{ + 0: "$schema", + 1: "deliveries", } -// Decode decodes MirrorCollaborator from json. -func (s *MirrorCollaborator) Decode(d *jx.Decoder) error { +// Decode decodes ListRepoCIDeliveriesOutputBody from json. +func (s *ListRepoCIDeliveriesOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MirrorCollaborator to nil") + return errors.New("invalid: unable to decode ListRepoCIDeliveriesOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "accountId": - requiredBitSet[0] |= 1 << 0 - if err := func() error { - v, err := d.Str() - s.AccountId = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"accountId\"") - } - case "handle": + case "$schema": if err := func() error { - s.Handle.Reset() - if err := s.Handle.Decode(d); err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"handle\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "role": - requiredBitSet[0] |= 1 << 2 + case "deliveries": + requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.Role = string(v) - if err != nil { + s.Deliveries = make([]CIDeliveryView, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem CIDeliveryView + if err := elem.Decode(d); err != nil { + return err + } + s.Deliveries = append(s.Deliveries, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"role\"") + return errors.Wrap(err, "decode field \"deliveries\"") } default: var elem jx.Raw @@ -21013,12 +21208,12 @@ func (s *MirrorCollaborator) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode MirrorCollaborator") + return errors.Wrap(err, "decode ListRepoCIDeliveriesOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000101, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -21030,8 +21225,8 @@ func (s *MirrorCollaborator) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfMirrorCollaborator) { - name = jsonFieldsNameOfMirrorCollaborator[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListRepoCIDeliveriesOutputBody) { + name = jsonFieldsNameOfListRepoCIDeliveriesOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -21052,27 +21247,27 @@ func (s *MirrorCollaborator) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *MirrorCollaborator) MarshalJSON() ([]byte, error) { +func (s *ListRepoCIDeliveriesOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MirrorCollaborator) UnmarshalJSON(data []byte) error { +func (s *ListRepoCIDeliveriesOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s MirrorCollaboratorAdditional) Encode(e *jx.Encoder) { +func (s ListRepoCIDeliveriesOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s MirrorCollaboratorAdditional) encodeFields(e *jx.Encoder) { +func (s ListRepoCIDeliveriesOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -21082,10 +21277,10 @@ func (s MirrorCollaboratorAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes MirrorCollaboratorAdditional from json. -func (s *MirrorCollaboratorAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListRepoCIDeliveriesOutputBodyAdditional from json. +func (s *ListRepoCIDeliveriesOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MirrorCollaboratorAdditional to nil") + return errors.New("invalid: unable to decode ListRepoCIDeliveriesOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -21103,34 +21298,34 @@ func (s *MirrorCollaboratorAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode MirrorCollaboratorAdditional") + return errors.Wrap(err, "decode ListRepoCIDeliveriesOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s MirrorCollaboratorAdditional) MarshalJSON() ([]byte, error) { +func (s ListRepoCIDeliveriesOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MirrorCollaboratorAdditional) UnmarshalJSON(data []byte) error { +func (s *ListRepoCIDeliveriesOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *MirrorRequest) Encode(e *jx.Encoder) { +func (s *ListRepoCIProvidersOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *MirrorRequest) encodeFields(e *jx.Encoder) { +func (s *ListRepoCIProvidersOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -21138,24 +21333,12 @@ func (s *MirrorRequest) encodeFields(e *jx.Encoder) { } } { - if s.Failure.Set { - e.FieldStart("failure") - s.Failure.Encode(e) - } - } - { - e.FieldStart("requestId") - json.EncodeUUID(e, s.RequestId) - } - { - if s.Result.Set { - e.FieldStart("result") - s.Result.Encode(e) + e.FieldStart("providers") + e.ArrStart() + for _, elem := range s.Providers { + elem.Encode(e) } - } - { - e.FieldStart("status") - s.Status.Encode(e) + e.ArrEnd() } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -21166,18 +21349,15 @@ func (s *MirrorRequest) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfMirrorRequest = [5]string{ +var jsonFieldsNameOfListRepoCIProvidersOutputBody = [2]string{ 0: "$schema", - 1: "failure", - 2: "requestId", - 3: "result", - 4: "status", + 1: "providers", } -// Decode decodes MirrorRequest from json. -func (s *MirrorRequest) Decode(d *jx.Decoder) error { +// Decode decodes ListRepoCIProvidersOutputBody from json. +func (s *ListRepoCIProvidersOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MirrorRequest to nil") + return errors.New("invalid: unable to decode ListRepoCIProvidersOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -21194,47 +21374,23 @@ func (s *MirrorRequest) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "failure": - if err := func() error { - s.Failure.Reset() - if err := s.Failure.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"failure\"") - } - case "requestId": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := json.DecodeUUID(d) - s.RequestId = v - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"requestId\"") - } - case "result": - if err := func() error { - s.Result.Reset() - if err := s.Result.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"result\"") - } - case "status": - requiredBitSet[0] |= 1 << 4 + case "providers": + requiredBitSet[0] |= 1 << 1 if err := func() error { - if err := s.Status.Decode(d); err != nil { + s.Providers = make([]CIProviderDescriptor, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem CIProviderDescriptor + if err := elem.Decode(d); err != nil { + return err + } + s.Providers = append(s.Providers, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"status\"") + return errors.Wrap(err, "decode field \"providers\"") } default: var elem jx.Raw @@ -21252,12 +21408,12 @@ func (s *MirrorRequest) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode MirrorRequest") + return errors.Wrap(err, "decode ListRepoCIProvidersOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00010100, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -21269,8 +21425,8 @@ func (s *MirrorRequest) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfMirrorRequest) { - name = jsonFieldsNameOfMirrorRequest[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListRepoCIProvidersOutputBody) { + name = jsonFieldsNameOfListRepoCIProvidersOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -21291,27 +21447,27 @@ func (s *MirrorRequest) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *MirrorRequest) MarshalJSON() ([]byte, error) { +func (s *ListRepoCIProvidersOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MirrorRequest) UnmarshalJSON(data []byte) error { +func (s *ListRepoCIProvidersOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s MirrorRequestAdditional) Encode(e *jx.Encoder) { +func (s ListRepoCIProvidersOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s MirrorRequestAdditional) encodeFields(e *jx.Encoder) { +func (s ListRepoCIProvidersOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -21321,10 +21477,10 @@ func (s MirrorRequestAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes MirrorRequestAdditional from json. -func (s *MirrorRequestAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListRepoCIProvidersOutputBodyAdditional from json. +func (s *ListRepoCIProvidersOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MirrorRequestAdditional to nil") + return errors.New("invalid: unable to decode ListRepoCIProvidersOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -21342,45 +21498,47 @@ func (s *MirrorRequestAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode MirrorRequestAdditional") + return errors.Wrap(err, "decode ListRepoCIProvidersOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s MirrorRequestAdditional) MarshalJSON() ([]byte, error) { +func (s ListRepoCIProvidersOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MirrorRequestAdditional) UnmarshalJSON(data []byte) error { +func (s *ListRepoCIProvidersOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *MirrorRequestFailure) Encode(e *jx.Encoder) { +func (s *ListRepoCIWebhookAuditOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *MirrorRequestFailure) encodeFields(e *jx.Encoder) { - { - e.FieldStart("code") - e.Str(s.Code) - } +func (s *ListRepoCIWebhookAuditOutputBody) encodeFields(e *jx.Encoder) { { - e.FieldStart("message") - e.Str(s.Message) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } } { - e.FieldStart("retryable") - e.Bool(s.Retryable) + e.FieldStart("events") + e.ArrStart() + for _, elem := range s.Events { + elem.Encode(e) + } + e.ArrEnd() } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -21391,57 +21549,48 @@ func (s *MirrorRequestFailure) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfMirrorRequestFailure = [3]string{ - 0: "code", - 1: "message", - 2: "retryable", +var jsonFieldsNameOfListRepoCIWebhookAuditOutputBody = [2]string{ + 0: "$schema", + 1: "events", } -// Decode decodes MirrorRequestFailure from json. -func (s *MirrorRequestFailure) Decode(d *jx.Decoder) error { +// Decode decodes ListRepoCIWebhookAuditOutputBody from json. +func (s *ListRepoCIWebhookAuditOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MirrorRequestFailure to nil") + return errors.New("invalid: unable to decode ListRepoCIWebhookAuditOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "code": - requiredBitSet[0] |= 1 << 0 + case "$schema": if err := func() error { - v, err := d.Str() - s.Code = string(v) - if err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"code\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "message": + case "events": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.Message = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"message\"") - } - case "retryable": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Bool() - s.Retryable = bool(v) - if err != nil { + s.Events = make([]CIWebhookAuditEventView, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem CIWebhookAuditEventView + if err := elem.Decode(d); err != nil { + return err + } + s.Events = append(s.Events, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"retryable\"") + return errors.Wrap(err, "decode field \"events\"") } default: var elem jx.Raw @@ -21459,12 +21608,12 @@ func (s *MirrorRequestFailure) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode MirrorRequestFailure") + return errors.Wrap(err, "decode ListRepoCIWebhookAuditOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000111, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -21476,8 +21625,8 @@ func (s *MirrorRequestFailure) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfMirrorRequestFailure) { - name = jsonFieldsNameOfMirrorRequestFailure[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListRepoCIWebhookAuditOutputBody) { + name = jsonFieldsNameOfListRepoCIWebhookAuditOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -21498,27 +21647,27 @@ func (s *MirrorRequestFailure) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *MirrorRequestFailure) MarshalJSON() ([]byte, error) { +func (s *ListRepoCIWebhookAuditOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MirrorRequestFailure) UnmarshalJSON(data []byte) error { +func (s *ListRepoCIWebhookAuditOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s MirrorRequestFailureAdditional) Encode(e *jx.Encoder) { +func (s ListRepoCIWebhookAuditOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s MirrorRequestFailureAdditional) encodeFields(e *jx.Encoder) { +func (s ListRepoCIWebhookAuditOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -21528,10 +21677,10 @@ func (s MirrorRequestFailureAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes MirrorRequestFailureAdditional from json. -func (s *MirrorRequestFailureAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListRepoCIWebhookAuditOutputBodyAdditional from json. +func (s *ListRepoCIWebhookAuditOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MirrorRequestFailureAdditional to nil") + return errors.New("invalid: unable to decode ListRepoCIWebhookAuditOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -21549,45 +21698,47 @@ func (s *MirrorRequestFailureAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode MirrorRequestFailureAdditional") + return errors.Wrap(err, "decode ListRepoCIWebhookAuditOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s MirrorRequestFailureAdditional) MarshalJSON() ([]byte, error) { +func (s ListRepoCIWebhookAuditOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MirrorRequestFailureAdditional) UnmarshalJSON(data []byte) error { +func (s *ListRepoCIWebhookAuditOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *MirrorRequestResult) Encode(e *jx.Encoder) { +func (s *ListRepoCIWebhooksOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *MirrorRequestResult) encodeFields(e *jx.Encoder) { - { - e.FieldStart("mirrorId") - e.Str(s.MirrorId) - } +func (s *ListRepoCIWebhooksOutputBody) encodeFields(e *jx.Encoder) { { - e.FieldStart("mirrorUrl") - e.Str(s.MirrorUrl) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } } { - e.FieldStart("publicUrl") - e.Str(s.PublicUrl) + e.FieldStart("subscriptions") + e.ArrStart() + for _, elem := range s.Subscriptions { + elem.Encode(e) + } + e.ArrEnd() } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -21598,57 +21749,48 @@ func (s *MirrorRequestResult) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfMirrorRequestResult = [3]string{ - 0: "mirrorId", - 1: "mirrorUrl", - 2: "publicUrl", +var jsonFieldsNameOfListRepoCIWebhooksOutputBody = [2]string{ + 0: "$schema", + 1: "subscriptions", } -// Decode decodes MirrorRequestResult from json. -func (s *MirrorRequestResult) Decode(d *jx.Decoder) error { +// Decode decodes ListRepoCIWebhooksOutputBody from json. +func (s *ListRepoCIWebhooksOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MirrorRequestResult to nil") + return errors.New("invalid: unable to decode ListRepoCIWebhooksOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "mirrorId": - requiredBitSet[0] |= 1 << 0 + case "$schema": if err := func() error { - v, err := d.Str() - s.MirrorId = string(v) - if err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"mirrorId\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "mirrorUrl": + case "subscriptions": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.MirrorUrl = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"mirrorUrl\"") - } - case "publicUrl": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.PublicUrl = string(v) - if err != nil { + s.Subscriptions = make([]CIWebhookView, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem CIWebhookView + if err := elem.Decode(d); err != nil { + return err + } + s.Subscriptions = append(s.Subscriptions, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"publicUrl\"") + return errors.Wrap(err, "decode field \"subscriptions\"") } default: var elem jx.Raw @@ -21666,12 +21808,12 @@ func (s *MirrorRequestResult) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode MirrorRequestResult") + return errors.Wrap(err, "decode ListRepoCIWebhooksOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000111, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -21683,8 +21825,8 @@ func (s *MirrorRequestResult) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfMirrorRequestResult) { - name = jsonFieldsNameOfMirrorRequestResult[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListRepoCIWebhooksOutputBody) { + name = jsonFieldsNameOfListRepoCIWebhooksOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -21705,27 +21847,27 @@ func (s *MirrorRequestResult) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *MirrorRequestResult) MarshalJSON() ([]byte, error) { +func (s *ListRepoCIWebhooksOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MirrorRequestResult) UnmarshalJSON(data []byte) error { +func (s *ListRepoCIWebhooksOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s MirrorRequestResultAdditional) Encode(e *jx.Encoder) { +func (s ListRepoCIWebhooksOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s MirrorRequestResultAdditional) encodeFields(e *jx.Encoder) { +func (s ListRepoCIWebhooksOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -21735,10 +21877,10 @@ func (s MirrorRequestResultAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes MirrorRequestResultAdditional from json. -func (s *MirrorRequestResultAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListRepoCIWebhooksOutputBodyAdditional from json. +func (s *ListRepoCIWebhooksOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MirrorRequestResultAdditional to nil") + return errors.New("invalid: unable to decode ListRepoCIWebhooksOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -21756,122 +21898,34 @@ func (s *MirrorRequestResultAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode MirrorRequestResultAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s MirrorRequestResultAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MirrorRequestResultAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes MirrorRequestStatus as json. -func (s MirrorRequestStatus) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes MirrorRequestStatus from json. -func (s *MirrorRequestStatus) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode MirrorRequestStatus to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch MirrorRequestStatus(v) { - case MirrorRequestStatusPending: - *s = MirrorRequestStatusPending - case MirrorRequestStatusProcessing: - *s = MirrorRequestStatusProcessing - case MirrorRequestStatusSucceeded: - *s = MirrorRequestStatusSucceeded - case MirrorRequestStatusFailed: - *s = MirrorRequestStatusFailed - default: - *s = MirrorRequestStatus(v) - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s MirrorRequestStatus) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MirrorRequestStatus) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes MirrorStatus as json. -func (s MirrorStatus) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes MirrorStatus from json. -func (s *MirrorStatus) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode MirrorStatus to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch MirrorStatus(v) { - case MirrorStatusProcessing: - *s = MirrorStatusProcessing - case MirrorStatusReady: - *s = MirrorStatusReady - case MirrorStatusFailed: - *s = MirrorStatusFailed - case MirrorStatusSuspended: - *s = MirrorStatusSuspended - default: - *s = MirrorStatus(v) + return errors.Wrap(err, "decode ListRepoCIWebhooksOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s MirrorStatus) MarshalJSON() ([]byte, error) { +func (s ListRepoCIWebhooksOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MirrorStatus) UnmarshalJSON(data []byte) error { +func (s *ListRepoCIWebhooksOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *NativeMirrorPlacement) Encode(e *jx.Encoder) { +func (s *ListRepoCollaboratorsOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *NativeMirrorPlacement) encodeFields(e *jx.Encoder) { +func (s *ListRepoCollaboratorsOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -21879,51 +21933,19 @@ func (s *NativeMirrorPlacement) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("attempts") - e.Int64(s.Attempts) - } - { - e.FieldStart("clusterSlug") - e.Str(s.ClusterSlug) - } - { - e.FieldStart("createdAt") - json.EncodeDateTime(e, s.CreatedAt) - } - { - if s.CreationFailedAt.Set { - e.FieldStart("creationFailedAt") - s.CreationFailedAt.Encode(e, json.EncodeDateTime) - } - } - { - e.FieldStart("desiredState") - s.DesiredState.Encode(e) - } - { - if s.LastError.Set { - e.FieldStart("lastError") - s.LastError.Encode(e) + e.FieldStart("collaborators") + e.ArrStart() + for _, elem := range s.Collaborators { + elem.Encode(e) } + e.ArrEnd() } { - if s.NextRetryAt.Set { - e.FieldStart("nextRetryAt") - s.NextRetryAt.Encode(e, json.EncodeDateTime) + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) } } - { - e.FieldStart("placementId") - e.Str(s.PlacementId) - } - { - e.FieldStart("stage") - s.Stage.Encode(e) - } - { - e.FieldStart("status") - s.Status.Encode(e) - } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -21933,26 +21955,18 @@ func (s *NativeMirrorPlacement) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfNativeMirrorPlacement = [11]string{ - 0: "$schema", - 1: "attempts", - 2: "clusterSlug", - 3: "createdAt", - 4: "creationFailedAt", - 5: "desiredState", - 6: "lastError", - 7: "nextRetryAt", - 8: "placementId", - 9: "stage", - 10: "status", +var jsonFieldsNameOfListRepoCollaboratorsOutputBody = [3]string{ + 0: "$schema", + 1: "collaborators", + 2: "nextPageToken", } -// Decode decodes NativeMirrorPlacement from json. -func (s *NativeMirrorPlacement) Decode(d *jx.Decoder) error { +// Decode decodes ListRepoCollaboratorsOutputBody from json. +func (s *ListRepoCollaboratorsOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode NativeMirrorPlacement to nil") + return errors.New("invalid: unable to decode ListRepoCollaboratorsOutputBody to nil") } - var requiredBitSet [2]uint8 + var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -21967,113 +21981,33 @@ func (s *NativeMirrorPlacement) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "attempts": + case "collaborators": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Int64() - s.Attempts = int64(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"attempts\"") - } - case "clusterSlug": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.ClusterSlug = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"clusterSlug\"") - } - case "createdAt": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - v, err := json.DecodeDateTime(d) - s.CreatedAt = v - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"createdAt\"") - } - case "creationFailedAt": - if err := func() error { - s.CreationFailedAt.Reset() - if err := s.CreationFailedAt.Decode(d, json.DecodeDateTime); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"creationFailedAt\"") - } - case "desiredState": - requiredBitSet[0] |= 1 << 5 - if err := func() error { - if err := s.DesiredState.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"desiredState\"") - } - case "lastError": - if err := func() error { - s.LastError.Reset() - if err := s.LastError.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"lastError\"") - } - case "nextRetryAt": - if err := func() error { - s.NextRetryAt.Reset() - if err := s.NextRetryAt.Decode(d, json.DecodeDateTime); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"nextRetryAt\"") - } - case "placementId": - requiredBitSet[1] |= 1 << 0 - if err := func() error { - v, err := d.Str() - s.PlacementId = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"placementId\"") - } - case "stage": - requiredBitSet[1] |= 1 << 1 - if err := func() error { - if err := s.Stage.Decode(d); err != nil { + s.Collaborators = make([]RepoCollaborator, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem RepoCollaborator + if err := elem.Decode(d); err != nil { + return err + } + s.Collaborators = append(s.Collaborators, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"stage\"") + return errors.Wrap(err, "decode field \"collaborators\"") } - case "status": - requiredBitSet[1] |= 1 << 2 + case "nextPageToken": if err := func() error { - if err := s.Status.Decode(d); err != nil { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"status\"") + return errors.Wrap(err, "decode field \"nextPageToken\"") } default: var elem jx.Raw @@ -22091,13 +22025,12 @@ func (s *NativeMirrorPlacement) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode NativeMirrorPlacement") + return errors.Wrap(err, "decode ListRepoCollaboratorsOutputBody") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [2]uint8{ - 0b00101110, - 0b00000111, + for i, mask := range [1]uint8{ + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -22109,8 +22042,8 @@ func (s *NativeMirrorPlacement) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfNativeMirrorPlacement) { - name = jsonFieldsNameOfNativeMirrorPlacement[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListRepoCollaboratorsOutputBody) { + name = jsonFieldsNameOfListRepoCollaboratorsOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -22131,27 +22064,27 @@ func (s *NativeMirrorPlacement) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *NativeMirrorPlacement) MarshalJSON() ([]byte, error) { +func (s *ListRepoCollaboratorsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *NativeMirrorPlacement) UnmarshalJSON(data []byte) error { +func (s *ListRepoCollaboratorsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s NativeMirrorPlacementAdditional) Encode(e *jx.Encoder) { +func (s ListRepoCollaboratorsOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s NativeMirrorPlacementAdditional) encodeFields(e *jx.Encoder) { +func (s ListRepoCollaboratorsOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -22161,10 +22094,10 @@ func (s NativeMirrorPlacementAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes NativeMirrorPlacementAdditional from json. -func (s *NativeMirrorPlacementAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListRepoCollaboratorsOutputBodyAdditional from json. +func (s *ListRepoCollaboratorsOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode NativeMirrorPlacementAdditional to nil") + return errors.New("invalid: unable to decode ListRepoCollaboratorsOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -22182,183 +22115,280 @@ func (s *NativeMirrorPlacementAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode NativeMirrorPlacementAdditional") + return errors.Wrap(err, "decode ListRepoCollaboratorsOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s NativeMirrorPlacementAdditional) MarshalJSON() ([]byte, error) { +func (s ListRepoCollaboratorsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *NativeMirrorPlacementAdditional) UnmarshalJSON(data []byte) error { +func (s *ListRepoCollaboratorsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes NativeMirrorPlacementDesiredState as json. -func (s NativeMirrorPlacementDesiredState) Encode(e *jx.Encoder) { - e.Str(string(s)) +// Encode implements json.Marshaler. +func (s *ListRepoGrantsOutputBody) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() } -// Decode decodes NativeMirrorPlacementDesiredState from json. -func (s *NativeMirrorPlacementDesiredState) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode NativeMirrorPlacementDesiredState to nil") - } - v, err := d.StrBytes() - if err != nil { - return err +// encodeFields encodes fields. +func (s *ListRepoGrantsOutputBody) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } } - // Try to use constant string. - switch NativeMirrorPlacementDesiredState(v) { - case NativeMirrorPlacementDesiredStateActive: - *s = NativeMirrorPlacementDesiredStateActive - case NativeMirrorPlacementDesiredStateDeleted: - *s = NativeMirrorPlacementDesiredStateDeleted - default: - *s = NativeMirrorPlacementDesiredState(v) + { + e.FieldStart("grants") + e.ArrStart() + for _, elem := range s.Grants { + elem.Encode(e) + } + e.ArrEnd() } + { + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) + } + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s NativeMirrorPlacementDesiredState) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *NativeMirrorPlacementDesiredState) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) + if len(elem) != 0 { + e.Raw(elem) + } + } } -// Encode encodes NativeMirrorPlacementStage as json. -func (s NativeMirrorPlacementStage) Encode(e *jx.Encoder) { - e.Str(string(s)) +var jsonFieldsNameOfListRepoGrantsOutputBody = [3]string{ + 0: "$schema", + 1: "grants", + 2: "nextPageToken", } -// Decode decodes NativeMirrorPlacementStage from json. -func (s *NativeMirrorPlacementStage) Decode(d *jx.Decoder) error { +// Decode decodes ListRepoGrantsOutputBody from json. +func (s *ListRepoGrantsOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode NativeMirrorPlacementStage to nil") + return errors.New("invalid: unable to decode ListRepoGrantsOutputBody to nil") } - v, err := d.StrBytes() - if err != nil { - return err + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "grants": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + s.Grants = make([]RepoGrant, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem RepoGrant + if err := elem.Decode(d); err != nil { + return err + } + s.Grants = append(s.Grants, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"grants\"") + } + case "nextPageToken": + if err := func() error { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"nextPageToken\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode ListRepoGrantsOutputBody") } - // Try to use constant string. - switch NativeMirrorPlacementStage(v) { - case NativeMirrorPlacementStagePending: - *s = NativeMirrorPlacementStagePending - case NativeMirrorPlacementStageProvisioned: - *s = NativeMirrorPlacementStageProvisioned - case NativeMirrorPlacementStageRegistered: - *s = NativeMirrorPlacementStageRegistered - case NativeMirrorPlacementStageSeeded: - *s = NativeMirrorPlacementStageSeeded - case NativeMirrorPlacementStageAnnounced: - *s = NativeMirrorPlacementStageAnnounced - default: - *s = NativeMirrorPlacementStage(v) + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00000010, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfListRepoGrantsOutputBody) { + name = jsonFieldsNameOfListRepoGrantsOutputBody[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s NativeMirrorPlacementStage) MarshalJSON() ([]byte, error) { +func (s *ListRepoGrantsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *NativeMirrorPlacementStage) UnmarshalJSON(data []byte) error { +func (s *ListRepoGrantsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes NativeMirrorPlacementStatus as json. -func (s NativeMirrorPlacementStatus) Encode(e *jx.Encoder) { - e.Str(string(s)) +// Encode implements json.Marshaler. +func (s ListRepoGrantsOutputBodyAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() } -// Decode decodes NativeMirrorPlacementStatus from json. -func (s *NativeMirrorPlacementStatus) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode NativeMirrorPlacementStatus to nil") +// encodeFields implements json.Marshaler. +func (s ListRepoGrantsOutputBodyAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } } - v, err := d.StrBytes() - if err != nil { - return err +} + +// Decode decodes ListRepoGrantsOutputBodyAdditional from json. +func (s *ListRepoGrantsOutputBodyAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode ListRepoGrantsOutputBodyAdditional to nil") } - // Try to use constant string. - switch NativeMirrorPlacementStatus(v) { - case NativeMirrorPlacementStatusProcessing: - *s = NativeMirrorPlacementStatusProcessing - case NativeMirrorPlacementStatusReady: - *s = NativeMirrorPlacementStatusReady - case NativeMirrorPlacementStatusFailed: - *s = NativeMirrorPlacementStatusFailed - case NativeMirrorPlacementStatusSuspended: - *s = NativeMirrorPlacementStatusSuspended - default: - *s = NativeMirrorPlacementStatus(v) + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode ListRepoGrantsOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s NativeMirrorPlacementStatus) MarshalJSON() ([]byte, error) { +func (s ListRepoGrantsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *NativeMirrorPlacementStatus) UnmarshalJSON(data []byte) error { +func (s *ListRepoGrantsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *OIDCProvider) Encode(e *jx.Encoder) { +func (s *ListReposOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *OIDCProvider) encodeFields(e *jx.Encoder) { +func (s *ListReposOutputBody) encodeFields(e *jx.Encoder) { { - if s.Description.Set { - e.FieldStart("description") - s.Description.Encode(e) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) } } { - if s.DisplayName.Set { - e.FieldStart("displayName") - s.DisplayName.Encode(e) + if s.CandidatesIncomplete.Set { + e.FieldStart("candidatesIncomplete") + s.CandidatesIncomplete.Encode(e) } } { - e.FieldStart("id") - e.Str(s.ID) + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) + } } { - e.FieldStart("issuer") - e.Str(s.Issuer) + e.FieldStart("repos") + e.ArrStart() + for _, elem := range s.Repos { + elem.Encode(e) + } + e.ArrEnd() + } + { + e.FieldStart("truncated") + e.Bool(s.Truncated) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -22369,66 +22399,83 @@ func (s *OIDCProvider) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfOIDCProvider = [4]string{ - 0: "description", - 1: "displayName", - 2: "id", - 3: "issuer", +var jsonFieldsNameOfListReposOutputBody = [5]string{ + 0: "$schema", + 1: "candidatesIncomplete", + 2: "nextPageToken", + 3: "repos", + 4: "truncated", } -// Decode decodes OIDCProvider from json. -func (s *OIDCProvider) Decode(d *jx.Decoder) error { +// Decode decodes ListReposOutputBody from json. +func (s *ListReposOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode OIDCProvider to nil") + return errors.New("invalid: unable to decode ListReposOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "description": + case "$schema": if err := func() error { - s.Description.Reset() - if err := s.Description.Decode(d); err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"description\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "displayName": + case "candidatesIncomplete": if err := func() error { - s.DisplayName.Reset() - if err := s.DisplayName.Decode(d); err != nil { + s.CandidatesIncomplete.Reset() + if err := s.CandidatesIncomplete.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"displayName\"") + return errors.Wrap(err, "decode field \"candidatesIncomplete\"") } - case "id": - requiredBitSet[0] |= 1 << 2 + case "nextPageToken": if err := func() error { - v, err := d.Str() - s.ID = string(v) - if err != nil { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"id\"") + return errors.Wrap(err, "decode field \"nextPageToken\"") } - case "issuer": + case "repos": requiredBitSet[0] |= 1 << 3 if err := func() error { - v, err := d.Str() - s.Issuer = string(v) + s.Repos = make([]RepoIndexEntry, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem RepoIndexEntry + if err := elem.Decode(d); err != nil { + return err + } + s.Repos = append(s.Repos, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"repos\"") + } + case "truncated": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + v, err := d.Bool() + s.Truncated = bool(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"issuer\"") + return errors.Wrap(err, "decode field \"truncated\"") } default: var elem jx.Raw @@ -22446,12 +22493,12 @@ func (s *OIDCProvider) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode OIDCProvider") + return errors.Wrap(err, "decode ListReposOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00001100, + 0b00011000, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -22463,8 +22510,8 @@ func (s *OIDCProvider) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfOIDCProvider) { - name = jsonFieldsNameOfOIDCProvider[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfListReposOutputBody) { + name = jsonFieldsNameOfListReposOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -22485,27 +22532,27 @@ func (s *OIDCProvider) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *OIDCProvider) MarshalJSON() ([]byte, error) { +func (s *ListReposOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OIDCProvider) UnmarshalJSON(data []byte) error { +func (s *ListReposOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s OIDCProviderAdditional) Encode(e *jx.Encoder) { +func (s ListReposOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s OIDCProviderAdditional) encodeFields(e *jx.Encoder) { +func (s ListReposOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -22515,10 +22562,10 @@ func (s OIDCProviderAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes OIDCProviderAdditional from json. -func (s *OIDCProviderAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ListReposOutputBodyAdditional from json. +func (s *ListReposOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode OIDCProviderAdditional to nil") + return errors.New("invalid: unable to decode ListReposOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -22536,1106 +22583,9110 @@ func (s *OIDCProviderAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode OIDCProviderAdditional") + return errors.Wrap(err, "decode ListReposOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OIDCProviderAdditional) MarshalJSON() ([]byte, error) { +func (s ListReposOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OIDCProviderAdditional) UnmarshalJSON(data []byte) error { +func (s *ListReposOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes AddOrgMemberInputBodyRole as json. -func (o OptAddOrgMemberInputBodyRole) Encode(e *jx.Encoder) { - if !o.Set { - return +// Encode implements json.Marshaler. +func (s *ListServiceAccountGrantsOutputBody) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *ListServiceAccountGrantsOutputBody) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } + } + { + e.FieldStart("grants") + e.ArrStart() + for _, elem := range s.Grants { + elem.Encode(e) + } + e.ArrEnd() + } + { + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) + } + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } } - e.Str(string(o.Value)) } -// Decode decodes AddOrgMemberInputBodyRole from json. -func (o *OptAddOrgMemberInputBodyRole) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptAddOrgMemberInputBodyRole to nil") +var jsonFieldsNameOfListServiceAccountGrantsOutputBody = [3]string{ + 0: "$schema", + 1: "grants", + 2: "nextPageToken", +} + +// Decode decodes ListServiceAccountGrantsOutputBody from json. +func (s *ListServiceAccountGrantsOutputBody) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode ListServiceAccountGrantsOutputBody to nil") } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "grants": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + s.Grants = make([]ServiceAccountGrant, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem ServiceAccountGrant + if err := elem.Decode(d); err != nil { + return err + } + s.Grants = append(s.Grants, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"grants\"") + } + case "nextPageToken": + if err := func() error { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"nextPageToken\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode ListServiceAccountGrantsOutputBody") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00000010, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfListServiceAccountGrantsOutputBody) { + name = jsonFieldsNameOfListServiceAccountGrantsOutputBody[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptAddOrgMemberInputBodyRole) MarshalJSON() ([]byte, error) { +func (s *ListServiceAccountGrantsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptAddOrgMemberInputBodyRole) UnmarshalJSON(data []byte) error { +func (s *ListServiceAccountGrantsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes AuditEventMetadata as json. -func (o OptAuditEventMetadata) Encode(e *jx.Encoder) { - if !o.Set { - return - } - o.Value.Encode(e) +// Encode implements json.Marshaler. +func (s ListServiceAccountGrantsOutputBodyAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() } -// Decode decodes AuditEventMetadata from json. -func (o *OptAuditEventMetadata) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptAuditEventMetadata to nil") +// encodeFields implements json.Marshaler. +func (s ListServiceAccountGrantsOutputBodyAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } } - o.Set = true - o.Value = make(AuditEventMetadata) - if err := o.Value.Decode(d); err != nil { - return err +} + +// Decode decodes ListServiceAccountGrantsOutputBodyAdditional from json. +func (s *ListServiceAccountGrantsOutputBodyAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode ListServiceAccountGrantsOutputBodyAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode ListServiceAccountGrantsOutputBodyAdditional") } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptAuditEventMetadata) MarshalJSON() ([]byte, error) { +func (s ListServiceAccountGrantsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptAuditEventMetadata) UnmarshalJSON(data []byte) error { +func (s *ListServiceAccountGrantsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes bool as json. -func (o OptBool) Encode(e *jx.Encoder) { - if !o.Set { - return - } - e.Bool(bool(o.Value)) +// Encode implements json.Marshaler. +func (s *ListServiceAccountsOutputBody) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() } -// Decode decodes bool from json. -func (o *OptBool) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptBool to nil") +// encodeFields encodes fields. +func (s *ListServiceAccountsOutputBody) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } } - o.Set = true - v, err := d.Bool() - if err != nil { - return err + { + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) + } } - o.Value = bool(v) - return nil -} + { + e.FieldStart("serviceAccounts") + e.ArrStart() + for _, elem := range s.ServiceAccounts { + elem.Encode(e) + } + e.ArrEnd() + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) -// MarshalJSON implements stdjson.Marshaler. -func (s OptBool) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil + if len(elem) != 0 { + e.Raw(elem) + } + } } -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptBool) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) +var jsonFieldsNameOfListServiceAccountsOutputBody = [3]string{ + 0: "$schema", + 1: "nextPageToken", + 2: "serviceAccounts", } -// Encode encodes CISetupBlock as json. -func (o OptCISetupBlock) Encode(e *jx.Encoder) { - if !o.Set { - return +// Decode decodes ListServiceAccountsOutputBody from json. +func (s *ListServiceAccountsOutputBody) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode ListServiceAccountsOutputBody to nil") } - o.Value.Encode(e) -} + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} -// Decode decodes CISetupBlock from json. -func (o *OptCISetupBlock) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptCISetupBlock to nil") + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "nextPageToken": + if err := func() error { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"nextPageToken\"") + } + case "serviceAccounts": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + s.ServiceAccounts = make([]ServiceAccountWithGrants, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem ServiceAccountWithGrants + if err := elem.Decode(d); err != nil { + return err + } + s.ServiceAccounts = append(s.ServiceAccounts, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"serviceAccounts\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode ListServiceAccountsOutputBody") } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00000100, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfListServiceAccountsOutputBody) { + name = jsonFieldsNameOfListServiceAccountsOutputBody[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptCISetupBlock) MarshalJSON() ([]byte, error) { +func (s *ListServiceAccountsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptCISetupBlock) UnmarshalJSON(data []byte) error { +func (s *ListServiceAccountsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes CIWebhookAuditEventViewMetadata as json. -func (o OptCIWebhookAuditEventViewMetadata) Encode(e *jx.Encoder) { - if !o.Set { - return +// Encode implements json.Marshaler. +func (s ListServiceAccountsOutputBodyAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s ListServiceAccountsOutputBodyAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } } - o.Value.Encode(e) } -// Decode decodes CIWebhookAuditEventViewMetadata from json. -func (o *OptCIWebhookAuditEventViewMetadata) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptCIWebhookAuditEventViewMetadata to nil") +// Decode decodes ListServiceAccountsOutputBodyAdditional from json. +func (s *ListServiceAccountsOutputBodyAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode ListServiceAccountsOutputBodyAdditional to nil") } - o.Set = true - o.Value = make(CIWebhookAuditEventViewMetadata) - if err := o.Value.Decode(d); err != nil { - return err + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode ListServiceAccountsOutputBodyAdditional") } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptCIWebhookAuditEventViewMetadata) MarshalJSON() ([]byte, error) { +func (s ListServiceAccountsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptCIWebhookAuditEventViewMetadata) UnmarshalJSON(data []byte) error { +func (s *ListServiceAccountsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes CreateRepoCIWebhookInputBodyConfig as json. -func (o OptCreateRepoCIWebhookInputBodyConfig) Encode(e *jx.Encoder) { - if !o.Set { - return - } - o.Value.Encode(e) +// Encode implements json.Marshaler. +func (s *LookupBySlugOutputBody) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() } -// Decode decodes CreateRepoCIWebhookInputBodyConfig from json. -func (o *OptCreateRepoCIWebhookInputBodyConfig) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptCreateRepoCIWebhookInputBodyConfig to nil") +// encodeFields encodes fields. +func (s *LookupBySlugOutputBody) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } } - o.Set = true - o.Value = make(CreateRepoCIWebhookInputBodyConfig) - if err := o.Value.Decode(d); err != nil { - return err + { + e.FieldStart("cell") + e.Str(s.Cell) } - return nil -} + { + e.FieldStart("jurisdiction") + e.Str(s.Jurisdiction) + } + { + e.FieldStart("owner") + e.Str(s.Owner) + } + { + e.FieldStart("repo") + e.Str(s.Repo) + } + { + e.FieldStart("repoId") + e.Str(s.RepoId) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) -// MarshalJSON implements stdjson.Marshaler. -func (s OptCreateRepoCIWebhookInputBodyConfig) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil + if len(elem) != 0 { + e.Raw(elem) + } + } } -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptCreateRepoCIWebhookInputBodyConfig) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) +var jsonFieldsNameOfLookupBySlugOutputBody = [6]string{ + 0: "$schema", + 1: "cell", + 2: "jurisdiction", + 3: "owner", + 4: "repo", + 5: "repoId", } -// Encode encodes CreateRepoInputBodyObjectFormat as json. -func (o OptCreateRepoInputBodyObjectFormat) Encode(e *jx.Encoder) { - if !o.Set { - return +// Decode decodes LookupBySlugOutputBody from json. +func (s *LookupBySlugOutputBody) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode LookupBySlugOutputBody to nil") } - e.Str(string(o.Value)) -} + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} -// Decode decodes CreateRepoInputBodyObjectFormat from json. -func (o *OptCreateRepoInputBodyObjectFormat) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptCreateRepoInputBodyObjectFormat to nil") + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "cell": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.Cell = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"cell\"") + } + case "jurisdiction": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.Jurisdiction = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"jurisdiction\"") + } + case "owner": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.Owner = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"owner\"") + } + case "repo": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + v, err := d.Str() + s.Repo = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"repo\"") + } + case "repoId": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + v, err := d.Str() + s.RepoId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"repoId\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode LookupBySlugOutputBody") } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00111110, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfLookupBySlugOutputBody) { + name = jsonFieldsNameOfLookupBySlugOutputBody[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptCreateRepoInputBodyObjectFormat) MarshalJSON() ([]byte, error) { +func (s *LookupBySlugOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptCreateRepoInputBodyObjectFormat) UnmarshalJSON(data []byte) error { +func (s *LookupBySlugOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes time.Time as json. -func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time)) { - if !o.Set { - return - } - format(e, o.Value) +// Encode implements json.Marshaler. +func (s LookupBySlugOutputBodyAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() } -// Decode decodes time.Time from json. -func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error { - if o == nil { - return errors.New("invalid: unable to decode OptDateTime to nil") - } - o.Set = true - v, err := format(d) - if err != nil { - return err +// encodeFields implements json.Marshaler. +func (s LookupBySlugOutputBodyAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } } - o.Value = v - return nil +} + +// Decode decodes LookupBySlugOutputBodyAdditional from json. +func (s *LookupBySlugOutputBodyAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode LookupBySlugOutputBodyAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode LookupBySlugOutputBodyAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s LookupBySlugOutputBodyAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *LookupBySlugOutputBodyAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *MeAuth) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *MeAuth) encodeFields(e *jx.Encoder) { + { + e.FieldStart("provider") + e.Str(s.Provider) + } + { + e.FieldStart("providerUserId") + e.Str(s.ProviderUserId) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfMeAuth = [2]string{ + 0: "provider", + 1: "providerUserId", +} + +// Decode decodes MeAuth from json. +func (s *MeAuth) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MeAuth to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "provider": + requiredBitSet[0] |= 1 << 0 + if err := func() error { + v, err := d.Str() + s.Provider = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider\"") + } + case "providerUserId": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.ProviderUserId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"providerUserId\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode MeAuth") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00000011, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfMeAuth) { + name = jsonFieldsNameOfMeAuth[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *MeAuth) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MeAuth) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s MeAuthAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s MeAuthAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes MeAuthAdditional from json. +func (s *MeAuthAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MeAuthAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode MeAuthAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s MeAuthAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MeAuthAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *MeDeletion) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *MeDeletion) encodeFields(e *jx.Encoder) { + { + e.FieldStart("cooldownEndsAt") + json.EncodeDateTime(e, s.CooldownEndsAt) + } + { + e.FieldStart("requestedAt") + json.EncodeDateTime(e, s.RequestedAt) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfMeDeletion = [2]string{ + 0: "cooldownEndsAt", + 1: "requestedAt", +} + +// Decode decodes MeDeletion from json. +func (s *MeDeletion) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MeDeletion to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "cooldownEndsAt": + requiredBitSet[0] |= 1 << 0 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.CooldownEndsAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"cooldownEndsAt\"") + } + case "requestedAt": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.RequestedAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"requestedAt\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode MeDeletion") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00000011, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfMeDeletion) { + name = jsonFieldsNameOfMeDeletion[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *MeDeletion) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MeDeletion) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s MeDeletionAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s MeDeletionAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes MeDeletionAdditional from json. +func (s *MeDeletionAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MeDeletionAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode MeDeletionAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s MeDeletionAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MeDeletionAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *MeGlobal) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *MeGlobal) encodeFields(e *jx.Encoder) { + { + e.FieldStart("accountId") + e.Str(s.AccountId) + } + { + if s.AvatarUrl.Set { + e.FieldStart("avatarUrl") + s.AvatarUrl.Encode(e) + } + } + { + e.FieldStart("createdAt") + json.EncodeDateTime(e, s.CreatedAt) + } + { + if s.Handle.Set { + e.FieldStart("handle") + s.Handle.Encode(e) + } + } + { + e.FieldStart("handles") + e.ArrStart() + for _, elem := range s.Handles { + elem.Encode(e) + } + e.ArrEnd() + } + { + if s.HomeJurisdiction.Set { + e.FieldStart("homeJurisdiction") + s.HomeJurisdiction.Encode(e) + } + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfMeGlobal = [6]string{ + 0: "accountId", + 1: "avatarUrl", + 2: "createdAt", + 3: "handle", + 4: "handles", + 5: "homeJurisdiction", +} + +// Decode decodes MeGlobal from json. +func (s *MeGlobal) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MeGlobal to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "accountId": + requiredBitSet[0] |= 1 << 0 + if err := func() error { + v, err := d.Str() + s.AccountId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"accountId\"") + } + case "avatarUrl": + if err := func() error { + s.AvatarUrl.Reset() + if err := s.AvatarUrl.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"avatarUrl\"") + } + case "createdAt": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.CreatedAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"createdAt\"") + } + case "handle": + if err := func() error { + s.Handle.Reset() + if err := s.Handle.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"handle\"") + } + case "handles": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + s.Handles = make([]MeIdentityHandle, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem MeIdentityHandle + if err := elem.Decode(d); err != nil { + return err + } + s.Handles = append(s.Handles, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"handles\"") + } + case "homeJurisdiction": + if err := func() error { + s.HomeJurisdiction.Reset() + if err := s.HomeJurisdiction.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"homeJurisdiction\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode MeGlobal") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00010101, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfMeGlobal) { + name = jsonFieldsNameOfMeGlobal[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *MeGlobal) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MeGlobal) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s MeGlobalAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s MeGlobalAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes MeGlobalAdditional from json. +func (s *MeGlobalAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MeGlobalAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode MeGlobalAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s MeGlobalAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MeGlobalAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *MeIdentityHandle) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *MeIdentityHandle) encodeFields(e *jx.Encoder) { + { + if s.Email.Set { + e.FieldStart("email") + s.Email.Encode(e) + } + } + { + e.FieldStart("handle") + e.Str(s.Handle) + } + { + e.FieldStart("provider") + e.Str(s.Provider) + } + { + e.FieldStart("providerUserId") + e.Str(s.ProviderUserId) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfMeIdentityHandle = [4]string{ + 0: "email", + 1: "handle", + 2: "provider", + 3: "providerUserId", +} + +// Decode decodes MeIdentityHandle from json. +func (s *MeIdentityHandle) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MeIdentityHandle to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "email": + if err := func() error { + s.Email.Reset() + if err := s.Email.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"email\"") + } + case "handle": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.Handle = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"handle\"") + } + case "provider": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.Provider = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider\"") + } + case "providerUserId": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.ProviderUserId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"providerUserId\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode MeIdentityHandle") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00001110, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfMeIdentityHandle) { + name = jsonFieldsNameOfMeIdentityHandle[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *MeIdentityHandle) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MeIdentityHandle) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s MeIdentityHandleAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s MeIdentityHandleAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes MeIdentityHandleAdditional from json. +func (s *MeIdentityHandleAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MeIdentityHandleAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode MeIdentityHandleAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s MeIdentityHandleAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MeIdentityHandleAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *MeRegional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *MeRegional) encodeFields(e *jx.Encoder) { + { + if s.Bio.Set { + e.FieldStart("bio") + s.Bio.Encode(e) + } + } + { + if s.Company.Set { + e.FieldStart("company") + s.Company.Encode(e) + } + } + { + if s.DisplayName.Set { + e.FieldStart("displayName") + s.DisplayName.Encode(e) + } + } + { + if s.Email.Set { + e.FieldStart("email") + s.Email.Encode(e) + } + } + { + if s.Location.Set { + e.FieldStart("location") + s.Location.Encode(e) + } + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfMeRegional = [5]string{ + 0: "bio", + 1: "company", + 2: "displayName", + 3: "email", + 4: "location", +} + +// Decode decodes MeRegional from json. +func (s *MeRegional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MeRegional to nil") + } + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "bio": + if err := func() error { + s.Bio.Reset() + if err := s.Bio.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"bio\"") + } + case "company": + if err := func() error { + s.Company.Reset() + if err := s.Company.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"company\"") + } + case "displayName": + if err := func() error { + s.DisplayName.Reset() + if err := s.DisplayName.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"displayName\"") + } + case "email": + if err := func() error { + s.Email.Reset() + if err := s.Email.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"email\"") + } + case "location": + if err := func() error { + s.Location.Reset() + if err := s.Location.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode MeRegional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *MeRegional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MeRegional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s MeRegionalAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s MeRegionalAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes MeRegionalAdditional from json. +func (s *MeRegionalAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MeRegionalAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode MeRegionalAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s MeRegionalAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MeRegionalAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *MeRegionalUnavailable) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *MeRegionalUnavailable) encodeFields(e *jx.Encoder) { + { + e.FieldStart("error") + s.Error.Encode(e) + } + { + e.FieldStart("homeCoreUrl") + e.Str(s.HomeCoreUrl) + } + { + e.FieldStart("jurisdiction") + e.Str(s.Jurisdiction) + } + { + e.FieldStart("message") + e.Str(s.Message) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfMeRegionalUnavailable = [4]string{ + 0: "error", + 1: "homeCoreUrl", + 2: "jurisdiction", + 3: "message", +} + +// Decode decodes MeRegionalUnavailable from json. +func (s *MeRegionalUnavailable) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MeRegionalUnavailable to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "error": + requiredBitSet[0] |= 1 << 0 + if err := func() error { + if err := s.Error.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"error\"") + } + case "homeCoreUrl": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.HomeCoreUrl = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"homeCoreUrl\"") + } + case "jurisdiction": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.Jurisdiction = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"jurisdiction\"") + } + case "message": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.Message = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"message\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode MeRegionalUnavailable") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00001111, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfMeRegionalUnavailable) { + name = jsonFieldsNameOfMeRegionalUnavailable[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *MeRegionalUnavailable) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MeRegionalUnavailable) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s MeRegionalUnavailableAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s MeRegionalUnavailableAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes MeRegionalUnavailableAdditional from json. +func (s *MeRegionalUnavailableAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MeRegionalUnavailableAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode MeRegionalUnavailableAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s MeRegionalUnavailableAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MeRegionalUnavailableAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes MeRegionalUnavailableError as json. +func (s MeRegionalUnavailableError) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes MeRegionalUnavailableError from json. +func (s *MeRegionalUnavailableError) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MeRegionalUnavailableError to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch MeRegionalUnavailableError(v) { + case MeRegionalUnavailableErrorForeignJurisdiction: + *s = MeRegionalUnavailableErrorForeignJurisdiction + default: + *s = MeRegionalUnavailableError(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s MeRegionalUnavailableError) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MeRegionalUnavailableError) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *Membership) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *Membership) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } + } + { + e.FieldStart("accountId") + e.Str(s.AccountId) + } + { + e.FieldStart("createdAt") + json.EncodeDateTime(e, s.CreatedAt) + } + { + if s.Handle.Set { + e.FieldStart("handle") + s.Handle.Encode(e) + } + } + { + e.FieldStart("id") + e.Str(s.ID) + } + { + e.FieldStart("orgId") + e.Str(s.OrgId) + } + { + if s.Provider.Set { + e.FieldStart("provider") + s.Provider.Encode(e) + } + } + { + e.FieldStart("role") + e.Str(s.Role) + } + { + e.FieldStart("status") + e.Str(s.Status) + } + { + if s.WorkosOrgMembershipId.Set { + e.FieldStart("workosOrgMembershipId") + s.WorkosOrgMembershipId.Encode(e) + } + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfMembership = [10]string{ + 0: "$schema", + 1: "accountId", + 2: "createdAt", + 3: "handle", + 4: "id", + 5: "orgId", + 6: "provider", + 7: "role", + 8: "status", + 9: "workosOrgMembershipId", +} + +// Decode decodes Membership from json. +func (s *Membership) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode Membership to nil") + } + var requiredBitSet [2]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "accountId": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.AccountId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"accountId\"") + } + case "createdAt": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.CreatedAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"createdAt\"") + } + case "handle": + if err := func() error { + s.Handle.Reset() + if err := s.Handle.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"handle\"") + } + case "id": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + v, err := d.Str() + s.ID = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"id\"") + } + case "orgId": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + v, err := d.Str() + s.OrgId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"orgId\"") + } + case "provider": + if err := func() error { + s.Provider.Reset() + if err := s.Provider.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider\"") + } + case "role": + requiredBitSet[0] |= 1 << 7 + if err := func() error { + v, err := d.Str() + s.Role = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"role\"") + } + case "status": + requiredBitSet[1] |= 1 << 0 + if err := func() error { + v, err := d.Str() + s.Status = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"status\"") + } + case "workosOrgMembershipId": + if err := func() error { + s.WorkosOrgMembershipId.Reset() + if err := s.WorkosOrgMembershipId.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"workosOrgMembershipId\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode Membership") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [2]uint8{ + 0b10110110, + 0b00000001, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfMembership) { + name = jsonFieldsNameOfMembership[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *Membership) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *Membership) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s MembershipAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s MembershipAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes MembershipAdditional from json. +func (s *MembershipAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MembershipAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode MembershipAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s MembershipAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MembershipAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *MintOrgCIGitHubActionsCredentialInputBody) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *MintOrgCIGitHubActionsCredentialInputBody) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } + } + { + e.FieldStart("account") + e.Str(s.Account) + } + { + if s.APIToken.Set { + e.FieldStart("api_token") + s.APIToken.Encode(e) + } + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfMintOrgCIGitHubActionsCredentialInputBody = [3]string{ + 0: "$schema", + 1: "account", + 2: "api_token", +} + +// Decode decodes MintOrgCIGitHubActionsCredentialInputBody from json. +func (s *MintOrgCIGitHubActionsCredentialInputBody) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MintOrgCIGitHubActionsCredentialInputBody to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "account": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.Account = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"account\"") + } + case "api_token": + if err := func() error { + s.APIToken.Reset() + if err := s.APIToken.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"api_token\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode MintOrgCIGitHubActionsCredentialInputBody") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00000010, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfMintOrgCIGitHubActionsCredentialInputBody) { + name = jsonFieldsNameOfMintOrgCIGitHubActionsCredentialInputBody[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *MintOrgCIGitHubActionsCredentialInputBody) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MintOrgCIGitHubActionsCredentialInputBody) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s MintOrgCIGitHubActionsCredentialInputBodyAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s MintOrgCIGitHubActionsCredentialInputBodyAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes MintOrgCIGitHubActionsCredentialInputBodyAdditional from json. +func (s *MintOrgCIGitHubActionsCredentialInputBodyAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MintOrgCIGitHubActionsCredentialInputBodyAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode MintOrgCIGitHubActionsCredentialInputBodyAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s MintOrgCIGitHubActionsCredentialInputBodyAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MintOrgCIGitHubActionsCredentialInputBodyAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *Mirror) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *Mirror) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } + } + { + if s.Cell.Set { + e.FieldStart("cell") + s.Cell.Encode(e) + } + } + { + e.FieldStart("clusterHost") + e.Str(s.ClusterHost) + } + { + e.FieldStart("createdAt") + json.EncodeDateTime(e, s.CreatedAt) + } + { + if s.IsArchived.Set { + e.FieldStart("isArchived") + s.IsArchived.Encode(e) + } + } + { + if s.IsPrivate.Set { + e.FieldStart("isPrivate") + s.IsPrivate.Encode(e) + } + } + { + if s.IsProcessingPrimary.Set { + e.FieldStart("isProcessingPrimary") + s.IsProcessingPrimary.Encode(e) + } + } + { + if s.Jurisdiction.Set { + e.FieldStart("jurisdiction") + s.Jurisdiction.Encode(e) + } + } + { + e.FieldStart("mirrorId") + e.Str(s.MirrorId) + } + { + e.FieldStart("owner") + e.Str(s.Owner) + } + { + e.FieldStart("provider") + e.Str(s.Provider) + } + { + e.FieldStart("repo") + e.Str(s.Repo) + } + { + if s.Status.Set { + e.FieldStart("status") + s.Status.Encode(e) + } + } + { + if s.SuspendedAt.Set { + e.FieldStart("suspendedAt") + s.SuspendedAt.Encode(e, json.EncodeDateTime) + } + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfMirror = [14]string{ + 0: "$schema", + 1: "cell", + 2: "clusterHost", + 3: "createdAt", + 4: "isArchived", + 5: "isPrivate", + 6: "isProcessingPrimary", + 7: "jurisdiction", + 8: "mirrorId", + 9: "owner", + 10: "provider", + 11: "repo", + 12: "status", + 13: "suspendedAt", +} + +// Decode decodes Mirror from json. +func (s *Mirror) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode Mirror to nil") + } + var requiredBitSet [2]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "cell": + if err := func() error { + s.Cell.Reset() + if err := s.Cell.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"cell\"") + } + case "clusterHost": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.ClusterHost = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"clusterHost\"") + } + case "createdAt": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.CreatedAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"createdAt\"") + } + case "isArchived": + if err := func() error { + s.IsArchived.Reset() + if err := s.IsArchived.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"isArchived\"") + } + case "isPrivate": + if err := func() error { + s.IsPrivate.Reset() + if err := s.IsPrivate.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"isPrivate\"") + } + case "isProcessingPrimary": + if err := func() error { + s.IsProcessingPrimary.Reset() + if err := s.IsProcessingPrimary.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"isProcessingPrimary\"") + } + case "jurisdiction": + if err := func() error { + s.Jurisdiction.Reset() + if err := s.Jurisdiction.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"jurisdiction\"") + } + case "mirrorId": + requiredBitSet[1] |= 1 << 0 + if err := func() error { + v, err := d.Str() + s.MirrorId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"mirrorId\"") + } + case "owner": + requiredBitSet[1] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.Owner = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"owner\"") + } + case "provider": + requiredBitSet[1] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.Provider = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider\"") + } + case "repo": + requiredBitSet[1] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.Repo = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"repo\"") + } + case "status": + if err := func() error { + s.Status.Reset() + if err := s.Status.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"status\"") + } + case "suspendedAt": + if err := func() error { + s.SuspendedAt.Reset() + if err := s.SuspendedAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"suspendedAt\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode Mirror") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [2]uint8{ + 0b00001100, + 0b00001111, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfMirror) { + name = jsonFieldsNameOfMirror[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *Mirror) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *Mirror) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s MirrorAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s MirrorAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes MirrorAdditional from json. +func (s *MirrorAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MirrorAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode MirrorAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s MirrorAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MirrorAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *MirrorCollaborator) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *MirrorCollaborator) encodeFields(e *jx.Encoder) { + { + e.FieldStart("accountId") + e.Str(s.AccountId) + } + { + if s.Handle.Set { + e.FieldStart("handle") + s.Handle.Encode(e) + } + } + { + e.FieldStart("role") + e.Str(s.Role) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfMirrorCollaborator = [3]string{ + 0: "accountId", + 1: "handle", + 2: "role", +} + +// Decode decodes MirrorCollaborator from json. +func (s *MirrorCollaborator) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MirrorCollaborator to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "accountId": + requiredBitSet[0] |= 1 << 0 + if err := func() error { + v, err := d.Str() + s.AccountId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"accountId\"") + } + case "handle": + if err := func() error { + s.Handle.Reset() + if err := s.Handle.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"handle\"") + } + case "role": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.Role = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"role\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode MirrorCollaborator") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00000101, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfMirrorCollaborator) { + name = jsonFieldsNameOfMirrorCollaborator[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *MirrorCollaborator) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MirrorCollaborator) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s MirrorCollaboratorAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s MirrorCollaboratorAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes MirrorCollaboratorAdditional from json. +func (s *MirrorCollaboratorAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MirrorCollaboratorAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode MirrorCollaboratorAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s MirrorCollaboratorAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MirrorCollaboratorAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *MirrorRequest) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *MirrorRequest) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } + } + { + if s.Failure.Set { + e.FieldStart("failure") + s.Failure.Encode(e) + } + } + { + e.FieldStart("requestId") + json.EncodeUUID(e, s.RequestId) + } + { + if s.Result.Set { + e.FieldStart("result") + s.Result.Encode(e) + } + } + { + e.FieldStart("status") + s.Status.Encode(e) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfMirrorRequest = [5]string{ + 0: "$schema", + 1: "failure", + 2: "requestId", + 3: "result", + 4: "status", +} + +// Decode decodes MirrorRequest from json. +func (s *MirrorRequest) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MirrorRequest to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "failure": + if err := func() error { + s.Failure.Reset() + if err := s.Failure.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"failure\"") + } + case "requestId": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := json.DecodeUUID(d) + s.RequestId = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"requestId\"") + } + case "result": + if err := func() error { + s.Result.Reset() + if err := s.Result.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"result\"") + } + case "status": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + if err := s.Status.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"status\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode MirrorRequest") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00010100, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfMirrorRequest) { + name = jsonFieldsNameOfMirrorRequest[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *MirrorRequest) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MirrorRequest) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s MirrorRequestAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s MirrorRequestAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes MirrorRequestAdditional from json. +func (s *MirrorRequestAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MirrorRequestAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode MirrorRequestAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s MirrorRequestAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MirrorRequestAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *MirrorRequestFailure) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *MirrorRequestFailure) encodeFields(e *jx.Encoder) { + { + e.FieldStart("code") + e.Str(s.Code) + } + { + e.FieldStart("message") + e.Str(s.Message) + } + { + e.FieldStart("retryable") + e.Bool(s.Retryable) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfMirrorRequestFailure = [3]string{ + 0: "code", + 1: "message", + 2: "retryable", +} + +// Decode decodes MirrorRequestFailure from json. +func (s *MirrorRequestFailure) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MirrorRequestFailure to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "code": + requiredBitSet[0] |= 1 << 0 + if err := func() error { + v, err := d.Str() + s.Code = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"code\"") + } + case "message": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.Message = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"message\"") + } + case "retryable": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Bool() + s.Retryable = bool(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"retryable\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode MirrorRequestFailure") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00000111, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfMirrorRequestFailure) { + name = jsonFieldsNameOfMirrorRequestFailure[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *MirrorRequestFailure) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MirrorRequestFailure) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s MirrorRequestFailureAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s MirrorRequestFailureAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes MirrorRequestFailureAdditional from json. +func (s *MirrorRequestFailureAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MirrorRequestFailureAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode MirrorRequestFailureAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s MirrorRequestFailureAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MirrorRequestFailureAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *MirrorRequestResult) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *MirrorRequestResult) encodeFields(e *jx.Encoder) { + { + e.FieldStart("mirrorId") + e.Str(s.MirrorId) + } + { + e.FieldStart("mirrorUrl") + e.Str(s.MirrorUrl) + } + { + e.FieldStart("publicUrl") + e.Str(s.PublicUrl) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfMirrorRequestResult = [3]string{ + 0: "mirrorId", + 1: "mirrorUrl", + 2: "publicUrl", +} + +// Decode decodes MirrorRequestResult from json. +func (s *MirrorRequestResult) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MirrorRequestResult to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "mirrorId": + requiredBitSet[0] |= 1 << 0 + if err := func() error { + v, err := d.Str() + s.MirrorId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"mirrorId\"") + } + case "mirrorUrl": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.MirrorUrl = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"mirrorUrl\"") + } + case "publicUrl": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.PublicUrl = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"publicUrl\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode MirrorRequestResult") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00000111, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfMirrorRequestResult) { + name = jsonFieldsNameOfMirrorRequestResult[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *MirrorRequestResult) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MirrorRequestResult) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s MirrorRequestResultAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s MirrorRequestResultAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes MirrorRequestResultAdditional from json. +func (s *MirrorRequestResultAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MirrorRequestResultAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode MirrorRequestResultAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s MirrorRequestResultAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MirrorRequestResultAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes MirrorRequestStatus as json. +func (s MirrorRequestStatus) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes MirrorRequestStatus from json. +func (s *MirrorRequestStatus) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MirrorRequestStatus to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch MirrorRequestStatus(v) { + case MirrorRequestStatusPending: + *s = MirrorRequestStatusPending + case MirrorRequestStatusProcessing: + *s = MirrorRequestStatusProcessing + case MirrorRequestStatusSucceeded: + *s = MirrorRequestStatusSucceeded + case MirrorRequestStatusFailed: + *s = MirrorRequestStatusFailed + default: + *s = MirrorRequestStatus(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s MirrorRequestStatus) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MirrorRequestStatus) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes MirrorStatus as json. +func (s MirrorStatus) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes MirrorStatus from json. +func (s *MirrorStatus) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode MirrorStatus to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch MirrorStatus(v) { + case MirrorStatusProcessing: + *s = MirrorStatusProcessing + case MirrorStatusReady: + *s = MirrorStatusReady + case MirrorStatusFailed: + *s = MirrorStatusFailed + case MirrorStatusSuspended: + *s = MirrorStatusSuspended + default: + *s = MirrorStatus(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s MirrorStatus) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *MirrorStatus) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *NativeMirrorPlacement) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *NativeMirrorPlacement) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } + } + { + e.FieldStart("attempts") + e.Int64(s.Attempts) + } + { + e.FieldStart("clusterSlug") + e.Str(s.ClusterSlug) + } + { + e.FieldStart("createdAt") + json.EncodeDateTime(e, s.CreatedAt) + } + { + if s.CreationFailedAt.Set { + e.FieldStart("creationFailedAt") + s.CreationFailedAt.Encode(e, json.EncodeDateTime) + } + } + { + e.FieldStart("desiredState") + s.DesiredState.Encode(e) + } + { + if s.LastError.Set { + e.FieldStart("lastError") + s.LastError.Encode(e) + } + } + { + if s.NextRetryAt.Set { + e.FieldStart("nextRetryAt") + s.NextRetryAt.Encode(e, json.EncodeDateTime) + } + } + { + e.FieldStart("placementId") + e.Str(s.PlacementId) + } + { + e.FieldStart("stage") + s.Stage.Encode(e) + } + { + e.FieldStart("status") + s.Status.Encode(e) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfNativeMirrorPlacement = [11]string{ + 0: "$schema", + 1: "attempts", + 2: "clusterSlug", + 3: "createdAt", + 4: "creationFailedAt", + 5: "desiredState", + 6: "lastError", + 7: "nextRetryAt", + 8: "placementId", + 9: "stage", + 10: "status", +} + +// Decode decodes NativeMirrorPlacement from json. +func (s *NativeMirrorPlacement) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode NativeMirrorPlacement to nil") + } + var requiredBitSet [2]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "attempts": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Int64() + s.Attempts = int64(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"attempts\"") + } + case "clusterSlug": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.ClusterSlug = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"clusterSlug\"") + } + case "createdAt": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.CreatedAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"createdAt\"") + } + case "creationFailedAt": + if err := func() error { + s.CreationFailedAt.Reset() + if err := s.CreationFailedAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"creationFailedAt\"") + } + case "desiredState": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + if err := s.DesiredState.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"desiredState\"") + } + case "lastError": + if err := func() error { + s.LastError.Reset() + if err := s.LastError.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"lastError\"") + } + case "nextRetryAt": + if err := func() error { + s.NextRetryAt.Reset() + if err := s.NextRetryAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"nextRetryAt\"") + } + case "placementId": + requiredBitSet[1] |= 1 << 0 + if err := func() error { + v, err := d.Str() + s.PlacementId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"placementId\"") + } + case "stage": + requiredBitSet[1] |= 1 << 1 + if err := func() error { + if err := s.Stage.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"stage\"") + } + case "status": + requiredBitSet[1] |= 1 << 2 + if err := func() error { + if err := s.Status.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"status\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode NativeMirrorPlacement") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [2]uint8{ + 0b00101110, + 0b00000111, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfNativeMirrorPlacement) { + name = jsonFieldsNameOfNativeMirrorPlacement[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *NativeMirrorPlacement) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *NativeMirrorPlacement) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s NativeMirrorPlacementAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s NativeMirrorPlacementAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes NativeMirrorPlacementAdditional from json. +func (s *NativeMirrorPlacementAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode NativeMirrorPlacementAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode NativeMirrorPlacementAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s NativeMirrorPlacementAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *NativeMirrorPlacementAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes NativeMirrorPlacementDesiredState as json. +func (s NativeMirrorPlacementDesiredState) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes NativeMirrorPlacementDesiredState from json. +func (s *NativeMirrorPlacementDesiredState) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode NativeMirrorPlacementDesiredState to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch NativeMirrorPlacementDesiredState(v) { + case NativeMirrorPlacementDesiredStateActive: + *s = NativeMirrorPlacementDesiredStateActive + case NativeMirrorPlacementDesiredStateDeleted: + *s = NativeMirrorPlacementDesiredStateDeleted + default: + *s = NativeMirrorPlacementDesiredState(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s NativeMirrorPlacementDesiredState) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *NativeMirrorPlacementDesiredState) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes NativeMirrorPlacementStage as json. +func (s NativeMirrorPlacementStage) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes NativeMirrorPlacementStage from json. +func (s *NativeMirrorPlacementStage) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode NativeMirrorPlacementStage to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch NativeMirrorPlacementStage(v) { + case NativeMirrorPlacementStagePending: + *s = NativeMirrorPlacementStagePending + case NativeMirrorPlacementStageProvisioned: + *s = NativeMirrorPlacementStageProvisioned + case NativeMirrorPlacementStageRegistered: + *s = NativeMirrorPlacementStageRegistered + case NativeMirrorPlacementStageSeeded: + *s = NativeMirrorPlacementStageSeeded + case NativeMirrorPlacementStageAnnounced: + *s = NativeMirrorPlacementStageAnnounced + default: + *s = NativeMirrorPlacementStage(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s NativeMirrorPlacementStage) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *NativeMirrorPlacementStage) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes NativeMirrorPlacementStatus as json. +func (s NativeMirrorPlacementStatus) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes NativeMirrorPlacementStatus from json. +func (s *NativeMirrorPlacementStatus) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode NativeMirrorPlacementStatus to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch NativeMirrorPlacementStatus(v) { + case NativeMirrorPlacementStatusProcessing: + *s = NativeMirrorPlacementStatusProcessing + case NativeMirrorPlacementStatusReady: + *s = NativeMirrorPlacementStatusReady + case NativeMirrorPlacementStatusFailed: + *s = NativeMirrorPlacementStatusFailed + case NativeMirrorPlacementStatusSuspended: + *s = NativeMirrorPlacementStatusSuspended + default: + *s = NativeMirrorPlacementStatus(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s NativeMirrorPlacementStatus) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *NativeMirrorPlacementStatus) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *OIDCProvider) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *OIDCProvider) encodeFields(e *jx.Encoder) { + { + if s.Description.Set { + e.FieldStart("description") + s.Description.Encode(e) + } + } + { + if s.DisplayName.Set { + e.FieldStart("displayName") + s.DisplayName.Encode(e) + } + } + { + e.FieldStart("id") + e.Str(s.ID) + } + { + e.FieldStart("issuer") + e.Str(s.Issuer) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfOIDCProvider = [4]string{ + 0: "description", + 1: "displayName", + 2: "id", + 3: "issuer", +} + +// Decode decodes OIDCProvider from json. +func (s *OIDCProvider) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OIDCProvider to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "description": + if err := func() error { + s.Description.Reset() + if err := s.Description.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"description\"") + } + case "displayName": + if err := func() error { + s.DisplayName.Reset() + if err := s.DisplayName.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"displayName\"") + } + case "id": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.ID = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"id\"") + } + case "issuer": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.Issuer = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"issuer\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode OIDCProvider") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00001100, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfOIDCProvider) { + name = jsonFieldsNameOfOIDCProvider[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *OIDCProvider) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OIDCProvider) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s OIDCProviderAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s OIDCProviderAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes OIDCProviderAdditional from json. +func (s *OIDCProviderAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OIDCProviderAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode OIDCProviderAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OIDCProviderAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OIDCProviderAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes AddOrgMemberInputBodyRole as json. +func (o OptAddOrgMemberInputBodyRole) Encode(e *jx.Encoder) { + if !o.Set { + return + } + e.Str(string(o.Value)) +} + +// Decode decodes AddOrgMemberInputBodyRole from json. +func (o *OptAddOrgMemberInputBodyRole) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptAddOrgMemberInputBodyRole to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptAddOrgMemberInputBodyRole) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptAddOrgMemberInputBodyRole) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes AuditEventMetadata as json. +func (o OptAuditEventMetadata) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes AuditEventMetadata from json. +func (o *OptAuditEventMetadata) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptAuditEventMetadata to nil") + } + o.Set = true + o.Value = make(AuditEventMetadata) + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptAuditEventMetadata) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptAuditEventMetadata) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes bool as json. +func (o OptBool) Encode(e *jx.Encoder) { + if !o.Set { + return + } + e.Bool(bool(o.Value)) +} + +// Decode decodes bool from json. +func (o *OptBool) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptBool to nil") + } + o.Set = true + v, err := d.Bool() + if err != nil { + return err + } + o.Value = bool(v) + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptBool) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptBool) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes CIDeliveryPayloadView as json. +func (o OptCIDeliveryPayloadView) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes CIDeliveryPayloadView from json. +func (o *OptCIDeliveryPayloadView) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptCIDeliveryPayloadView to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptCIDeliveryPayloadView) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptCIDeliveryPayloadView) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes CISetupBlock as json. +func (o OptCISetupBlock) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes CISetupBlock from json. +func (o *OptCISetupBlock) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptCISetupBlock to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptCISetupBlock) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptCISetupBlock) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes CIWebhookAuditEventViewMetadata as json. +func (o OptCIWebhookAuditEventViewMetadata) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes CIWebhookAuditEventViewMetadata from json. +func (o *OptCIWebhookAuditEventViewMetadata) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptCIWebhookAuditEventViewMetadata to nil") + } + o.Set = true + o.Value = make(CIWebhookAuditEventViewMetadata) + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptCIWebhookAuditEventViewMetadata) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptCIWebhookAuditEventViewMetadata) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes CreateRepoCIWebhookInputBodyConfig as json. +func (o OptCreateRepoCIWebhookInputBodyConfig) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes CreateRepoCIWebhookInputBodyConfig from json. +func (o *OptCreateRepoCIWebhookInputBodyConfig) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptCreateRepoCIWebhookInputBodyConfig to nil") + } + o.Set = true + o.Value = make(CreateRepoCIWebhookInputBodyConfig) + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptCreateRepoCIWebhookInputBodyConfig) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptCreateRepoCIWebhookInputBodyConfig) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes CreateRepoInputBodyObjectFormat as json. +func (o OptCreateRepoInputBodyObjectFormat) Encode(e *jx.Encoder) { + if !o.Set { + return + } + e.Str(string(o.Value)) +} + +// Decode decodes CreateRepoInputBodyObjectFormat from json. +func (o *OptCreateRepoInputBodyObjectFormat) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptCreateRepoInputBodyObjectFormat to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptCreateRepoInputBodyObjectFormat) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptCreateRepoInputBodyObjectFormat) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes time.Time as json. +func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time)) { + if !o.Set { + return + } + format(e, o.Value) +} + +// Decode decodes time.Time from json. +func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error { + if o == nil { + return errors.New("invalid: unable to decode OptDateTime to nil") + } + o.Set = true + v, err := format(d) + if err != nil { + return err + } + o.Value = v + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptDateTime) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e, json.EncodeDateTime) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptDateTime) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d, json.DecodeDateTime) +} + +// Encode encodes float64 as json. +func (o OptFloat64) Encode(e *jx.Encoder) { + if !o.Set { + return + } + e.Float64(float64(o.Value)) +} + +// Decode decodes float64 from json. +func (o *OptFloat64) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptFloat64 to nil") + } + o.Set = true + v, err := d.Float64() + if err != nil { + return err + } + o.Value = float64(v) + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptFloat64) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptFloat64) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes ForgeRepoIdentity as json. +func (o OptForgeRepoIdentity) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes ForgeRepoIdentity from json. +func (o *OptForgeRepoIdentity) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptForgeRepoIdentity to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptForgeRepoIdentity) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptForgeRepoIdentity) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes GetMeOutputBodyMode as json. +func (o OptGetMeOutputBodyMode) Encode(e *jx.Encoder) { + if !o.Set { + return + } + e.Str(string(o.Value)) +} + +// Decode decodes GetMeOutputBodyMode from json. +func (o *OptGetMeOutputBodyMode) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptGetMeOutputBodyMode to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptGetMeOutputBodyMode) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptGetMeOutputBodyMode) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes GetVersionOutputBodyMode as json. +func (o OptGetVersionOutputBodyMode) Encode(e *jx.Encoder) { + if !o.Set { + return + } + e.Str(string(o.Value)) +} + +// Decode decodes GetVersionOutputBodyMode from json. +func (o *OptGetVersionOutputBodyMode) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptGetVersionOutputBodyMode to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptGetVersionOutputBodyMode) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptGetVersionOutputBodyMode) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes GrantAccessBodyGranteeType as json. +func (o OptGrantAccessBodyGranteeType) Encode(e *jx.Encoder) { + if !o.Set { + return + } + e.Str(string(o.Value)) +} + +// Decode decodes GrantAccessBodyGranteeType from json. +func (o *OptGrantAccessBodyGranteeType) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptGrantAccessBodyGranteeType to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptGrantAccessBodyGranteeType) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptGrantAccessBodyGranteeType) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes int64 as json. +func (o OptInt64) Encode(e *jx.Encoder) { + if !o.Set { + return + } + e.Int64(int64(o.Value)) +} + +// Decode decodes int64 from json. +func (o *OptInt64) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptInt64 to nil") + } + o.Set = true + v, err := d.Int64() + if err != nil { + return err + } + o.Value = int64(v) + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptInt64) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptInt64) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes MeDeletion as json. +func (o OptMeDeletion) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes MeDeletion from json. +func (o *OptMeDeletion) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptMeDeletion to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptMeDeletion) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptMeDeletion) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes MeRegional as json. +func (o OptMeRegional) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes MeRegional from json. +func (o *OptMeRegional) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptMeRegional to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptMeRegional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptMeRegional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes MeRegionalUnavailable as json. +func (o OptMeRegionalUnavailable) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes MeRegionalUnavailable from json. +func (o *OptMeRegionalUnavailable) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptMeRegionalUnavailable to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptMeRegionalUnavailable) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptMeRegionalUnavailable) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes MirrorRequestFailure as json. +func (o OptMirrorRequestFailure) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes MirrorRequestFailure from json. +func (o *OptMirrorRequestFailure) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptMirrorRequestFailure to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptMirrorRequestFailure) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptMirrorRequestFailure) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes MirrorRequestResult as json. +func (o OptMirrorRequestResult) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes MirrorRequestResult from json. +func (o *OptMirrorRequestResult) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptMirrorRequestResult to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptMirrorRequestResult) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptMirrorRequestResult) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes MirrorStatus as json. +func (o OptMirrorStatus) Encode(e *jx.Encoder) { + if !o.Set { + return + } + e.Str(string(o.Value)) +} + +// Decode decodes MirrorStatus from json. +func (o *OptMirrorStatus) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptMirrorStatus to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptMirrorStatus) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptMirrorStatus) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes Org as json. +func (o OptOrg) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes Org from json. +func (o *OptOrg) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptOrg to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptOrg) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptOrg) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes OrgCapabilities as json. +func (o OptOrgCapabilities) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes OrgCapabilities from json. +func (o *OptOrgCapabilities) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptOrgCapabilities to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptOrgCapabilities) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptOrgCapabilities) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes Project as json. +func (o OptProject) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes Project from json. +func (o *OptProject) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptProject to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptProject) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptProject) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes ProjectCapabilities as json. +func (o OptProjectCapabilities) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes ProjectCapabilities from json. +func (o *OptProjectCapabilities) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptProjectCapabilities to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptProjectCapabilities) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptProjectCapabilities) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes Repo as json. +func (o OptRepo) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes Repo from json. +func (o *OptRepo) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptRepo to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptRepo) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptRepo) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes RepoCandidate as json. +func (o OptRepoCandidate) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes RepoCandidate from json. +func (o *OptRepoCandidate) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptRepoCandidate to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptRepoCandidate) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptRepoCandidate) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes RepoCapabilities as json. +func (o OptRepoCapabilities) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes RepoCapabilities from json. +func (o *OptRepoCapabilities) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptRepoCapabilities to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptRepoCapabilities) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptRepoCapabilities) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes RepoPrimaries as json. +func (o OptRepoPrimaries) Encode(e *jx.Encoder) { + if !o.Set { + return + } + o.Value.Encode(e) +} + +// Decode decodes RepoPrimaries from json. +func (o *OptRepoPrimaries) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptRepoPrimaries to nil") + } + o.Set = true + if err := o.Value.Decode(d); err != nil { + return err + } + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptRepoPrimaries) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptRepoPrimaries) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes string as json. +func (o OptString) Encode(e *jx.Encoder) { + if !o.Set { + return + } + e.Str(string(o.Value)) +} + +// Decode decodes string from json. +func (o *OptString) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptString to nil") + } + o.Set = true + v, err := d.Str() + if err != nil { + return err + } + o.Value = string(v) + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptString) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptString) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes url.URL as json. +func (o OptURI) Encode(e *jx.Encoder) { + if !o.Set { + return + } + json.EncodeURI(e, o.Value) +} + +// Decode decodes url.URL from json. +func (o *OptURI) Decode(d *jx.Decoder) error { + if o == nil { + return errors.New("invalid: unable to decode OptURI to nil") + } + o.Set = true + v, err := json.DecodeURI(d) + if err != nil { + return err + } + o.Value = v + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OptURI) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OptURI) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *Org) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *Org) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } + } + { + if s.Capabilities.Set { + e.FieldStart("capabilities") + s.Capabilities.Encode(e) + } + } + { + e.FieldStart("createdAt") + json.EncodeDateTime(e, s.CreatedAt) + } + { + e.FieldStart("id") + e.Str(s.ID) + } + { + e.FieldStart("name") + e.Str(s.Name) + } + { + e.FieldStart("region") + e.Str(s.Region) + } + { + if s.WorkosOrganizationId.Set { + e.FieldStart("workosOrganizationId") + s.WorkosOrganizationId.Encode(e) + } + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfOrg = [7]string{ + 0: "$schema", + 1: "capabilities", + 2: "createdAt", + 3: "id", + 4: "name", + 5: "region", + 6: "workosOrganizationId", +} + +// Decode decodes Org from json. +func (s *Org) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode Org to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "capabilities": + if err := func() error { + s.Capabilities.Reset() + if err := s.Capabilities.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"capabilities\"") + } + case "createdAt": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.CreatedAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"createdAt\"") + } + case "id": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.ID = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"id\"") + } + case "name": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + v, err := d.Str() + s.Name = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"name\"") + } + case "region": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + v, err := d.Str() + s.Region = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"region\"") + } + case "workosOrganizationId": + if err := func() error { + s.WorkosOrganizationId.Reset() + if err := s.WorkosOrganizationId.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"workosOrganizationId\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode Org") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00111100, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfOrg) { + name = jsonFieldsNameOfOrg[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *Org) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *Org) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s OrgAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s OrgAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes OrgAdditional from json. +func (s *OrgAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OrgAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OrgAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *OrgCIBuildkiteClusterView) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *OrgCIBuildkiteClusterView) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } + } + { + e.FieldStart("auth_plugin_ref") + e.Str(s.AuthPluginRef) + } + { + e.FieldStart("bk_cluster_id") + e.Str(s.BkClusterID) + } + { + e.FieldStart("bk_organization") + e.Str(s.BkOrganization) + } + { + e.FieldStart("created_at") + json.EncodeDateTime(e, s.CreatedAt) + } + { + e.FieldStart("label") + e.Str(s.Label) + } + { + e.FieldStart("owner") + e.Str(s.Owner) + } + { + e.FieldStart("updated_at") + json.EncodeDateTime(e, s.UpdatedAt) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfOrgCIBuildkiteClusterView = [8]string{ + 0: "$schema", + 1: "auth_plugin_ref", + 2: "bk_cluster_id", + 3: "bk_organization", + 4: "created_at", + 5: "label", + 6: "owner", + 7: "updated_at", +} + +// Decode decodes OrgCIBuildkiteClusterView from json. +func (s *OrgCIBuildkiteClusterView) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgCIBuildkiteClusterView to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "auth_plugin_ref": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.AuthPluginRef = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"auth_plugin_ref\"") + } + case "bk_cluster_id": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.BkClusterID = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"bk_cluster_id\"") + } + case "bk_organization": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.BkOrganization = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"bk_organization\"") + } + case "created_at": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.CreatedAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"created_at\"") + } + case "label": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + v, err := d.Str() + s.Label = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"label\"") + } + case "owner": + requiredBitSet[0] |= 1 << 6 + if err := func() error { + v, err := d.Str() + s.Owner = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"owner\"") + } + case "updated_at": + requiredBitSet[0] |= 1 << 7 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.UpdatedAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"updated_at\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgCIBuildkiteClusterView") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b11111110, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfOrgCIBuildkiteClusterView) { + name = jsonFieldsNameOfOrgCIBuildkiteClusterView[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *OrgCIBuildkiteClusterView) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OrgCIBuildkiteClusterView) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s OrgCIBuildkiteClusterViewAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s OrgCIBuildkiteClusterViewAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes OrgCIBuildkiteClusterViewAdditional from json. +func (s *OrgCIBuildkiteClusterViewAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgCIBuildkiteClusterViewAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgCIBuildkiteClusterViewAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OrgCIBuildkiteClusterViewAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OrgCIBuildkiteClusterViewAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *OrgCIBuildkiteCredentialView) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *OrgCIBuildkiteCredentialView) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } + } + { + e.FieldStart("bk_organization") + e.Str(s.BkOrganization) + } + { + e.FieldStart("cipher_version") + e.Int64(s.CipherVersion) + } + { + e.FieldStart("created_at") + json.EncodeDateTime(e, s.CreatedAt) + } + { + if s.InboundEndpointID.Set { + e.FieldStart("inbound_endpoint_id") + s.InboundEndpointID.Encode(e) + } + } + { + if s.InboundEndpointPath.Set { + e.FieldStart("inbound_endpoint_path") + s.InboundEndpointPath.Encode(e) + } + } + { + if s.InboundEndpointURL.Set { + e.FieldStart("inbound_endpoint_url") + s.InboundEndpointURL.Encode(e) + } + } + { + if s.InboundSecret.Set { + e.FieldStart("inbound_secret") + s.InboundSecret.Encode(e) + } + } + { + if s.InboundSecretIssuedAt.Set { + e.FieldStart("inbound_secret_issued_at") + s.InboundSecretIssuedAt.Encode(e, json.EncodeDateTime) + } + } + { + e.FieldStart("inbound_secret_set") + e.Bool(s.InboundSecretSet) + } + { + e.FieldStart("owner") + e.Str(s.Owner) + } + { + e.FieldStart("token_len") + e.Int64(s.TokenLen) + } + { + e.FieldStart("updated_at") + json.EncodeDateTime(e, s.UpdatedAt) + } + { + if s.VerifiedAt.Set { + e.FieldStart("verified_at") + s.VerifiedAt.Encode(e, json.EncodeDateTime) + } + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfOrgCIBuildkiteCredentialView = [14]string{ + 0: "$schema", + 1: "bk_organization", + 2: "cipher_version", + 3: "created_at", + 4: "inbound_endpoint_id", + 5: "inbound_endpoint_path", + 6: "inbound_endpoint_url", + 7: "inbound_secret", + 8: "inbound_secret_issued_at", + 9: "inbound_secret_set", + 10: "owner", + 11: "token_len", + 12: "updated_at", + 13: "verified_at", +} + +// Decode decodes OrgCIBuildkiteCredentialView from json. +func (s *OrgCIBuildkiteCredentialView) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgCIBuildkiteCredentialView to nil") + } + var requiredBitSet [2]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "bk_organization": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.BkOrganization = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"bk_organization\"") + } + case "cipher_version": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Int64() + s.CipherVersion = int64(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"cipher_version\"") + } + case "created_at": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.CreatedAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"created_at\"") + } + case "inbound_endpoint_id": + if err := func() error { + s.InboundEndpointID.Reset() + if err := s.InboundEndpointID.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"inbound_endpoint_id\"") + } + case "inbound_endpoint_path": + if err := func() error { + s.InboundEndpointPath.Reset() + if err := s.InboundEndpointPath.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"inbound_endpoint_path\"") + } + case "inbound_endpoint_url": + if err := func() error { + s.InboundEndpointURL.Reset() + if err := s.InboundEndpointURL.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"inbound_endpoint_url\"") + } + case "inbound_secret": + if err := func() error { + s.InboundSecret.Reset() + if err := s.InboundSecret.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"inbound_secret\"") + } + case "inbound_secret_issued_at": + if err := func() error { + s.InboundSecretIssuedAt.Reset() + if err := s.InboundSecretIssuedAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"inbound_secret_issued_at\"") + } + case "inbound_secret_set": + requiredBitSet[1] |= 1 << 1 + if err := func() error { + v, err := d.Bool() + s.InboundSecretSet = bool(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"inbound_secret_set\"") + } + case "owner": + requiredBitSet[1] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.Owner = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"owner\"") + } + case "token_len": + requiredBitSet[1] |= 1 << 3 + if err := func() error { + v, err := d.Int64() + s.TokenLen = int64(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"token_len\"") + } + case "updated_at": + requiredBitSet[1] |= 1 << 4 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.UpdatedAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"updated_at\"") + } + case "verified_at": + if err := func() error { + s.VerifiedAt.Reset() + if err := s.VerifiedAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"verified_at\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgCIBuildkiteCredentialView") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [2]uint8{ + 0b00001110, + 0b00011110, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfOrgCIBuildkiteCredentialView) { + name = jsonFieldsNameOfOrgCIBuildkiteCredentialView[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *OrgCIBuildkiteCredentialView) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OrgCIBuildkiteCredentialView) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s OrgCIBuildkiteCredentialViewAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s OrgCIBuildkiteCredentialViewAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes OrgCIBuildkiteCredentialViewAdditional from json. +func (s *OrgCIBuildkiteCredentialViewAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgCIBuildkiteCredentialViewAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgCIBuildkiteCredentialViewAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OrgCIBuildkiteCredentialViewAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OrgCIBuildkiteCredentialViewAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *OrgCIDepotConnectionView) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *OrgCIDepotConnectionView) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } + } + { + e.FieldStart("account") + e.Str(s.Account) + } + { + if s.ConnectedAt.Set { + e.FieldStart("connected_at") + s.ConnectedAt.Encode(e, json.EncodeDateTime) + } + } + { + e.FieldStart("owner") + e.Str(s.Owner) + } + { + e.FieldStart("provider") + e.Str(s.Provider) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfOrgCIDepotConnectionView = [5]string{ + 0: "$schema", + 1: "account", + 2: "connected_at", + 3: "owner", + 4: "provider", +} + +// Decode decodes OrgCIDepotConnectionView from json. +func (s *OrgCIDepotConnectionView) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgCIDepotConnectionView to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "account": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.Account = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"account\"") + } + case "connected_at": + if err := func() error { + s.ConnectedAt.Reset() + if err := s.ConnectedAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"connected_at\"") + } + case "owner": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.Owner = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"owner\"") + } + case "provider": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + v, err := d.Str() + s.Provider = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgCIDepotConnectionView") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00011010, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfOrgCIDepotConnectionView) { + name = jsonFieldsNameOfOrgCIDepotConnectionView[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *OrgCIDepotConnectionView) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OrgCIDepotConnectionView) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s OrgCIDepotConnectionViewAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s OrgCIDepotConnectionViewAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes OrgCIDepotConnectionViewAdditional from json. +func (s *OrgCIDepotConnectionViewAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgCIDepotConnectionViewAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgCIDepotConnectionViewAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OrgCIDepotConnectionViewAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OrgCIDepotConnectionViewAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *OrgCIGitHubActionsCredentialView) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *OrgCIGitHubActionsCredentialView) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } + } + { + e.FieldStart("account") + e.Str(s.Account) + } + { + if s.HasAPIToken.Set { + e.FieldStart("has_api_token") + s.HasAPIToken.Encode(e) + } + } + { + if s.InboundEndpointID.Set { + e.FieldStart("inbound_endpoint_id") + s.InboundEndpointID.Encode(e) + } + } + { + if s.InboundEndpointPath.Set { + e.FieldStart("inbound_endpoint_path") + s.InboundEndpointPath.Encode(e) + } + } + { + if s.InboundEndpointURL.Set { + e.FieldStart("inbound_endpoint_url") + s.InboundEndpointURL.Encode(e) + } + } + { + if s.InboundSecret.Set { + e.FieldStart("inbound_secret") + s.InboundSecret.Encode(e) + } + } + { + e.FieldStart("owner") + e.Str(s.Owner) + } + { + e.FieldStart("provider") + e.Str(s.Provider) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfOrgCIGitHubActionsCredentialView = [9]string{ + 0: "$schema", + 1: "account", + 2: "has_api_token", + 3: "inbound_endpoint_id", + 4: "inbound_endpoint_path", + 5: "inbound_endpoint_url", + 6: "inbound_secret", + 7: "owner", + 8: "provider", +} + +// Decode decodes OrgCIGitHubActionsCredentialView from json. +func (s *OrgCIGitHubActionsCredentialView) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgCIGitHubActionsCredentialView to nil") + } + var requiredBitSet [2]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "account": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.Account = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"account\"") + } + case "has_api_token": + if err := func() error { + s.HasAPIToken.Reset() + if err := s.HasAPIToken.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"has_api_token\"") + } + case "inbound_endpoint_id": + if err := func() error { + s.InboundEndpointID.Reset() + if err := s.InboundEndpointID.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"inbound_endpoint_id\"") + } + case "inbound_endpoint_path": + if err := func() error { + s.InboundEndpointPath.Reset() + if err := s.InboundEndpointPath.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"inbound_endpoint_path\"") + } + case "inbound_endpoint_url": + if err := func() error { + s.InboundEndpointURL.Reset() + if err := s.InboundEndpointURL.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"inbound_endpoint_url\"") + } + case "inbound_secret": + if err := func() error { + s.InboundSecret.Reset() + if err := s.InboundSecret.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"inbound_secret\"") + } + case "owner": + requiredBitSet[0] |= 1 << 7 + if err := func() error { + v, err := d.Str() + s.Owner = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"owner\"") + } + case "provider": + requiredBitSet[1] |= 1 << 0 + if err := func() error { + v, err := d.Str() + s.Provider = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgCIGitHubActionsCredentialView") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [2]uint8{ + 0b10000010, + 0b00000001, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfOrgCIGitHubActionsCredentialView) { + name = jsonFieldsNameOfOrgCIGitHubActionsCredentialView[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptDateTime) MarshalJSON() ([]byte, error) { +func (s *OrgCIGitHubActionsCredentialView) MarshalJSON() ([]byte, error) { e := jx.Encoder{} - s.Encode(&e, json.EncodeDateTime) + s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptDateTime) UnmarshalJSON(data []byte) error { +func (s *OrgCIGitHubActionsCredentialView) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) - return s.Decode(d, json.DecodeDateTime) + return s.Decode(d) } -// Encode encodes float64 as json. -func (o OptFloat64) Encode(e *jx.Encoder) { - if !o.Set { - return +// Encode implements json.Marshaler. +func (s OrgCIGitHubActionsCredentialViewAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s OrgCIGitHubActionsCredentialViewAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes OrgCIGitHubActionsCredentialViewAdditional from json. +func (s *OrgCIGitHubActionsCredentialViewAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgCIGitHubActionsCredentialViewAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgCIGitHubActionsCredentialViewAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OrgCIGitHubActionsCredentialViewAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OrgCIGitHubActionsCredentialViewAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *OrgCapabilities) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *OrgCapabilities) encodeFields(e *jx.Encoder) { + { + e.FieldStart("canChangeOwners") + e.Bool(s.CanChangeOwners) + } + { + e.FieldStart("canCreateProject") + e.Bool(s.CanCreateProject) + } + { + e.FieldStart("canDelete") + e.Bool(s.CanDelete) + } + { + e.FieldStart("canManageMembers") + e.Bool(s.CanManageMembers) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfOrgCapabilities = [4]string{ + 0: "canChangeOwners", + 1: "canCreateProject", + 2: "canDelete", + 3: "canManageMembers", +} + +// Decode decodes OrgCapabilities from json. +func (s *OrgCapabilities) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgCapabilities to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "canChangeOwners": + requiredBitSet[0] |= 1 << 0 + if err := func() error { + v, err := d.Bool() + s.CanChangeOwners = bool(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"canChangeOwners\"") + } + case "canCreateProject": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Bool() + s.CanCreateProject = bool(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"canCreateProject\"") + } + case "canDelete": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Bool() + s.CanDelete = bool(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"canDelete\"") + } + case "canManageMembers": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Bool() + s.CanManageMembers = bool(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"canManageMembers\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgCapabilities") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00001111, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfOrgCapabilities) { + name = jsonFieldsNameOfOrgCapabilities[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *OrgCapabilities) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OrgCapabilities) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s OrgCapabilitiesAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s OrgCapabilitiesAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes OrgCapabilitiesAdditional from json. +func (s *OrgCapabilitiesAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgCapabilitiesAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgCapabilitiesAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s OrgCapabilitiesAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *OrgCapabilitiesAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *OrgPerson) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *OrgPerson) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } + } + { + e.FieldStart("accountId") + e.Str(s.AccountId) + } + { + if s.AvatarUrl.Set { + e.FieldStart("avatarUrl") + s.AvatarUrl.Encode(e) + } + } + { + e.FieldStart("grants") + e.ArrStart() + for _, elem := range s.Grants { + elem.Encode(e) + } + e.ArrEnd() + } + { + if s.Handle.Set { + e.FieldStart("handle") + s.Handle.Encode(e) + } + } + { + e.FieldStart("membership") + s.Membership.Encode(e) + } + { + if s.Provider.Set { + e.FieldStart("provider") + s.Provider.Encode(e) + } + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfOrgPerson = [7]string{ + 0: "$schema", + 1: "accountId", + 2: "avatarUrl", + 3: "grants", + 4: "handle", + 5: "membership", + 6: "provider", +} + +// Decode decodes OrgPerson from json. +func (s *OrgPerson) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgPerson to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "accountId": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.AccountId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"accountId\"") + } + case "avatarUrl": + if err := func() error { + s.AvatarUrl.Reset() + if err := s.AvatarUrl.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"avatarUrl\"") + } + case "grants": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + s.Grants = make([]OrgPersonGrant, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem OrgPersonGrant + if err := elem.Decode(d); err != nil { + return err + } + s.Grants = append(s.Grants, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"grants\"") + } + case "handle": + if err := func() error { + s.Handle.Reset() + if err := s.Handle.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"handle\"") + } + case "membership": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + if err := s.Membership.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"membership\"") + } + case "provider": + if err := func() error { + s.Provider.Reset() + if err := s.Provider.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgPerson") } - e.Float64(float64(o.Value)) -} - -// Decode decodes float64 from json. -func (o *OptFloat64) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptFloat64 to nil") + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00101010, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfOrgPerson) { + name = jsonFieldsNameOfOrgPerson[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } } - o.Set = true - v, err := d.Float64() - if err != nil { - return err + if len(failures) > 0 { + return &validate.Error{Fields: failures} } - o.Value = float64(v) + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptFloat64) MarshalJSON() ([]byte, error) { +func (s *OrgPerson) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptFloat64) UnmarshalJSON(data []byte) error { +func (s *OrgPerson) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes ForgeRepoIdentity as json. -func (o OptForgeRepoIdentity) Encode(e *jx.Encoder) { - if !o.Set { - return - } - o.Value.Encode(e) -} - -// Decode decodes ForgeRepoIdentity from json. -func (o *OptForgeRepoIdentity) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptForgeRepoIdentity to nil") - } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err - } - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s OptForgeRepoIdentity) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil +// Encode implements json.Marshaler. +func (s OrgPersonAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() } -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptForgeRepoIdentity) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} +// encodeFields implements json.Marshaler. +func (s OrgPersonAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) -// Encode encodes GetMeOutputBodyMode as json. -func (o OptGetMeOutputBodyMode) Encode(e *jx.Encoder) { - if !o.Set { - return + if len(elem) != 0 { + e.Raw(elem) + } } - e.Str(string(o.Value)) } -// Decode decodes GetMeOutputBodyMode from json. -func (o *OptGetMeOutputBodyMode) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptGetMeOutputBodyMode to nil") +// Decode decodes OrgPersonAdditional from json. +func (s *OrgPersonAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgPersonAdditional to nil") } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgPersonAdditional") } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptGetMeOutputBodyMode) MarshalJSON() ([]byte, error) { +func (s OrgPersonAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptGetMeOutputBodyMode) UnmarshalJSON(data []byte) error { +func (s *OrgPersonAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes GetPermissionsOutputBodyExplain as json. -func (o OptGetPermissionsOutputBodyExplain) Encode(e *jx.Encoder) { - if !o.Set { - return - } - o.Value.Encode(e) +// Encode implements json.Marshaler. +func (s *OrgPersonGrant) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() } -// Decode decodes GetPermissionsOutputBodyExplain from json. -func (o *OptGetPermissionsOutputBodyExplain) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptGetPermissionsOutputBodyExplain to nil") +// encodeFields encodes fields. +func (s *OrgPersonGrant) encodeFields(e *jx.Encoder) { + { + e.FieldStart("capabilities") + s.Capabilities.Encode(e) } - o.Set = true - o.Value = make(GetPermissionsOutputBodyExplain) - if err := o.Value.Decode(d); err != nil { - return err + { + e.FieldStart("resourceId") + e.Str(s.ResourceId) } - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s OptGetPermissionsOutputBodyExplain) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptGetPermissionsOutputBodyExplain) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes GetVersionOutputBodyMode as json. -func (o OptGetVersionOutputBodyMode) Encode(e *jx.Encoder) { - if !o.Set { - return + { + e.FieldStart("resourceName") + e.Str(s.ResourceName) } - e.Str(string(o.Value)) -} - -// Decode decodes GetVersionOutputBodyMode from json. -func (o *OptGetVersionOutputBodyMode) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptGetVersionOutputBodyMode to nil") + { + e.FieldStart("resourceType") + s.ResourceType.Encode(e) } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err + { + e.FieldStart("role") + s.Role.Encode(e) } - return nil -} + { + e.FieldStart("source") + s.Source.Encode(e) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) -// MarshalJSON implements stdjson.Marshaler. -func (s OptGetVersionOutputBodyMode) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil + if len(elem) != 0 { + e.Raw(elem) + } + } } -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptGetVersionOutputBodyMode) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) +var jsonFieldsNameOfOrgPersonGrant = [6]string{ + 0: "capabilities", + 1: "resourceId", + 2: "resourceName", + 3: "resourceType", + 4: "role", + 5: "source", } -// Encode encodes GrantProjectAccessInputBodyGranteeType as json. -func (o OptGrantProjectAccessInputBodyGranteeType) Encode(e *jx.Encoder) { - if !o.Set { - return +// Decode decodes OrgPersonGrant from json. +func (s *OrgPersonGrant) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgPersonGrant to nil") } - e.Str(string(o.Value)) -} + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} -// Decode decodes GrantProjectAccessInputBodyGranteeType from json. -func (o *OptGrantProjectAccessInputBodyGranteeType) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptGrantProjectAccessInputBodyGranteeType to nil") + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "capabilities": + requiredBitSet[0] |= 1 << 0 + if err := func() error { + if err := s.Capabilities.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"capabilities\"") + } + case "resourceId": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.ResourceId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"resourceId\"") + } + case "resourceName": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.ResourceName = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"resourceName\"") + } + case "resourceType": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + if err := s.ResourceType.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"resourceType\"") + } + case "role": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + if err := s.Role.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"role\"") + } + case "source": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + if err := s.Source.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"source\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgPersonGrant") } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00111111, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfOrgPersonGrant) { + name = jsonFieldsNameOfOrgPersonGrant[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptGrantProjectAccessInputBodyGranteeType) MarshalJSON() ([]byte, error) { +func (s *OrgPersonGrant) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptGrantProjectAccessInputBodyGranteeType) UnmarshalJSON(data []byte) error { +func (s *OrgPersonGrant) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes GrantRepoAccessInputBodyGranteeType as json. -func (o OptGrantRepoAccessInputBodyGranteeType) Encode(e *jx.Encoder) { - if !o.Set { - return - } - e.Str(string(o.Value)) -} - -// Decode decodes GrantRepoAccessInputBodyGranteeType from json. -func (o *OptGrantRepoAccessInputBodyGranteeType) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptGrantRepoAccessInputBodyGranteeType to nil") - } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err - } - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s OptGrantRepoAccessInputBodyGranteeType) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil +// Encode implements json.Marshaler. +func (s OrgPersonGrantAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() } -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptGrantRepoAccessInputBodyGranteeType) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} +// encodeFields implements json.Marshaler. +func (s OrgPersonGrantAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) -// Encode encodes int64 as json. -func (o OptInt64) Encode(e *jx.Encoder) { - if !o.Set { - return + if len(elem) != 0 { + e.Raw(elem) + } } - e.Int64(int64(o.Value)) } -// Decode decodes int64 from json. -func (o *OptInt64) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptInt64 to nil") +// Decode decodes OrgPersonGrantAdditional from json. +func (s *OrgPersonGrantAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgPersonGrantAdditional to nil") } - o.Set = true - v, err := d.Int64() - if err != nil { - return err + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgPersonGrantAdditional") } - o.Value = int64(v) + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptInt64) MarshalJSON() ([]byte, error) { +func (s OrgPersonGrantAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptInt64) UnmarshalJSON(data []byte) error { +func (s *OrgPersonGrantAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes MeDeletion as json. -func (o OptMeDeletion) Encode(e *jx.Encoder) { - if !o.Set { - return - } - o.Value.Encode(e) +// Encode implements json.Marshaler. +func (s *OrgPersonGrantCapabilities) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() } -// Decode decodes MeDeletion from json. -func (o *OptMeDeletion) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptMeDeletion to nil") +// encodeFields encodes fields. +func (s *OrgPersonGrantCapabilities) encodeFields(e *jx.Encoder) { + { + e.FieldStart("allowedRoles") + e.ArrStart() + for _, elem := range s.AllowedRoles { + elem.Encode(e) + } + e.ArrEnd() } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err + { + if s.TargetId.Set { + e.FieldStart("targetId") + s.TargetId.Encode(e) + } } - return nil -} + for k, elem := range s.AdditionalProps { + e.FieldStart(k) -// MarshalJSON implements stdjson.Marshaler. -func (s OptMeDeletion) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil + if len(elem) != 0 { + e.Raw(elem) + } + } } -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptMeDeletion) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) +var jsonFieldsNameOfOrgPersonGrantCapabilities = [2]string{ + 0: "allowedRoles", + 1: "targetId", } -// Encode encodes MeRegional as json. -func (o OptMeRegional) Encode(e *jx.Encoder) { - if !o.Set { - return +// Decode decodes OrgPersonGrantCapabilities from json. +func (s *OrgPersonGrantCapabilities) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgPersonGrantCapabilities to nil") } - o.Value.Encode(e) -} + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} -// Decode decodes MeRegional from json. -func (o *OptMeRegional) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptMeRegional to nil") + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "allowedRoles": + requiredBitSet[0] |= 1 << 0 + if err := func() error { + s.AllowedRoles = make([]OrgPersonGrantCapabilitiesAllowedRolesItem, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem OrgPersonGrantCapabilitiesAllowedRolesItem + if err := elem.Decode(d); err != nil { + return err + } + s.AllowedRoles = append(s.AllowedRoles, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"allowedRoles\"") + } + case "targetId": + if err := func() error { + s.TargetId.Reset() + if err := s.TargetId.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"targetId\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgPersonGrantCapabilities") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00000001, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfOrgPersonGrantCapabilities) { + name = jsonFieldsNameOfOrgPersonGrantCapabilities[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err + if len(failures) > 0 { + return &validate.Error{Fields: failures} } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptMeRegional) MarshalJSON() ([]byte, error) { +func (s *OrgPersonGrantCapabilities) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptMeRegional) UnmarshalJSON(data []byte) error { +func (s *OrgPersonGrantCapabilities) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes MeRegionalUnavailable as json. -func (o OptMeRegionalUnavailable) Encode(e *jx.Encoder) { - if !o.Set { - return +// Encode implements json.Marshaler. +func (s OrgPersonGrantCapabilitiesAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s OrgPersonGrantCapabilitiesAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } } - o.Value.Encode(e) } -// Decode decodes MeRegionalUnavailable from json. -func (o *OptMeRegionalUnavailable) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptMeRegionalUnavailable to nil") +// Decode decodes OrgPersonGrantCapabilitiesAdditional from json. +func (s *OrgPersonGrantCapabilitiesAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgPersonGrantCapabilitiesAdditional to nil") } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgPersonGrantCapabilitiesAdditional") } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptMeRegionalUnavailable) MarshalJSON() ([]byte, error) { +func (s OrgPersonGrantCapabilitiesAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptMeRegionalUnavailable) UnmarshalJSON(data []byte) error { +func (s *OrgPersonGrantCapabilitiesAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes MirrorRequestFailure as json. -func (o OptMirrorRequestFailure) Encode(e *jx.Encoder) { - if !o.Set { - return - } - o.Value.Encode(e) +// Encode encodes OrgPersonGrantCapabilitiesAllowedRolesItem as json. +func (s OrgPersonGrantCapabilitiesAllowedRolesItem) Encode(e *jx.Encoder) { + e.Str(string(s)) } -// Decode decodes MirrorRequestFailure from json. -func (o *OptMirrorRequestFailure) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptMirrorRequestFailure to nil") +// Decode decodes OrgPersonGrantCapabilitiesAllowedRolesItem from json. +func (s *OrgPersonGrantCapabilitiesAllowedRolesItem) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgPersonGrantCapabilitiesAllowedRolesItem to nil") } - o.Set = true - if err := o.Value.Decode(d); err != nil { + v, err := d.StrBytes() + if err != nil { return err } + // Try to use constant string. + switch OrgPersonGrantCapabilitiesAllowedRolesItem(v) { + case OrgPersonGrantCapabilitiesAllowedRolesItemOwner: + *s = OrgPersonGrantCapabilitiesAllowedRolesItemOwner + case OrgPersonGrantCapabilitiesAllowedRolesItemAdmin: + *s = OrgPersonGrantCapabilitiesAllowedRolesItemAdmin + case OrgPersonGrantCapabilitiesAllowedRolesItemMember: + *s = OrgPersonGrantCapabilitiesAllowedRolesItemMember + case OrgPersonGrantCapabilitiesAllowedRolesItemWriter: + *s = OrgPersonGrantCapabilitiesAllowedRolesItemWriter + case OrgPersonGrantCapabilitiesAllowedRolesItemReader: + *s = OrgPersonGrantCapabilitiesAllowedRolesItemReader + default: + *s = OrgPersonGrantCapabilitiesAllowedRolesItem(v) + } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptMirrorRequestFailure) MarshalJSON() ([]byte, error) { +func (s OrgPersonGrantCapabilitiesAllowedRolesItem) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptMirrorRequestFailure) UnmarshalJSON(data []byte) error { +func (s *OrgPersonGrantCapabilitiesAllowedRolesItem) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes MirrorRequestResult as json. -func (o OptMirrorRequestResult) Encode(e *jx.Encoder) { - if !o.Set { - return - } - o.Value.Encode(e) +// Encode encodes OrgPersonGrantResourceType as json. +func (s OrgPersonGrantResourceType) Encode(e *jx.Encoder) { + e.Str(string(s)) } -// Decode decodes MirrorRequestResult from json. -func (o *OptMirrorRequestResult) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptMirrorRequestResult to nil") +// Decode decodes OrgPersonGrantResourceType from json. +func (s *OrgPersonGrantResourceType) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgPersonGrantResourceType to nil") } - o.Set = true - if err := o.Value.Decode(d); err != nil { + v, err := d.StrBytes() + if err != nil { return err } + // Try to use constant string. + switch OrgPersonGrantResourceType(v) { + case OrgPersonGrantResourceTypeOrganization: + *s = OrgPersonGrantResourceTypeOrganization + case OrgPersonGrantResourceTypeProject: + *s = OrgPersonGrantResourceTypeProject + case OrgPersonGrantResourceTypeRepository: + *s = OrgPersonGrantResourceTypeRepository + default: + *s = OrgPersonGrantResourceType(v) + } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptMirrorRequestResult) MarshalJSON() ([]byte, error) { +func (s OrgPersonGrantResourceType) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptMirrorRequestResult) UnmarshalJSON(data []byte) error { +func (s *OrgPersonGrantResourceType) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes MirrorStatus as json. -func (o OptMirrorStatus) Encode(e *jx.Encoder) { - if !o.Set { - return - } - e.Str(string(o.Value)) +// Encode encodes OrgPersonGrantRole as json. +func (s OrgPersonGrantRole) Encode(e *jx.Encoder) { + e.Str(string(s)) } -// Decode decodes MirrorStatus from json. -func (o *OptMirrorStatus) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptMirrorStatus to nil") +// Decode decodes OrgPersonGrantRole from json. +func (s *OrgPersonGrantRole) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgPersonGrantRole to nil") } - o.Set = true - if err := o.Value.Decode(d); err != nil { + v, err := d.StrBytes() + if err != nil { return err } + // Try to use constant string. + switch OrgPersonGrantRole(v) { + case OrgPersonGrantRoleOwner: + *s = OrgPersonGrantRoleOwner + case OrgPersonGrantRoleAdmin: + *s = OrgPersonGrantRoleAdmin + case OrgPersonGrantRoleMember: + *s = OrgPersonGrantRoleMember + case OrgPersonGrantRoleReader: + *s = OrgPersonGrantRoleReader + case OrgPersonGrantRoleWriter: + *s = OrgPersonGrantRoleWriter + case OrgPersonGrantRoleMirrorSourceAdmin: + *s = OrgPersonGrantRoleMirrorSourceAdmin + default: + *s = OrgPersonGrantRole(v) + } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptMirrorStatus) MarshalJSON() ([]byte, error) { +func (s OrgPersonGrantRole) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptMirrorStatus) UnmarshalJSON(data []byte) error { +func (s *OrgPersonGrantRole) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes Org as json. -func (o OptOrg) Encode(e *jx.Encoder) { - if !o.Set { - return - } - o.Value.Encode(e) +// Encode encodes OrgPersonGrantSource as json. +func (s OrgPersonGrantSource) Encode(e *jx.Encoder) { + e.Str(string(s)) } -// Decode decodes Org from json. -func (o *OptOrg) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptOrg to nil") +// Decode decodes OrgPersonGrantSource from json. +func (s *OrgPersonGrantSource) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgPersonGrantSource to nil") } - o.Set = true - if err := o.Value.Decode(d); err != nil { + v, err := d.StrBytes() + if err != nil { return err } + // Try to use constant string. + switch OrgPersonGrantSource(v) { + case OrgPersonGrantSourceMembership: + *s = OrgPersonGrantSourceMembership + case OrgPersonGrantSourceDirect: + *s = OrgPersonGrantSourceDirect + case OrgPersonGrantSourceTeam: + *s = OrgPersonGrantSourceTeam + case OrgPersonGrantSourceGithub: + *s = OrgPersonGrantSourceGithub + default: + *s = OrgPersonGrantSource(v) + } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptOrg) MarshalJSON() ([]byte, error) { +func (s OrgPersonGrantSource) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptOrg) UnmarshalJSON(data []byte) error { +func (s *OrgPersonGrantSource) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes OrgCapabilities as json. -func (o OptOrgCapabilities) Encode(e *jx.Encoder) { - if !o.Set { - return - } - o.Value.Encode(e) +// Encode implements json.Marshaler. +func (s *OrgPersonMembership) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() } -// Decode decodes OrgCapabilities from json. -func (o *OptOrgCapabilities) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptOrgCapabilities to nil") +// encodeFields encodes fields. +func (s *OrgPersonMembership) encodeFields(e *jx.Encoder) { + { + e.FieldStart("createdAt") + json.EncodeDateTime(e, s.CreatedAt) } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err + { + e.FieldStart("id") + e.Str(s.ID) } - return nil -} + { + e.FieldStart("role") + e.Str(s.Role) + } + { + e.FieldStart("status") + e.Str(s.Status) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) -// MarshalJSON implements stdjson.Marshaler. -func (s OptOrgCapabilities) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil + if len(elem) != 0 { + e.Raw(elem) + } + } } -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptOrgCapabilities) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) +var jsonFieldsNameOfOrgPersonMembership = [4]string{ + 0: "createdAt", + 1: "id", + 2: "role", + 3: "status", } -// Encode encodes Project as json. -func (o OptProject) Encode(e *jx.Encoder) { - if !o.Set { - return +// Decode decodes OrgPersonMembership from json. +func (s *OrgPersonMembership) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgPersonMembership to nil") } - o.Value.Encode(e) -} + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} -// Decode decodes Project from json. -func (o *OptProject) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptProject to nil") + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "createdAt": + requiredBitSet[0] |= 1 << 0 + if err := func() error { + v, err := json.DecodeDateTime(d) + s.CreatedAt = v + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"createdAt\"") + } + case "id": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.ID = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"id\"") + } + case "role": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.Role = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"role\"") + } + case "status": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.Status = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"status\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgPersonMembership") } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00001111, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfOrgPersonMembership) { + name = jsonFieldsNameOfOrgPersonMembership[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptProject) MarshalJSON() ([]byte, error) { +func (s *OrgPersonMembership) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptProject) UnmarshalJSON(data []byte) error { +func (s *OrgPersonMembership) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes ProjectCapabilities as json. -func (o OptProjectCapabilities) Encode(e *jx.Encoder) { - if !o.Set { - return +// Encode implements json.Marshaler. +func (s OrgPersonMembershipAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s OrgPersonMembershipAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } } - o.Value.Encode(e) } -// Decode decodes ProjectCapabilities from json. -func (o *OptProjectCapabilities) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptProjectCapabilities to nil") +// Decode decodes OrgPersonMembershipAdditional from json. +func (s *OrgPersonMembershipAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgPersonMembershipAdditional to nil") } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgPersonMembershipAdditional") } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptProjectCapabilities) MarshalJSON() ([]byte, error) { +func (s OrgPersonMembershipAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptProjectCapabilities) UnmarshalJSON(data []byte) error { +func (s *OrgPersonMembershipAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes Repo as json. -func (o OptRepo) Encode(e *jx.Encoder) { - if !o.Set { - return +// Encode implements json.Marshaler. +func (s *OrgPersonSummary) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *OrgPersonSummary) encodeFields(e *jx.Encoder) { + { + e.FieldStart("accessScopes") + e.ArrStart() + for _, elem := range s.AccessScopes { + elem.Encode(e) + } + e.ArrEnd() + } + { + e.FieldStart("accountId") + e.Str(s.AccountId) + } + { + if s.AvatarUrl.Set { + e.FieldStart("avatarUrl") + s.AvatarUrl.Encode(e) + } + } + { + if s.Handle.Set { + e.FieldStart("handle") + s.Handle.Encode(e) + } + } + { + e.FieldStart("membership") + s.Membership.Encode(e) + } + { + if s.Provider.Set { + e.FieldStart("provider") + s.Provider.Encode(e) + } + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } } - o.Value.Encode(e) } -// Decode decodes Repo from json. -func (o *OptRepo) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptRepo to nil") +var jsonFieldsNameOfOrgPersonSummary = [6]string{ + 0: "accessScopes", + 1: "accountId", + 2: "avatarUrl", + 3: "handle", + 4: "membership", + 5: "provider", +} + +// Decode decodes OrgPersonSummary from json. +func (s *OrgPersonSummary) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgPersonSummary to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "accessScopes": + requiredBitSet[0] |= 1 << 0 + if err := func() error { + s.AccessScopes = make([]OrgPersonSummaryAccessScopesItem, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem OrgPersonSummaryAccessScopesItem + if err := elem.Decode(d); err != nil { + return err + } + s.AccessScopes = append(s.AccessScopes, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"accessScopes\"") + } + case "accountId": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.AccountId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"accountId\"") + } + case "avatarUrl": + if err := func() error { + s.AvatarUrl.Reset() + if err := s.AvatarUrl.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"avatarUrl\"") + } + case "handle": + if err := func() error { + s.Handle.Reset() + if err := s.Handle.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"handle\"") + } + case "membership": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + if err := s.Membership.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"membership\"") + } + case "provider": + if err := func() error { + s.Provider.Reset() + if err := s.Provider.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgPersonSummary") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00010011, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfOrgPersonSummary) { + name = jsonFieldsNameOfOrgPersonSummary[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err + if len(failures) > 0 { + return &validate.Error{Fields: failures} } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptRepo) MarshalJSON() ([]byte, error) { +func (s *OrgPersonSummary) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptRepo) UnmarshalJSON(data []byte) error { +func (s *OrgPersonSummary) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes RepoCandidate as json. -func (o OptRepoCandidate) Encode(e *jx.Encoder) { - if !o.Set { - return - } - o.Value.Encode(e) +// Encode encodes OrgPersonSummaryAccessScopesItem as json. +func (s OrgPersonSummaryAccessScopesItem) Encode(e *jx.Encoder) { + e.Str(string(s)) } -// Decode decodes RepoCandidate from json. -func (o *OptRepoCandidate) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptRepoCandidate to nil") +// Decode decodes OrgPersonSummaryAccessScopesItem from json. +func (s *OrgPersonSummaryAccessScopesItem) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgPersonSummaryAccessScopesItem to nil") } - o.Set = true - if err := o.Value.Decode(d); err != nil { + v, err := d.StrBytes() + if err != nil { return err } + // Try to use constant string. + switch OrgPersonSummaryAccessScopesItem(v) { + case OrgPersonSummaryAccessScopesItemOrganization: + *s = OrgPersonSummaryAccessScopesItemOrganization + case OrgPersonSummaryAccessScopesItemProject: + *s = OrgPersonSummaryAccessScopesItemProject + case OrgPersonSummaryAccessScopesItemRepository: + *s = OrgPersonSummaryAccessScopesItemRepository + default: + *s = OrgPersonSummaryAccessScopesItem(v) + } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptRepoCandidate) MarshalJSON() ([]byte, error) { +func (s OrgPersonSummaryAccessScopesItem) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptRepoCandidate) UnmarshalJSON(data []byte) error { +func (s *OrgPersonSummaryAccessScopesItem) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes RepoCapabilities as json. -func (o OptRepoCapabilities) Encode(e *jx.Encoder) { - if !o.Set { - return +// Encode implements json.Marshaler. +func (s OrgPersonSummaryAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s OrgPersonSummaryAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } } - o.Value.Encode(e) } -// Decode decodes RepoCapabilities from json. -func (o *OptRepoCapabilities) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptRepoCapabilities to nil") +// Decode decodes OrgPersonSummaryAdditional from json. +func (s *OrgPersonSummaryAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode OrgPersonSummaryAdditional to nil") } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode OrgPersonSummaryAdditional") } + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptRepoCapabilities) MarshalJSON() ([]byte, error) { +func (s OrgPersonSummaryAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptRepoCapabilities) UnmarshalJSON(data []byte) error { +func (s *OrgPersonSummaryAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes RepoPrimaries as json. -func (o OptRepoPrimaries) Encode(e *jx.Encoder) { - if !o.Set { - return - } - o.Value.Encode(e) +// Encode implements json.Marshaler. +func (s *PatchRepoCIWebhookInputBody) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() } -// Decode decodes RepoPrimaries from json. -func (o *OptRepoPrimaries) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptRepoPrimaries to nil") +// encodeFields encodes fields. +func (s *PatchRepoCIWebhookInputBody) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } } - o.Set = true - if err := o.Value.Decode(d); err != nil { - return err + { + if s.DisplayName.Set { + e.FieldStart("display_name") + s.DisplayName.Encode(e) + } } - return nil -} + { + if s.Enabled.Set { + e.FieldStart("enabled") + s.Enabled.Encode(e) + } + } + { + if s.Events != nil { + e.FieldStart("events") + e.ArrStart() + for _, elem := range s.Events { + e.Str(elem) + } + e.ArrEnd() + } + } + { + if s.PublishChecks.Set { + e.FieldStart("publish_checks") + s.PublishChecks.Encode(e) + } + } + { + if s.RefFilter.Set { + e.FieldStart("ref_filter") + s.RefFilter.Encode(e) + } + } + { + if s.RepoWrite.Set { + e.FieldStart("repo_write") + s.RepoWrite.Encode(e) + } + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) -// MarshalJSON implements stdjson.Marshaler. -func (s OptRepoPrimaries) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil + if len(elem) != 0 { + e.Raw(elem) + } + } } -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptRepoPrimaries) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) +var jsonFieldsNameOfPatchRepoCIWebhookInputBody = [7]string{ + 0: "$schema", + 1: "display_name", + 2: "enabled", + 3: "events", + 4: "publish_checks", + 5: "ref_filter", + 6: "repo_write", } -// Encode encodes string as json. -func (o OptString) Encode(e *jx.Encoder) { - if !o.Set { - return +// Decode decodes PatchRepoCIWebhookInputBody from json. +func (s *PatchRepoCIWebhookInputBody) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode PatchRepoCIWebhookInputBody to nil") } - e.Str(string(o.Value)) -} + s.AdditionalProps = map[string]jx.Raw{} -// Decode decodes string from json. -func (o *OptString) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptString to nil") - } - o.Set = true - v, err := d.Str() - if err != nil { - return err + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "display_name": + if err := func() error { + s.DisplayName.Reset() + if err := s.DisplayName.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"display_name\"") + } + case "enabled": + if err := func() error { + s.Enabled.Reset() + if err := s.Enabled.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"enabled\"") + } + case "events": + if err := func() error { + s.Events = make([]string, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem string + v, err := d.Str() + elem = string(v) + if err != nil { + return err + } + s.Events = append(s.Events, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"events\"") + } + case "publish_checks": + if err := func() error { + s.PublishChecks.Reset() + if err := s.PublishChecks.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"publish_checks\"") + } + case "ref_filter": + if err := func() error { + s.RefFilter.Reset() + if err := s.RefFilter.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"ref_filter\"") + } + case "repo_write": + if err := func() error { + s.RepoWrite.Reset() + if err := s.RepoWrite.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"repo_write\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode PatchRepoCIWebhookInputBody") } - o.Value = string(v) + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptString) MarshalJSON() ([]byte, error) { +func (s *PatchRepoCIWebhookInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptString) UnmarshalJSON(data []byte) error { +func (s *PatchRepoCIWebhookInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes url.URL as json. -func (o OptURI) Encode(e *jx.Encoder) { - if !o.Set { - return +// Encode implements json.Marshaler. +func (s PatchRepoCIWebhookInputBodyAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s PatchRepoCIWebhookInputBodyAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } } - json.EncodeURI(e, o.Value) } -// Decode decodes url.URL from json. -func (o *OptURI) Decode(d *jx.Decoder) error { - if o == nil { - return errors.New("invalid: unable to decode OptURI to nil") +// Decode decodes PatchRepoCIWebhookInputBodyAdditional from json. +func (s *PatchRepoCIWebhookInputBodyAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode PatchRepoCIWebhookInputBodyAdditional to nil") } - o.Set = true - v, err := json.DecodeURI(d) - if err != nil { - return err + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode PatchRepoCIWebhookInputBodyAdditional") } - o.Value = v + return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OptURI) MarshalJSON() ([]byte, error) { +func (s PatchRepoCIWebhookInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OptURI) UnmarshalJSON(data []byte) error { +func (s *PatchRepoCIWebhookInputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *Org) Encode(e *jx.Encoder) { +func (s *PreviewInvitationInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *Org) encodeFields(e *jx.Encoder) { +func (s *PreviewInvitationInputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -23643,32 +31694,8 @@ func (s *Org) encodeFields(e *jx.Encoder) { } } { - if s.Capabilities.Set { - e.FieldStart("capabilities") - s.Capabilities.Encode(e) - } - } - { - e.FieldStart("createdAt") - json.EncodeDateTime(e, s.CreatedAt) - } - { - e.FieldStart("id") - e.Str(s.ID) - } - { - e.FieldStart("name") - e.Str(s.Name) - } - { - e.FieldStart("region") - e.Str(s.Region) - } - { - if s.WorkosOrganizationId.Set { - e.FieldStart("workosOrganizationId") - s.WorkosOrganizationId.Encode(e) - } + e.FieldStart("token") + e.Str(s.Token) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -23679,20 +31706,15 @@ func (s *Org) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfOrg = [7]string{ +var jsonFieldsNameOfPreviewInvitationInputBody = [2]string{ 0: "$schema", - 1: "capabilities", - 2: "createdAt", - 3: "id", - 4: "name", - 5: "region", - 6: "workosOrganizationId", + 1: "token", } -// Decode decodes Org from json. -func (s *Org) Decode(d *jx.Decoder) error { +// Decode decodes PreviewInvitationInputBody from json. +func (s *PreviewInvitationInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode Org to nil") + return errors.New("invalid: unable to decode PreviewInvitationInputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -23709,73 +31731,222 @@ func (s *Org) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "capabilities": + case "token": + requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Capabilities.Reset() - if err := s.Capabilities.Decode(d); err != nil { + v, err := d.Str() + s.Token = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"capabilities\"") + return errors.Wrap(err, "decode field \"token\"") } - case "createdAt": - requiredBitSet[0] |= 1 << 2 + default: + var elem jx.Raw if err := func() error { - v, err := json.DecodeDateTime(d) - s.CreatedAt = v + v, err := d.RawAppend(nil) + elem = jx.Raw(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"createdAt\"") + return errors.Wrapf(err, "decode field %q", k) } - case "id": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - v, err := d.Str() - s.ID = string(v) - if err != nil { - return err + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode PreviewInvitationInputBody") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00000010, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfPreviewInvitationInputBody) { + name = jsonFieldsNameOfPreviewInvitationInputBody[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"id\"") + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx } - case "name": - requiredBitSet[0] |= 1 << 4 + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *PreviewInvitationInputBody) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *PreviewInvitationInputBody) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s PreviewInvitationInputBodyAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s PreviewInvitationInputBodyAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes PreviewInvitationInputBodyAdditional from json. +func (s *PreviewInvitationInputBodyAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode PreviewInvitationInputBodyAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode PreviewInvitationInputBodyAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s PreviewInvitationInputBodyAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *PreviewInvitationInputBodyAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *PreviewInvitationOK) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *PreviewInvitationOK) encodeFields(e *jx.Encoder) { + { + e.FieldStart("inviterHandle") + e.Str(s.InviterHandle) + } + { + e.FieldStart("orgName") + e.Str(s.OrgName) + } + { + e.FieldStart("role") + s.Role.Encode(e) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfPreviewInvitationOK = [3]string{ + 0: "inviterHandle", + 1: "orgName", + 2: "role", +} + +// Decode decodes PreviewInvitationOK from json. +func (s *PreviewInvitationOK) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode PreviewInvitationOK to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "inviterHandle": + requiredBitSet[0] |= 1 << 0 if err := func() error { v, err := d.Str() - s.Name = string(v) + s.InviterHandle = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"name\"") + return errors.Wrap(err, "decode field \"inviterHandle\"") } - case "region": - requiredBitSet[0] |= 1 << 5 + case "orgName": + requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.Region = string(v) + s.OrgName = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"region\"") + return errors.Wrap(err, "decode field \"orgName\"") } - case "workosOrganizationId": + case "role": + requiredBitSet[0] |= 1 << 2 if err := func() error { - s.WorkosOrganizationId.Reset() - if err := s.WorkosOrganizationId.Decode(d); err != nil { + if err := s.Role.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"workosOrganizationId\"") + return errors.Wrap(err, "decode field \"role\"") } default: var elem jx.Raw @@ -23793,12 +31964,12 @@ func (s *Org) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode Org") + return errors.Wrap(err, "decode PreviewInvitationOK") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00111100, + 0b00000111, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -23810,8 +31981,8 @@ func (s *Org) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfOrg) { - name = jsonFieldsNameOfOrg[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfPreviewInvitationOK) { + name = jsonFieldsNameOfPreviewInvitationOK[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -23832,27 +32003,27 @@ func (s *Org) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *Org) MarshalJSON() ([]byte, error) { +func (s *PreviewInvitationOK) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *Org) UnmarshalJSON(data []byte) error { +func (s *PreviewInvitationOK) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s OrgAdditional) Encode(e *jx.Encoder) { +func (s PreviewInvitationOKAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s OrgAdditional) encodeFields(e *jx.Encoder) { +func (s PreviewInvitationOKAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -23862,10 +32033,10 @@ func (s OrgAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes OrgAdditional from json. -func (s *OrgAdditional) Decode(d *jx.Decoder) error { +// Decode decodes PreviewInvitationOKAdditional from json. +func (s *PreviewInvitationOKAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode OrgAdditional to nil") + return errors.New("invalid: unable to decode PreviewInvitationOKAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -23883,34 +32054,76 @@ func (s *OrgAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode OrgAdditional") + return errors.Wrap(err, "decode PreviewInvitationOKAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OrgAdditional) MarshalJSON() ([]byte, error) { +func (s PreviewInvitationOKAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OrgAdditional) UnmarshalJSON(data []byte) error { +func (s *PreviewInvitationOKAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes PreviewInvitationOKRole as json. +func (s PreviewInvitationOKRole) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes PreviewInvitationOKRole from json. +func (s *PreviewInvitationOKRole) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode PreviewInvitationOKRole to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch PreviewInvitationOKRole(v) { + case PreviewInvitationOKRoleOwner: + *s = PreviewInvitationOKRoleOwner + case PreviewInvitationOKRoleAdmin: + *s = PreviewInvitationOKRoleAdmin + case PreviewInvitationOKRoleMember: + *s = PreviewInvitationOKRoleMember + default: + *s = PreviewInvitationOKRole(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s PreviewInvitationOKRole) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *PreviewInvitationOKRole) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *OrgCIBuildkiteClusterView) Encode(e *jx.Encoder) { +func (s *Project) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *OrgCIBuildkiteClusterView) encodeFields(e *jx.Encoder) { +func (s *Project) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -23918,32 +32131,58 @@ func (s *OrgCIBuildkiteClusterView) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("auth_plugin_ref") - e.Str(s.AuthPluginRef) + if s.ApiUrl.Set { + e.FieldStart("apiUrl") + s.ApiUrl.Encode(e) + } } { - e.FieldStart("bk_cluster_id") - e.Str(s.BkClusterID) + if s.Capabilities.Set { + e.FieldStart("capabilities") + s.Capabilities.Encode(e) + } } { - e.FieldStart("bk_organization") - e.Str(s.BkOrganization) + e.FieldStart("createdAt") + json.EncodeDateTime(e, s.CreatedAt) } { - e.FieldStart("created_at") - json.EncodeDateTime(e, s.CreatedAt) + e.FieldStart("id") + e.Str(s.ID) } { - e.FieldStart("label") - e.Str(s.Label) + e.FieldStart("name") + e.Str(s.Name) } { - e.FieldStart("owner") - e.Str(s.Owner) + e.FieldStart("ownerId") + e.Str(s.OwnerId) } { - e.FieldStart("updated_at") - json.EncodeDateTime(e, s.UpdatedAt) + if s.OwnerName.Set { + e.FieldStart("ownerName") + s.OwnerName.Encode(e) + } + } + { + e.FieldStart("ownerType") + s.OwnerType.Encode(e) + } + { + if s.PrimaryProcessingCell.Set { + e.FieldStart("primaryProcessingCell") + s.PrimaryProcessingCell.Encode(e) + } + } + { + e.FieldStart("region") + e.Str(s.Region) + } + { + if s.RepositoryCount.Set { + e.FieldStart("repositoryCount") + s.RepositoryCount.Encode(e) + } } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -23954,23 +32193,27 @@ func (s *OrgCIBuildkiteClusterView) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfOrgCIBuildkiteClusterView = [8]string{ - 0: "$schema", - 1: "auth_plugin_ref", - 2: "bk_cluster_id", - 3: "bk_organization", - 4: "created_at", - 5: "label", - 6: "owner", - 7: "updated_at", +var jsonFieldsNameOfProject = [12]string{ + 0: "$schema", + 1: "apiUrl", + 2: "capabilities", + 3: "createdAt", + 4: "id", + 5: "name", + 6: "ownerId", + 7: "ownerName", + 8: "ownerType", + 9: "primaryProcessingCell", + 10: "region", + 11: "repositoryCount", } -// Decode decodes OrgCIBuildkiteClusterView from json. -func (s *OrgCIBuildkiteClusterView) Decode(d *jx.Decoder) error { +// Decode decodes Project from json. +func (s *Project) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode OrgCIBuildkiteClusterView to nil") + return errors.New("invalid: unable to decode Project to nil") } - var requiredBitSet [1]uint8 + var requiredBitSet [2]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -23985,89 +32228,125 @@ func (s *OrgCIBuildkiteClusterView) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "auth_plugin_ref": - requiredBitSet[0] |= 1 << 1 + case "apiUrl": if err := func() error { - v, err := d.Str() - s.AuthPluginRef = string(v) - if err != nil { + s.ApiUrl.Reset() + if err := s.ApiUrl.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"auth_plugin_ref\"") + return errors.Wrap(err, "decode field \"apiUrl\"") } - case "bk_cluster_id": - requiredBitSet[0] |= 1 << 2 + case "capabilities": if err := func() error { - v, err := d.Str() - s.BkClusterID = string(v) - if err != nil { + s.Capabilities.Reset() + if err := s.Capabilities.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"bk_cluster_id\"") + return errors.Wrap(err, "decode field \"capabilities\"") } - case "bk_organization": + case "createdAt": requiredBitSet[0] |= 1 << 3 if err := func() error { - v, err := d.Str() - s.BkOrganization = string(v) + v, err := json.DecodeDateTime(d) + s.CreatedAt = v if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"bk_organization\"") + return errors.Wrap(err, "decode field \"createdAt\"") } - case "created_at": + case "id": requiredBitSet[0] |= 1 << 4 if err := func() error { - v, err := json.DecodeDateTime(d) - s.CreatedAt = v + v, err := d.Str() + s.ID = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"created_at\"") + return errors.Wrap(err, "decode field \"id\"") } - case "label": + case "name": requiredBitSet[0] |= 1 << 5 if err := func() error { v, err := d.Str() - s.Label = string(v) + s.Name = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"label\"") + return errors.Wrap(err, "decode field \"name\"") } - case "owner": + case "ownerId": requiredBitSet[0] |= 1 << 6 if err := func() error { v, err := d.Str() - s.Owner = string(v) + s.OwnerId = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"owner\"") + return errors.Wrap(err, "decode field \"ownerId\"") } - case "updated_at": - requiredBitSet[0] |= 1 << 7 + case "ownerName": if err := func() error { - v, err := json.DecodeDateTime(d) - s.UpdatedAt = v + s.OwnerName.Reset() + if err := s.OwnerName.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"ownerName\"") + } + case "ownerType": + requiredBitSet[1] |= 1 << 0 + if err := func() error { + if err := s.OwnerType.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"ownerType\"") + } + case "primaryProcessingCell": + if err := func() error { + s.PrimaryProcessingCell.Reset() + if err := s.PrimaryProcessingCell.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"primaryProcessingCell\"") + } + case "region": + requiredBitSet[1] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.Region = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"updated_at\"") + return errors.Wrap(err, "decode field \"region\"") + } + case "repositoryCount": + if err := func() error { + s.RepositoryCount.Reset() + if err := s.RepositoryCount.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"repositoryCount\"") } default: var elem jx.Raw @@ -24085,12 +32364,13 @@ func (s *OrgCIBuildkiteClusterView) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode OrgCIBuildkiteClusterView") + return errors.Wrap(err, "decode Project") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [1]uint8{ - 0b11111110, + for i, mask := range [2]uint8{ + 0b01111000, + 0b00000101, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -24102,8 +32382,8 @@ func (s *OrgCIBuildkiteClusterView) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfOrgCIBuildkiteClusterView) { - name = jsonFieldsNameOfOrgCIBuildkiteClusterView[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfProject) { + name = jsonFieldsNameOfProject[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -24124,27 +32404,27 @@ func (s *OrgCIBuildkiteClusterView) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *OrgCIBuildkiteClusterView) MarshalJSON() ([]byte, error) { +func (s *Project) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OrgCIBuildkiteClusterView) UnmarshalJSON(data []byte) error { +func (s *Project) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s OrgCIBuildkiteClusterViewAdditional) Encode(e *jx.Encoder) { +func (s ProjectAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s OrgCIBuildkiteClusterViewAdditional) encodeFields(e *jx.Encoder) { +func (s ProjectAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -24154,10 +32434,10 @@ func (s OrgCIBuildkiteClusterViewAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes OrgCIBuildkiteClusterViewAdditional from json. -func (s *OrgCIBuildkiteClusterViewAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ProjectAdditional from json. +func (s *ProjectAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode OrgCIBuildkiteClusterViewAdditional to nil") + return errors.New("invalid: unable to decode ProjectAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -24175,103 +32455,49 @@ func (s *OrgCIBuildkiteClusterViewAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode OrgCIBuildkiteClusterViewAdditional") + return errors.Wrap(err, "decode ProjectAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OrgCIBuildkiteClusterViewAdditional) MarshalJSON() ([]byte, error) { +func (s ProjectAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OrgCIBuildkiteClusterViewAdditional) UnmarshalJSON(data []byte) error { +func (s *ProjectAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *OrgCIBuildkiteCredentialView) Encode(e *jx.Encoder) { +func (s *ProjectCapabilities) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *OrgCIBuildkiteCredentialView) encodeFields(e *jx.Encoder) { - { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } - } - { - e.FieldStart("bk_organization") - e.Str(s.BkOrganization) - } - { - e.FieldStart("cipher_version") - e.Int64(s.CipherVersion) - } - { - e.FieldStart("created_at") - json.EncodeDateTime(e, s.CreatedAt) - } - { - if s.InboundEndpointID.Set { - e.FieldStart("inbound_endpoint_id") - s.InboundEndpointID.Encode(e) - } - } - { - if s.InboundEndpointPath.Set { - e.FieldStart("inbound_endpoint_path") - s.InboundEndpointPath.Encode(e) - } - } - { - if s.InboundEndpointURL.Set { - e.FieldStart("inbound_endpoint_url") - s.InboundEndpointURL.Encode(e) - } - } - { - if s.InboundSecret.Set { - e.FieldStart("inbound_secret") - s.InboundSecret.Encode(e) - } - } - { - if s.InboundSecretIssuedAt.Set { - e.FieldStart("inbound_secret_issued_at") - s.InboundSecretIssuedAt.Encode(e, json.EncodeDateTime) - } - } - { - e.FieldStart("inbound_secret_set") - e.Bool(s.InboundSecretSet) - } +func (s *ProjectCapabilities) encodeFields(e *jx.Encoder) { { - e.FieldStart("owner") - e.Str(s.Owner) + e.FieldStart("canCreateRepository") + e.Bool(s.CanCreateRepository) } { - e.FieldStart("token_len") - e.Int64(s.TokenLen) + e.FieldStart("canDelete") + e.Bool(s.CanDelete) } { - e.FieldStart("updated_at") - json.EncodeDateTime(e, s.UpdatedAt) + e.FieldStart("canManageAccess") + e.Bool(s.CanManageAccess) } { - if s.VerifiedAt.Set { - e.FieldStart("verified_at") - s.VerifiedAt.Encode(e, json.EncodeDateTime) - } + e.FieldStart("canManageTrails") + e.Bool(s.CanManageTrails) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -24282,186 +32508,70 @@ func (s *OrgCIBuildkiteCredentialView) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfOrgCIBuildkiteCredentialView = [14]string{ - 0: "$schema", - 1: "bk_organization", - 2: "cipher_version", - 3: "created_at", - 4: "inbound_endpoint_id", - 5: "inbound_endpoint_path", - 6: "inbound_endpoint_url", - 7: "inbound_secret", - 8: "inbound_secret_issued_at", - 9: "inbound_secret_set", - 10: "owner", - 11: "token_len", - 12: "updated_at", - 13: "verified_at", +var jsonFieldsNameOfProjectCapabilities = [4]string{ + 0: "canCreateRepository", + 1: "canDelete", + 2: "canManageAccess", + 3: "canManageTrails", } -// Decode decodes OrgCIBuildkiteCredentialView from json. -func (s *OrgCIBuildkiteCredentialView) Decode(d *jx.Decoder) error { +// Decode decodes ProjectCapabilities from json. +func (s *ProjectCapabilities) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode OrgCIBuildkiteCredentialView to nil") + return errors.New("invalid: unable to decode ProjectCapabilities to nil") } - var requiredBitSet [2]uint8 + var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "canCreateRepository": + requiredBitSet[0] |= 1 << 0 if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + v, err := d.Bool() + s.CanCreateRepository = bool(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"canCreateRepository\"") } - case "bk_organization": + case "canDelete": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.BkOrganization = string(v) + v, err := d.Bool() + s.CanDelete = bool(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"bk_organization\"") + return errors.Wrap(err, "decode field \"canDelete\"") } - case "cipher_version": + case "canManageAccess": requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Int64() - s.CipherVersion = int64(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"cipher_version\"") - } - case "created_at": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - v, err := json.DecodeDateTime(d) - s.CreatedAt = v - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"created_at\"") - } - case "inbound_endpoint_id": - if err := func() error { - s.InboundEndpointID.Reset() - if err := s.InboundEndpointID.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"inbound_endpoint_id\"") - } - case "inbound_endpoint_path": - if err := func() error { - s.InboundEndpointPath.Reset() - if err := s.InboundEndpointPath.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"inbound_endpoint_path\"") - } - case "inbound_endpoint_url": - if err := func() error { - s.InboundEndpointURL.Reset() - if err := s.InboundEndpointURL.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"inbound_endpoint_url\"") - } - case "inbound_secret": - if err := func() error { - s.InboundSecret.Reset() - if err := s.InboundSecret.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"inbound_secret\"") - } - case "inbound_secret_issued_at": - if err := func() error { - s.InboundSecretIssuedAt.Reset() - if err := s.InboundSecretIssuedAt.Decode(d, json.DecodeDateTime); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"inbound_secret_issued_at\"") - } - case "inbound_secret_set": - requiredBitSet[1] |= 1 << 1 if err := func() error { v, err := d.Bool() - s.InboundSecretSet = bool(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"inbound_secret_set\"") - } - case "owner": - requiredBitSet[1] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.Owner = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"owner\"") - } - case "token_len": - requiredBitSet[1] |= 1 << 3 - if err := func() error { - v, err := d.Int64() - s.TokenLen = int64(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"token_len\"") - } - case "updated_at": - requiredBitSet[1] |= 1 << 4 - if err := func() error { - v, err := json.DecodeDateTime(d) - s.UpdatedAt = v + s.CanManageAccess = bool(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"updated_at\"") + return errors.Wrap(err, "decode field \"canManageAccess\"") } - case "verified_at": + case "canManageTrails": + requiredBitSet[0] |= 1 << 3 if err := func() error { - s.VerifiedAt.Reset() - if err := s.VerifiedAt.Decode(d, json.DecodeDateTime); err != nil { + v, err := d.Bool() + s.CanManageTrails = bool(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"verified_at\"") + return errors.Wrap(err, "decode field \"canManageTrails\"") } default: var elem jx.Raw @@ -24479,13 +32589,12 @@ func (s *OrgCIBuildkiteCredentialView) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode OrgCIBuildkiteCredentialView") + return errors.Wrap(err, "decode ProjectCapabilities") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [2]uint8{ - 0b00001110, - 0b00011110, + for i, mask := range [1]uint8{ + 0b00001111, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -24497,8 +32606,8 @@ func (s *OrgCIBuildkiteCredentialView) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfOrgCIBuildkiteCredentialView) { - name = jsonFieldsNameOfOrgCIBuildkiteCredentialView[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfProjectCapabilities) { + name = jsonFieldsNameOfProjectCapabilities[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -24519,27 +32628,27 @@ func (s *OrgCIBuildkiteCredentialView) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *OrgCIBuildkiteCredentialView) MarshalJSON() ([]byte, error) { +func (s *ProjectCapabilities) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OrgCIBuildkiteCredentialView) UnmarshalJSON(data []byte) error { +func (s *ProjectCapabilities) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s OrgCIBuildkiteCredentialViewAdditional) Encode(e *jx.Encoder) { +func (s ProjectCapabilitiesAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s OrgCIBuildkiteCredentialViewAdditional) encodeFields(e *jx.Encoder) { +func (s ProjectCapabilitiesAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -24549,10 +32658,10 @@ func (s OrgCIBuildkiteCredentialViewAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes OrgCIBuildkiteCredentialViewAdditional from json. -func (s *OrgCIBuildkiteCredentialViewAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ProjectCapabilitiesAdditional from json. +func (s *ProjectCapabilitiesAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode OrgCIBuildkiteCredentialViewAdditional to nil") + return errors.New("invalid: unable to decode ProjectCapabilitiesAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -24570,81 +32679,55 @@ func (s *OrgCIBuildkiteCredentialViewAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode OrgCIBuildkiteCredentialViewAdditional") + return errors.Wrap(err, "decode ProjectCapabilitiesAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OrgCIBuildkiteCredentialViewAdditional) MarshalJSON() ([]byte, error) { +func (s ProjectCapabilitiesAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OrgCIBuildkiteCredentialViewAdditional) UnmarshalJSON(data []byte) error { +func (s *ProjectCapabilitiesAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *OrgCIGitHubActionsCredentialView) Encode(e *jx.Encoder) { +func (s *ProjectGrant) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *OrgCIGitHubActionsCredentialView) encodeFields(e *jx.Encoder) { - { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } - } - { - e.FieldStart("account") - e.Str(s.Account) - } - { - if s.HasAPIToken.Set { - e.FieldStart("has_api_token") - s.HasAPIToken.Encode(e) - } - } - { - if s.InboundEndpointID.Set { - e.FieldStart("inbound_endpoint_id") - s.InboundEndpointID.Encode(e) - } - } +func (s *ProjectGrant) encodeFields(e *jx.Encoder) { { - if s.InboundEndpointPath.Set { - e.FieldStart("inbound_endpoint_path") - s.InboundEndpointPath.Encode(e) - } + e.FieldStart("granteeId") + e.Str(s.GranteeId) } { - if s.InboundEndpointURL.Set { - e.FieldStart("inbound_endpoint_url") - s.InboundEndpointURL.Encode(e) + if s.GranteeName.Set { + e.FieldStart("granteeName") + s.GranteeName.Encode(e) } } { - if s.InboundSecret.Set { - e.FieldStart("inbound_secret") - s.InboundSecret.Encode(e) - } + e.FieldStart("granteeType") + e.Str(s.GranteeType) } { - e.FieldStart("owner") - e.Str(s.Owner) + e.FieldStart("role") + e.Str(s.Role) } { - e.FieldStart("provider") - e.Str(s.Provider) + e.FieldStart("source") + e.Str(s.Source) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -24655,123 +32738,309 @@ func (s *OrgCIGitHubActionsCredentialView) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfOrgCIGitHubActionsCredentialView = [9]string{ - 0: "$schema", - 1: "account", - 2: "has_api_token", - 3: "inbound_endpoint_id", - 4: "inbound_endpoint_path", - 5: "inbound_endpoint_url", - 6: "inbound_secret", - 7: "owner", - 8: "provider", +var jsonFieldsNameOfProjectGrant = [5]string{ + 0: "granteeId", + 1: "granteeName", + 2: "granteeType", + 3: "role", + 4: "source", } -// Decode decodes OrgCIGitHubActionsCredentialView from json. -func (s *OrgCIGitHubActionsCredentialView) Decode(d *jx.Decoder) error { +// Decode decodes ProjectGrant from json. +func (s *ProjectGrant) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode OrgCIGitHubActionsCredentialView to nil") + return errors.New("invalid: unable to decode ProjectGrant to nil") } - var requiredBitSet [2]uint8 + var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": - if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") - } - case "account": - requiredBitSet[0] |= 1 << 1 + case "granteeId": + requiredBitSet[0] |= 1 << 0 if err := func() error { v, err := d.Str() - s.Account = string(v) + s.GranteeId = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"account\"") + return errors.Wrap(err, "decode field \"granteeId\"") } - case "has_api_token": + case "granteeName": if err := func() error { - s.HasAPIToken.Reset() - if err := s.HasAPIToken.Decode(d); err != nil { + s.GranteeName.Reset() + if err := s.GranteeName.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"has_api_token\"") + return errors.Wrap(err, "decode field \"granteeName\"") } - case "inbound_endpoint_id": + case "granteeType": + requiredBitSet[0] |= 1 << 2 if err := func() error { - s.InboundEndpointID.Reset() - if err := s.InboundEndpointID.Decode(d); err != nil { + v, err := d.Str() + s.GranteeType = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"inbound_endpoint_id\"") + return errors.Wrap(err, "decode field \"granteeType\"") } - case "inbound_endpoint_path": + case "role": + requiredBitSet[0] |= 1 << 3 if err := func() error { - s.InboundEndpointPath.Reset() - if err := s.InboundEndpointPath.Decode(d); err != nil { + v, err := d.Str() + s.Role = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"inbound_endpoint_path\"") + return errors.Wrap(err, "decode field \"role\"") } - case "inbound_endpoint_url": + case "source": + requiredBitSet[0] |= 1 << 4 if err := func() error { - s.InboundEndpointURL.Reset() - if err := s.InboundEndpointURL.Decode(d); err != nil { + v, err := d.Str() + s.Source = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"inbound_endpoint_url\"") + return errors.Wrap(err, "decode field \"source\"") } - case "inbound_secret": + default: + var elem jx.Raw if err := func() error { - s.InboundSecret.Reset() - if err := s.InboundSecret.Decode(d); err != nil { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"inbound_secret\"") + return errors.Wrapf(err, "decode field %q", k) } - case "owner": - requiredBitSet[0] |= 1 << 7 + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode ProjectGrant") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00011101, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfProjectGrant) { + name = jsonFieldsNameOfProjectGrant[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *ProjectGrant) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *ProjectGrant) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s ProjectGrantAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s ProjectGrantAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes ProjectGrantAdditional from json. +func (s *ProjectGrantAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode ProjectGrantAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode ProjectGrantAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s ProjectGrantAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *ProjectGrantAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes ProjectOwnerType as json. +func (s ProjectOwnerType) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes ProjectOwnerType from json. +func (s *ProjectOwnerType) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode ProjectOwnerType to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch ProjectOwnerType(v) { + case ProjectOwnerTypeOrg: + *s = ProjectOwnerTypeOrg + case ProjectOwnerTypeAccount: + *s = ProjectOwnerTypeAccount + default: + *s = ProjectOwnerType(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s ProjectOwnerType) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *ProjectOwnerType) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s *ProjectReference) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *ProjectReference) encodeFields(e *jx.Encoder) { + { + e.FieldStart("host") + s.Host.Encode(e) + } + { + e.FieldStart("project") + e.Str(s.Project) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfProjectReference = [2]string{ + 0: "host", + 1: "project", +} + +// Decode decodes ProjectReference from json. +func (s *ProjectReference) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode ProjectReference to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "host": + requiredBitSet[0] |= 1 << 0 if err := func() error { - v, err := d.Str() - s.Owner = string(v) - if err != nil { + if err := s.Host.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"owner\"") + return errors.Wrap(err, "decode field \"host\"") } - case "provider": - requiredBitSet[1] |= 1 << 0 + case "project": + requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.Provider = string(v) + s.Project = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"provider\"") + return errors.Wrap(err, "decode field \"project\"") } default: var elem jx.Raw @@ -24789,13 +33058,12 @@ func (s *OrgCIGitHubActionsCredentialView) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode OrgCIGitHubActionsCredentialView") + return errors.Wrap(err, "decode ProjectReference") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [2]uint8{ - 0b10000010, - 0b00000001, + for i, mask := range [1]uint8{ + 0b00000011, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -24807,8 +33075,8 @@ func (s *OrgCIGitHubActionsCredentialView) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfOrgCIGitHubActionsCredentialView) { - name = jsonFieldsNameOfOrgCIGitHubActionsCredentialView[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfProjectReference) { + name = jsonFieldsNameOfProjectReference[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -24829,27 +33097,27 @@ func (s *OrgCIGitHubActionsCredentialView) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *OrgCIGitHubActionsCredentialView) MarshalJSON() ([]byte, error) { +func (s *ProjectReference) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OrgCIGitHubActionsCredentialView) UnmarshalJSON(data []byte) error { +func (s *ProjectReference) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s OrgCIGitHubActionsCredentialViewAdditional) Encode(e *jx.Encoder) { +func (s ProjectReferenceAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s OrgCIGitHubActionsCredentialViewAdditional) encodeFields(e *jx.Encoder) { +func (s ProjectReferenceAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -24859,10 +33127,10 @@ func (s OrgCIGitHubActionsCredentialViewAdditional) encodeFields(e *jx.Encoder) } } -// Decode decodes OrgCIGitHubActionsCredentialViewAdditional from json. -func (s *OrgCIGitHubActionsCredentialViewAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ProjectReferenceAdditional from json. +func (s *ProjectReferenceAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode OrgCIGitHubActionsCredentialViewAdditional to nil") + return errors.New("invalid: unable to decode ProjectReferenceAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -24880,45 +33148,99 @@ func (s *OrgCIGitHubActionsCredentialViewAdditional) Decode(d *jx.Decoder) error m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode OrgCIGitHubActionsCredentialViewAdditional") + return errors.Wrap(err, "decode ProjectReferenceAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OrgCIGitHubActionsCredentialViewAdditional) MarshalJSON() ([]byte, error) { +func (s ProjectReferenceAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OrgCIGitHubActionsCredentialViewAdditional) UnmarshalJSON(data []byte) error { +func (s *ProjectReferenceAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes ProjectReferenceHost as json. +func (s ProjectReferenceHost) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes ProjectReferenceHost from json. +func (s *ProjectReferenceHost) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode ProjectReferenceHost to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch ProjectReferenceHost(v) { + case ProjectReferenceHostEt: + *s = ProjectReferenceHostEt + case ProjectReferenceHostGh: + *s = ProjectReferenceHostGh + default: + *s = ProjectReferenceHost(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s ProjectReferenceHost) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *ProjectReferenceHost) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *OrgCapabilities) Encode(e *jx.Encoder) { +func (s *RegisterOrgCIBuildkiteClusterInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *OrgCapabilities) encodeFields(e *jx.Encoder) { +func (s *RegisterOrgCIBuildkiteClusterInputBody) encodeFields(e *jx.Encoder) { { - e.FieldStart("canCreateProject") - e.Bool(s.CanCreateProject) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } } { - e.FieldStart("canDelete") - e.Bool(s.CanDelete) + if s.AuthPluginRef.Set { + e.FieldStart("auth_plugin_ref") + s.AuthPluginRef.Encode(e) + } } { - e.FieldStart("canManageMembers") - e.Bool(s.CanManageMembers) + e.FieldStart("bk_cluster_id") + e.Str(s.BkClusterID) + } + { + e.FieldStart("bk_organization") + e.Str(s.BkOrganization) + } + { + if s.Label.Set { + e.FieldStart("label") + s.Label.Encode(e) + } } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -24929,57 +33251,77 @@ func (s *OrgCapabilities) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfOrgCapabilities = [3]string{ - 0: "canCreateProject", - 1: "canDelete", - 2: "canManageMembers", +var jsonFieldsNameOfRegisterOrgCIBuildkiteClusterInputBody = [5]string{ + 0: "$schema", + 1: "auth_plugin_ref", + 2: "bk_cluster_id", + 3: "bk_organization", + 4: "label", } -// Decode decodes OrgCapabilities from json. -func (s *OrgCapabilities) Decode(d *jx.Decoder) error { +// Decode decodes RegisterOrgCIBuildkiteClusterInputBody from json. +func (s *RegisterOrgCIBuildkiteClusterInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode OrgCapabilities to nil") + return errors.New("invalid: unable to decode RegisterOrgCIBuildkiteClusterInputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "canCreateProject": - requiredBitSet[0] |= 1 << 0 + case "$schema": if err := func() error { - v, err := d.Bool() - s.CanCreateProject = bool(v) + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "auth_plugin_ref": + if err := func() error { + s.AuthPluginRef.Reset() + if err := s.AuthPluginRef.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"auth_plugin_ref\"") + } + case "bk_cluster_id": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.BkClusterID = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"canCreateProject\"") + return errors.Wrap(err, "decode field \"bk_cluster_id\"") } - case "canDelete": - requiredBitSet[0] |= 1 << 1 + case "bk_organization": + requiredBitSet[0] |= 1 << 3 if err := func() error { - v, err := d.Bool() - s.CanDelete = bool(v) + v, err := d.Str() + s.BkOrganization = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"canDelete\"") + return errors.Wrap(err, "decode field \"bk_organization\"") } - case "canManageMembers": - requiredBitSet[0] |= 1 << 2 + case "label": if err := func() error { - v, err := d.Bool() - s.CanManageMembers = bool(v) - if err != nil { + s.Label.Reset() + if err := s.Label.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"canManageMembers\"") + return errors.Wrap(err, "decode field \"label\"") } default: var elem jx.Raw @@ -24997,12 +33339,12 @@ func (s *OrgCapabilities) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode OrgCapabilities") + return errors.Wrap(err, "decode RegisterOrgCIBuildkiteClusterInputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000111, + 0b00001100, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -25014,8 +33356,8 @@ func (s *OrgCapabilities) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfOrgCapabilities) { - name = jsonFieldsNameOfOrgCapabilities[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfRegisterOrgCIBuildkiteClusterInputBody) { + name = jsonFieldsNameOfRegisterOrgCIBuildkiteClusterInputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -25036,27 +33378,27 @@ func (s *OrgCapabilities) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *OrgCapabilities) MarshalJSON() ([]byte, error) { +func (s *RegisterOrgCIBuildkiteClusterInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OrgCapabilities) UnmarshalJSON(data []byte) error { +func (s *RegisterOrgCIBuildkiteClusterInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s OrgCapabilitiesAdditional) Encode(e *jx.Encoder) { +func (s RegisterOrgCIBuildkiteClusterInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s OrgCapabilitiesAdditional) encodeFields(e *jx.Encoder) { +func (s RegisterOrgCIBuildkiteClusterInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -25066,10 +33408,10 @@ func (s OrgCapabilitiesAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes OrgCapabilitiesAdditional from json. -func (s *OrgCapabilitiesAdditional) Decode(d *jx.Decoder) error { +// Decode decodes RegisterOrgCIBuildkiteClusterInputBodyAdditional from json. +func (s *RegisterOrgCIBuildkiteClusterInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode OrgCapabilitiesAdditional to nil") + return errors.New("invalid: unable to decode RegisterOrgCIBuildkiteClusterInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -25087,34 +33429,34 @@ func (s *OrgCapabilitiesAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode OrgCapabilitiesAdditional") + return errors.Wrap(err, "decode RegisterOrgCIBuildkiteClusterInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s OrgCapabilitiesAdditional) MarshalJSON() ([]byte, error) { +func (s RegisterOrgCIBuildkiteClusterInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *OrgCapabilitiesAdditional) UnmarshalJSON(data []byte) error { +func (s *RegisterOrgCIBuildkiteClusterInputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *PatchRepoCIWebhookInputBody) Encode(e *jx.Encoder) { +func (s *Repo) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *PatchRepoCIWebhookInputBody) encodeFields(e *jx.Encoder) { +func (s *Repo) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -25122,37 +33464,127 @@ func (s *PatchRepoCIWebhookInputBody) encodeFields(e *jx.Encoder) { } } { - if s.DisplayName.Set { - e.FieldStart("display_name") - s.DisplayName.Encode(e) + if s.Capabilities.Set { + e.FieldStart("capabilities") + s.Capabilities.Encode(e) } } { - if s.Enabled.Set { - e.FieldStart("enabled") - s.Enabled.Encode(e) + if s.ClusterHost.Set { + e.FieldStart("clusterHost") + s.ClusterHost.Encode(e) } } { - if s.Events != nil { - e.FieldStart("events") + if s.ClusterSlug.Set { + e.FieldStart("clusterSlug") + s.ClusterSlug.Encode(e) + } + } + { + if s.Foreign.Set { + e.FieldStart("foreign") + s.Foreign.Encode(e) + } + } + { + if s.FullName.Set { + e.FieldStart("fullName") + s.FullName.Encode(e) + } + } + { + e.FieldStart("id") + e.Str(s.ID) + } + { + if s.Jurisdiction.Set { + e.FieldStart("jurisdiction") + s.Jurisdiction.Encode(e) + } + } + { + if s.MirrorSuspended.Set { + e.FieldStart("mirrorSuspended") + s.MirrorSuspended.Encode(e) + } + } + { + if s.MirrorSuspendedAt.Set { + e.FieldStart("mirrorSuspendedAt") + s.MirrorSuspendedAt.Encode(e) + } + } + { + e.FieldStart("name") + e.Str(s.Name) + } + { + if s.ObjectFormat.Set { + e.FieldStart("objectFormat") + s.ObjectFormat.Encode(e) + } + } + { + e.FieldStart("owningProjectId") + e.Str(s.OwningProjectId) + } + { + if s.Path.Set { + e.FieldStart("path") + s.Path.Encode(e) + } + } + { + if s.Placements != nil { + e.FieldStart("placements") e.ArrStart() - for _, elem := range s.Events { - e.Str(elem) + for _, elem := range s.Placements { + elem.Encode(e) } e.ArrEnd() } } { - if s.PublishChecks.Set { - e.FieldStart("publish_checks") - s.PublishChecks.Encode(e) + if s.Primaries.Set { + e.FieldStart("primaries") + s.Primaries.Encode(e) } } { - if s.RefFilter.Set { - e.FieldStart("ref_filter") - s.RefFilter.Encode(e) + if s.Provider.Set { + e.FieldStart("provider") + s.Provider.Encode(e) + } + } + { + if s.ProvisionAttempts.Set { + e.FieldStart("provisionAttempts") + s.ProvisionAttempts.Encode(e) + } + } + { + if s.ProvisionReason.Set { + e.FieldStart("provisionReason") + s.ProvisionReason.Encode(e) + } + } + { + if s.RepoGroupId.Set { + e.FieldStart("repoGroupId") + s.RepoGroupId.Encode(e) + } + } + { + if s.State.Set { + e.FieldStart("state") + s.State.Encode(e) + } + } + { + if s.Visibility.Set { + e.FieldStart("visibility") + s.Visibility.Encode(e) } } for k, elem := range s.AdditionalProps { @@ -25164,20 +33596,37 @@ func (s *PatchRepoCIWebhookInputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfPatchRepoCIWebhookInputBody = [6]string{ - 0: "$schema", - 1: "display_name", - 2: "enabled", - 3: "events", - 4: "publish_checks", - 5: "ref_filter", +var jsonFieldsNameOfRepo = [22]string{ + 0: "$schema", + 1: "capabilities", + 2: "clusterHost", + 3: "clusterSlug", + 4: "foreign", + 5: "fullName", + 6: "id", + 7: "jurisdiction", + 8: "mirrorSuspended", + 9: "mirrorSuspendedAt", + 10: "name", + 11: "objectFormat", + 12: "owningProjectId", + 13: "path", + 14: "placements", + 15: "primaries", + 16: "provider", + 17: "provisionAttempts", + 18: "provisionReason", + 19: "repoGroupId", + 20: "state", + 21: "visibility", } -// Decode decodes PatchRepoCIWebhookInputBody from json. -func (s *PatchRepoCIWebhookInputBody) Decode(d *jx.Decoder) error { +// Decode decodes Repo from json. +func (s *Repo) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode PatchRepoCIWebhookInputBody to nil") + return errors.New("invalid: unable to decode Repo to nil") } + var requiredBitSet [3]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -25192,64 +33641,228 @@ func (s *PatchRepoCIWebhookInputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "display_name": + case "capabilities": if err := func() error { - s.DisplayName.Reset() - if err := s.DisplayName.Decode(d); err != nil { + s.Capabilities.Reset() + if err := s.Capabilities.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"display_name\"") + return errors.Wrap(err, "decode field \"capabilities\"") } - case "enabled": + case "clusterHost": if err := func() error { - s.Enabled.Reset() - if err := s.Enabled.Decode(d); err != nil { + s.ClusterHost.Reset() + if err := s.ClusterHost.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"enabled\"") + return errors.Wrap(err, "decode field \"clusterHost\"") } - case "events": + case "clusterSlug": if err := func() error { - s.Events = make([]string, 0) + s.ClusterSlug.Reset() + if err := s.ClusterSlug.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"clusterSlug\"") + } + case "foreign": + if err := func() error { + s.Foreign.Reset() + if err := s.Foreign.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"foreign\"") + } + case "fullName": + if err := func() error { + s.FullName.Reset() + if err := s.FullName.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"fullName\"") + } + case "id": + requiredBitSet[0] |= 1 << 6 + if err := func() error { + v, err := d.Str() + s.ID = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"id\"") + } + case "jurisdiction": + if err := func() error { + s.Jurisdiction.Reset() + if err := s.Jurisdiction.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"jurisdiction\"") + } + case "mirrorSuspended": + if err := func() error { + s.MirrorSuspended.Reset() + if err := s.MirrorSuspended.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"mirrorSuspended\"") + } + case "mirrorSuspendedAt": + if err := func() error { + s.MirrorSuspendedAt.Reset() + if err := s.MirrorSuspendedAt.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"mirrorSuspendedAt\"") + } + case "name": + requiredBitSet[1] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.Name = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"name\"") + } + case "objectFormat": + if err := func() error { + s.ObjectFormat.Reset() + if err := s.ObjectFormat.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"objectFormat\"") + } + case "owningProjectId": + requiredBitSet[1] |= 1 << 4 + if err := func() error { + v, err := d.Str() + s.OwningProjectId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"owningProjectId\"") + } + case "path": + if err := func() error { + s.Path.Reset() + if err := s.Path.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"path\"") + } + case "placements": + if err := func() error { + s.Placements = make([]RepoPlacement, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem string - v, err := d.Str() - elem = string(v) - if err != nil { + var elem RepoPlacement + if err := elem.Decode(d); err != nil { return err } - s.Events = append(s.Events, elem) + s.Placements = append(s.Placements, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"events\"") + return errors.Wrap(err, "decode field \"placements\"") } - case "publish_checks": + case "primaries": if err := func() error { - s.PublishChecks.Reset() - if err := s.PublishChecks.Decode(d); err != nil { + s.Primaries.Reset() + if err := s.Primaries.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"publish_checks\"") + return errors.Wrap(err, "decode field \"primaries\"") } - case "ref_filter": + case "provider": if err := func() error { - s.RefFilter.Reset() - if err := s.RefFilter.Decode(d); err != nil { + s.Provider.Reset() + if err := s.Provider.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"ref_filter\"") + return errors.Wrap(err, "decode field \"provider\"") + } + case "provisionAttempts": + if err := func() error { + s.ProvisionAttempts.Reset() + if err := s.ProvisionAttempts.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provisionAttempts\"") + } + case "provisionReason": + if err := func() error { + s.ProvisionReason.Reset() + if err := s.ProvisionReason.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provisionReason\"") + } + case "repoGroupId": + if err := func() error { + s.RepoGroupId.Reset() + if err := s.RepoGroupId.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"repoGroupId\"") + } + case "state": + if err := func() error { + s.State.Reset() + if err := s.State.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"state\"") + } + case "visibility": + if err := func() error { + s.Visibility.Reset() + if err := s.Visibility.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"visibility\"") } default: var elem jx.Raw @@ -25267,34 +33880,68 @@ func (s *PatchRepoCIWebhookInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode PatchRepoCIWebhookInputBody") + return errors.Wrap(err, "decode Repo") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [3]uint8{ + 0b01000000, + 0b00010100, + 0b00000000, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfRepo) { + name = jsonFieldsNameOfRepo[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s *PatchRepoCIWebhookInputBody) MarshalJSON() ([]byte, error) { +func (s *Repo) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *PatchRepoCIWebhookInputBody) UnmarshalJSON(data []byte) error { +func (s *Repo) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s PatchRepoCIWebhookInputBodyAdditional) Encode(e *jx.Encoder) { +func (s RepoAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s PatchRepoCIWebhookInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s RepoAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -25304,10 +33951,10 @@ func (s PatchRepoCIWebhookInputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes PatchRepoCIWebhookInputBodyAdditional from json. -func (s *PatchRepoCIWebhookInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes RepoAdditional from json. +func (s *RepoAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode PatchRepoCIWebhookInputBodyAdditional to nil") + return errors.New("invalid: unable to decode RepoAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -25325,75 +33972,41 @@ func (s *PatchRepoCIWebhookInputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode PatchRepoCIWebhookInputBodyAdditional") + return errors.Wrap(err, "decode RepoAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s PatchRepoCIWebhookInputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s RepoAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *PatchRepoCIWebhookInputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *RepoAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *Project) Encode(e *jx.Encoder) { +func (s *RepoCandidate) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *Project) encodeFields(e *jx.Encoder) { - { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } - } - { - if s.Capabilities.Set { - e.FieldStart("capabilities") - s.Capabilities.Encode(e) - } - } - { - e.FieldStart("createdAt") - json.EncodeDateTime(e, s.CreatedAt) - } - { - e.FieldStart("id") - e.Str(s.ID) - } - { - e.FieldStart("name") - e.Str(s.Name) - } - { - e.FieldStart("ownerId") - e.Str(s.OwnerId) - } - { - if s.OwnerName.Set { - e.FieldStart("ownerName") - s.OwnerName.Encode(e) - } - } +func (s *RepoCandidate) encodeFields(e *jx.Encoder) { { - e.FieldStart("ownerType") - s.OwnerType.Encode(e) + e.FieldStart("access") + s.Access.Encode(e) } { - e.FieldStart("region") - e.Str(s.Region) + e.FieldStart("onboardable") + e.Bool(s.Onboardable) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -25404,127 +34017,42 @@ func (s *Project) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfProject = [9]string{ - 0: "$schema", - 1: "capabilities", - 2: "createdAt", - 3: "id", - 4: "name", - 5: "ownerId", - 6: "ownerName", - 7: "ownerType", - 8: "region", +var jsonFieldsNameOfRepoCandidate = [2]string{ + 0: "access", + 1: "onboardable", } -// Decode decodes Project from json. -func (s *Project) Decode(d *jx.Decoder) error { +// Decode decodes RepoCandidate from json. +func (s *RepoCandidate) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode Project to nil") + return errors.New("invalid: unable to decode RepoCandidate to nil") } - var requiredBitSet [2]uint8 + var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": - if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") - } - case "capabilities": - if err := func() error { - s.Capabilities.Reset() - if err := s.Capabilities.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"capabilities\"") - } - case "createdAt": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := json.DecodeDateTime(d) - s.CreatedAt = v - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"createdAt\"") - } - case "id": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - v, err := d.Str() - s.ID = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"id\"") - } - case "name": - requiredBitSet[0] |= 1 << 4 - if err := func() error { - v, err := d.Str() - s.Name = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"name\"") - } - case "ownerId": - requiredBitSet[0] |= 1 << 5 - if err := func() error { - v, err := d.Str() - s.OwnerId = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"ownerId\"") - } - case "ownerName": - if err := func() error { - s.OwnerName.Reset() - if err := s.OwnerName.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"ownerName\"") - } - case "ownerType": - requiredBitSet[0] |= 1 << 7 + case "access": + requiredBitSet[0] |= 1 << 0 if err := func() error { - if err := s.OwnerType.Decode(d); err != nil { + if err := s.Access.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"ownerType\"") + return errors.Wrap(err, "decode field \"access\"") } - case "region": - requiredBitSet[1] |= 1 << 0 + case "onboardable": + requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.Region = string(v) + v, err := d.Bool() + s.Onboardable = bool(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"region\"") + return errors.Wrap(err, "decode field \"onboardable\"") } default: var elem jx.Raw @@ -25542,13 +34070,12 @@ func (s *Project) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode Project") + return errors.Wrap(err, "decode RepoCandidate") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [2]uint8{ - 0b10111100, - 0b00000001, + for i, mask := range [1]uint8{ + 0b00000011, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -25560,8 +34087,8 @@ func (s *Project) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfProject) { - name = jsonFieldsNameOfProject[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfRepoCandidate) { + name = jsonFieldsNameOfRepoCandidate[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -25582,27 +34109,69 @@ func (s *Project) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *Project) MarshalJSON() ([]byte, error) { +func (s *RepoCandidate) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *Project) UnmarshalJSON(data []byte) error { +func (s *RepoCandidate) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes RepoCandidateAccess as json. +func (s RepoCandidateAccess) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes RepoCandidateAccess from json. +func (s *RepoCandidateAccess) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode RepoCandidateAccess to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch RepoCandidateAccess(v) { + case RepoCandidateAccessRead: + *s = RepoCandidateAccessRead + case RepoCandidateAccessWrite: + *s = RepoCandidateAccessWrite + case RepoCandidateAccessAdmin: + *s = RepoCandidateAccessAdmin + default: + *s = RepoCandidateAccess(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s RepoCandidateAccess) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *RepoCandidateAccess) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ProjectAdditional) Encode(e *jx.Encoder) { +func (s RepoCandidateAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ProjectAdditional) encodeFields(e *jx.Encoder) { +func (s RepoCandidateAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -25612,10 +34181,10 @@ func (s ProjectAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ProjectAdditional from json. -func (s *ProjectAdditional) Decode(d *jx.Decoder) error { +// Decode decodes RepoCandidateAdditional from json. +func (s *RepoCandidateAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ProjectAdditional to nil") + return errors.New("invalid: unable to decode RepoCandidateAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -25633,49 +34202,45 @@ func (s *ProjectAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ProjectAdditional") + return errors.Wrap(err, "decode RepoCandidateAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ProjectAdditional) MarshalJSON() ([]byte, error) { +func (s RepoCandidateAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ProjectAdditional) UnmarshalJSON(data []byte) error { +func (s *RepoCandidateAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ProjectCapabilities) Encode(e *jx.Encoder) { +func (s *RepoCapabilities) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ProjectCapabilities) encodeFields(e *jx.Encoder) { - { - e.FieldStart("canCreateRepository") - e.Bool(s.CanCreateRepository) - } +func (s *RepoCapabilities) encodeFields(e *jx.Encoder) { { - e.FieldStart("canDelete") - e.Bool(s.CanDelete) + e.FieldStart("canManage") + e.Bool(s.CanManage) } { - e.FieldStart("canManageAccess") - e.Bool(s.CanManageAccess) + e.FieldStart("canPull") + e.Bool(s.CanPull) } { - e.FieldStart("canManageTrails") - e.Bool(s.CanManageTrails) + e.FieldStart("canPush") + e.Bool(s.CanPush) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -25686,70 +34251,57 @@ func (s *ProjectCapabilities) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfProjectCapabilities = [4]string{ - 0: "canCreateRepository", - 1: "canDelete", - 2: "canManageAccess", - 3: "canManageTrails", +var jsonFieldsNameOfRepoCapabilities = [3]string{ + 0: "canManage", + 1: "canPull", + 2: "canPush", } -// Decode decodes ProjectCapabilities from json. -func (s *ProjectCapabilities) Decode(d *jx.Decoder) error { +// Decode decodes RepoCapabilities from json. +func (s *RepoCapabilities) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ProjectCapabilities to nil") + return errors.New("invalid: unable to decode RepoCapabilities to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "canCreateRepository": + case "canManage": requiredBitSet[0] |= 1 << 0 if err := func() error { v, err := d.Bool() - s.CanCreateRepository = bool(v) + s.CanManage = bool(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"canCreateRepository\"") + return errors.Wrap(err, "decode field \"canManage\"") } - case "canDelete": + case "canPull": requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Bool() - s.CanDelete = bool(v) + s.CanPull = bool(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"canDelete\"") + return errors.Wrap(err, "decode field \"canPull\"") } - case "canManageAccess": + case "canPush": requiredBitSet[0] |= 1 << 2 if err := func() error { v, err := d.Bool() - s.CanManageAccess = bool(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"canManageAccess\"") - } - case "canManageTrails": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - v, err := d.Bool() - s.CanManageTrails = bool(v) + s.CanPush = bool(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"canManageTrails\"") + return errors.Wrap(err, "decode field \"canPush\"") } default: var elem jx.Raw @@ -25767,12 +34319,12 @@ func (s *ProjectCapabilities) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ProjectCapabilities") + return errors.Wrap(err, "decode RepoCapabilities") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00001111, + 0b00000111, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -25784,8 +34336,8 @@ func (s *ProjectCapabilities) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfProjectCapabilities) { - name = jsonFieldsNameOfProjectCapabilities[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfRepoCapabilities) { + name = jsonFieldsNameOfRepoCapabilities[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -25806,27 +34358,27 @@ func (s *ProjectCapabilities) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ProjectCapabilities) MarshalJSON() ([]byte, error) { +func (s *RepoCapabilities) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ProjectCapabilities) UnmarshalJSON(data []byte) error { +func (s *RepoCapabilities) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ProjectCapabilitiesAdditional) Encode(e *jx.Encoder) { +func (s RepoCapabilitiesAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ProjectCapabilitiesAdditional) encodeFields(e *jx.Encoder) { +func (s RepoCapabilitiesAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -25836,10 +34388,10 @@ func (s ProjectCapabilitiesAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ProjectCapabilitiesAdditional from json. -func (s *ProjectCapabilitiesAdditional) Decode(d *jx.Decoder) error { +// Decode decodes RepoCapabilitiesAdditional from json. +func (s *RepoCapabilitiesAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ProjectCapabilitiesAdditional to nil") + return errors.New("invalid: unable to decode RepoCapabilitiesAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -25857,55 +34409,47 @@ func (s *ProjectCapabilitiesAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ProjectCapabilitiesAdditional") + return errors.Wrap(err, "decode RepoCapabilitiesAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ProjectCapabilitiesAdditional) MarshalJSON() ([]byte, error) { +func (s RepoCapabilitiesAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ProjectCapabilitiesAdditional) UnmarshalJSON(data []byte) error { +func (s *RepoCapabilitiesAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ProjectGrant) Encode(e *jx.Encoder) { +func (s *RepoCollaborator) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ProjectGrant) encodeFields(e *jx.Encoder) { +func (s *RepoCollaborator) encodeFields(e *jx.Encoder) { { - e.FieldStart("granteeId") - e.Str(s.GranteeId) + e.FieldStart("accountId") + e.Str(s.AccountId) } { - if s.GranteeName.Set { - e.FieldStart("granteeName") - s.GranteeName.Encode(e) + if s.Handle.Set { + e.FieldStart("handle") + s.Handle.Encode(e) } } - { - e.FieldStart("granteeType") - e.Str(s.GranteeType) - } { e.FieldStart("role") - e.Str(s.Role) - } - { - e.FieldStart("source") - e.Str(s.Source) + s.Role.Encode(e) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -25916,82 +34460,54 @@ func (s *ProjectGrant) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfProjectGrant = [5]string{ - 0: "granteeId", - 1: "granteeName", - 2: "granteeType", - 3: "role", - 4: "source", +var jsonFieldsNameOfRepoCollaborator = [3]string{ + 0: "accountId", + 1: "handle", + 2: "role", } -// Decode decodes ProjectGrant from json. -func (s *ProjectGrant) Decode(d *jx.Decoder) error { +// Decode decodes RepoCollaborator from json. +func (s *RepoCollaborator) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ProjectGrant to nil") + return errors.New("invalid: unable to decode RepoCollaborator to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "granteeId": + case "accountId": requiredBitSet[0] |= 1 << 0 if err := func() error { v, err := d.Str() - s.GranteeId = string(v) + s.AccountId = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"granteeId\"") - } - case "granteeName": - if err := func() error { - s.GranteeName.Reset() - if err := s.GranteeName.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"granteeName\"") + return errors.Wrap(err, "decode field \"accountId\"") } - case "granteeType": - requiredBitSet[0] |= 1 << 2 + case "handle": if err := func() error { - v, err := d.Str() - s.GranteeType = string(v) - if err != nil { + s.Handle.Reset() + if err := s.Handle.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"granteeType\"") + return errors.Wrap(err, "decode field \"handle\"") } case "role": - requiredBitSet[0] |= 1 << 3 + requiredBitSet[0] |= 1 << 2 if err := func() error { - v, err := d.Str() - s.Role = string(v) - if err != nil { + if err := s.Role.Decode(d); err != nil { return err } return nil }(); err != nil { return errors.Wrap(err, "decode field \"role\"") } - case "source": - requiredBitSet[0] |= 1 << 4 - if err := func() error { - v, err := d.Str() - s.Source = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"source\"") - } default: var elem jx.Raw if err := func() error { @@ -26008,12 +34524,12 @@ func (s *ProjectGrant) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ProjectGrant") + return errors.Wrap(err, "decode RepoCollaborator") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00011101, + 0b00000101, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -26025,8 +34541,8 @@ func (s *ProjectGrant) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfProjectGrant) { - name = jsonFieldsNameOfProjectGrant[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfRepoCollaborator) { + name = jsonFieldsNameOfRepoCollaborator[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -26047,27 +34563,27 @@ func (s *ProjectGrant) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ProjectGrant) MarshalJSON() ([]byte, error) { +func (s *RepoCollaborator) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ProjectGrant) UnmarshalJSON(data []byte) error { +func (s *RepoCollaborator) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ProjectGrantAdditional) Encode(e *jx.Encoder) { +func (s RepoCollaboratorAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ProjectGrantAdditional) encodeFields(e *jx.Encoder) { +func (s RepoCollaboratorAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -26077,10 +34593,10 @@ func (s ProjectGrantAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ProjectGrantAdditional from json. -func (s *ProjectGrantAdditional) Decode(d *jx.Decoder) error { +// Decode decodes RepoCollaboratorAdditional from json. +func (s *RepoCollaboratorAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ProjectGrantAdditional to nil") + return errors.New("invalid: unable to decode RepoCollaboratorAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -26098,74 +34614,76 @@ func (s *ProjectGrantAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ProjectGrantAdditional") + return errors.Wrap(err, "decode RepoCollaboratorAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ProjectGrantAdditional) MarshalJSON() ([]byte, error) { +func (s RepoCollaboratorAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ProjectGrantAdditional) UnmarshalJSON(data []byte) error { +func (s *RepoCollaboratorAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes ProjectOwnerType as json. -func (s ProjectOwnerType) Encode(e *jx.Encoder) { +// Encode encodes RepoCollaboratorRole as json. +func (s RepoCollaboratorRole) Encode(e *jx.Encoder) { e.Str(string(s)) } -// Decode decodes ProjectOwnerType from json. -func (s *ProjectOwnerType) Decode(d *jx.Decoder) error { +// Decode decodes RepoCollaboratorRole from json. +func (s *RepoCollaboratorRole) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ProjectOwnerType to nil") + return errors.New("invalid: unable to decode RepoCollaboratorRole to nil") } v, err := d.StrBytes() if err != nil { return err } // Try to use constant string. - switch ProjectOwnerType(v) { - case ProjectOwnerTypeOrg: - *s = ProjectOwnerTypeOrg - case ProjectOwnerTypeAccount: - *s = ProjectOwnerTypeAccount + switch RepoCollaboratorRole(v) { + case RepoCollaboratorRoleReader: + *s = RepoCollaboratorRoleReader + case RepoCollaboratorRoleWriter: + *s = RepoCollaboratorRoleWriter + case RepoCollaboratorRoleAdmin: + *s = RepoCollaboratorRoleAdmin default: - *s = ProjectOwnerType(v) + *s = RepoCollaboratorRole(v) } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ProjectOwnerType) MarshalJSON() ([]byte, error) { +func (s RepoCollaboratorRole) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ProjectOwnerType) UnmarshalJSON(data []byte) error { +func (s *RepoCollaboratorRole) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *RegisterOrgCIBuildkiteClusterInputBody) Encode(e *jx.Encoder) { +func (s *RepoFacetPage) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *RegisterOrgCIBuildkiteClusterInputBody) encodeFields(e *jx.Encoder) { +func (s *RepoFacetPage) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -26173,23 +34691,17 @@ func (s *RegisterOrgCIBuildkiteClusterInputBody) encodeFields(e *jx.Encoder) { } } { - if s.AuthPluginRef.Set { - e.FieldStart("auth_plugin_ref") - s.AuthPluginRef.Encode(e) + e.FieldStart("items") + e.ArrStart() + for _, elem := range s.Items { + e.Str(elem) } + e.ArrEnd() } { - e.FieldStart("bk_cluster_id") - e.Str(s.BkClusterID) - } - { - e.FieldStart("bk_organization") - e.Str(s.BkOrganization) - } - { - if s.Label.Set { - e.FieldStart("label") - s.Label.Encode(e) + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) } } for k, elem := range s.AdditionalProps { @@ -26201,18 +34713,16 @@ func (s *RegisterOrgCIBuildkiteClusterInputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfRegisterOrgCIBuildkiteClusterInputBody = [5]string{ +var jsonFieldsNameOfRepoFacetPage = [3]string{ 0: "$schema", - 1: "auth_plugin_ref", - 2: "bk_cluster_id", - 3: "bk_organization", - 4: "label", + 1: "items", + 2: "nextPageToken", } -// Decode decodes RegisterOrgCIBuildkiteClusterInputBody from json. -func (s *RegisterOrgCIBuildkiteClusterInputBody) Decode(d *jx.Decoder) error { +// Decode decodes RepoFacetPage from json. +func (s *RepoFacetPage) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RegisterOrgCIBuildkiteClusterInputBody to nil") + return errors.New("invalid: unable to decode RepoFacetPage to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -26229,49 +34739,35 @@ func (s *RegisterOrgCIBuildkiteClusterInputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "auth_plugin_ref": - if err := func() error { - s.AuthPluginRef.Reset() - if err := s.AuthPluginRef.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"auth_plugin_ref\"") - } - case "bk_cluster_id": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.BkClusterID = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"bk_cluster_id\"") - } - case "bk_organization": - requiredBitSet[0] |= 1 << 3 + case "items": + requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.BkOrganization = string(v) - if err != nil { + s.Items = make([]string, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem string + v, err := d.Str() + elem = string(v) + if err != nil { + return err + } + s.Items = append(s.Items, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"bk_organization\"") + return errors.Wrap(err, "decode field \"items\"") } - case "label": + case "nextPageToken": if err := func() error { - s.Label.Reset() - if err := s.Label.Decode(d); err != nil { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"label\"") + return errors.Wrap(err, "decode field \"nextPageToken\"") } default: var elem jx.Raw @@ -26289,12 +34785,12 @@ func (s *RegisterOrgCIBuildkiteClusterInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode RegisterOrgCIBuildkiteClusterInputBody") + return errors.Wrap(err, "decode RepoFacetPage") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00001100, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -26306,8 +34802,8 @@ func (s *RegisterOrgCIBuildkiteClusterInputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfRegisterOrgCIBuildkiteClusterInputBody) { - name = jsonFieldsNameOfRegisterOrgCIBuildkiteClusterInputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfRepoFacetPage) { + name = jsonFieldsNameOfRepoFacetPage[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -26328,27 +34824,27 @@ func (s *RegisterOrgCIBuildkiteClusterInputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *RegisterOrgCIBuildkiteClusterInputBody) MarshalJSON() ([]byte, error) { +func (s *RepoFacetPage) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RegisterOrgCIBuildkiteClusterInputBody) UnmarshalJSON(data []byte) error { +func (s *RepoFacetPage) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s RegisterOrgCIBuildkiteClusterInputBodyAdditional) Encode(e *jx.Encoder) { +func (s RepoFacetPageAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s RegisterOrgCIBuildkiteClusterInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s RepoFacetPageAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -26358,10 +34854,10 @@ func (s RegisterOrgCIBuildkiteClusterInputBodyAdditional) encodeFields(e *jx.Enc } } -// Decode decodes RegisterOrgCIBuildkiteClusterInputBodyAdditional from json. -func (s *RegisterOrgCIBuildkiteClusterInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes RepoFacetPageAdditional from json. +func (s *RepoFacetPageAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RegisterOrgCIBuildkiteClusterInputBodyAdditional to nil") + return errors.New("invalid: unable to decode RepoFacetPageAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -26379,153 +34875,55 @@ func (s *RegisterOrgCIBuildkiteClusterInputBodyAdditional) Decode(d *jx.Decoder) m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode RegisterOrgCIBuildkiteClusterInputBodyAdditional") + return errors.Wrap(err, "decode RepoFacetPageAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s RegisterOrgCIBuildkiteClusterInputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s RepoFacetPageAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RegisterOrgCIBuildkiteClusterInputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *RepoFacetPageAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *Repo) Encode(e *jx.Encoder) { +func (s *RepoGrant) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *Repo) encodeFields(e *jx.Encoder) { - { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } - } - { - if s.Capabilities.Set { - e.FieldStart("capabilities") - s.Capabilities.Encode(e) - } - } - { - if s.ClusterHost.Set { - e.FieldStart("clusterHost") - s.ClusterHost.Encode(e) - } - } - { - if s.ClusterSlug.Set { - e.FieldStart("clusterSlug") - s.ClusterSlug.Encode(e) - } - } - { - if s.Foreign.Set { - e.FieldStart("foreign") - s.Foreign.Encode(e) - } - } - { - if s.FullName.Set { - e.FieldStart("fullName") - s.FullName.Encode(e) - } - } - { - e.FieldStart("id") - e.Str(s.ID) - } - { - if s.Jurisdiction.Set { - e.FieldStart("jurisdiction") - s.Jurisdiction.Encode(e) - } - } - { - if s.MirrorSuspended.Set { - e.FieldStart("mirrorSuspended") - s.MirrorSuspended.Encode(e) - } - } - { - if s.MirrorSuspendedAt.Set { - e.FieldStart("mirrorSuspendedAt") - s.MirrorSuspendedAt.Encode(e) - } - } - { - e.FieldStart("name") - e.Str(s.Name) - } - { - if s.ObjectFormat.Set { - e.FieldStart("objectFormat") - s.ObjectFormat.Encode(e) - } - } - { - e.FieldStart("owningProjectId") - e.Str(s.OwningProjectId) - } - { - if s.Path.Set { - e.FieldStart("path") - s.Path.Encode(e) - } - } - { - if s.Primaries.Set { - e.FieldStart("primaries") - s.Primaries.Encode(e) - } - } - { - if s.Provider.Set { - e.FieldStart("provider") - s.Provider.Encode(e) - } - } +func (s *RepoGrant) encodeFields(e *jx.Encoder) { { - if s.ProvisionAttempts.Set { - e.FieldStart("provisionAttempts") - s.ProvisionAttempts.Encode(e) - } + e.FieldStart("granteeId") + e.Str(s.GranteeId) } { - if s.ProvisionReason.Set { - e.FieldStart("provisionReason") - s.ProvisionReason.Encode(e) + if s.GranteeName.Set { + e.FieldStart("granteeName") + s.GranteeName.Encode(e) } } { - if s.RepoGroupId.Set { - e.FieldStart("repoGroupId") - s.RepoGroupId.Encode(e) - } + e.FieldStart("granteeType") + e.Str(s.GranteeType) } { - if s.State.Set { - e.FieldStart("state") - s.State.Encode(e) - } + e.FieldStart("role") + e.Str(s.Role) } { - if s.Visibility.Set { - e.FieldStart("visibility") - s.Visibility.Encode(e) - } + e.FieldStart("source") + e.Str(s.Source) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -26536,255 +34934,81 @@ func (s *Repo) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfRepo = [21]string{ - 0: "$schema", - 1: "capabilities", - 2: "clusterHost", - 3: "clusterSlug", - 4: "foreign", - 5: "fullName", - 6: "id", - 7: "jurisdiction", - 8: "mirrorSuspended", - 9: "mirrorSuspendedAt", - 10: "name", - 11: "objectFormat", - 12: "owningProjectId", - 13: "path", - 14: "primaries", - 15: "provider", - 16: "provisionAttempts", - 17: "provisionReason", - 18: "repoGroupId", - 19: "state", - 20: "visibility", +var jsonFieldsNameOfRepoGrant = [5]string{ + 0: "granteeId", + 1: "granteeName", + 2: "granteeType", + 3: "role", + 4: "source", } -// Decode decodes Repo from json. -func (s *Repo) Decode(d *jx.Decoder) error { +// Decode decodes RepoGrant from json. +func (s *RepoGrant) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode Repo to nil") + return errors.New("invalid: unable to decode RepoGrant to nil") } - var requiredBitSet [3]uint8 + var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": - if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") - } - case "capabilities": - if err := func() error { - s.Capabilities.Reset() - if err := s.Capabilities.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"capabilities\"") - } - case "clusterHost": - if err := func() error { - s.ClusterHost.Reset() - if err := s.ClusterHost.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"clusterHost\"") - } - case "clusterSlug": - if err := func() error { - s.ClusterSlug.Reset() - if err := s.ClusterSlug.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"clusterSlug\"") - } - case "foreign": - if err := func() error { - s.Foreign.Reset() - if err := s.Foreign.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"foreign\"") - } - case "fullName": - if err := func() error { - s.FullName.Reset() - if err := s.FullName.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"fullName\"") - } - case "id": - requiredBitSet[0] |= 1 << 6 + case "granteeId": + requiredBitSet[0] |= 1 << 0 if err := func() error { v, err := d.Str() - s.ID = string(v) + s.GranteeId = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"id\"") - } - case "jurisdiction": - if err := func() error { - s.Jurisdiction.Reset() - if err := s.Jurisdiction.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"jurisdiction\"") - } - case "mirrorSuspended": - if err := func() error { - s.MirrorSuspended.Reset() - if err := s.MirrorSuspended.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"mirrorSuspended\"") + return errors.Wrap(err, "decode field \"granteeId\"") } - case "mirrorSuspendedAt": + case "granteeName": if err := func() error { - s.MirrorSuspendedAt.Reset() - if err := s.MirrorSuspendedAt.Decode(d); err != nil { + s.GranteeName.Reset() + if err := s.GranteeName.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"mirrorSuspendedAt\"") + return errors.Wrap(err, "decode field \"granteeName\"") } - case "name": - requiredBitSet[1] |= 1 << 2 + case "granteeType": + requiredBitSet[0] |= 1 << 2 if err := func() error { v, err := d.Str() - s.Name = string(v) + s.GranteeType = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"name\"") - } - case "objectFormat": - if err := func() error { - s.ObjectFormat.Reset() - if err := s.ObjectFormat.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"objectFormat\"") + return errors.Wrap(err, "decode field \"granteeType\"") } - case "owningProjectId": - requiredBitSet[1] |= 1 << 4 + case "role": + requiredBitSet[0] |= 1 << 3 if err := func() error { v, err := d.Str() - s.OwningProjectId = string(v) + s.Role = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"owningProjectId\"") - } - case "path": - if err := func() error { - s.Path.Reset() - if err := s.Path.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"path\"") - } - case "primaries": - if err := func() error { - s.Primaries.Reset() - if err := s.Primaries.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"primaries\"") - } - case "provider": - if err := func() error { - s.Provider.Reset() - if err := s.Provider.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"provider\"") - } - case "provisionAttempts": - if err := func() error { - s.ProvisionAttempts.Reset() - if err := s.ProvisionAttempts.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"provisionAttempts\"") - } - case "provisionReason": - if err := func() error { - s.ProvisionReason.Reset() - if err := s.ProvisionReason.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"provisionReason\"") - } - case "repoGroupId": - if err := func() error { - s.RepoGroupId.Reset() - if err := s.RepoGroupId.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"repoGroupId\"") - } - case "state": - if err := func() error { - s.State.Reset() - if err := s.State.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"state\"") + return errors.Wrap(err, "decode field \"role\"") } - case "visibility": + case "source": + requiredBitSet[0] |= 1 << 4 if err := func() error { - s.Visibility.Reset() - if err := s.Visibility.Decode(d); err != nil { + v, err := d.Str() + s.Source = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"visibility\"") + return errors.Wrap(err, "decode field \"source\"") } default: var elem jx.Raw @@ -26802,14 +35026,12 @@ func (s *Repo) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode Repo") + return errors.Wrap(err, "decode RepoGrant") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [3]uint8{ - 0b01000000, - 0b00010100, - 0b00000000, + for i, mask := range [1]uint8{ + 0b00011101, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -26821,8 +35043,8 @@ func (s *Repo) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfRepo) { - name = jsonFieldsNameOfRepo[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfRepoGrant) { + name = jsonFieldsNameOfRepoGrant[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -26843,27 +35065,27 @@ func (s *Repo) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *Repo) MarshalJSON() ([]byte, error) { +func (s *RepoGrant) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *Repo) UnmarshalJSON(data []byte) error { +func (s *RepoGrant) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s RepoAdditional) Encode(e *jx.Encoder) { +func (s RepoGrantAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s RepoAdditional) encodeFields(e *jx.Encoder) { +func (s RepoGrantAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -26873,10 +35095,10 @@ func (s RepoAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes RepoAdditional from json. -func (s *RepoAdditional) Decode(d *jx.Decoder) error { +// Decode decodes RepoGrantAdditional from json. +func (s *RepoGrantAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoAdditional to nil") + return errors.New("invalid: unable to decode RepoGrantAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -26894,41 +35116,53 @@ func (s *RepoAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode RepoAdditional") + return errors.Wrap(err, "decode RepoGrantAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s RepoAdditional) MarshalJSON() ([]byte, error) { +func (s RepoGrantAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoAdditional) UnmarshalJSON(data []byte) error { +func (s *RepoGrantAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *RepoCandidate) Encode(e *jx.Encoder) { +func (s *RepoIDResolution) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *RepoCandidate) encodeFields(e *jx.Encoder) { +func (s *RepoIDResolution) encodeFields(e *jx.Encoder) { { - e.FieldStart("access") - s.Access.Encode(e) + if s.FullName.Set { + e.FieldStart("fullName") + s.FullName.Encode(e) + } } { - e.FieldStart("onboardable") - e.Bool(s.Onboardable) + if s.Provider.Set { + e.FieldStart("provider") + s.Provider.Encode(e) + } + } + { + e.FieldStart("repoId") + e.Str(s.RepoId) + } + { + e.FieldStart("status") + s.Status.Encode(e) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -26939,42 +35173,64 @@ func (s *RepoCandidate) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfRepoCandidate = [2]string{ - 0: "access", - 1: "onboardable", +var jsonFieldsNameOfRepoIDResolution = [4]string{ + 0: "fullName", + 1: "provider", + 2: "repoId", + 3: "status", } -// Decode decodes RepoCandidate from json. -func (s *RepoCandidate) Decode(d *jx.Decoder) error { +// Decode decodes RepoIDResolution from json. +func (s *RepoIDResolution) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoCandidate to nil") + return errors.New("invalid: unable to decode RepoIDResolution to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "access": - requiredBitSet[0] |= 1 << 0 + case "fullName": if err := func() error { - if err := s.Access.Decode(d); err != nil { + s.FullName.Reset() + if err := s.FullName.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"access\"") + return errors.Wrap(err, "decode field \"fullName\"") } - case "onboardable": - requiredBitSet[0] |= 1 << 1 + case "provider": if err := func() error { - v, err := d.Bool() - s.Onboardable = bool(v) + s.Provider.Reset() + if err := s.Provider.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider\"") + } + case "repoId": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.RepoId = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"onboardable\"") + return errors.Wrap(err, "decode field \"repoId\"") + } + case "status": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + if err := s.Status.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"status\"") } default: var elem jx.Raw @@ -26992,12 +35248,12 @@ func (s *RepoCandidate) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode RepoCandidate") + return errors.Wrap(err, "decode RepoIDResolution") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000011, + 0b00001100, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -27009,91 +35265,49 @@ func (s *RepoCandidate) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfRepoCandidate) { - name = jsonFieldsNameOfRepoCandidate[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfRepoIDResolution) { + name = jsonFieldsNameOfRepoIDResolution[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } failures = append(failures, validate.FieldError{ Name: name, Error: validate.ErrFieldRequired, - }) - // Reset bit. - result &^= 1 << bitIdx - } - } - } - if len(failures) > 0 { - return &validate.Error{Fields: failures} - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s *RepoCandidate) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoCandidate) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes RepoCandidateAccess as json. -func (s RepoCandidateAccess) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes RepoCandidateAccess from json. -func (s *RepoCandidateAccess) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode RepoCandidateAccess to nil") - } - v, err := d.StrBytes() - if err != nil { - return err + }) + // Reset bit. + result &^= 1 << bitIdx + } + } } - // Try to use constant string. - switch RepoCandidateAccess(v) { - case RepoCandidateAccessRead: - *s = RepoCandidateAccessRead - case RepoCandidateAccessWrite: - *s = RepoCandidateAccessWrite - case RepoCandidateAccessAdmin: - *s = RepoCandidateAccessAdmin - default: - *s = RepoCandidateAccess(v) + if len(failures) > 0 { + return &validate.Error{Fields: failures} } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s RepoCandidateAccess) MarshalJSON() ([]byte, error) { +func (s *RepoIDResolution) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoCandidateAccess) UnmarshalJSON(data []byte) error { +func (s *RepoIDResolution) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s RepoCandidateAdditional) Encode(e *jx.Encoder) { +func (s RepoIDResolutionAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s RepoCandidateAdditional) encodeFields(e *jx.Encoder) { +func (s RepoIDResolutionAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -27103,10 +35317,10 @@ func (s RepoCandidateAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes RepoCandidateAdditional from json. -func (s *RepoCandidateAdditional) Decode(d *jx.Decoder) error { +// Decode decodes RepoIDResolutionAdditional from json. +func (s *RepoIDResolutionAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoCandidateAdditional to nil") + return errors.New("invalid: unable to decode RepoIDResolutionAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -27124,45 +35338,199 @@ func (s *RepoCandidateAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode RepoCandidateAdditional") + return errors.Wrap(err, "decode RepoIDResolutionAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s RepoCandidateAdditional) MarshalJSON() ([]byte, error) { +func (s RepoIDResolutionAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoCandidateAdditional) UnmarshalJSON(data []byte) error { +func (s *RepoIDResolutionAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes RepoIDResolutionStatus as json. +func (s RepoIDResolutionStatus) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes RepoIDResolutionStatus from json. +func (s *RepoIDResolutionStatus) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode RepoIDResolutionStatus to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch RepoIDResolutionStatus(v) { + case RepoIDResolutionStatusResolved: + *s = RepoIDResolutionStatusResolved + case RepoIDResolutionStatusUnavailable: + *s = RepoIDResolutionStatusUnavailable + default: + *s = RepoIDResolutionStatus(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s RepoIDResolutionStatus) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *RepoIDResolutionStatus) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *RepoCapabilities) Encode(e *jx.Encoder) { +func (s *RepoIndexEntry) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *RepoCapabilities) encodeFields(e *jx.Encoder) { +func (s *RepoIndexEntry) encodeFields(e *jx.Encoder) { { - e.FieldStart("canManage") - e.Bool(s.CanManage) + if s.ActivityHotness.Set { + e.FieldStart("activityHotness") + s.ActivityHotness.Encode(e) + } } { - e.FieldStart("canPull") - e.Bool(s.CanPull) + if s.Archived.Set { + e.FieldStart("archived") + s.Archived.Encode(e) + } } { - e.FieldStart("canPush") - e.Bool(s.CanPush) + if s.Candidate.Set { + e.FieldStart("candidate") + s.Candidate.Encode(e) + } + } + { + e.FieldStart("cell") + e.Str(s.Cell) + } + { + if s.CheckpointCount.Set { + e.FieldStart("checkpointCount") + s.CheckpointCount.Encode(e) + } + } + { + e.FieldStart("clusterSlug") + e.Str(s.ClusterSlug) + } + { + if s.Forks.Set { + e.FieldStart("forks") + s.Forks.Encode(e) + } + } + { + e.FieldStart("full_name") + e.Str(s.FullName) + } + { + e.FieldStart("id") + e.Str(s.ID) + } + { + e.FieldStart("jurisdiction") + e.Str(s.Jurisdiction) + } + { + if s.Language.Set { + e.FieldStart("language") + s.Language.Encode(e) + } + } + { + if s.LastActivityAt.Set { + e.FieldStart("lastActivityAt") + s.LastActivityAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.LastPushedAt.Set { + e.FieldStart("lastPushedAt") + s.LastPushedAt.Encode(e, json.EncodeDateTime) + } + } + { + e.FieldStart("name") + e.Str(s.Name) + } + { + if s.OpenPrCount.Set { + e.FieldStart("openPrCount") + s.OpenPrCount.Encode(e) + } + } + { + if s.Org.Set { + e.FieldStart("org") + s.Org.Encode(e) + } + } + { + if s.Permission.Set { + e.FieldStart("permission") + s.Permission.Encode(e) + } + } + { + e.FieldStart("placements") + e.ArrStart() + for _, elem := range s.Placements { + elem.Encode(e) + } + e.ArrEnd() + } + { + if s.Primaries.Set { + e.FieldStart("primaries") + s.Primaries.Encode(e) + } + } + { + if s.Provider.Set { + e.FieldStart("provider") + s.Provider.Encode(e) + } + } + { + if s.PushedAt.Set { + e.FieldStart("pushedAt") + s.PushedAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.Stars.Set { + e.FieldStart("stars") + s.Stars.Encode(e) + } + } + { + e.FieldStart("visibility") + e.Str(s.Visibility) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -27173,57 +35541,293 @@ func (s *RepoCapabilities) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfRepoCapabilities = [3]string{ - 0: "canManage", - 1: "canPull", - 2: "canPush", +var jsonFieldsNameOfRepoIndexEntry = [23]string{ + 0: "activityHotness", + 1: "archived", + 2: "candidate", + 3: "cell", + 4: "checkpointCount", + 5: "clusterSlug", + 6: "forks", + 7: "full_name", + 8: "id", + 9: "jurisdiction", + 10: "language", + 11: "lastActivityAt", + 12: "lastPushedAt", + 13: "name", + 14: "openPrCount", + 15: "org", + 16: "permission", + 17: "placements", + 18: "primaries", + 19: "provider", + 20: "pushedAt", + 21: "stars", + 22: "visibility", } -// Decode decodes RepoCapabilities from json. -func (s *RepoCapabilities) Decode(d *jx.Decoder) error { +// Decode decodes RepoIndexEntry from json. +func (s *RepoIndexEntry) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoCapabilities to nil") + return errors.New("invalid: unable to decode RepoIndexEntry to nil") } - var requiredBitSet [1]uint8 + var requiredBitSet [3]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "canManage": - requiredBitSet[0] |= 1 << 0 + case "activityHotness": if err := func() error { - v, err := d.Bool() - s.CanManage = bool(v) + s.ActivityHotness.Reset() + if err := s.ActivityHotness.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"activityHotness\"") + } + case "archived": + if err := func() error { + s.Archived.Reset() + if err := s.Archived.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"archived\"") + } + case "candidate": + if err := func() error { + s.Candidate.Reset() + if err := s.Candidate.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"candidate\"") + } + case "cell": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.Cell = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"canManage\"") + return errors.Wrap(err, "decode field \"cell\"") } - case "canPull": - requiredBitSet[0] |= 1 << 1 + case "checkpointCount": if err := func() error { - v, err := d.Bool() - s.CanPull = bool(v) + s.CheckpointCount.Reset() + if err := s.CheckpointCount.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"checkpointCount\"") + } + case "clusterSlug": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + v, err := d.Str() + s.ClusterSlug = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"canPull\"") + return errors.Wrap(err, "decode field \"clusterSlug\"") } - case "canPush": - requiredBitSet[0] |= 1 << 2 + case "forks": if err := func() error { - v, err := d.Bool() - s.CanPush = bool(v) + s.Forks.Reset() + if err := s.Forks.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"forks\"") + } + case "full_name": + requiredBitSet[0] |= 1 << 7 + if err := func() error { + v, err := d.Str() + s.FullName = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"canPush\"") + return errors.Wrap(err, "decode field \"full_name\"") + } + case "id": + requiredBitSet[1] |= 1 << 0 + if err := func() error { + v, err := d.Str() + s.ID = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"id\"") + } + case "jurisdiction": + requiredBitSet[1] |= 1 << 1 + if err := func() error { + v, err := d.Str() + s.Jurisdiction = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"jurisdiction\"") + } + case "language": + if err := func() error { + s.Language.Reset() + if err := s.Language.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"language\"") + } + case "lastActivityAt": + if err := func() error { + s.LastActivityAt.Reset() + if err := s.LastActivityAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"lastActivityAt\"") + } + case "lastPushedAt": + if err := func() error { + s.LastPushedAt.Reset() + if err := s.LastPushedAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"lastPushedAt\"") + } + case "name": + requiredBitSet[1] |= 1 << 5 + if err := func() error { + v, err := d.Str() + s.Name = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"name\"") + } + case "openPrCount": + if err := func() error { + s.OpenPrCount.Reset() + if err := s.OpenPrCount.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"openPrCount\"") + } + case "org": + if err := func() error { + s.Org.Reset() + if err := s.Org.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"org\"") + } + case "permission": + if err := func() error { + s.Permission.Reset() + if err := s.Permission.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"permission\"") + } + case "placements": + requiredBitSet[2] |= 1 << 1 + if err := func() error { + s.Placements = make([]RepoPlacement, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem RepoPlacement + if err := elem.Decode(d); err != nil { + return err + } + s.Placements = append(s.Placements, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"placements\"") + } + case "primaries": + if err := func() error { + s.Primaries.Reset() + if err := s.Primaries.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"primaries\"") + } + case "provider": + if err := func() error { + s.Provider.Reset() + if err := s.Provider.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider\"") + } + case "pushedAt": + if err := func() error { + s.PushedAt.Reset() + if err := s.PushedAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"pushedAt\"") + } + case "stars": + if err := func() error { + s.Stars.Reset() + if err := s.Stars.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"stars\"") + } + case "visibility": + requiredBitSet[2] |= 1 << 6 + if err := func() error { + v, err := d.Str() + s.Visibility = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"visibility\"") } default: var elem jx.Raw @@ -27241,12 +35845,14 @@ func (s *RepoCapabilities) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode RepoCapabilities") + return errors.Wrap(err, "decode RepoIndexEntry") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [1]uint8{ - 0b00000111, + for i, mask := range [3]uint8{ + 0b10101000, + 0b00100011, + 0b01000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -27258,8 +35864,8 @@ func (s *RepoCapabilities) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfRepoCapabilities) { - name = jsonFieldsNameOfRepoCapabilities[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfRepoIndexEntry) { + name = jsonFieldsNameOfRepoIndexEntry[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -27280,27 +35886,27 @@ func (s *RepoCapabilities) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *RepoCapabilities) MarshalJSON() ([]byte, error) { +func (s *RepoIndexEntry) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoCapabilities) UnmarshalJSON(data []byte) error { +func (s *RepoIndexEntry) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s RepoCapabilitiesAdditional) Encode(e *jx.Encoder) { +func (s RepoIndexEntryAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s RepoCapabilitiesAdditional) encodeFields(e *jx.Encoder) { +func (s RepoIndexEntryAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -27309,11 +35915,11 @@ func (s RepoCapabilitiesAdditional) encodeFields(e *jx.Encoder) { } } } - -// Decode decodes RepoCapabilitiesAdditional from json. -func (s *RepoCapabilitiesAdditional) Decode(d *jx.Decoder) error { + +// Decode decodes RepoIndexEntryAdditional from json. +func (s *RepoIndexEntryAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoCapabilitiesAdditional to nil") + return errors.New("invalid: unable to decode RepoIndexEntryAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -27331,47 +35937,63 @@ func (s *RepoCapabilitiesAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode RepoCapabilitiesAdditional") + return errors.Wrap(err, "decode RepoIndexEntryAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s RepoCapabilitiesAdditional) MarshalJSON() ([]byte, error) { +func (s RepoIndexEntryAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoCapabilitiesAdditional) UnmarshalJSON(data []byte) error { +func (s *RepoIndexEntryAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *RepoCollaborator) Encode(e *jx.Encoder) { +func (s *RepoPlacement) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *RepoCollaborator) encodeFields(e *jx.Encoder) { +func (s *RepoPlacement) encodeFields(e *jx.Encoder) { { - e.FieldStart("accountId") - e.Str(s.AccountId) + if s.ApiBaseUrl.Set { + e.FieldStart("apiBaseUrl") + s.ApiBaseUrl.Encode(e) + } } { - if s.Handle.Set { - e.FieldStart("handle") - s.Handle.Encode(e) - } + e.FieldStart("cell") + e.Str(s.Cell) } { - e.FieldStart("role") - e.Str(s.Role) + e.FieldStart("clusterSlug") + e.Str(s.ClusterSlug) + } + { + e.FieldStart("id") + e.Str(s.ID) + } + { + e.FieldStart("jurisdiction") + e.Str(s.Jurisdiction) + } + { + e.FieldStart("mirror") + e.Bool(s.Mirror) + } + { + e.FieldStart("status") + s.Status.Encode(e) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -27382,55 +36004,105 @@ func (s *RepoCollaborator) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfRepoCollaborator = [3]string{ - 0: "accountId", - 1: "handle", - 2: "role", +var jsonFieldsNameOfRepoPlacement = [7]string{ + 0: "apiBaseUrl", + 1: "cell", + 2: "clusterSlug", + 3: "id", + 4: "jurisdiction", + 5: "mirror", + 6: "status", } -// Decode decodes RepoCollaborator from json. -func (s *RepoCollaborator) Decode(d *jx.Decoder) error { +// Decode decodes RepoPlacement from json. +func (s *RepoPlacement) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoCollaborator to nil") + return errors.New("invalid: unable to decode RepoPlacement to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "accountId": - requiredBitSet[0] |= 1 << 0 + case "apiBaseUrl": + if err := func() error { + s.ApiBaseUrl.Reset() + if err := s.ApiBaseUrl.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"apiBaseUrl\"") + } + case "cell": + requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.AccountId = string(v) + s.Cell = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"accountId\"") + return errors.Wrap(err, "decode field \"cell\"") } - case "handle": + case "clusterSlug": + requiredBitSet[0] |= 1 << 2 if err := func() error { - s.Handle.Reset() - if err := s.Handle.Decode(d); err != nil { + v, err := d.Str() + s.ClusterSlug = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"handle\"") + return errors.Wrap(err, "decode field \"clusterSlug\"") } - case "role": - requiredBitSet[0] |= 1 << 2 + case "id": + requiredBitSet[0] |= 1 << 3 if err := func() error { v, err := d.Str() - s.Role = string(v) + s.ID = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"role\"") + return errors.Wrap(err, "decode field \"id\"") + } + case "jurisdiction": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + v, err := d.Str() + s.Jurisdiction = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"jurisdiction\"") + } + case "mirror": + requiredBitSet[0] |= 1 << 5 + if err := func() error { + v, err := d.Bool() + s.Mirror = bool(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"mirror\"") + } + case "status": + requiredBitSet[0] |= 1 << 6 + if err := func() error { + if err := s.Status.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"status\"") } default: var elem jx.Raw @@ -27448,12 +36120,12 @@ func (s *RepoCollaborator) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode RepoCollaborator") + return errors.Wrap(err, "decode RepoPlacement") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000101, + 0b01111110, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -27465,8 +36137,8 @@ func (s *RepoCollaborator) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfRepoCollaborator) { - name = jsonFieldsNameOfRepoCollaborator[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfRepoPlacement) { + name = jsonFieldsNameOfRepoPlacement[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -27487,27 +36159,27 @@ func (s *RepoCollaborator) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *RepoCollaborator) MarshalJSON() ([]byte, error) { +func (s *RepoPlacement) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoCollaborator) UnmarshalJSON(data []byte) error { +func (s *RepoPlacement) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s RepoCollaboratorAdditional) Encode(e *jx.Encoder) { +func (s RepoPlacementAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s RepoCollaboratorAdditional) encodeFields(e *jx.Encoder) { +func (s RepoPlacementAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -27517,10 +36189,10 @@ func (s RepoCollaboratorAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes RepoCollaboratorAdditional from json. -func (s *RepoCollaboratorAdditional) Decode(d *jx.Decoder) error { +// Decode decodes RepoPlacementAdditional from json. +func (s *RepoPlacementAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoCollaboratorAdditional to nil") + return errors.New("invalid: unable to decode RepoPlacementAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -27538,52 +36210,94 @@ func (s *RepoCollaboratorAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode RepoCollaboratorAdditional") + return errors.Wrap(err, "decode RepoPlacementAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s RepoCollaboratorAdditional) MarshalJSON() ([]byte, error) { +func (s RepoPlacementAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoCollaboratorAdditional) UnmarshalJSON(data []byte) error { +func (s *RepoPlacementAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes RepoPlacementStatus as json. +func (s RepoPlacementStatus) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes RepoPlacementStatus from json. +func (s *RepoPlacementStatus) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode RepoPlacementStatus to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch RepoPlacementStatus(v) { + case RepoPlacementStatusProcessing: + *s = RepoPlacementStatusProcessing + case RepoPlacementStatusReady: + *s = RepoPlacementStatusReady + case RepoPlacementStatusFailed: + *s = RepoPlacementStatusFailed + case RepoPlacementStatusSuspended: + *s = RepoPlacementStatusSuspended + default: + *s = RepoPlacementStatus(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s RepoPlacementStatus) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *RepoPlacementStatus) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *RepoFacetPage) Encode(e *jx.Encoder) { +func (s *RepoPrimaries) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *RepoFacetPage) encodeFields(e *jx.Encoder) { +func (s *RepoPrimaries) encodeFields(e *jx.Encoder) { { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } + e.FieldStart("data_primary") + s.DataPrimary.Encode(e) } { - e.FieldStart("items") - e.ArrStart() - for _, elem := range s.Items { - e.Str(elem) - } - e.ArrEnd() + e.FieldStart("git_data") + e.Str(s.GitData) } { - if s.NextPageToken.Set { - e.FieldStart("nextPageToken") - s.NextPageToken.Encode(e) + e.FieldStart("processing") + e.Str(s.Processing) + } + { + if s.ProcessingPrimary.Set { + e.FieldStart("processing_primary") + s.ProcessingPrimary.Encode(e) } } for k, elem := range s.AdditionalProps { @@ -27595,61 +36309,66 @@ func (s *RepoFacetPage) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfRepoFacetPage = [3]string{ - 0: "$schema", - 1: "items", - 2: "nextPageToken", +var jsonFieldsNameOfRepoPrimaries = [4]string{ + 0: "data_primary", + 1: "git_data", + 2: "processing", + 3: "processing_primary", } -// Decode decodes RepoFacetPage from json. -func (s *RepoFacetPage) Decode(d *jx.Decoder) error { +// Decode decodes RepoPrimaries from json. +func (s *RepoPrimaries) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoFacetPage to nil") + return errors.New("invalid: unable to decode RepoPrimaries to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "data_primary": + requiredBitSet[0] |= 1 << 0 if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + if err := s.DataPrimary.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"data_primary\"") } - case "items": + case "git_data": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Items = make([]string, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem string - v, err := d.Str() - elem = string(v) - if err != nil { - return err - } - s.Items = append(s.Items, elem) - return nil - }); err != nil { + v, err := d.Str() + s.GitData = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"items\"") + return errors.Wrap(err, "decode field \"git_data\"") } - case "nextPageToken": + case "processing": + requiredBitSet[0] |= 1 << 2 if err := func() error { - s.NextPageToken.Reset() - if err := s.NextPageToken.Decode(d); err != nil { + v, err := d.Str() + s.Processing = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"nextPageToken\"") + return errors.Wrap(err, "decode field \"processing\"") + } + case "processing_primary": + if err := func() error { + s.ProcessingPrimary.Reset() + if err := s.ProcessingPrimary.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"processing_primary\"") } default: var elem jx.Raw @@ -27667,12 +36386,12 @@ func (s *RepoFacetPage) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode RepoFacetPage") + return errors.Wrap(err, "decode RepoPrimaries") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00000111, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -27684,8 +36403,8 @@ func (s *RepoFacetPage) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfRepoFacetPage) { - name = jsonFieldsNameOfRepoFacetPage[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfRepoPrimaries) { + name = jsonFieldsNameOfRepoPrimaries[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -27706,27 +36425,27 @@ func (s *RepoFacetPage) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *RepoFacetPage) MarshalJSON() ([]byte, error) { +func (s *RepoPrimaries) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoFacetPage) UnmarshalJSON(data []byte) error { +func (s *RepoPrimaries) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s RepoFacetPageAdditional) Encode(e *jx.Encoder) { +func (s RepoPrimariesAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s RepoFacetPageAdditional) encodeFields(e *jx.Encoder) { +func (s RepoPrimariesAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -27736,10 +36455,10 @@ func (s RepoFacetPageAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes RepoFacetPageAdditional from json. -func (s *RepoFacetPageAdditional) Decode(d *jx.Decoder) error { +// Decode decodes RepoPrimariesAdditional from json. +func (s *RepoPrimariesAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoFacetPageAdditional to nil") + return errors.New("invalid: unable to decode RepoPrimariesAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -27757,55 +36476,41 @@ func (s *RepoFacetPageAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode RepoFacetPageAdditional") + return errors.Wrap(err, "decode RepoPrimariesAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s RepoFacetPageAdditional) MarshalJSON() ([]byte, error) { +func (s RepoPrimariesAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoFacetPageAdditional) UnmarshalJSON(data []byte) error { +func (s *RepoPrimariesAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *RepoGrant) Encode(e *jx.Encoder) { +func (s *RepoReference) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *RepoGrant) encodeFields(e *jx.Encoder) { - { - e.FieldStart("granteeId") - e.Str(s.GranteeId) - } - { - if s.GranteeName.Set { - e.FieldStart("granteeName") - s.GranteeName.Encode(e) - } - } - { - e.FieldStart("granteeType") - e.Str(s.GranteeType) - } +func (s *RepoReference) encodeFields(e *jx.Encoder) { { - e.FieldStart("role") - e.Str(s.Role) + e.FieldStart("fullName") + e.Str(s.FullName) } { - e.FieldStart("source") - e.Str(s.Source) + e.FieldStart("provider") + e.Str(s.Provider) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -27816,81 +36521,44 @@ func (s *RepoGrant) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfRepoGrant = [5]string{ - 0: "granteeId", - 1: "granteeName", - 2: "granteeType", - 3: "role", - 4: "source", +var jsonFieldsNameOfRepoReference = [2]string{ + 0: "fullName", + 1: "provider", } -// Decode decodes RepoGrant from json. -func (s *RepoGrant) Decode(d *jx.Decoder) error { +// Decode decodes RepoReference from json. +func (s *RepoReference) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoGrant to nil") + return errors.New("invalid: unable to decode RepoReference to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "granteeId": + case "fullName": requiredBitSet[0] |= 1 << 0 if err := func() error { v, err := d.Str() - s.GranteeId = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"granteeId\"") - } - case "granteeName": - if err := func() error { - s.GranteeName.Reset() - if err := s.GranteeName.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"granteeName\"") - } - case "granteeType": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.GranteeType = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"granteeType\"") - } - case "role": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - v, err := d.Str() - s.Role = string(v) + s.FullName = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"role\"") + return errors.Wrap(err, "decode field \"fullName\"") } - case "source": - requiredBitSet[0] |= 1 << 4 + case "provider": + requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Str() - s.Source = string(v) + s.Provider = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"source\"") + return errors.Wrap(err, "decode field \"provider\"") } default: var elem jx.Raw @@ -27908,12 +36576,12 @@ func (s *RepoGrant) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode RepoGrant") + return errors.Wrap(err, "decode RepoReference") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00011101, + 0b00000011, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -27925,8 +36593,8 @@ func (s *RepoGrant) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfRepoGrant) { - name = jsonFieldsNameOfRepoGrant[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfRepoReference) { + name = jsonFieldsNameOfRepoReference[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -27947,27 +36615,27 @@ func (s *RepoGrant) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *RepoGrant) MarshalJSON() ([]byte, error) { +func (s *RepoReference) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoGrant) UnmarshalJSON(data []byte) error { +func (s *RepoReference) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s RepoGrantAdditional) Encode(e *jx.Encoder) { +func (s RepoReferenceAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s RepoGrantAdditional) encodeFields(e *jx.Encoder) { +func (s RepoReferenceAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -27977,10 +36645,10 @@ func (s RepoGrantAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes RepoGrantAdditional from json. -func (s *RepoGrantAdditional) Decode(d *jx.Decoder) error { +// Decode decodes RepoReferenceAdditional from json. +func (s *RepoReferenceAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoGrantAdditional to nil") + return errors.New("invalid: unable to decode RepoReferenceAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -27998,34 +36666,40 @@ func (s *RepoGrantAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode RepoGrantAdditional") + return errors.Wrap(err, "decode RepoReferenceAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s RepoGrantAdditional) MarshalJSON() ([]byte, error) { +func (s RepoReferenceAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoGrantAdditional) UnmarshalJSON(data []byte) error { +func (s *RepoReferenceAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *RepoIDResolution) Encode(e *jx.Encoder) { +func (s *RepoResolution) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *RepoIDResolution) encodeFields(e *jx.Encoder) { +func (s *RepoResolution) encodeFields(e *jx.Encoder) { + { + if s.Candidate.Set { + e.FieldStart("candidate") + s.Candidate.Encode(e) + } + } { if s.FullName.Set { e.FieldStart("fullName") @@ -28033,14 +36707,34 @@ func (s *RepoIDResolution) encodeFields(e *jx.Encoder) { } } { - if s.Provider.Set { - e.FieldStart("provider") - s.Provider.Encode(e) + if s.Placements != nil { + e.FieldStart("placements") + e.ArrStart() + for _, elem := range s.Placements { + elem.Encode(e) + } + e.ArrEnd() } } { - e.FieldStart("repoId") - e.Str(s.RepoId) + if s.Primaries.Set { + e.FieldStart("primaries") + s.Primaries.Encode(e) + } + } + { + e.FieldStart("provider") + e.Str(s.Provider) + } + { + if s.RepoId.Set { + e.FieldStart("repoId") + s.RepoId.Encode(e) + } + } + { + e.FieldStart("requestedFullName") + e.Str(s.RequestedFullName) } { e.FieldStart("status") @@ -28055,37 +36749,80 @@ func (s *RepoIDResolution) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfRepoIDResolution = [4]string{ - 0: "fullName", - 1: "provider", - 2: "repoId", - 3: "status", +var jsonFieldsNameOfRepoResolution = [8]string{ + 0: "candidate", + 1: "fullName", + 2: "placements", + 3: "primaries", + 4: "provider", + 5: "repoId", + 6: "requestedFullName", + 7: "status", } -// Decode decodes RepoIDResolution from json. -func (s *RepoIDResolution) Decode(d *jx.Decoder) error { +// Decode decodes RepoResolution from json. +func (s *RepoResolution) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoIDResolution to nil") + return errors.New("invalid: unable to decode RepoResolution to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { + case "candidate": + if err := func() error { + s.Candidate.Reset() + if err := s.Candidate.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"candidate\"") + } case "fullName": if err := func() error { - s.FullName.Reset() - if err := s.FullName.Decode(d); err != nil { + s.FullName.Reset() + if err := s.FullName.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"fullName\"") + } + case "placements": + if err := func() error { + s.Placements = make([]RepoPlacement, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem RepoPlacement + if err := elem.Decode(d); err != nil { + return err + } + s.Placements = append(s.Placements, elem) + return nil + }); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"placements\"") + } + case "primaries": + if err := func() error { + s.Primaries.Reset() + if err := s.Primaries.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"fullName\"") + return errors.Wrap(err, "decode field \"primaries\"") } case "provider": + requiredBitSet[0] |= 1 << 4 if err := func() error { - s.Provider.Reset() - if err := s.Provider.Decode(d); err != nil { + v, err := d.Str() + s.Provider = string(v) + if err != nil { return err } return nil @@ -28093,19 +36830,29 @@ func (s *RepoIDResolution) Decode(d *jx.Decoder) error { return errors.Wrap(err, "decode field \"provider\"") } case "repoId": - requiredBitSet[0] |= 1 << 2 + if err := func() error { + s.RepoId.Reset() + if err := s.RepoId.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"repoId\"") + } + case "requestedFullName": + requiredBitSet[0] |= 1 << 6 if err := func() error { v, err := d.Str() - s.RepoId = string(v) + s.RequestedFullName = string(v) if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"repoId\"") + return errors.Wrap(err, "decode field \"requestedFullName\"") } case "status": - requiredBitSet[0] |= 1 << 3 + requiredBitSet[0] |= 1 << 7 if err := func() error { if err := s.Status.Decode(d); err != nil { return err @@ -28130,12 +36877,12 @@ func (s *RepoIDResolution) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode RepoIDResolution") + return errors.Wrap(err, "decode RepoResolution") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00001100, + 0b11010000, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -28147,8 +36894,8 @@ func (s *RepoIDResolution) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfRepoIDResolution) { - name = jsonFieldsNameOfRepoIDResolution[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfRepoResolution) { + name = jsonFieldsNameOfRepoResolution[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -28169,27 +36916,27 @@ func (s *RepoIDResolution) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *RepoIDResolution) MarshalJSON() ([]byte, error) { +func (s *RepoResolution) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoIDResolution) UnmarshalJSON(data []byte) error { +func (s *RepoResolution) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s RepoIDResolutionAdditional) Encode(e *jx.Encoder) { +func (s RepoResolutionAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s RepoIDResolutionAdditional) encodeFields(e *jx.Encoder) { +func (s RepoResolutionAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -28199,10 +36946,10 @@ func (s RepoIDResolutionAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes RepoIDResolutionAdditional from json. -func (s *RepoIDResolutionAdditional) Decode(d *jx.Decoder) error { +// Decode decodes RepoResolutionAdditional from json. +func (s *RepoResolutionAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoIDResolutionAdditional to nil") + return errors.New("invalid: unable to decode RepoResolutionAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -28220,162 +36967,82 @@ func (s *RepoIDResolutionAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode RepoIDResolutionAdditional") + return errors.Wrap(err, "decode RepoResolutionAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s RepoIDResolutionAdditional) MarshalJSON() ([]byte, error) { +func (s RepoResolutionAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoIDResolutionAdditional) UnmarshalJSON(data []byte) error { +func (s *RepoResolutionAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } -// Encode encodes RepoIDResolutionStatus as json. -func (s RepoIDResolutionStatus) Encode(e *jx.Encoder) { +// Encode encodes RepoResolutionStatus as json. +func (s RepoResolutionStatus) Encode(e *jx.Encoder) { e.Str(string(s)) } -// Decode decodes RepoIDResolutionStatus from json. -func (s *RepoIDResolutionStatus) Decode(d *jx.Decoder) error { +// Decode decodes RepoResolutionStatus from json. +func (s *RepoResolutionStatus) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoIDResolutionStatus to nil") + return errors.New("invalid: unable to decode RepoResolutionStatus to nil") } v, err := d.StrBytes() if err != nil { return err } // Try to use constant string. - switch RepoIDResolutionStatus(v) { - case RepoIDResolutionStatusResolved: - *s = RepoIDResolutionStatusResolved - case RepoIDResolutionStatusUnavailable: - *s = RepoIDResolutionStatusUnavailable + switch RepoResolutionStatus(v) { + case RepoResolutionStatusReady: + *s = RepoResolutionStatusReady + case RepoResolutionStatusProcessing: + *s = RepoResolutionStatusProcessing + case RepoResolutionStatusNoMirror: + *s = RepoResolutionStatusNoMirror + case RepoResolutionStatusUnavailable: + *s = RepoResolutionStatusUnavailable default: - *s = RepoIDResolutionStatus(v) + *s = RepoResolutionStatus(v) } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s RepoIDResolutionStatus) MarshalJSON() ([]byte, error) { +func (s RepoResolutionStatus) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoIDResolutionStatus) UnmarshalJSON(data []byte) error { +func (s *RepoResolutionStatus) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *RepoIndexEntry) Encode(e *jx.Encoder) { +func (s *ResolvePlacementsOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *RepoIndexEntry) encodeFields(e *jx.Encoder) { - { - if s.ActivityHotness.Set { - e.FieldStart("activityHotness") - s.ActivityHotness.Encode(e) - } - } - { - if s.Archived.Set { - e.FieldStart("archived") - s.Archived.Encode(e) - } - } - { - if s.Candidate.Set { - e.FieldStart("candidate") - s.Candidate.Encode(e) - } - } - { - e.FieldStart("cell") - e.Str(s.Cell) - } - { - if s.CheckpointCount.Set { - e.FieldStart("checkpointCount") - s.CheckpointCount.Encode(e) - } - } - { - e.FieldStart("clusterSlug") - e.Str(s.ClusterSlug) - } - { - if s.Forks.Set { - e.FieldStart("forks") - s.Forks.Encode(e) - } - } - { - e.FieldStart("full_name") - e.Str(s.FullName) - } - { - e.FieldStart("id") - e.Str(s.ID) - } - { - e.FieldStart("jurisdiction") - e.Str(s.Jurisdiction) - } - { - if s.Language.Set { - e.FieldStart("language") - s.Language.Encode(e) - } - } - { - if s.LastActivityAt.Set { - e.FieldStart("lastActivityAt") - s.LastActivityAt.Encode(e, json.EncodeDateTime) - } - } - { - if s.LastPushedAt.Set { - e.FieldStart("lastPushedAt") - s.LastPushedAt.Encode(e, json.EncodeDateTime) - } - } - { - e.FieldStart("name") - e.Str(s.Name) - } - { - if s.OpenPrCount.Set { - e.FieldStart("openPrCount") - s.OpenPrCount.Encode(e) - } - } - { - if s.Org.Set { - e.FieldStart("org") - s.Org.Encode(e) - } - } +func (s *ResolvePlacementsOutputBody) encodeFields(e *jx.Encoder) { { - if s.Permission.Set { - e.FieldStart("permission") - s.Permission.Encode(e) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) } } { @@ -28386,34 +37053,6 @@ func (s *RepoIndexEntry) encodeFields(e *jx.Encoder) { } e.ArrEnd() } - { - if s.Primaries.Set { - e.FieldStart("primaries") - s.Primaries.Encode(e) - } - } - { - if s.Provider.Set { - e.FieldStart("provider") - s.Provider.Encode(e) - } - } - { - if s.PushedAt.Set { - e.FieldStart("pushedAt") - s.PushedAt.Encode(e, json.EncodeDateTime) - } - } - { - if s.Stars.Set { - e.FieldStart("stars") - s.Stars.Encode(e) - } - } - { - e.FieldStart("visibility") - e.Str(s.Visibility) - } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -28423,230 +37062,37 @@ func (s *RepoIndexEntry) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfRepoIndexEntry = [23]string{ - 0: "activityHotness", - 1: "archived", - 2: "candidate", - 3: "cell", - 4: "checkpointCount", - 5: "clusterSlug", - 6: "forks", - 7: "full_name", - 8: "id", - 9: "jurisdiction", - 10: "language", - 11: "lastActivityAt", - 12: "lastPushedAt", - 13: "name", - 14: "openPrCount", - 15: "org", - 16: "permission", - 17: "placements", - 18: "primaries", - 19: "provider", - 20: "pushedAt", - 21: "stars", - 22: "visibility", +var jsonFieldsNameOfResolvePlacementsOutputBody = [2]string{ + 0: "$schema", + 1: "placements", } -// Decode decodes RepoIndexEntry from json. -func (s *RepoIndexEntry) Decode(d *jx.Decoder) error { +// Decode decodes ResolvePlacementsOutputBody from json. +func (s *ResolvePlacementsOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoIndexEntry to nil") + return errors.New("invalid: unable to decode ResolvePlacementsOutputBody to nil") } - var requiredBitSet [3]uint8 + var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "activityHotness": - if err := func() error { - s.ActivityHotness.Reset() - if err := s.ActivityHotness.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"activityHotness\"") - } - case "archived": - if err := func() error { - s.Archived.Reset() - if err := s.Archived.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"archived\"") - } - case "candidate": - if err := func() error { - s.Candidate.Reset() - if err := s.Candidate.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"candidate\"") - } - case "cell": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - v, err := d.Str() - s.Cell = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"cell\"") - } - case "checkpointCount": - if err := func() error { - s.CheckpointCount.Reset() - if err := s.CheckpointCount.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"checkpointCount\"") - } - case "clusterSlug": - requiredBitSet[0] |= 1 << 5 - if err := func() error { - v, err := d.Str() - s.ClusterSlug = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"clusterSlug\"") - } - case "forks": - if err := func() error { - s.Forks.Reset() - if err := s.Forks.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"forks\"") - } - case "full_name": - requiredBitSet[0] |= 1 << 7 - if err := func() error { - v, err := d.Str() - s.FullName = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"full_name\"") - } - case "id": - requiredBitSet[1] |= 1 << 0 - if err := func() error { - v, err := d.Str() - s.ID = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"id\"") - } - case "jurisdiction": - requiredBitSet[1] |= 1 << 1 - if err := func() error { - v, err := d.Str() - s.Jurisdiction = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"jurisdiction\"") - } - case "language": - if err := func() error { - s.Language.Reset() - if err := s.Language.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"language\"") - } - case "lastActivityAt": - if err := func() error { - s.LastActivityAt.Reset() - if err := s.LastActivityAt.Decode(d, json.DecodeDateTime); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"lastActivityAt\"") - } - case "lastPushedAt": - if err := func() error { - s.LastPushedAt.Reset() - if err := s.LastPushedAt.Decode(d, json.DecodeDateTime); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"lastPushedAt\"") - } - case "name": - requiredBitSet[1] |= 1 << 5 - if err := func() error { - v, err := d.Str() - s.Name = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"name\"") - } - case "openPrCount": - if err := func() error { - s.OpenPrCount.Reset() - if err := s.OpenPrCount.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"openPrCount\"") - } - case "org": - if err := func() error { - s.Org.Reset() - if err := s.Org.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"org\"") - } - case "permission": + case "$schema": if err := func() error { - s.Permission.Reset() - if err := s.Permission.Decode(d); err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"permission\"") + return errors.Wrap(err, "decode field \"$schema\"") } case "placements": - requiredBitSet[2] |= 1 << 1 + requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Placements = make([]RepoPlacement, 0) + s.Placements = make([]ResolvedPlacement, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem RepoPlacement + var elem ResolvedPlacement if err := elem.Decode(d); err != nil { return err } @@ -28659,58 +37105,6 @@ func (s *RepoIndexEntry) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"placements\"") } - case "primaries": - if err := func() error { - s.Primaries.Reset() - if err := s.Primaries.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"primaries\"") - } - case "provider": - if err := func() error { - s.Provider.Reset() - if err := s.Provider.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"provider\"") - } - case "pushedAt": - if err := func() error { - s.PushedAt.Reset() - if err := s.PushedAt.Decode(d, json.DecodeDateTime); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"pushedAt\"") - } - case "stars": - if err := func() error { - s.Stars.Reset() - if err := s.Stars.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"stars\"") - } - case "visibility": - requiredBitSet[2] |= 1 << 6 - if err := func() error { - v, err := d.Str() - s.Visibility = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"visibility\"") - } default: var elem jx.Raw if err := func() error { @@ -28727,14 +37121,12 @@ func (s *RepoIndexEntry) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode RepoIndexEntry") + return errors.Wrap(err, "decode ResolvePlacementsOutputBody") } // Validate required fields. var failures []validate.FieldError - for i, mask := range [3]uint8{ - 0b10101000, - 0b00100011, - 0b01000010, + for i, mask := range [1]uint8{ + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -28746,8 +37138,8 @@ func (s *RepoIndexEntry) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfRepoIndexEntry) { - name = jsonFieldsNameOfRepoIndexEntry[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfResolvePlacementsOutputBody) { + name = jsonFieldsNameOfResolvePlacementsOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -28768,27 +37160,27 @@ func (s *RepoIndexEntry) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *RepoIndexEntry) MarshalJSON() ([]byte, error) { +func (s *ResolvePlacementsOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoIndexEntry) UnmarshalJSON(data []byte) error { +func (s *ResolvePlacementsOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s RepoIndexEntryAdditional) Encode(e *jx.Encoder) { +func (s ResolvePlacementsOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s RepoIndexEntryAdditional) encodeFields(e *jx.Encoder) { +func (s ResolvePlacementsOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -28798,10 +37190,10 @@ func (s RepoIndexEntryAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes RepoIndexEntryAdditional from json. -func (s *RepoIndexEntryAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ResolvePlacementsOutputBodyAdditional from json. +func (s *ResolvePlacementsOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoIndexEntryAdditional to nil") + return errors.New("invalid: unable to decode ResolvePlacementsOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -28819,57 +37211,47 @@ func (s *RepoIndexEntryAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode RepoIndexEntryAdditional") + return errors.Wrap(err, "decode ResolvePlacementsOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s RepoIndexEntryAdditional) MarshalJSON() ([]byte, error) { +func (s ResolvePlacementsOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoIndexEntryAdditional) UnmarshalJSON(data []byte) error { +func (s *ResolvePlacementsOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *RepoPlacement) Encode(e *jx.Encoder) { +func (s *ResolveProjectOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *RepoPlacement) encodeFields(e *jx.Encoder) { - { - e.FieldStart("cell") - e.Str(s.Cell) - } - { - e.FieldStart("clusterSlug") - e.Str(s.ClusterSlug) - } - { - e.FieldStart("id") - e.Str(s.ID) - } +func (s *ResolveProjectOutputBody) encodeFields(e *jx.Encoder) { { - e.FieldStart("jurisdiction") - e.Str(s.Jurisdiction) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } } { - e.FieldStart("mirror") - e.Bool(s.Mirror) + e.FieldStart("project") + s.Project.Encode(e) } { - e.FieldStart("status") - s.Status.Encode(e) + e.FieldStart("reference") + s.Reference.Encode(e) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -28880,94 +37262,51 @@ func (s *RepoPlacement) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfRepoPlacement = [6]string{ - 0: "cell", - 1: "clusterSlug", - 2: "id", - 3: "jurisdiction", - 4: "mirror", - 5: "status", +var jsonFieldsNameOfResolveProjectOutputBody = [3]string{ + 0: "$schema", + 1: "project", + 2: "reference", } -// Decode decodes RepoPlacement from json. -func (s *RepoPlacement) Decode(d *jx.Decoder) error { +// Decode decodes ResolveProjectOutputBody from json. +func (s *ResolveProjectOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoPlacement to nil") + return errors.New("invalid: unable to decode ResolveProjectOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "cell": - requiredBitSet[0] |= 1 << 0 + case "$schema": if err := func() error { - v, err := d.Str() - s.Cell = string(v) - if err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"cell\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "clusterSlug": + case "project": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.ClusterSlug = string(v) - if err != nil { + if err := s.Project.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"clusterSlug\"") + return errors.Wrap(err, "decode field \"project\"") } - case "id": + case "reference": requiredBitSet[0] |= 1 << 2 if err := func() error { - v, err := d.Str() - s.ID = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"id\"") - } - case "jurisdiction": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - v, err := d.Str() - s.Jurisdiction = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"jurisdiction\"") - } - case "mirror": - requiredBitSet[0] |= 1 << 4 - if err := func() error { - v, err := d.Bool() - s.Mirror = bool(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"mirror\"") - } - case "status": - requiredBitSet[0] |= 1 << 5 - if err := func() error { - if err := s.Status.Decode(d); err != nil { + if err := s.Reference.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"status\"") + return errors.Wrap(err, "decode field \"reference\"") } default: var elem jx.Raw @@ -28985,12 +37324,12 @@ func (s *RepoPlacement) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode RepoPlacement") + return errors.Wrap(err, "decode ResolveProjectOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00111111, + 0b00000110, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -29002,8 +37341,8 @@ func (s *RepoPlacement) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfRepoPlacement) { - name = jsonFieldsNameOfRepoPlacement[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfResolveProjectOutputBody) { + name = jsonFieldsNameOfResolveProjectOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -29024,27 +37363,27 @@ func (s *RepoPlacement) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *RepoPlacement) MarshalJSON() ([]byte, error) { +func (s *ResolveProjectOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoPlacement) UnmarshalJSON(data []byte) error { +func (s *ResolveProjectOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s RepoPlacementAdditional) Encode(e *jx.Encoder) { +func (s ResolveProjectOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s RepoPlacementAdditional) encodeFields(e *jx.Encoder) { +func (s ResolveProjectOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -29054,10 +37393,10 @@ func (s RepoPlacementAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes RepoPlacementAdditional from json. -func (s *RepoPlacementAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ResolveProjectOutputBodyAdditional from json. +func (s *ResolveProjectOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoPlacementAdditional to nil") + return errors.New("invalid: unable to decode ResolveProjectOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -29075,95 +37414,47 @@ func (s *RepoPlacementAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode RepoPlacementAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s RepoPlacementAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoPlacementAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes RepoPlacementStatus as json. -func (s RepoPlacementStatus) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes RepoPlacementStatus from json. -func (s *RepoPlacementStatus) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode RepoPlacementStatus to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch RepoPlacementStatus(v) { - case RepoPlacementStatusProcessing: - *s = RepoPlacementStatusProcessing - case RepoPlacementStatusReady: - *s = RepoPlacementStatusReady - case RepoPlacementStatusFailed: - *s = RepoPlacementStatusFailed - case RepoPlacementStatusSuspended: - *s = RepoPlacementStatusSuspended - default: - *s = RepoPlacementStatus(v) + return errors.Wrap(err, "decode ResolveProjectOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s RepoPlacementStatus) MarshalJSON() ([]byte, error) { +func (s ResolveProjectOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoPlacementStatus) UnmarshalJSON(data []byte) error { +func (s *ResolveProjectOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *RepoPrimaries) Encode(e *jx.Encoder) { +func (s *ResolveRepoIDsInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *RepoPrimaries) encodeFields(e *jx.Encoder) { - { - e.FieldStart("data_primary") - s.DataPrimary.Encode(e) - } - { - e.FieldStart("git_data") - e.Str(s.GitData) - } +func (s *ResolveRepoIDsInputBody) encodeFields(e *jx.Encoder) { { - e.FieldStart("processing") - e.Str(s.Processing) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } } { - if s.ProcessingPrimary.Set { - e.FieldStart("processing_primary") - s.ProcessingPrimary.Encode(e) + e.FieldStart("repoIds") + e.ArrStart() + for _, elem := range s.RepoIds { + e.Str(elem) } + e.ArrEnd() } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -29174,66 +37465,50 @@ func (s *RepoPrimaries) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfRepoPrimaries = [4]string{ - 0: "data_primary", - 1: "git_data", - 2: "processing", - 3: "processing_primary", +var jsonFieldsNameOfResolveRepoIDsInputBody = [2]string{ + 0: "$schema", + 1: "repoIds", } -// Decode decodes RepoPrimaries from json. -func (s *RepoPrimaries) Decode(d *jx.Decoder) error { +// Decode decodes ResolveRepoIDsInputBody from json. +func (s *ResolveRepoIDsInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoPrimaries to nil") + return errors.New("invalid: unable to decode ResolveRepoIDsInputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "data_primary": - requiredBitSet[0] |= 1 << 0 + case "$schema": if err := func() error { - if err := s.DataPrimary.Decode(d); err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"data_primary\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "git_data": + case "repoIds": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.GitData = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"git_data\"") - } - case "processing": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.Processing = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"processing\"") - } - case "processing_primary": - if err := func() error { - s.ProcessingPrimary.Reset() - if err := s.ProcessingPrimary.Decode(d); err != nil { + s.RepoIds = make([]string, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem string + v, err := d.Str() + elem = string(v) + if err != nil { + return err + } + s.RepoIds = append(s.RepoIds, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"processing_primary\"") + return errors.Wrap(err, "decode field \"repoIds\"") } default: var elem jx.Raw @@ -29251,12 +37526,12 @@ func (s *RepoPrimaries) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode RepoPrimaries") + return errors.Wrap(err, "decode ResolveRepoIDsInputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000111, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -29268,8 +37543,8 @@ func (s *RepoPrimaries) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfRepoPrimaries) { - name = jsonFieldsNameOfRepoPrimaries[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfResolveRepoIDsInputBody) { + name = jsonFieldsNameOfResolveRepoIDsInputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -29290,27 +37565,27 @@ func (s *RepoPrimaries) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *RepoPrimaries) MarshalJSON() ([]byte, error) { +func (s *ResolveRepoIDsInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoPrimaries) UnmarshalJSON(data []byte) error { +func (s *ResolveRepoIDsInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s RepoPrimariesAdditional) Encode(e *jx.Encoder) { +func (s ResolveRepoIDsInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s RepoPrimariesAdditional) encodeFields(e *jx.Encoder) { +func (s ResolveRepoIDsInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -29320,10 +37595,10 @@ func (s RepoPrimariesAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes RepoPrimariesAdditional from json. -func (s *RepoPrimariesAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ResolveRepoIDsInputBodyAdditional from json. +func (s *ResolveRepoIDsInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoPrimariesAdditional to nil") + return errors.New("invalid: unable to decode ResolveRepoIDsInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -29341,41 +37616,47 @@ func (s *RepoPrimariesAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode RepoPrimariesAdditional") + return errors.Wrap(err, "decode ResolveRepoIDsInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s RepoPrimariesAdditional) MarshalJSON() ([]byte, error) { +func (s ResolveRepoIDsInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoPrimariesAdditional) UnmarshalJSON(data []byte) error { +func (s *ResolveRepoIDsInputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *RepoReference) Encode(e *jx.Encoder) { +func (s *ResolveRepoIDsResponse) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *RepoReference) encodeFields(e *jx.Encoder) { +func (s *ResolveRepoIDsResponse) encodeFields(e *jx.Encoder) { { - e.FieldStart("fullName") - e.Str(s.FullName) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } } { - e.FieldStart("provider") - e.Str(s.Provider) + e.FieldStart("resolutions") + e.ArrStart() + for _, elem := range s.Resolutions { + elem.Encode(e) + } + e.ArrEnd() } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -29386,44 +37667,48 @@ func (s *RepoReference) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfRepoReference = [2]string{ - 0: "fullName", - 1: "provider", +var jsonFieldsNameOfResolveRepoIDsResponse = [2]string{ + 0: "$schema", + 1: "resolutions", } -// Decode decodes RepoReference from json. -func (s *RepoReference) Decode(d *jx.Decoder) error { +// Decode decodes ResolveRepoIDsResponse from json. +func (s *ResolveRepoIDsResponse) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoReference to nil") + return errors.New("invalid: unable to decode ResolveRepoIDsResponse to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "fullName": - requiredBitSet[0] |= 1 << 0 + case "$schema": if err := func() error { - v, err := d.Str() - s.FullName = string(v) - if err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"fullName\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "provider": + case "resolutions": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.Provider = string(v) - if err != nil { + s.Resolutions = make([]RepoIDResolution, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem RepoIDResolution + if err := elem.Decode(d); err != nil { + return err + } + s.Resolutions = append(s.Resolutions, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"provider\"") + return errors.Wrap(err, "decode field \"resolutions\"") } default: var elem jx.Raw @@ -29441,12 +37726,12 @@ func (s *RepoReference) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode RepoReference") + return errors.Wrap(err, "decode ResolveRepoIDsResponse") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000011, + 0b00000010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -29458,8 +37743,8 @@ func (s *RepoReference) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfRepoReference) { - name = jsonFieldsNameOfRepoReference[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfResolveRepoIDsResponse) { + name = jsonFieldsNameOfResolveRepoIDsResponse[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -29480,27 +37765,27 @@ func (s *RepoReference) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *RepoReference) MarshalJSON() ([]byte, error) { +func (s *ResolveRepoIDsResponse) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoReference) UnmarshalJSON(data []byte) error { +func (s *ResolveRepoIDsResponse) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s RepoReferenceAdditional) Encode(e *jx.Encoder) { +func (s ResolveRepoIDsResponseAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s RepoReferenceAdditional) encodeFields(e *jx.Encoder) { +func (s ResolveRepoIDsResponseAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -29510,10 +37795,10 @@ func (s RepoReferenceAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes RepoReferenceAdditional from json. -func (s *RepoReferenceAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ResolveRepoIDsResponseAdditional from json. +func (s *ResolveRepoIDsResponseAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoReferenceAdditional to nil") + return errors.New("invalid: unable to decode ResolveRepoIDsResponseAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -29531,79 +37816,59 @@ func (s *RepoReferenceAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode RepoReferenceAdditional") + return errors.Wrap(err, "decode ResolveRepoIDsResponseAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s RepoReferenceAdditional) MarshalJSON() ([]byte, error) { +func (s ResolveRepoIDsResponseAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoReferenceAdditional) UnmarshalJSON(data []byte) error { +func (s *ResolveRepoIDsResponseAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *RepoResolution) Encode(e *jx.Encoder) { +func (s *ResolveReposInputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *RepoResolution) encodeFields(e *jx.Encoder) { - { - if s.Candidate.Set { - e.FieldStart("candidate") - s.Candidate.Encode(e) - } - } +func (s *ResolveReposInputBody) encodeFields(e *jx.Encoder) { { - if s.FullName.Set { - e.FieldStart("fullName") - s.FullName.Encode(e) + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) } } { - if s.Placements != nil { - e.FieldStart("placements") - e.ArrStart() - for _, elem := range s.Placements { - elem.Encode(e) - } - e.ArrEnd() + if s.CommitToken.Set { + e.FieldStart("commitToken") + s.CommitToken.Encode(e) } } { - if s.Primaries.Set { - e.FieldStart("primaries") - s.Primaries.Encode(e) + if s.RecheckDeniedPermissions.Set { + e.FieldStart("recheckDeniedPermissions") + s.RecheckDeniedPermissions.Encode(e) } } { - e.FieldStart("provider") - e.Str(s.Provider) - } - { - if s.RepoId.Set { - e.FieldStart("repoId") - s.RepoId.Encode(e) + e.FieldStart("repositories") + e.ArrStart() + for _, elem := range s.Repositories { + elem.Encode(e) } - } - { - e.FieldStart("requestedFullName") - e.Str(s.RequestedFullName) - } - { - e.FieldStart("status") - s.Status.Encode(e) + e.ArrEnd() } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -29614,117 +37879,70 @@ func (s *RepoResolution) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfRepoResolution = [8]string{ - 0: "candidate", - 1: "fullName", - 2: "placements", - 3: "primaries", - 4: "provider", - 5: "repoId", - 6: "requestedFullName", - 7: "status", +var jsonFieldsNameOfResolveReposInputBody = [4]string{ + 0: "$schema", + 1: "commitToken", + 2: "recheckDeniedPermissions", + 3: "repositories", } -// Decode decodes RepoResolution from json. -func (s *RepoResolution) Decode(d *jx.Decoder) error { +// Decode decodes ResolveReposInputBody from json. +func (s *ResolveReposInputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoResolution to nil") + return errors.New("invalid: unable to decode ResolveReposInputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "candidate": - if err := func() error { - s.Candidate.Reset() - if err := s.Candidate.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"candidate\"") - } - case "fullName": - if err := func() error { - s.FullName.Reset() - if err := s.FullName.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"fullName\"") - } - case "placements": - if err := func() error { - s.Placements = make([]RepoPlacement, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem RepoPlacement - if err := elem.Decode(d); err != nil { - return err - } - s.Placements = append(s.Placements, elem) - return nil - }); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"placements\"") - } - case "primaries": - if err := func() error { - s.Primaries.Reset() - if err := s.Primaries.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"primaries\"") - } - case "provider": - requiredBitSet[0] |= 1 << 4 + case "$schema": if err := func() error { - v, err := d.Str() - s.Provider = string(v) - if err != nil { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"provider\"") + return errors.Wrap(err, "decode field \"$schema\"") } - case "repoId": + case "commitToken": if err := func() error { - s.RepoId.Reset() - if err := s.RepoId.Decode(d); err != nil { + s.CommitToken.Reset() + if err := s.CommitToken.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"repoId\"") + return errors.Wrap(err, "decode field \"commitToken\"") } - case "requestedFullName": - requiredBitSet[0] |= 1 << 6 + case "recheckDeniedPermissions": if err := func() error { - v, err := d.Str() - s.RequestedFullName = string(v) - if err != nil { + s.RecheckDeniedPermissions.Reset() + if err := s.RecheckDeniedPermissions.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"requestedFullName\"") + return errors.Wrap(err, "decode field \"recheckDeniedPermissions\"") } - case "status": - requiredBitSet[0] |= 1 << 7 + case "repositories": + requiredBitSet[0] |= 1 << 3 if err := func() error { - if err := s.Status.Decode(d); err != nil { + s.Repositories = make([]RepoReference, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem RepoReference + if err := elem.Decode(d); err != nil { + return err + } + s.Repositories = append(s.Repositories, elem) + return nil + }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"status\"") + return errors.Wrap(err, "decode field \"repositories\"") } default: var elem jx.Raw @@ -29742,12 +37960,12 @@ func (s *RepoResolution) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode RepoResolution") + return errors.Wrap(err, "decode ResolveReposInputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b11010000, + 0b00001000, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -29759,8 +37977,8 @@ func (s *RepoResolution) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfRepoResolution) { - name = jsonFieldsNameOfRepoResolution[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfResolveReposInputBody) { + name = jsonFieldsNameOfResolveReposInputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -29781,27 +37999,27 @@ func (s *RepoResolution) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *RepoResolution) MarshalJSON() ([]byte, error) { +func (s *ResolveReposInputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoResolution) UnmarshalJSON(data []byte) error { +func (s *ResolveReposInputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s RepoResolutionAdditional) Encode(e *jx.Encoder) { +func (s ResolveReposInputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s RepoResolutionAdditional) encodeFields(e *jx.Encoder) { +func (s ResolveReposInputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -29811,10 +38029,10 @@ func (s RepoResolutionAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes RepoResolutionAdditional from json. -func (s *RepoResolutionAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ResolveReposInputBodyAdditional from json. +func (s *ResolveReposInputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode RepoResolutionAdditional to nil") + return errors.New("invalid: unable to decode ResolveReposInputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -29832,78 +38050,34 @@ func (s *RepoResolutionAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode RepoResolutionAdditional") - } - - return nil -} - -// MarshalJSON implements stdjson.Marshaler. -func (s RepoResolutionAdditional) MarshalJSON() ([]byte, error) { - e := jx.Encoder{} - s.Encode(&e) - return e.Bytes(), nil -} - -// UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoResolutionAdditional) UnmarshalJSON(data []byte) error { - d := jx.DecodeBytes(data) - return s.Decode(d) -} - -// Encode encodes RepoResolutionStatus as json. -func (s RepoResolutionStatus) Encode(e *jx.Encoder) { - e.Str(string(s)) -} - -// Decode decodes RepoResolutionStatus from json. -func (s *RepoResolutionStatus) Decode(d *jx.Decoder) error { - if s == nil { - return errors.New("invalid: unable to decode RepoResolutionStatus to nil") - } - v, err := d.StrBytes() - if err != nil { - return err - } - // Try to use constant string. - switch RepoResolutionStatus(v) { - case RepoResolutionStatusReady: - *s = RepoResolutionStatusReady - case RepoResolutionStatusProcessing: - *s = RepoResolutionStatusProcessing - case RepoResolutionStatusNoMirror: - *s = RepoResolutionStatusNoMirror - case RepoResolutionStatusUnavailable: - *s = RepoResolutionStatusUnavailable - default: - *s = RepoResolutionStatus(v) + return errors.Wrap(err, "decode ResolveReposInputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s RepoResolutionStatus) MarshalJSON() ([]byte, error) { +func (s ResolveReposInputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *RepoResolutionStatus) UnmarshalJSON(data []byte) error { +func (s *ResolveReposInputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ResolvePlacementsOutputBody) Encode(e *jx.Encoder) { +func (s *ResolveReposResponse) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ResolvePlacementsOutputBody) encodeFields(e *jx.Encoder) { +func (s *ResolveReposResponse) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -29911,9 +38085,9 @@ func (s *ResolvePlacementsOutputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("placements") + e.FieldStart("resolutions") e.ArrStart() - for _, elem := range s.Placements { + for _, elem := range s.Resolutions { elem.Encode(e) } e.ArrEnd() @@ -29927,15 +38101,15 @@ func (s *ResolvePlacementsOutputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfResolvePlacementsOutputBody = [2]string{ +var jsonFieldsNameOfResolveReposResponse = [2]string{ 0: "$schema", - 1: "placements", + 1: "resolutions", } -// Decode decodes ResolvePlacementsOutputBody from json. -func (s *ResolvePlacementsOutputBody) Decode(d *jx.Decoder) error { +// Decode decodes ResolveReposResponse from json. +func (s *ResolveReposResponse) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ResolvePlacementsOutputBody to nil") + return errors.New("invalid: unable to decode ResolveReposResponse to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -29952,23 +38126,23 @@ func (s *ResolvePlacementsOutputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "placements": + case "resolutions": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Placements = make([]ResolvedPlacement, 0) + s.Resolutions = make([]RepoResolution, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem ResolvedPlacement + var elem RepoResolution if err := elem.Decode(d); err != nil { return err } - s.Placements = append(s.Placements, elem) + s.Resolutions = append(s.Resolutions, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"placements\"") + return errors.Wrap(err, "decode field \"resolutions\"") } default: var elem jx.Raw @@ -29986,7 +38160,7 @@ func (s *ResolvePlacementsOutputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ResolvePlacementsOutputBody") + return errors.Wrap(err, "decode ResolveReposResponse") } // Validate required fields. var failures []validate.FieldError @@ -30003,8 +38177,8 @@ func (s *ResolvePlacementsOutputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfResolvePlacementsOutputBody) { - name = jsonFieldsNameOfResolvePlacementsOutputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfResolveReposResponse) { + name = jsonFieldsNameOfResolveReposResponse[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -30025,27 +38199,27 @@ func (s *ResolvePlacementsOutputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ResolvePlacementsOutputBody) MarshalJSON() ([]byte, error) { +func (s *ResolveReposResponse) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ResolvePlacementsOutputBody) UnmarshalJSON(data []byte) error { +func (s *ResolveReposResponse) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ResolvePlacementsOutputBodyAdditional) Encode(e *jx.Encoder) { +func (s ResolveReposResponseAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ResolvePlacementsOutputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ResolveReposResponseAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -30055,10 +38229,10 @@ func (s ResolvePlacementsOutputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ResolvePlacementsOutputBodyAdditional from json. -func (s *ResolvePlacementsOutputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ResolveReposResponseAdditional from json. +func (s *ResolveReposResponseAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ResolvePlacementsOutputBodyAdditional to nil") + return errors.New("invalid: unable to decode ResolveReposResponseAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -30076,34 +38250,34 @@ func (s *ResolvePlacementsOutputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ResolvePlacementsOutputBodyAdditional") + return errors.Wrap(err, "decode ResolveReposResponseAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ResolvePlacementsOutputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ResolveReposResponseAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ResolvePlacementsOutputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ResolveReposResponseAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ResolveRepoIDsInputBody) Encode(e *jx.Encoder) { +func (s *ResolvedIdentity) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ResolveRepoIDsInputBody) encodeFields(e *jx.Encoder) { +func (s *ResolvedIdentity) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -30111,12 +38285,20 @@ func (s *ResolveRepoIDsInputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("repoIds") - e.ArrStart() - for _, elem := range s.RepoIds { - e.Str(elem) - } - e.ArrEnd() + e.FieldStart("accountId") + e.Str(s.AccountId) + } + { + e.FieldStart("handle") + e.Str(s.Handle) + } + { + e.FieldStart("provider") + e.Str(s.Provider) + } + { + e.FieldStart("providerUserId") + e.Str(s.ProviderUserId) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -30127,15 +38309,18 @@ func (s *ResolveRepoIDsInputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfResolveRepoIDsInputBody = [2]string{ +var jsonFieldsNameOfResolvedIdentity = [5]string{ 0: "$schema", - 1: "repoIds", + 1: "accountId", + 2: "handle", + 3: "provider", + 4: "providerUserId", } -// Decode decodes ResolveRepoIDsInputBody from json. -func (s *ResolveRepoIDsInputBody) Decode(d *jx.Decoder) error { +// Decode decodes ResolvedIdentity from json. +func (s *ResolvedIdentity) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ResolveRepoIDsInputBody to nil") + return errors.New("invalid: unable to decode ResolvedIdentity to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -30152,25 +38337,53 @@ func (s *ResolveRepoIDsInputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "repoIds": + case "accountId": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.RepoIds = make([]string, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem string - v, err := d.Str() - elem = string(v) - if err != nil { - return err - } - s.RepoIds = append(s.RepoIds, elem) - return nil - }); err != nil { + v, err := d.Str() + s.AccountId = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"repoIds\"") + return errors.Wrap(err, "decode field \"accountId\"") + } + case "handle": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Str() + s.Handle = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"handle\"") + } + case "provider": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.Provider = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider\"") + } + case "providerUserId": + requiredBitSet[0] |= 1 << 4 + if err := func() error { + v, err := d.Str() + s.ProviderUserId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"providerUserId\"") } default: var elem jx.Raw @@ -30188,12 +38401,12 @@ func (s *ResolveRepoIDsInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ResolveRepoIDsInputBody") + return errors.Wrap(err, "decode ResolvedIdentity") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00011110, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -30205,8 +38418,8 @@ func (s *ResolveRepoIDsInputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfResolveRepoIDsInputBody) { - name = jsonFieldsNameOfResolveRepoIDsInputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfResolvedIdentity) { + name = jsonFieldsNameOfResolvedIdentity[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -30227,27 +38440,27 @@ func (s *ResolveRepoIDsInputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ResolveRepoIDsInputBody) MarshalJSON() ([]byte, error) { +func (s *ResolvedIdentity) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ResolveRepoIDsInputBody) UnmarshalJSON(data []byte) error { +func (s *ResolvedIdentity) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ResolveRepoIDsInputBodyAdditional) Encode(e *jx.Encoder) { +func (s ResolvedIdentityAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ResolveRepoIDsInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ResolvedIdentityAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -30257,10 +38470,10 @@ func (s ResolveRepoIDsInputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ResolveRepoIDsInputBodyAdditional from json. -func (s *ResolveRepoIDsInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ResolvedIdentityAdditional from json. +func (s *ResolvedIdentityAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ResolveRepoIDsInputBodyAdditional to nil") + return errors.New("invalid: unable to decode ResolvedIdentityAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -30278,47 +38491,53 @@ func (s *ResolveRepoIDsInputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ResolveRepoIDsInputBodyAdditional") + return errors.Wrap(err, "decode ResolvedIdentityAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ResolveRepoIDsInputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ResolvedIdentityAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ResolveRepoIDsInputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ResolvedIdentityAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ResolveRepoIDsResponse) Encode(e *jx.Encoder) { +func (s *ResolvedPlacement) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ResolveRepoIDsResponse) encodeFields(e *jx.Encoder) { +func (s *ResolvedPlacement) encodeFields(e *jx.Encoder) { { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) + if s.Cell.Set { + e.FieldStart("cell") + s.Cell.Encode(e) } } { - e.FieldStart("resolutions") - e.ArrStart() - for _, elem := range s.Resolutions { - elem.Encode(e) + e.FieldStart("clusterHost") + e.Str(s.ClusterHost) + } + { + if s.Jurisdiction.Set { + e.FieldStart("jurisdiction") + s.Jurisdiction.Encode(e) } - e.ArrEnd() + } + { + e.FieldStart("mirrorId") + e.Str(s.MirrorId) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -30329,48 +38548,66 @@ func (s *ResolveRepoIDsResponse) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfResolveRepoIDsResponse = [2]string{ - 0: "$schema", - 1: "resolutions", +var jsonFieldsNameOfResolvedPlacement = [4]string{ + 0: "cell", + 1: "clusterHost", + 2: "jurisdiction", + 3: "mirrorId", } -// Decode decodes ResolveRepoIDsResponse from json. -func (s *ResolveRepoIDsResponse) Decode(d *jx.Decoder) error { +// Decode decodes ResolvedPlacement from json. +func (s *ResolvedPlacement) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ResolveRepoIDsResponse to nil") + return errors.New("invalid: unable to decode ResolvedPlacement to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "cell": if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + s.Cell.Reset() + if err := s.Cell.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"cell\"") } - case "resolutions": + case "clusterHost": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Resolutions = make([]RepoIDResolution, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem RepoIDResolution - if err := elem.Decode(d); err != nil { - return err - } - s.Resolutions = append(s.Resolutions, elem) - return nil - }); err != nil { + v, err := d.Str() + s.ClusterHost = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"resolutions\"") + return errors.Wrap(err, "decode field \"clusterHost\"") + } + case "jurisdiction": + if err := func() error { + s.Jurisdiction.Reset() + if err := s.Jurisdiction.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"jurisdiction\"") + } + case "mirrorId": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Str() + s.MirrorId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"mirrorId\"") } default: var elem jx.Raw @@ -30388,12 +38625,12 @@ func (s *ResolveRepoIDsResponse) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ResolveRepoIDsResponse") + return errors.Wrap(err, "decode ResolvedPlacement") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00001010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -30405,8 +38642,8 @@ func (s *ResolveRepoIDsResponse) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfResolveRepoIDsResponse) { - name = jsonFieldsNameOfResolveRepoIDsResponse[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfResolvedPlacement) { + name = jsonFieldsNameOfResolvedPlacement[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -30427,27 +38664,27 @@ func (s *ResolveRepoIDsResponse) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ResolveRepoIDsResponse) MarshalJSON() ([]byte, error) { +func (s *ResolvedPlacement) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ResolveRepoIDsResponse) UnmarshalJSON(data []byte) error { +func (s *ResolvedPlacement) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ResolveRepoIDsResponseAdditional) Encode(e *jx.Encoder) { +func (s ResolvedPlacementAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ResolveRepoIDsResponseAdditional) encodeFields(e *jx.Encoder) { +func (s ResolvedPlacementAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -30457,10 +38694,10 @@ func (s ResolveRepoIDsResponseAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ResolveRepoIDsResponseAdditional from json. -func (s *ResolveRepoIDsResponseAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ResolvedPlacementAdditional from json. +func (s *ResolvedPlacementAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ResolveRepoIDsResponseAdditional to nil") + return errors.New("invalid: unable to decode ResolvedPlacementAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -30478,34 +38715,34 @@ func (s *ResolveRepoIDsResponseAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ResolveRepoIDsResponseAdditional") + return errors.Wrap(err, "decode ResolvedPlacementAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ResolveRepoIDsResponseAdditional) MarshalJSON() ([]byte, error) { +func (s ResolvedPlacementAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ResolveRepoIDsResponseAdditional) UnmarshalJSON(data []byte) error { +func (s *ResolvedPlacementAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ResolveReposInputBody) Encode(e *jx.Encoder) { +func (s *ResourcePeopleOutputBody) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ResolveReposInputBody) encodeFields(e *jx.Encoder) { +func (s *ResourcePeopleOutputBody) encodeFields(e *jx.Encoder) { { if s.Schema.Set { e.FieldStart("$schema") @@ -30513,13 +38750,23 @@ func (s *ResolveReposInputBody) encodeFields(e *jx.Encoder) { } } { - e.FieldStart("repositories") + e.FieldStart("items") e.ArrStart() - for _, elem := range s.Repositories { + for _, elem := range s.Items { elem.Encode(e) } e.ArrEnd() } + { + if s.NextPageToken.Set { + e.FieldStart("nextPageToken") + s.NextPageToken.Encode(e) + } + } + { + e.FieldStart("totalCount") + e.Int64(s.TotalCount) + } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -30529,15 +38776,17 @@ func (s *ResolveReposInputBody) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfResolveReposInputBody = [2]string{ +var jsonFieldsNameOfResourcePeopleOutputBody = [4]string{ 0: "$schema", - 1: "repositories", + 1: "items", + 2: "nextPageToken", + 3: "totalCount", } -// Decode decodes ResolveReposInputBody from json. -func (s *ResolveReposInputBody) Decode(d *jx.Decoder) error { +// Decode decodes ResourcePeopleOutputBody from json. +func (s *ResourcePeopleOutputBody) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ResolveReposInputBody to nil") + return errors.New("invalid: unable to decode ResourcePeopleOutputBody to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} @@ -30554,23 +38803,45 @@ func (s *ResolveReposInputBody) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"$schema\"") } - case "repositories": + case "items": requiredBitSet[0] |= 1 << 1 if err := func() error { - s.Repositories = make([]RepoReference, 0) + s.Items = make([]ResourcePerson, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem RepoReference + var elem ResourcePerson if err := elem.Decode(d); err != nil { return err } - s.Repositories = append(s.Repositories, elem) + s.Items = append(s.Items, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"repositories\"") + return errors.Wrap(err, "decode field \"items\"") + } + case "nextPageToken": + if err := func() error { + s.NextPageToken.Reset() + if err := s.NextPageToken.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"nextPageToken\"") + } + case "totalCount": + requiredBitSet[0] |= 1 << 3 + if err := func() error { + v, err := d.Int64() + s.TotalCount = int64(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"totalCount\"") } default: var elem jx.Raw @@ -30588,12 +38859,12 @@ func (s *ResolveReposInputBody) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ResolveReposInputBody") + return errors.Wrap(err, "decode ResourcePeopleOutputBody") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b00001010, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -30605,8 +38876,8 @@ func (s *ResolveReposInputBody) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfResolveReposInputBody) { - name = jsonFieldsNameOfResolveReposInputBody[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfResourcePeopleOutputBody) { + name = jsonFieldsNameOfResourcePeopleOutputBody[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -30627,27 +38898,27 @@ func (s *ResolveReposInputBody) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ResolveReposInputBody) MarshalJSON() ([]byte, error) { +func (s *ResourcePeopleOutputBody) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ResolveReposInputBody) UnmarshalJSON(data []byte) error { +func (s *ResourcePeopleOutputBody) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ResolveReposInputBodyAdditional) Encode(e *jx.Encoder) { +func (s ResourcePeopleOutputBodyAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ResolveReposInputBodyAdditional) encodeFields(e *jx.Encoder) { +func (s ResourcePeopleOutputBodyAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -30657,10 +38928,10 @@ func (s ResolveReposInputBodyAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ResolveReposInputBodyAdditional from json. -func (s *ResolveReposInputBodyAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ResourcePeopleOutputBodyAdditional from json. +func (s *ResourcePeopleOutputBodyAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ResolveReposInputBodyAdditional to nil") + return errors.New("invalid: unable to decode ResourcePeopleOutputBodyAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -30678,44 +38949,68 @@ func (s *ResolveReposInputBodyAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ResolveReposInputBodyAdditional") + return errors.Wrap(err, "decode ResourcePeopleOutputBodyAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ResolveReposInputBodyAdditional) MarshalJSON() ([]byte, error) { +func (s ResourcePeopleOutputBodyAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ResolveReposInputBodyAdditional) UnmarshalJSON(data []byte) error { +func (s *ResourcePeopleOutputBodyAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ResolveReposResponse) Encode(e *jx.Encoder) { +func (s *ResourcePerson) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ResolveReposResponse) encodeFields(e *jx.Encoder) { +func (s *ResourcePerson) encodeFields(e *jx.Encoder) { { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) + e.FieldStart("accountId") + e.Str(s.AccountId) + } + { + if s.AvatarUrl.Set { + e.FieldStart("avatarUrl") + s.AvatarUrl.Encode(e) } } { - e.FieldStart("resolutions") + e.FieldStart("directGrant") + s.DirectGrant.Encode(e) + } + { + if s.Handle.Set { + e.FieldStart("handle") + s.Handle.Encode(e) + } + } + { + if s.Provider.Set { + e.FieldStart("provider") + s.Provider.Encode(e) + } + } + { + e.FieldStart("role") + e.Str(s.Role) + } + { + e.FieldStart("sources") e.ArrStart() - for _, elem := range s.Resolutions { + for _, elem := range s.Sources { elem.Encode(e) } e.ArrEnd() @@ -30729,48 +39024,107 @@ func (s *ResolveReposResponse) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfResolveReposResponse = [2]string{ - 0: "$schema", - 1: "resolutions", +var jsonFieldsNameOfResourcePerson = [7]string{ + 0: "accountId", + 1: "avatarUrl", + 2: "directGrant", + 3: "handle", + 4: "provider", + 5: "role", + 6: "sources", } -// Decode decodes ResolveReposResponse from json. -func (s *ResolveReposResponse) Decode(d *jx.Decoder) error { +// Decode decodes ResourcePerson from json. +func (s *ResourcePerson) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ResolveReposResponse to nil") + return errors.New("invalid: unable to decode ResourcePerson to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "accountId": + requiredBitSet[0] |= 1 << 0 + if err := func() error { + v, err := d.Str() + s.AccountId = string(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"accountId\"") + } + case "avatarUrl": + if err := func() error { + s.AvatarUrl.Reset() + if err := s.AvatarUrl.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"avatarUrl\"") + } + case "directGrant": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + if err := s.DirectGrant.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"directGrant\"") + } + case "handle": + if err := func() error { + s.Handle.Reset() + if err := s.Handle.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"handle\"") + } + case "provider": + if err := func() error { + s.Provider.Reset() + if err := s.Provider.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"provider\"") + } + case "role": + requiredBitSet[0] |= 1 << 5 if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + v, err := d.Str() + s.Role = string(v) + if err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"role\"") } - case "resolutions": - requiredBitSet[0] |= 1 << 1 + case "sources": + requiredBitSet[0] |= 1 << 6 if err := func() error { - s.Resolutions = make([]RepoResolution, 0) + s.Sources = make([]ResourcePersonSource, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem RepoResolution + var elem ResourcePersonSource if err := elem.Decode(d); err != nil { return err } - s.Resolutions = append(s.Resolutions, elem) + s.Sources = append(s.Sources, elem) return nil }); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"resolutions\"") + return errors.Wrap(err, "decode field \"sources\"") } default: var elem jx.Raw @@ -30788,12 +39142,12 @@ func (s *ResolveReposResponse) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ResolveReposResponse") + return errors.Wrap(err, "decode ResourcePerson") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000010, + 0b01100101, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -30805,8 +39159,8 @@ func (s *ResolveReposResponse) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfResolveReposResponse) { - name = jsonFieldsNameOfResolveReposResponse[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfResourcePerson) { + name = jsonFieldsNameOfResourcePerson[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -30827,27 +39181,27 @@ func (s *ResolveReposResponse) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ResolveReposResponse) MarshalJSON() ([]byte, error) { +func (s *ResourcePerson) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ResolveReposResponse) UnmarshalJSON(data []byte) error { +func (s *ResourcePerson) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ResolveReposResponseAdditional) Encode(e *jx.Encoder) { +func (s ResourcePersonAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ResolveReposResponseAdditional) encodeFields(e *jx.Encoder) { +func (s ResourcePersonAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -30857,10 +39211,10 @@ func (s ResolveReposResponseAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ResolveReposResponseAdditional from json. -func (s *ResolveReposResponseAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ResourcePersonAdditional from json. +func (s *ResourcePersonAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ResolveReposResponseAdditional to nil") + return errors.New("invalid: unable to decode ResourcePersonAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -30878,55 +39232,41 @@ func (s *ResolveReposResponseAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ResolveReposResponseAdditional") + return errors.Wrap(err, "decode ResourcePersonAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ResolveReposResponseAdditional) MarshalJSON() ([]byte, error) { +func (s ResourcePersonAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ResolveReposResponseAdditional) UnmarshalJSON(data []byte) error { +func (s *ResourcePersonAdditional) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ResolvedIdentity) Encode(e *jx.Encoder) { +func (s *ResourcePersonDirectGrant) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ResolvedIdentity) encodeFields(e *jx.Encoder) { - { - if s.Schema.Set { - e.FieldStart("$schema") - s.Schema.Encode(e) - } - } - { - e.FieldStart("accountId") - e.Str(s.AccountId) - } - { - e.FieldStart("handle") - e.Str(s.Handle) - } +func (s *ResourcePersonDirectGrant) encodeFields(e *jx.Encoder) { { - e.FieldStart("provider") - e.Str(s.Provider) + e.FieldStart("role") + s.Role.Encode(e) } { - e.FieldStart("providerUserId") - e.Str(s.ProviderUserId) + e.FieldStart("source") + s.Source.Encode(e) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -30937,81 +39277,40 @@ func (s *ResolvedIdentity) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfResolvedIdentity = [5]string{ - 0: "$schema", - 1: "accountId", - 2: "handle", - 3: "provider", - 4: "providerUserId", +var jsonFieldsNameOfResourcePersonDirectGrant = [2]string{ + 0: "role", + 1: "source", } -// Decode decodes ResolvedIdentity from json. -func (s *ResolvedIdentity) Decode(d *jx.Decoder) error { +// Decode decodes ResourcePersonDirectGrant from json. +func (s *ResourcePersonDirectGrant) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ResolvedIdentity to nil") + return errors.New("invalid: unable to decode ResourcePersonDirectGrant to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "$schema": + case "role": + requiredBitSet[0] |= 1 << 0 if err := func() error { - s.Schema.Reset() - if err := s.Schema.Decode(d); err != nil { + if err := s.Role.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"$schema\"") + return errors.Wrap(err, "decode field \"role\"") } - case "accountId": + case "source": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.AccountId = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"accountId\"") - } - case "handle": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Str() - s.Handle = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"handle\"") - } - case "provider": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - v, err := d.Str() - s.Provider = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"provider\"") - } - case "providerUserId": - requiredBitSet[0] |= 1 << 4 - if err := func() error { - v, err := d.Str() - s.ProviderUserId = string(v) - if err != nil { + if err := s.Source.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"providerUserId\"") + return errors.Wrap(err, "decode field \"source\"") } default: var elem jx.Raw @@ -31029,12 +39328,12 @@ func (s *ResolvedIdentity) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ResolvedIdentity") + return errors.Wrap(err, "decode ResourcePersonDirectGrant") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00011110, + 0b00000011, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -31046,8 +39345,8 @@ func (s *ResolvedIdentity) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfResolvedIdentity) { - name = jsonFieldsNameOfResolvedIdentity[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfResourcePersonDirectGrant) { + name = jsonFieldsNameOfResourcePersonDirectGrant[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -31068,27 +39367,27 @@ func (s *ResolvedIdentity) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ResolvedIdentity) MarshalJSON() ([]byte, error) { +func (s *ResourcePersonDirectGrant) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ResolvedIdentity) UnmarshalJSON(data []byte) error { +func (s *ResourcePersonDirectGrant) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ResolvedIdentityAdditional) Encode(e *jx.Encoder) { +func (s ResourcePersonDirectGrantAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ResolvedIdentityAdditional) encodeFields(e *jx.Encoder) { +func (s ResourcePersonDirectGrantAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -31098,10 +39397,10 @@ func (s ResolvedIdentityAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ResolvedIdentityAdditional from json. -func (s *ResolvedIdentityAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ResourcePersonDirectGrantAdditional from json. +func (s *ResourcePersonDirectGrantAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ResolvedIdentityAdditional to nil") + return errors.New("invalid: unable to decode ResourcePersonDirectGrantAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -31119,53 +39418,129 @@ func (s *ResolvedIdentityAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ResolvedIdentityAdditional") + return errors.Wrap(err, "decode ResourcePersonDirectGrantAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ResolvedIdentityAdditional) MarshalJSON() ([]byte, error) { +func (s ResourcePersonDirectGrantAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ResolvedIdentityAdditional) UnmarshalJSON(data []byte) error { +func (s *ResourcePersonDirectGrantAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes ResourcePersonDirectGrantRole as json. +func (s ResourcePersonDirectGrantRole) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes ResourcePersonDirectGrantRole from json. +func (s *ResourcePersonDirectGrantRole) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode ResourcePersonDirectGrantRole to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch ResourcePersonDirectGrantRole(v) { + case ResourcePersonDirectGrantRoleOwner: + *s = ResourcePersonDirectGrantRoleOwner + case ResourcePersonDirectGrantRoleAdmin: + *s = ResourcePersonDirectGrantRoleAdmin + case ResourcePersonDirectGrantRoleMember: + *s = ResourcePersonDirectGrantRoleMember + case ResourcePersonDirectGrantRoleReader: + *s = ResourcePersonDirectGrantRoleReader + case ResourcePersonDirectGrantRoleWriter: + *s = ResourcePersonDirectGrantRoleWriter + case ResourcePersonDirectGrantRoleMirrorSourceAdmin: + *s = ResourcePersonDirectGrantRoleMirrorSourceAdmin + default: + *s = ResourcePersonDirectGrantRole(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s ResourcePersonDirectGrantRole) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *ResourcePersonDirectGrantRole) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes ResourcePersonDirectGrantSource as json. +func (s ResourcePersonDirectGrantSource) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes ResourcePersonDirectGrantSource from json. +func (s *ResourcePersonDirectGrantSource) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode ResourcePersonDirectGrantSource to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch ResourcePersonDirectGrantSource(v) { + case ResourcePersonDirectGrantSourceMembership: + *s = ResourcePersonDirectGrantSourceMembership + case ResourcePersonDirectGrantSourceDirect: + *s = ResourcePersonDirectGrantSourceDirect + default: + *s = ResourcePersonDirectGrantSource(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s ResourcePersonDirectGrantSource) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *ResourcePersonDirectGrantSource) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s *ResolvedPlacement) Encode(e *jx.Encoder) { +func (s *ResourcePersonSource) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *ResolvedPlacement) encodeFields(e *jx.Encoder) { - { - if s.Cell.Set { - e.FieldStart("cell") - s.Cell.Encode(e) - } - } - { - e.FieldStart("clusterHost") - e.Str(s.ClusterHost) - } +func (s *ResourcePersonSource) encodeFields(e *jx.Encoder) { { - if s.Jurisdiction.Set { - e.FieldStart("jurisdiction") - s.Jurisdiction.Encode(e) - } + e.FieldStart("role") + s.Role.Encode(e) } { - e.FieldStart("mirrorId") - e.Str(s.MirrorId) + e.FieldStart("source") + s.Source.Encode(e) } for k, elem := range s.AdditionalProps { e.FieldStart(k) @@ -31176,66 +39551,40 @@ func (s *ResolvedPlacement) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfResolvedPlacement = [4]string{ - 0: "cell", - 1: "clusterHost", - 2: "jurisdiction", - 3: "mirrorId", +var jsonFieldsNameOfResourcePersonSource = [2]string{ + 0: "role", + 1: "source", } -// Decode decodes ResolvedPlacement from json. -func (s *ResolvedPlacement) Decode(d *jx.Decoder) error { +// Decode decodes ResourcePersonSource from json. +func (s *ResourcePersonSource) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ResolvedPlacement to nil") + return errors.New("invalid: unable to decode ResourcePersonSource to nil") } var requiredBitSet [1]uint8 s.AdditionalProps = map[string]jx.Raw{} if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "cell": + case "role": + requiredBitSet[0] |= 1 << 0 if err := func() error { - s.Cell.Reset() - if err := s.Cell.Decode(d); err != nil { + if err := s.Role.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"cell\"") + return errors.Wrap(err, "decode field \"role\"") } - case "clusterHost": + case "source": requiredBitSet[0] |= 1 << 1 if err := func() error { - v, err := d.Str() - s.ClusterHost = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"clusterHost\"") - } - case "jurisdiction": - if err := func() error { - s.Jurisdiction.Reset() - if err := s.Jurisdiction.Decode(d); err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"jurisdiction\"") - } - case "mirrorId": - requiredBitSet[0] |= 1 << 3 - if err := func() error { - v, err := d.Str() - s.MirrorId = string(v) - if err != nil { + if err := s.Source.Decode(d); err != nil { return err } return nil }(); err != nil { - return errors.Wrap(err, "decode field \"mirrorId\"") + return errors.Wrap(err, "decode field \"source\"") } default: var elem jx.Raw @@ -31253,12 +39602,12 @@ func (s *ResolvedPlacement) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode ResolvedPlacement") + return errors.Wrap(err, "decode ResourcePersonSource") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00001010, + 0b00000011, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -31270,8 +39619,8 @@ func (s *ResolvedPlacement) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfResolvedPlacement) { - name = jsonFieldsNameOfResolvedPlacement[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfResourcePersonSource) { + name = jsonFieldsNameOfResourcePersonSource[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -31292,27 +39641,27 @@ func (s *ResolvedPlacement) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *ResolvedPlacement) MarshalJSON() ([]byte, error) { +func (s *ResourcePersonSource) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ResolvedPlacement) UnmarshalJSON(data []byte) error { +func (s *ResourcePersonSource) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } // Encode implements json.Marshaler. -func (s ResolvedPlacementAdditional) Encode(e *jx.Encoder) { +func (s ResourcePersonSourceAdditional) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields implements json.Marshaler. -func (s ResolvedPlacementAdditional) encodeFields(e *jx.Encoder) { +func (s ResourcePersonSourceAdditional) encodeFields(e *jx.Encoder) { for k, elem := range s { e.FieldStart(k) @@ -31322,10 +39671,10 @@ func (s ResolvedPlacementAdditional) encodeFields(e *jx.Encoder) { } } -// Decode decodes ResolvedPlacementAdditional from json. -func (s *ResolvedPlacementAdditional) Decode(d *jx.Decoder) error { +// Decode decodes ResourcePersonSourceAdditional from json. +func (s *ResourcePersonSourceAdditional) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode ResolvedPlacementAdditional to nil") + return errors.New("invalid: unable to decode ResourcePersonSourceAdditional to nil") } m := s.init() if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { @@ -31343,21 +39692,119 @@ func (s *ResolvedPlacementAdditional) Decode(d *jx.Decoder) error { m[string(k)] = elem return nil }); err != nil { - return errors.Wrap(err, "decode ResolvedPlacementAdditional") + return errors.Wrap(err, "decode ResourcePersonSourceAdditional") } return nil } // MarshalJSON implements stdjson.Marshaler. -func (s ResolvedPlacementAdditional) MarshalJSON() ([]byte, error) { +func (s ResourcePersonSourceAdditional) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *ResolvedPlacementAdditional) UnmarshalJSON(data []byte) error { +func (s *ResourcePersonSourceAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes ResourcePersonSourceRole as json. +func (s ResourcePersonSourceRole) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes ResourcePersonSourceRole from json. +func (s *ResourcePersonSourceRole) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode ResourcePersonSourceRole to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch ResourcePersonSourceRole(v) { + case ResourcePersonSourceRoleOwner: + *s = ResourcePersonSourceRoleOwner + case ResourcePersonSourceRoleAdmin: + *s = ResourcePersonSourceRoleAdmin + case ResourcePersonSourceRoleMember: + *s = ResourcePersonSourceRoleMember + case ResourcePersonSourceRoleReader: + *s = ResourcePersonSourceRoleReader + case ResourcePersonSourceRoleWriter: + *s = ResourcePersonSourceRoleWriter + case ResourcePersonSourceRoleMirrorSourceAdmin: + *s = ResourcePersonSourceRoleMirrorSourceAdmin + default: + *s = ResourcePersonSourceRole(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s ResourcePersonSourceRole) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *ResourcePersonSourceRole) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes ResourcePersonSourceSource as json. +func (s ResourcePersonSourceSource) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes ResourcePersonSourceSource from json. +func (s *ResourcePersonSourceSource) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode ResourcePersonSourceSource to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch ResourcePersonSourceSource(v) { + case ResourcePersonSourceSourceMembership: + *s = ResourcePersonSourceSourceMembership + case ResourcePersonSourceSourceDirect: + *s = ResourcePersonSourceSourceDirect + case ResourcePersonSourceSourceTeam: + *s = ResourcePersonSourceSourceTeam + case ResourcePersonSourceSourceOrganization: + *s = ResourcePersonSourceSourceOrganization + case ResourcePersonSourceSourceProject: + *s = ResourcePersonSourceSourceProject + case ResourcePersonSourceSourceOwner: + *s = ResourcePersonSourceSourceOwner + case ResourcePersonSourceSourceGithub: + *s = ResourcePersonSourceSourceGithub + default: + *s = ResourcePersonSourceSource(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s ResourcePersonSourceSource) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *ResourcePersonSourceSource) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } @@ -33350,9 +41797,9 @@ func (s *UpdateBranchProtectionInputBody) Decode(d *jx.Decoder) error { } case "addRules": if err := func() error { - s.AddRules = make([]BranchRule, 0) + s.AddRules = make([]BranchRuleUpdate, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem BranchRule + var elem BranchRuleUpdate if err := elem.Decode(d); err != nil { return err } @@ -33477,6 +41924,236 @@ func (s *UpdateBranchProtectionInputBodyAdditional) UnmarshalJSON(data []byte) e return s.Decode(d) } +// Encode implements json.Marshaler. +func (s *UpdateOrgMemberRoleInputBody) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields encodes fields. +func (s *UpdateOrgMemberRoleInputBody) encodeFields(e *jx.Encoder) { + { + if s.Schema.Set { + e.FieldStart("$schema") + s.Schema.Encode(e) + } + } + { + e.FieldStart("role") + s.Role.Encode(e) + } + for k, elem := range s.AdditionalProps { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +var jsonFieldsNameOfUpdateOrgMemberRoleInputBody = [2]string{ + 0: "$schema", + 1: "role", +} + +// Decode decodes UpdateOrgMemberRoleInputBody from json. +func (s *UpdateOrgMemberRoleInputBody) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode UpdateOrgMemberRoleInputBody to nil") + } + var requiredBitSet [1]uint8 + s.AdditionalProps = map[string]jx.Raw{} + + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + switch string(k) { + case "$schema": + if err := func() error { + s.Schema.Reset() + if err := s.Schema.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"$schema\"") + } + case "role": + requiredBitSet[0] |= 1 << 1 + if err := func() error { + if err := s.Role.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"role\"") + } + default: + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + s.AdditionalProps[string(k)] = elem + } + return nil + }); err != nil { + return errors.Wrap(err, "decode UpdateOrgMemberRoleInputBody") + } + // Validate required fields. + var failures []validate.FieldError + for i, mask := range [1]uint8{ + 0b00000010, + } { + if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { + // Mask only required fields and check equality to mask using XOR. + // + // If XOR result is not zero, result is not equal to expected, so some fields are missed. + // Bits of fields which would be set are actually bits of missed fields. + missed := bits.OnesCount8(result) + for bitN := 0; bitN < missed; bitN++ { + bitIdx := bits.TrailingZeros8(result) + fieldIdx := i*8 + bitIdx + var name string + if fieldIdx < len(jsonFieldsNameOfUpdateOrgMemberRoleInputBody) { + name = jsonFieldsNameOfUpdateOrgMemberRoleInputBody[fieldIdx] + } else { + name = strconv.Itoa(fieldIdx) + } + failures = append(failures, validate.FieldError{ + Name: name, + Error: validate.ErrFieldRequired, + }) + // Reset bit. + result &^= 1 << bitIdx + } + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s *UpdateOrgMemberRoleInputBody) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *UpdateOrgMemberRoleInputBody) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode implements json.Marshaler. +func (s UpdateOrgMemberRoleInputBodyAdditional) Encode(e *jx.Encoder) { + e.ObjStart() + s.encodeFields(e) + e.ObjEnd() +} + +// encodeFields implements json.Marshaler. +func (s UpdateOrgMemberRoleInputBodyAdditional) encodeFields(e *jx.Encoder) { + for k, elem := range s { + e.FieldStart(k) + + if len(elem) != 0 { + e.Raw(elem) + } + } +} + +// Decode decodes UpdateOrgMemberRoleInputBodyAdditional from json. +func (s *UpdateOrgMemberRoleInputBodyAdditional) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode UpdateOrgMemberRoleInputBodyAdditional to nil") + } + m := s.init() + if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { + var elem jx.Raw + if err := func() error { + v, err := d.RawAppend(nil) + elem = jx.Raw(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrapf(err, "decode field %q", k) + } + m[string(k)] = elem + return nil + }); err != nil { + return errors.Wrap(err, "decode UpdateOrgMemberRoleInputBodyAdditional") + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s UpdateOrgMemberRoleInputBodyAdditional) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *UpdateOrgMemberRoleInputBodyAdditional) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + +// Encode encodes UpdateOrgMemberRoleInputBodyRole as json. +func (s UpdateOrgMemberRoleInputBodyRole) Encode(e *jx.Encoder) { + e.Str(string(s)) +} + +// Decode decodes UpdateOrgMemberRoleInputBodyRole from json. +func (s *UpdateOrgMemberRoleInputBodyRole) Decode(d *jx.Decoder) error { + if s == nil { + return errors.New("invalid: unable to decode UpdateOrgMemberRoleInputBodyRole to nil") + } + v, err := d.StrBytes() + if err != nil { + return err + } + // Try to use constant string. + switch UpdateOrgMemberRoleInputBodyRole(v) { + case UpdateOrgMemberRoleInputBodyRoleOwner: + *s = UpdateOrgMemberRoleInputBodyRoleOwner + case UpdateOrgMemberRoleInputBodyRoleAdmin: + *s = UpdateOrgMemberRoleInputBodyRoleAdmin + case UpdateOrgMemberRoleInputBodyRoleMember: + *s = UpdateOrgMemberRoleInputBodyRoleMember + default: + *s = UpdateOrgMemberRoleInputBodyRole(v) + } + + return nil +} + +// MarshalJSON implements stdjson.Marshaler. +func (s UpdateOrgMemberRoleInputBodyRole) MarshalJSON() ([]byte, error) { + e := jx.Encoder{} + s.Encode(&e) + return e.Bytes(), nil +} + +// UnmarshalJSON implements stdjson.Unmarshaler. +func (s *UpdateOrgMemberRoleInputBodyRole) UnmarshalJSON(data []byte) error { + d := jx.DecodeBytes(data) + return s.Decode(d) +} + // Encode implements json.Marshaler. func (s *WillDeleteStruct) Encode(e *jx.Encoder) { e.ObjStart() diff --git a/internal/coreapi/oas_operations_gen.go b/internal/coreapi/oas_operations_gen.go index 606f7e9546..66762f4882 100644 --- a/internal/coreapi/oas_operations_gen.go +++ b/internal/coreapi/oas_operations_gen.go @@ -6,15 +6,17 @@ package coreapi type OperationName = string const ( + AcceptInvitationOperation OperationName = "AcceptInvitation" AddOrgMemberOperation OperationName = "AddOrgMember" CancelDeletionOperation OperationName = "CancelDeletion" CompleteOnboardingOperation OperationName = "CompleteOnboarding" ConnectOrgCIBuildkiteCredentialOperation OperationName = "ConnectOrgCIBuildkiteCredential" + ConnectOrgCIDepotOrganizationOperation OperationName = "ConnectOrgCIDepotOrganization" CreateBindingOperation OperationName = "CreateBinding" - CreateMirrorOperation OperationName = "CreateMirror" CreateMirrorRequestOperation OperationName = "CreateMirrorRequest" CreateNativeMirrorOperation OperationName = "CreateNativeMirror" CreateOrgOperation OperationName = "CreateOrg" + CreateOrgInvitationOperation OperationName = "CreateOrgInvitation" CreateProjectOperation OperationName = "CreateProject" CreateRepoOperation OperationName = "CreateRepo" CreateRepoCIWebhookOperation OperationName = "CreateRepoCIWebhook" @@ -30,6 +32,8 @@ const ( DeleteRepoOperation OperationName = "DeleteRepo" DeleteRepoCIWebhookOperation OperationName = "DeleteRepoCIWebhook" DeleteServiceAccountOperation OperationName = "DeleteServiceAccount" + DetachMyHandleOperation OperationName = "DetachMyHandle" + DisconnectOrgCIDepotOrganizationOperation OperationName = "DisconnectOrgCIDepotOrganization" GetBranchProtectionOperation OperationName = "GetBranchProtection" GetDeletionPreviewOperation OperationName = "GetDeletionPreview" GetMeOperation OperationName = "GetMe" @@ -37,9 +41,10 @@ const ( GetMirrorRequestOperation OperationName = "GetMirrorRequest" GetOnboardingStatusOperation OperationName = "GetOnboardingStatus" GetOrgOperation OperationName = "GetOrg" - GetPermissionsOperation OperationName = "GetPermissions" + GetOrgPersonAccessOperation OperationName = "GetOrgPersonAccess" GetProjectOperation OperationName = "GetProject" GetRepoOperation OperationName = "GetRepo" + GetRepoCIDeliveryOperation OperationName = "GetRepoCIDelivery" GetRepoVisibilityOperation OperationName = "GetRepoVisibility" GetServiceAccountOperation OperationName = "GetServiceAccount" GetTopologyOperation OperationName = "GetTopology" @@ -57,13 +62,18 @@ const ( ListOIDCProvidersOperation OperationName = "ListOIDCProviders" ListOrgCIBuildkiteClustersOperation OperationName = "ListOrgCIBuildkiteClusters" ListOrgCIBuildkiteCredentialsOperation OperationName = "ListOrgCIBuildkiteCredentials" + ListOrgCIDepotOrganizationsOperation OperationName = "ListOrgCIDepotOrganizations" + ListOrgInvitationsOperation OperationName = "ListOrgInvitations" ListOrgMembersOperation OperationName = "ListOrgMembers" + ListOrgPeopleOperation OperationName = "ListOrgPeople" ListOrgProjectsOperation OperationName = "ListOrgProjects" ListOrgsOperation OperationName = "ListOrgs" ListProjectMembersOperation OperationName = "ListProjectMembers" + ListProjectPeopleOperation OperationName = "ListProjectPeople" ListProjectReposOperation OperationName = "ListProjectRepos" ListProjectsOperation OperationName = "ListProjects" ListRepoCIBuildsOperation OperationName = "ListRepoCIBuilds" + ListRepoCIDeliveriesOperation OperationName = "ListRepoCIDeliveries" ListRepoCIProvidersOperation OperationName = "ListRepoCIProviders" ListRepoCIWebhookAuditOperation OperationName = "ListRepoCIWebhookAudit" ListRepoCIWebhooksOperation OperationName = "ListRepoCIWebhooks" @@ -71,18 +81,22 @@ const ( ListRepoGrantsOperation OperationName = "ListRepoGrants" ListRepoLanguageFacetsOperation OperationName = "ListRepoLanguageFacets" ListRepoOrgFacetsOperation OperationName = "ListRepoOrgFacets" + ListRepoPeopleOperation OperationName = "ListRepoPeople" ListReposOperation OperationName = "ListRepos" ListServiceAccountGrantsOperation OperationName = "ListServiceAccountGrants" ListServiceAccountsOperation OperationName = "ListServiceAccounts" LookupRepoBySlugOperation OperationName = "LookupRepoBySlug" MintOrgCIGitHubActionsCredentialOperation OperationName = "MintOrgCIGitHubActionsCredential" PatchRepoCIWebhookOperation OperationName = "PatchRepoCIWebhook" + PreviewInvitationOperation OperationName = "PreviewInvitation" RegisterOrgCIBuildkiteClusterOperation OperationName = "RegisterOrgCIBuildkiteCluster" RemoveOrgMemberOperation OperationName = "RemoveOrgMember" ResolveHandleOperation OperationName = "ResolveHandle" ResolveMirrorPlacementsOperation OperationName = "ResolveMirrorPlacements" + ResolveProjectOperation OperationName = "ResolveProject" ResolveRepoIDsOperation OperationName = "ResolveRepoIDs" ResolveReposOperation OperationName = "ResolveRepos" + RevokeOrgInvitationOperation OperationName = "RevokeOrgInvitation" RevokeProjectAccessOperation OperationName = "RevokeProjectAccess" RevokeProjectAccessByProviderOperation OperationName = "RevokeProjectAccessByProvider" RevokeRepoAccessOperation OperationName = "RevokeRepoAccess" @@ -92,4 +106,5 @@ const ( SetBranchProtectionOperation OperationName = "SetBranchProtection" SetRepoVisibilityOperation OperationName = "SetRepoVisibility" UpdateBranchProtectionOperation OperationName = "UpdateBranchProtection" + UpdateOrgMemberRoleOperation OperationName = "UpdateOrgMemberRole" ) diff --git a/internal/coreapi/oas_parameters_gen.go b/internal/coreapi/oas_parameters_gen.go index a415024feb..7f6048f0fa 100644 --- a/internal/coreapi/oas_parameters_gen.go +++ b/internal/coreapi/oas_parameters_gen.go @@ -16,6 +16,11 @@ type ConnectOrgCIBuildkiteCredentialParams struct { OrgId string } +// ConnectOrgCIDepotOrganizationParams is parameters of connectOrgCIDepotOrganization operation. +type ConnectOrgCIDepotOrganizationParams struct { + OrgId string +} + // CreateBindingParams is parameters of createBinding operation. type CreateBindingParams struct { AccountId string @@ -26,6 +31,11 @@ type CreateNativeMirrorParams struct { RepoId string } +// CreateOrgInvitationParams is parameters of createOrgInvitation operation. +type CreateOrgInvitationParams struct { + OrgId string +} + // CreateRepoCIWebhookParams is parameters of createRepoCIWebhook operation. type CreateRepoCIWebhookParams struct { RepoId string @@ -92,6 +102,20 @@ type DeleteServiceAccountParams struct { AccountId string } +// DetachMyHandleParams is parameters of detachMyHandle operation. +type DetachMyHandleParams struct { + // Sign-in provider of the handle to detach. + Provider DetachMyHandleProvider + // The provider's stable user identifier for the handle (handles[].providerUserId from GET /me). + ProviderUserId string +} + +// DisconnectOrgCIDepotOrganizationParams is parameters of disconnectOrgCIDepotOrganization operation. +type DisconnectOrgCIDepotOrganizationParams struct { + OrgId string + Account string +} + // GetBranchProtectionParams is parameters of getBranchProtection operation. type GetBranchProtectionParams struct { RepoId string @@ -112,12 +136,10 @@ type GetOrgParams struct { OrgId string } -// GetPermissionsParams is parameters of getPermissions operation. -type GetPermissionsParams struct { - ResourceType string - ResourceId string - // If set, return the SpiceDB trace for this permission instead of the permission list. - Explain OptString `json:",omitempty,omitzero"` +// GetOrgPersonAccessParams is parameters of getOrgPersonAccess operation. +type GetOrgPersonAccessParams struct { + OrgId string + AccountId string } // GetProjectParams is parameters of getProject operation. @@ -134,6 +156,12 @@ type GetRepoParams struct { Authoritative OptBool `json:",omitempty,omitzero"` } +// GetRepoCIDeliveryParams is parameters of getRepoCIDelivery operation. +type GetRepoCIDeliveryParams struct { + RepoId string + ID string +} + // GetRepoVisibilityParams is parameters of getRepoVisibility operation. type GetRepoVisibilityParams struct { RepoId string @@ -230,6 +258,22 @@ type ListOrgCIBuildkiteCredentialsParams struct { OrgId string } +// ListOrgCIDepotOrganizationsParams is parameters of listOrgCIDepotOrganizations operation. +type ListOrgCIDepotOrganizationsParams struct { + OrgId string +} + +// ListOrgInvitationsParams is parameters of listOrgInvitations operation. +type ListOrgInvitationsParams struct { + // Maximum entries to return; server may cap further. + PageSize OptInt32 `json:",omitempty,omitzero"` + // Opaque cursor from a previous response's nextPageToken. + PageToken OptString `json:",omitempty,omitzero"` + OrgId string + // Lifecycle state to return; all returns every state. + Status OptListOrgInvitationsStatus `json:",omitempty,omitzero"` +} + // ListOrgMembersParams is parameters of listOrgMembers operation. type ListOrgMembersParams struct { // Maximum entries to return; server may cap further. @@ -239,6 +283,26 @@ type ListOrgMembersParams struct { OrgId string } +// ListOrgPeopleParams is parameters of listOrgPeople operation. +type ListOrgPeopleParams struct { + // Maximum entries to return; server may cap further. + PageSize OptInt32 `json:",omitempty,omitzero"` + // Opaque cursor from a previous response's nextPageToken. + PageToken OptString `json:",omitempty,omitzero"` + // Select people with a recorded grant at this resource level. + Scope OptListOrgPeopleScope `json:",omitempty,omitzero"` + OrgId string + // Case-insensitive substring of account ID, public handle, or resource name. + Search OptString `json:",omitempty,omitzero"` + // Member includes non-pending memberships; invited means pending; collaborator means no direct + // membership. + Membership OptListOrgPeopleMembership `json:",omitempty,omitzero"` + // Direct membership status; collaborators have no membership status. + Status OptListOrgPeopleStatus `json:",omitempty,omitzero"` + // Exact recorded grant role, including organization membership and weaker independent grants. + Role OptListOrgPeopleRole `json:",omitempty,omitzero"` +} + // ListOrgProjectsParams is parameters of listOrgProjects operation. type ListOrgProjectsParams struct { // Maximum entries to return; server may cap further. @@ -259,6 +323,9 @@ type ListOrgsParams struct { // Optional: exact-match org name (case-insensitive). Name OptString `json:",omitempty,omitzero"` IfNoneMatch OptString `json:",omitempty,omitzero"` + // Optional: opaque commit token from an org create or delete, to read at a snapshot that contains + // that write. Applies to both the name lookup and the page. + CommitToken OptString `json:",omitempty,omitzero"` } // ListProjectMembersParams is parameters of listProjectMembers operation. @@ -270,6 +337,19 @@ type ListProjectMembersParams struct { ProjectId string } +// ListProjectPeopleParams is parameters of listProjectPeople operation. +type ListProjectPeopleParams struct { + // Maximum entries to return; server may cap further. + PageSize OptInt32 `json:",omitempty,omitzero"` + // Opaque cursor from a previous response's nextPageToken. + PageToken OptString `json:",omitempty,omitzero"` + // Case-insensitive substring of account ID or public handle. + Search OptString `json:",omitempty,omitzero"` + // Exact effective role on the selected resource. + Role OptListProjectPeopleRole `json:",omitempty,omitzero"` + ProjectId string +} + // ListProjectReposParams is parameters of listProjectRepos operation. type ListProjectReposParams struct { // Maximum entries to return; server may cap further. @@ -279,6 +359,8 @@ type ListProjectReposParams struct { ProjectId string // Optional: exact-match repo name (case-insensitive). Name OptString `json:",omitempty,omitzero"` + // Optional: opaque commit token from a create, to read a snapshot that contains that write. + CommitToken OptString `json:",omitempty,omitzero"` } // ListProjectsParams is parameters of listProjects operation. @@ -289,6 +371,9 @@ type ListProjectsParams struct { PageToken OptString `json:",omitempty,omitzero"` // Optional: exact-match project name (case-insensitive). Name OptString `json:",omitempty,omitzero"` + // Optional: opaque commit token from a project create or delete, to list at a snapshot that contains + // that write. Ignored when name is set. + CommitToken OptString `json:",omitempty,omitzero"` } // ListRepoCIBuildsParams is parameters of listRepoCIBuilds operation. @@ -300,6 +385,13 @@ type ListRepoCIBuildsParams struct { Limit OptInt64 `json:",omitempty,omitzero"` } +// ListRepoCIDeliveriesParams is parameters of listRepoCIDeliveries operation. +type ListRepoCIDeliveriesParams struct { + RepoId string + Direction OptListRepoCIDeliveriesDirection `json:",omitempty,omitzero"` + Limit OptInt64 `json:",omitempty,omitzero"` +} + // ListRepoCIProvidersParams is parameters of listRepoCIProviders operation. type ListRepoCIProvidersParams struct { RepoId string @@ -356,6 +448,19 @@ type ListRepoOrgFacetsParams struct { Q OptString `json:",omitempty,omitzero"` } +// ListRepoPeopleParams is parameters of listRepoPeople operation. +type ListRepoPeopleParams struct { + // Maximum entries to return; server may cap further. + PageSize OptInt32 `json:",omitempty,omitzero"` + // Opaque cursor from a previous response's nextPageToken. + PageToken OptString `json:",omitempty,omitzero"` + // Case-insensitive substring of account ID or public handle. + Search OptString `json:",omitempty,omitzero"` + // Exact effective role on the selected resource. + Role OptListRepoPeopleRole `json:",omitempty,omitzero"` + RepoId string +} + // ListReposParams is parameters of listRepos operation. type ListReposParams struct { // Maximum entries to return; server may cap further. @@ -368,6 +473,9 @@ type ListReposParams struct { // entries; pagination and scope are ignored, but the fact filters below still apply (a repo whose // facts don't match returns empty). Filter OptString `json:",omitempty,omitzero"` + // Optional: opaque commit token from a create, to read a snapshot that contains that write. Requires + // filter. + CommitToken OptString `json:",omitempty,omitzero"` // Multi-key sort spec, e.g. org:asc,stars:desc. Keys: name,org,language,candidacy,stars,forks, // pushed_at,last_activity_at,last_pushed_at,activity_hotness,checkpoint_count,open_pr_count. A // single bare key uses the order param. Encoded into the cursor (authoritative on continuation). @@ -388,6 +496,8 @@ type ListReposParams struct { Org OptString `json:",omitempty,omitzero"` // Literal case-insensitive substring match on the full name (owner/repo). Q OptString `json:",omitempty,omitzero"` + // Exact-match owning project id (ULID). Also accepts projectId[eq]; projectId[ne] is rejected. + ProjectId OptString `json:",omitempty,omitzero"` // Filter on placement/candidacy lifecycle. inactive requires scope=all. Also accepts // status[eq]/status[ne]. Status OptListReposStatus `json:",omitempty,omitzero"` @@ -460,6 +570,18 @@ type ResolveMirrorPlacementsParams struct { Repo string } +// ResolveProjectParams is parameters of resolveProject operation. +type ResolveProjectParams struct { + Host ResolveProjectHost + Project string +} + +// RevokeOrgInvitationParams is parameters of revokeOrgInvitation operation. +type RevokeOrgInvitationParams struct { + OrgId string + ID string +} + // RevokeProjectAccessParams is parameters of revokeProjectAccess operation. type RevokeProjectAccessParams struct { ProjectId string @@ -515,3 +637,9 @@ type SetRepoVisibilityParams struct { type UpdateBranchProtectionParams struct { RepoId string } + +// UpdateOrgMemberRoleParams is parameters of updateOrgMemberRole operation. +type UpdateOrgMemberRoleParams struct { + OrgId string + MembershipId string +} diff --git a/internal/coreapi/oas_request_encoders_gen.go b/internal/coreapi/oas_request_encoders_gen.go index 4b672c4e64..feb9d99da4 100644 --- a/internal/coreapi/oas_request_encoders_gen.go +++ b/internal/coreapi/oas_request_encoders_gen.go @@ -10,6 +10,20 @@ import ( ht "github.com/ogen-go/ogen/http" ) +func encodeAcceptInvitationRequest( + req *AcceptInvitationInputBody, + r *http.Request, +) error { + const contentType = "application/json" + e := new(jx.Encoder) + { + req.Encode(e) + } + encoded := e.Bytes() + ht.SetBody(r, bytes.NewReader(encoded), contentType) + return nil +} + func encodeAddOrgMemberRequest( req *AddOrgMemberInputBody, r *http.Request, @@ -38,8 +52,8 @@ func encodeConnectOrgCIBuildkiteCredentialRequest( return nil } -func encodeCreateBindingRequest( - req *CreateBindingInputBody, +func encodeConnectOrgCIDepotOrganizationRequest( + req *ConnectOrgCIDepotOrganizationInputBody, r *http.Request, ) error { const contentType = "application/json" @@ -52,8 +66,8 @@ func encodeCreateBindingRequest( return nil } -func encodeCreateMirrorRequest( - req *CreateMirrorInputBody, +func encodeCreateBindingRequest( + req *CreateBindingInputBody, r *http.Request, ) error { const contentType = "application/json" @@ -108,6 +122,20 @@ func encodeCreateOrgRequest( return nil } +func encodeCreateOrgInvitationRequest( + req *CreateOrgInvitationInputBody, + r *http.Request, +) error { + const contentType = "application/json" + e := new(jx.Encoder) + { + req.Encode(e) + } + encoded := e.Bytes() + ht.SetBody(r, bytes.NewReader(encoded), contentType) + return nil +} + func encodeCreateProjectRequest( req *CreateProjectInputBody, r *http.Request, @@ -165,7 +193,7 @@ func encodeCreateServiceAccountRequest( } func encodeGrantProjectAccessRequest( - req *GrantProjectAccessInputBody, + req *GrantAccessBody, r *http.Request, ) error { const contentType = "application/json" @@ -179,7 +207,7 @@ func encodeGrantProjectAccessRequest( } func encodeGrantRepoAccessRequest( - req *GrantRepoAccessInputBody, + req *GrantAccessBody, r *http.Request, ) error { const contentType = "application/json" @@ -234,6 +262,20 @@ func encodePatchRepoCIWebhookRequest( return nil } +func encodePreviewInvitationRequest( + req *PreviewInvitationInputBody, + r *http.Request, +) error { + const contentType = "application/json" + e := new(jx.Encoder) + { + req.Encode(e) + } + encoded := e.Bytes() + ht.SetBody(r, bytes.NewReader(encoded), contentType) + return nil +} + func encodeRegisterOrgCIBuildkiteClusterRequest( req *RegisterOrgCIBuildkiteClusterInputBody, r *http.Request, @@ -317,3 +359,17 @@ func encodeUpdateBranchProtectionRequest( ht.SetBody(r, bytes.NewReader(encoded), contentType) return nil } + +func encodeUpdateOrgMemberRoleRequest( + req *UpdateOrgMemberRoleInputBody, + r *http.Request, +) error { + const contentType = "application/json" + e := new(jx.Encoder) + { + req.Encode(e) + } + encoded := e.Bytes() + ht.SetBody(r, bytes.NewReader(encoded), contentType) + return nil +} diff --git a/internal/coreapi/oas_response_decoders_gen.go b/internal/coreapi/oas_response_decoders_gen.go index 84f7ddd7b2..59ffda662a 100644 --- a/internal/coreapi/oas_response_decoders_gen.go +++ b/internal/coreapi/oas_response_decoders_gen.go @@ -15,6 +15,124 @@ import ( "github.com/ogen-go/ogen/validate" ) +func decodeAcceptInvitationResponse(resp *http.Response) (res AcceptInvitationRes, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response AcceptInvitationOK + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + case 201: + // Code 201. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response AcceptedInvitation + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/problem+json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ErrorModel + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil + default: + return res, validate.InvalidContentType(ct) + } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} + func decodeAddOrgMemberResponse(resp *http.Response) (res *Membership, _ error) { switch resp.StatusCode { case 201: @@ -315,7 +433,7 @@ func decodeConnectOrgCIBuildkiteCredentialResponse(resp *http.Response) (res *Or return res, errors.Wrap(defRes, "error") } -func decodeCreateBindingResponse(resp *http.Response) (res *Binding, _ error) { +func decodeConnectOrgCIDepotOrganizationResponse(resp *http.Response) (res *OrgCIDepotConnectionView, _ error) { switch resp.StatusCode { case 201: // Code 201. @@ -331,7 +449,7 @@ func decodeCreateBindingResponse(resp *http.Response) (res *Binding, _ error) { } d := jx.DecodeBytes(buf) - var response Binding + var response OrgCIDepotConnectionView if err := func() error { if err := response.Decode(d); err != nil { return err @@ -398,7 +516,7 @@ func decodeCreateBindingResponse(resp *http.Response) (res *Binding, _ error) { return res, errors.Wrap(defRes, "error") } -func decodeCreateMirrorResponse(resp *http.Response) (res *CreatedMirror, _ error) { +func decodeCreateBindingResponse(resp *http.Response) (res *Binding, _ error) { switch resp.StatusCode { case 201: // Code 201. @@ -414,7 +532,7 @@ func decodeCreateMirrorResponse(resp *http.Response) (res *CreatedMirror, _ erro } d := jx.DecodeBytes(buf) - var response CreatedMirror + var response Binding if err := func() error { if err := response.Decode(d); err != nil { return err @@ -705,7 +823,7 @@ func decodeCreateNativeMirrorResponse(resp *http.Response) (res *NativeMirrorPla return res, errors.Wrap(defRes, "error") } -func decodeCreateOrgResponse(resp *http.Response) (res *Org, _ error) { +func decodeCreateOrgResponse(resp *http.Response) (res *CreatedOrgHeaders, _ error) { switch resp.StatusCode { case 201: // Code 201. @@ -721,7 +839,7 @@ func decodeCreateOrgResponse(resp *http.Response) (res *Org, _ error) { } d := jx.DecodeBytes(buf) - var response Org + var response CreatedOrg if err := func() error { if err := response.Decode(d); err != nil { return err @@ -738,7 +856,47 @@ func decodeCreateOrgResponse(resp *http.Response) (res *Org, _ error) { } return res, err } - return &response, nil + var wrapper CreatedOrgHeaders + wrapper.Response = response + h := uri.NewHeaderDecoder(resp.Header) + // Parse "X-Entire-Commit-Token" header. + { + cfg := uri.HeaderParameterDecodingConfig{ + Name: "X-Entire-Commit-Token", + Explode: false, + } + if err := func() error { + if err := h.HasParam(cfg); err == nil { + if err := h.DecodeParam(cfg, func(d uri.Decoder) error { + var wrapperDotXEntireCommitTokenVal string + if err := func() error { + val, err := d.DecodeValue() + if err != nil { + return err + } + + c, err := conv.ToString(val) + if err != nil { + return err + } + + wrapperDotXEntireCommitTokenVal = c + return nil + }(); err != nil { + return err + } + wrapper.XEntireCommitToken.SetTo(wrapperDotXEntireCommitTokenVal) + return nil + }); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "parse X-Entire-Commit-Token header") + } + } + return &wrapper, nil default: return res, validate.InvalidContentType(ct) } @@ -788,10 +946,10 @@ func decodeCreateOrgResponse(resp *http.Response) (res *Org, _ error) { return res, errors.Wrap(defRes, "error") } -func decodeCreateProjectResponse(resp *http.Response) (res *Project, _ error) { +func decodeCreateOrgInvitationResponse(resp *http.Response) (res CreateOrgInvitationRes, _ error) { switch resp.StatusCode { - case 201: - // Code 201. + case 200: + // Code 200. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -804,7 +962,7 @@ func decodeCreateProjectResponse(resp *http.Response) (res *Project, _ error) { } d := jx.DecodeBytes(buf) - var response Project + var response CreateOrgInvitationOK if err := func() error { if err := response.Decode(d); err != nil { return err @@ -821,67 +979,10 @@ func decodeCreateProjectResponse(resp *http.Response) (res *Project, _ error) { } return res, err } - // Validate response. - if err := func() error { - if err := response.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - return res, errors.Wrap(err, "validate") - } return &response, nil default: return res, validate.InvalidContentType(ct) } - } - // Convenient error response. - defRes, err := func() (res *ErrorModelStatusCode, err error) { - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/problem+json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response ErrorModel - if err := func() error { - if err := response.Decode(d); err != nil { - return err - } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") - } - return nil - }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err - } - return &ErrorModelStatusCode{ - StatusCode: resp.StatusCode, - Response: response, - }, nil - default: - return res, validate.InvalidContentType(ct) - } - }() - if err != nil { - return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) - } - return res, errors.Wrap(defRes, "error") -} - -func decodeCreateRepoResponse(resp *http.Response) (res *Repo, _ error) { - switch resp.StatusCode { case 201: // Code 201. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) @@ -896,7 +997,7 @@ func decodeCreateRepoResponse(resp *http.Response) (res *Repo, _ error) { } d := jx.DecodeBytes(buf) - var response Repo + var response CreateOrgInvitationCreated if err := func() error { if err := response.Decode(d); err != nil { return err @@ -963,7 +1064,7 @@ func decodeCreateRepoResponse(resp *http.Response) (res *Repo, _ error) { return res, errors.Wrap(defRes, "error") } -func decodeCreateRepoCIWebhookResponse(resp *http.Response) (res *CreateRepoCIWebhookBody, _ error) { +func decodeCreateProjectResponse(resp *http.Response) (res *CreatedProjectHeaders, _ error) { switch resp.StatusCode { case 201: // Code 201. @@ -979,7 +1080,7 @@ func decodeCreateRepoCIWebhookResponse(resp *http.Response) (res *CreateRepoCIWe } d := jx.DecodeBytes(buf) - var response CreateRepoCIWebhookBody + var response CreatedProject if err := func() error { if err := response.Decode(d); err != nil { return err @@ -1005,7 +1106,47 @@ func decodeCreateRepoCIWebhookResponse(resp *http.Response) (res *CreateRepoCIWe }(); err != nil { return res, errors.Wrap(err, "validate") } - return &response, nil + var wrapper CreatedProjectHeaders + wrapper.Response = response + h := uri.NewHeaderDecoder(resp.Header) + // Parse "X-Entire-Commit-Token" header. + { + cfg := uri.HeaderParameterDecodingConfig{ + Name: "X-Entire-Commit-Token", + Explode: false, + } + if err := func() error { + if err := h.HasParam(cfg); err == nil { + if err := h.DecodeParam(cfg, func(d uri.Decoder) error { + var wrapperDotXEntireCommitTokenVal string + if err := func() error { + val, err := d.DecodeValue() + if err != nil { + return err + } + + c, err := conv.ToString(val) + if err != nil { + return err + } + + wrapperDotXEntireCommitTokenVal = c + return nil + }(); err != nil { + return err + } + wrapper.XEntireCommitToken.SetTo(wrapperDotXEntireCommitTokenVal) + return nil + }); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "parse X-Entire-Commit-Token header") + } + } + return &wrapper, nil default: return res, validate.InvalidContentType(ct) } @@ -1055,7 +1196,7 @@ func decodeCreateRepoCIWebhookResponse(resp *http.Response) (res *CreateRepoCIWe return res, errors.Wrap(defRes, "error") } -func decodeCreateServiceAccountResponse(resp *http.Response) (res *ServiceAccount, _ error) { +func decodeCreateRepoResponse(resp *http.Response) (res *CreatedRepoHeaders, _ error) { switch resp.StatusCode { case 201: // Code 201. @@ -1071,7 +1212,7 @@ func decodeCreateServiceAccountResponse(resp *http.Response) (res *ServiceAccoun } d := jx.DecodeBytes(buf) - var response ServiceAccount + var response CreatedRepo if err := func() error { if err := response.Decode(d); err != nil { return err @@ -1088,7 +1229,56 @@ func decodeCreateServiceAccountResponse(resp *http.Response) (res *ServiceAccoun } return res, err } - return &response, nil + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + var wrapper CreatedRepoHeaders + wrapper.Response = response + h := uri.NewHeaderDecoder(resp.Header) + // Parse "X-Entire-Commit-Token" header. + { + cfg := uri.HeaderParameterDecodingConfig{ + Name: "X-Entire-Commit-Token", + Explode: false, + } + if err := func() error { + if err := h.HasParam(cfg); err == nil { + if err := h.DecodeParam(cfg, func(d uri.Decoder) error { + var wrapperDotXEntireCommitTokenVal string + if err := func() error { + val, err := d.DecodeValue() + if err != nil { + return err + } + + c, err := conv.ToString(val) + if err != nil { + return err + } + + wrapperDotXEntireCommitTokenVal = c + return nil + }(); err != nil { + return err + } + wrapper.XEntireCommitToken.SetTo(wrapperDotXEntireCommitTokenVal) + return nil + }); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "parse X-Entire-Commit-Token header") + } + } + return &wrapper, nil default: return res, validate.InvalidContentType(ct) } @@ -1138,27 +1328,23 @@ func decodeCreateServiceAccountResponse(resp *http.Response) (res *ServiceAccoun return res, errors.Wrap(defRes, "error") } -func decodeDeleteBindingResponse(resp *http.Response) (res *DeleteBindingNoContent, _ error) { +func decodeCreateRepoCIWebhookResponse(resp *http.Response) (res *CreateRepoCIWebhookBody, _ error) { switch resp.StatusCode { - case 204: - // Code 204. - return &DeleteBindingNoContent{}, nil - } - // Convenient error response. - defRes, err := func() (res *ErrorModelStatusCode, err error) { + case 201: + // Code 201. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") } switch { - case ct == "application/problem+json": + case ct == "application/json": buf, err := io.ReadAll(resp.Body) if err != nil { return res, err } d := jx.DecodeBytes(buf) - var response ErrorModel + var response CreateRepoCIWebhookBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -1175,25 +1361,19 @@ func decodeDeleteBindingResponse(resp *http.Response) (res *DeleteBindingNoConte } return res, err } - return &ErrorModelStatusCode{ - StatusCode: resp.StatusCode, - Response: response, - }, nil + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil default: return res, validate.InvalidContentType(ct) } - }() - if err != nil { - return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) - } - return res, errors.Wrap(defRes, "error") -} - -func decodeDeleteMeResponse(resp *http.Response) (res *DeleteMeAccepted, _ error) { - switch resp.StatusCode { - case 202: - // Code 202. - return &DeleteMeAccepted{}, nil } // Convenient error response. defRes, err := func() (res *ErrorModelStatusCode, err error) { @@ -1240,27 +1420,23 @@ func decodeDeleteMeResponse(resp *http.Response) (res *DeleteMeAccepted, _ error return res, errors.Wrap(defRes, "error") } -func decodeDeleteMirrorResponse(resp *http.Response) (res *DeleteMirrorNoContent, _ error) { +func decodeCreateServiceAccountResponse(resp *http.Response) (res *ServiceAccount, _ error) { switch resp.StatusCode { - case 204: - // Code 204. - return &DeleteMirrorNoContent{}, nil - } - // Convenient error response. - defRes, err := func() (res *ErrorModelStatusCode, err error) { + case 201: + // Code 201. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") } switch { - case ct == "application/problem+json": + case ct == "application/json": buf, err := io.ReadAll(resp.Body) if err != nil { return res, err } d := jx.DecodeBytes(buf) - var response ErrorModel + var response ServiceAccount if err := func() error { if err := response.Decode(d); err != nil { return err @@ -1277,37 +1453,26 @@ func decodeDeleteMirrorResponse(resp *http.Response) (res *DeleteMirrorNoContent } return res, err } - return &ErrorModelStatusCode{ - StatusCode: resp.StatusCode, - Response: response, - }, nil + return &response, nil default: return res, validate.InvalidContentType(ct) } - }() - if err != nil { - return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) } - return res, errors.Wrap(defRes, "error") -} - -func decodeDeleteNativeMirrorResponse(resp *http.Response) (res *NativeMirrorPlacement, _ error) { - switch resp.StatusCode { - case 202: - // Code 202. + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") } switch { - case ct == "application/json": + case ct == "application/problem+json": buf, err := io.ReadAll(resp.Body) if err != nil { return res, err } d := jx.DecodeBytes(buf) - var response NativeMirrorPlacement + var response ErrorModel if err := func() error { if err := response.Decode(d); err != nil { return err @@ -1324,19 +1489,25 @@ func decodeDeleteNativeMirrorResponse(resp *http.Response) (res *NativeMirrorPla } return res, err } - // Validate response. - if err := func() error { - if err := response.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - return res, errors.Wrap(err, "validate") - } - return &response, nil + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil default: return res, validate.InvalidContentType(ct) } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} + +func decodeDeleteBindingResponse(resp *http.Response) (res *DeleteBindingNoContent, _ error) { + switch resp.StatusCode { + case 204: + // Code 204. + return &DeleteBindingNoContent{}, nil } // Convenient error response. defRes, err := func() (res *ErrorModelStatusCode, err error) { @@ -1383,11 +1554,11 @@ func decodeDeleteNativeMirrorResponse(resp *http.Response) (res *NativeMirrorPla return res, errors.Wrap(defRes, "error") } -func decodeDeleteOrgResponse(resp *http.Response) (res *DeleteOrgNoContent, _ error) { +func decodeDeleteMeResponse(resp *http.Response) (res *DeleteMeAccepted, _ error) { switch resp.StatusCode { - case 204: - // Code 204. - return &DeleteOrgNoContent{}, nil + case 202: + // Code 202. + return &DeleteMeAccepted{}, nil } // Convenient error response. defRes, err := func() (res *ErrorModelStatusCode, err error) { @@ -1434,11 +1605,11 @@ func decodeDeleteOrgResponse(resp *http.Response) (res *DeleteOrgNoContent, _ er return res, errors.Wrap(defRes, "error") } -func decodeDeleteOrgCIBuildkiteClusterResponse(resp *http.Response) (res *DeleteOrgCIBuildkiteClusterNoContent, _ error) { +func decodeDeleteMirrorResponse(resp *http.Response) (res *DeleteMirrorNoContent, _ error) { switch resp.StatusCode { case 204: // Code 204. - return &DeleteOrgCIBuildkiteClusterNoContent{}, nil + return &DeleteMirrorNoContent{}, nil } // Convenient error response. defRes, err := func() (res *ErrorModelStatusCode, err error) { @@ -1485,27 +1656,23 @@ func decodeDeleteOrgCIBuildkiteClusterResponse(resp *http.Response) (res *Delete return res, errors.Wrap(defRes, "error") } -func decodeDeleteOrgCIBuildkiteCredentialResponse(resp *http.Response) (res *DeleteOrgCIBuildkiteCredentialNoContent, _ error) { +func decodeDeleteNativeMirrorResponse(resp *http.Response) (res *NativeMirrorPlacement, _ error) { switch resp.StatusCode { - case 204: - // Code 204. - return &DeleteOrgCIBuildkiteCredentialNoContent{}, nil - } - // Convenient error response. - defRes, err := func() (res *ErrorModelStatusCode, err error) { + case 202: + // Code 202. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") } switch { - case ct == "application/problem+json": + case ct == "application/json": buf, err := io.ReadAll(resp.Body) if err != nil { return res, err } d := jx.DecodeBytes(buf) - var response ErrorModel + var response NativeMirrorPlacement if err := func() error { if err := response.Decode(d); err != nil { return err @@ -1522,25 +1689,19 @@ func decodeDeleteOrgCIBuildkiteCredentialResponse(resp *http.Response) (res *Del } return res, err } - return &ErrorModelStatusCode{ - StatusCode: resp.StatusCode, - Response: response, - }, nil + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil default: return res, validate.InvalidContentType(ct) } - }() - if err != nil { - return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) - } - return res, errors.Wrap(defRes, "error") -} - -func decodeDeleteProjectResponse(resp *http.Response) (res *DeleteProjectNoContent, _ error) { - switch resp.StatusCode { - case 204: - // Code 204. - return &DeleteProjectNoContent{}, nil } // Convenient error response. defRes, err := func() (res *ErrorModelStatusCode, err error) { @@ -1587,11 +1748,50 @@ func decodeDeleteProjectResponse(resp *http.Response) (res *DeleteProjectNoConte return res, errors.Wrap(defRes, "error") } -func decodeDeleteRepoResponse(resp *http.Response) (res *DeleteRepoNoContent, _ error) { +func decodeDeleteOrgResponse(resp *http.Response) (res *DeleteOrgNoContent, _ error) { switch resp.StatusCode { case 204: // Code 204. - return &DeleteRepoNoContent{}, nil + var wrapper DeleteOrgNoContent + h := uri.NewHeaderDecoder(resp.Header) + // Parse "X-Entire-Commit-Token" header. + { + cfg := uri.HeaderParameterDecodingConfig{ + Name: "X-Entire-Commit-Token", + Explode: false, + } + if err := func() error { + if err := h.HasParam(cfg); err == nil { + if err := h.DecodeParam(cfg, func(d uri.Decoder) error { + var wrapperDotXEntireCommitTokenVal string + if err := func() error { + val, err := d.DecodeValue() + if err != nil { + return err + } + + c, err := conv.ToString(val) + if err != nil { + return err + } + + wrapperDotXEntireCommitTokenVal = c + return nil + }(); err != nil { + return err + } + wrapper.XEntireCommitToken.SetTo(wrapperDotXEntireCommitTokenVal) + return nil + }); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "parse X-Entire-Commit-Token header") + } + } + return &wrapper, nil } // Convenient error response. defRes, err := func() (res *ErrorModelStatusCode, err error) { @@ -1638,11 +1838,11 @@ func decodeDeleteRepoResponse(resp *http.Response) (res *DeleteRepoNoContent, _ return res, errors.Wrap(defRes, "error") } -func decodeDeleteRepoCIWebhookResponse(resp *http.Response) (res *DeleteRepoCIWebhookNoContent, _ error) { +func decodeDeleteOrgCIBuildkiteClusterResponse(resp *http.Response) (res *DeleteOrgCIBuildkiteClusterNoContent, _ error) { switch resp.StatusCode { case 204: // Code 204. - return &DeleteRepoCIWebhookNoContent{}, nil + return &DeleteOrgCIBuildkiteClusterNoContent{}, nil } // Convenient error response. defRes, err := func() (res *ErrorModelStatusCode, err error) { @@ -1689,11 +1889,11 @@ func decodeDeleteRepoCIWebhookResponse(resp *http.Response) (res *DeleteRepoCIWe return res, errors.Wrap(defRes, "error") } -func decodeDeleteServiceAccountResponse(resp *http.Response) (res *DeleteServiceAccountNoContent, _ error) { +func decodeDeleteOrgCIBuildkiteCredentialResponse(resp *http.Response) (res *DeleteOrgCIBuildkiteCredentialNoContent, _ error) { switch resp.StatusCode { case 204: // Code 204. - return &DeleteServiceAccountNoContent{}, nil + return &DeleteOrgCIBuildkiteCredentialNoContent{}, nil } // Convenient error response. defRes, err := func() (res *ErrorModelStatusCode, err error) { @@ -1740,23 +1940,66 @@ func decodeDeleteServiceAccountResponse(resp *http.Response) (res *DeleteService return res, errors.Wrap(defRes, "error") } -func decodeGetBranchProtectionResponse(resp *http.Response) (res *BranchProtection, _ error) { +func decodeDeleteProjectResponse(resp *http.Response) (res *DeleteProjectNoContent, _ error) { switch resp.StatusCode { - case 200: - // Code 200. + case 204: + // Code 204. + var wrapper DeleteProjectNoContent + h := uri.NewHeaderDecoder(resp.Header) + // Parse "X-Entire-Commit-Token" header. + { + cfg := uri.HeaderParameterDecodingConfig{ + Name: "X-Entire-Commit-Token", + Explode: false, + } + if err := func() error { + if err := h.HasParam(cfg); err == nil { + if err := h.DecodeParam(cfg, func(d uri.Decoder) error { + var wrapperDotXEntireCommitTokenVal string + if err := func() error { + val, err := d.DecodeValue() + if err != nil { + return err + } + + c, err := conv.ToString(val) + if err != nil { + return err + } + + wrapperDotXEntireCommitTokenVal = c + return nil + }(); err != nil { + return err + } + wrapper.XEntireCommitToken.SetTo(wrapperDotXEntireCommitTokenVal) + return nil + }); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "parse X-Entire-Commit-Token header") + } + } + return &wrapper, nil + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") } switch { - case ct == "application/json": + case ct == "application/problem+json": buf, err := io.ReadAll(resp.Body) if err != nil { return res, err } d := jx.DecodeBytes(buf) - var response BranchProtection + var response ErrorModel if err := func() error { if err := response.Decode(d); err != nil { return err @@ -1773,19 +2016,64 @@ func decodeGetBranchProtectionResponse(resp *http.Response) (res *BranchProtecti } return res, err } - // Validate response. - if err := func() error { - if err := response.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - return res, errors.Wrap(err, "validate") - } - return &response, nil + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil default: return res, validate.InvalidContentType(ct) } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} + +func decodeDeleteRepoResponse(resp *http.Response) (res *DeleteRepoNoContent, _ error) { + switch resp.StatusCode { + case 204: + // Code 204. + var wrapper DeleteRepoNoContent + h := uri.NewHeaderDecoder(resp.Header) + // Parse "X-Entire-Commit-Token" header. + { + cfg := uri.HeaderParameterDecodingConfig{ + Name: "X-Entire-Commit-Token", + Explode: false, + } + if err := func() error { + if err := h.HasParam(cfg); err == nil { + if err := h.DecodeParam(cfg, func(d uri.Decoder) error { + var wrapperDotXEntireCommitTokenVal string + if err := func() error { + val, err := d.DecodeValue() + if err != nil { + return err + } + + c, err := conv.ToString(val) + if err != nil { + return err + } + + wrapperDotXEntireCommitTokenVal = c + return nil + }(); err != nil { + return err + } + wrapper.XEntireCommitToken.SetTo(wrapperDotXEntireCommitTokenVal) + return nil + }); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "parse X-Entire-Commit-Token header") + } + } + return &wrapper, nil } // Convenient error response. defRes, err := func() (res *ErrorModelStatusCode, err error) { @@ -1832,23 +2120,27 @@ func decodeGetBranchProtectionResponse(resp *http.Response) (res *BranchProtecti return res, errors.Wrap(defRes, "error") } -func decodeGetDeletionPreviewResponse(resp *http.Response) (res *GetDeletionPreviewOutputBody, _ error) { +func decodeDeleteRepoCIWebhookResponse(resp *http.Response) (res *DeleteRepoCIWebhookNoContent, _ error) { switch resp.StatusCode { - case 200: - // Code 200. + case 204: + // Code 204. + return &DeleteRepoCIWebhookNoContent{}, nil + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") } switch { - case ct == "application/json": + case ct == "application/problem+json": buf, err := io.ReadAll(resp.Body) if err != nil { return res, err } d := jx.DecodeBytes(buf) - var response GetDeletionPreviewOutputBody + var response ErrorModel if err := func() error { if err := response.Decode(d); err != nil { return err @@ -1865,19 +2157,25 @@ func decodeGetDeletionPreviewResponse(resp *http.Response) (res *GetDeletionPrev } return res, err } - // Validate response. - if err := func() error { - if err := response.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - return res, errors.Wrap(err, "validate") - } - return &response, nil + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil default: return res, validate.InvalidContentType(ct) } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} + +func decodeDeleteServiceAccountResponse(resp *http.Response) (res *DeleteServiceAccountNoContent, _ error) { + switch resp.StatusCode { + case 204: + // Code 204. + return &DeleteServiceAccountNoContent{}, nil } // Convenient error response. defRes, err := func() (res *ErrorModelStatusCode, err error) { @@ -1924,23 +2222,27 @@ func decodeGetDeletionPreviewResponse(resp *http.Response) (res *GetDeletionPrev return res, errors.Wrap(defRes, "error") } -func decodeGetMeResponse(resp *http.Response) (res *GetMeOutputBody, _ error) { +func decodeDetachMyHandleResponse(resp *http.Response) (res *DetachMyHandleNoContent, _ error) { switch resp.StatusCode { - case 200: - // Code 200. + case 204: + // Code 204. + return &DetachMyHandleNoContent{}, nil + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") } switch { - case ct == "application/json": + case ct == "application/problem+json": buf, err := io.ReadAll(resp.Body) if err != nil { return res, err } d := jx.DecodeBytes(buf) - var response GetMeOutputBody + var response ErrorModel if err := func() error { if err := response.Decode(d); err != nil { return err @@ -1957,19 +2259,25 @@ func decodeGetMeResponse(resp *http.Response) (res *GetMeOutputBody, _ error) { } return res, err } - // Validate response. - if err := func() error { - if err := response.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - return res, errors.Wrap(err, "validate") - } - return &response, nil + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil default: return res, validate.InvalidContentType(ct) } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} + +func decodeDisconnectOrgCIDepotOrganizationResponse(resp *http.Response) (res *DisconnectOrgCIDepotOrganizationNoContent, _ error) { + switch resp.StatusCode { + case 204: + // Code 204. + return &DisconnectOrgCIDepotOrganizationNoContent{}, nil } // Convenient error response. defRes, err := func() (res *ErrorModelStatusCode, err error) { @@ -2016,7 +2324,7 @@ func decodeGetMeResponse(resp *http.Response) (res *GetMeOutputBody, _ error) { return res, errors.Wrap(defRes, "error") } -func decodeGetMirrorResponse(resp *http.Response) (res *Mirror, _ error) { +func decodeGetBranchProtectionResponse(resp *http.Response) (res *BranchProtection, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -2032,7 +2340,7 @@ func decodeGetMirrorResponse(resp *http.Response) (res *Mirror, _ error) { } d := jx.DecodeBytes(buf) - var response Mirror + var response BranchProtection if err := func() error { if err := response.Decode(d); err != nil { return err @@ -2108,7 +2416,7 @@ func decodeGetMirrorResponse(resp *http.Response) (res *Mirror, _ error) { return res, errors.Wrap(defRes, "error") } -func decodeGetMirrorRequestResponse(resp *http.Response) (res *MirrorRequest, _ error) { +func decodeGetDeletionPreviewResponse(resp *http.Response) (res *GetDeletionPreviewOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -2124,7 +2432,7 @@ func decodeGetMirrorRequestResponse(resp *http.Response) (res *MirrorRequest, _ } d := jx.DecodeBytes(buf) - var response MirrorRequest + var response GetDeletionPreviewOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -2200,7 +2508,7 @@ func decodeGetMirrorRequestResponse(resp *http.Response) (res *MirrorRequest, _ return res, errors.Wrap(defRes, "error") } -func decodeGetOnboardingStatusResponse(resp *http.Response) (res *GetOnboardingStatusOutputBody, _ error) { +func decodeGetMeResponse(resp *http.Response) (res *GetMeOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -2216,7 +2524,7 @@ func decodeGetOnboardingStatusResponse(resp *http.Response) (res *GetOnboardingS } d := jx.DecodeBytes(buf) - var response GetOnboardingStatusOutputBody + var response GetMeOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -2233,6 +2541,15 @@ func decodeGetOnboardingStatusResponse(resp *http.Response) (res *GetOnboardingS } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2283,7 +2600,7 @@ func decodeGetOnboardingStatusResponse(resp *http.Response) (res *GetOnboardingS return res, errors.Wrap(defRes, "error") } -func decodeGetOrgResponse(resp *http.Response) (res *Org, _ error) { +func decodeGetMirrorResponse(resp *http.Response) (res *Mirror, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -2299,7 +2616,7 @@ func decodeGetOrgResponse(resp *http.Response) (res *Org, _ error) { } d := jx.DecodeBytes(buf) - var response Org + var response Mirror if err := func() error { if err := response.Decode(d); err != nil { return err @@ -2316,6 +2633,15 @@ func decodeGetOrgResponse(resp *http.Response) (res *Org, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2366,7 +2692,7 @@ func decodeGetOrgResponse(resp *http.Response) (res *Org, _ error) { return res, errors.Wrap(defRes, "error") } -func decodeGetPermissionsResponse(resp *http.Response) (res *GetPermissionsOutputBody, _ error) { +func decodeGetMirrorRequestResponse(resp *http.Response) (res *MirrorRequest, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -2382,7 +2708,7 @@ func decodeGetPermissionsResponse(resp *http.Response) (res *GetPermissionsOutpu } d := jx.DecodeBytes(buf) - var response GetPermissionsOutputBody + var response MirrorRequest if err := func() error { if err := response.Decode(d); err != nil { return err @@ -2458,7 +2784,7 @@ func decodeGetPermissionsResponse(resp *http.Response) (res *GetPermissionsOutpu return res, errors.Wrap(defRes, "error") } -func decodeGetProjectResponse(resp *http.Response) (res *Project, _ error) { +func decodeGetOnboardingStatusResponse(resp *http.Response) (res *GetOnboardingStatusOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -2474,7 +2800,7 @@ func decodeGetProjectResponse(resp *http.Response) (res *Project, _ error) { } d := jx.DecodeBytes(buf) - var response Project + var response GetOnboardingStatusOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -2491,15 +2817,6 @@ func decodeGetProjectResponse(resp *http.Response) (res *Project, _ error) { } return res, err } - // Validate response. - if err := func() error { - if err := response.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - return res, errors.Wrap(err, "validate") - } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2550,7 +2867,7 @@ func decodeGetProjectResponse(resp *http.Response) (res *Project, _ error) { return res, errors.Wrap(defRes, "error") } -func decodeGetRepoResponse(resp *http.Response) (res *Repo, _ error) { +func decodeGetOrgResponse(resp *http.Response) (res *Org, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -2566,7 +2883,7 @@ func decodeGetRepoResponse(resp *http.Response) (res *Repo, _ error) { } d := jx.DecodeBytes(buf) - var response Repo + var response Org if err := func() error { if err := response.Decode(d); err != nil { return err @@ -2633,7 +2950,7 @@ func decodeGetRepoResponse(resp *http.Response) (res *Repo, _ error) { return res, errors.Wrap(defRes, "error") } -func decodeGetRepoVisibilityResponse(resp *http.Response) (res *GetRepoVisibilityOutputBody, _ error) { +func decodeGetOrgPersonAccessResponse(resp *http.Response) (res *OrgPersonHeaders, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -2649,7 +2966,7 @@ func decodeGetRepoVisibilityResponse(resp *http.Response) (res *GetRepoVisibilit } d := jx.DecodeBytes(buf) - var response GetRepoVisibilityOutputBody + var response OrgPerson if err := func() error { if err := response.Decode(d); err != nil { return err @@ -2675,7 +2992,47 @@ func decodeGetRepoVisibilityResponse(resp *http.Response) (res *GetRepoVisibilit }(); err != nil { return res, errors.Wrap(err, "validate") } - return &response, nil + var wrapper OrgPersonHeaders + wrapper.Response = response + h := uri.NewHeaderDecoder(resp.Header) + // Parse "Cache-Control" header. + { + cfg := uri.HeaderParameterDecodingConfig{ + Name: "Cache-Control", + Explode: false, + } + if err := func() error { + if err := h.HasParam(cfg); err == nil { + if err := h.DecodeParam(cfg, func(d uri.Decoder) error { + var wrapperDotCacheControlVal string + if err := func() error { + val, err := d.DecodeValue() + if err != nil { + return err + } + + c, err := conv.ToString(val) + if err != nil { + return err + } + + wrapperDotCacheControlVal = c + return nil + }(); err != nil { + return err + } + wrapper.CacheControl.SetTo(wrapperDotCacheControlVal) + return nil + }); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "parse Cache-Control header") + } + } + return &wrapper, nil default: return res, validate.InvalidContentType(ct) } @@ -2725,7 +3082,7 @@ func decodeGetRepoVisibilityResponse(resp *http.Response) (res *GetRepoVisibilit return res, errors.Wrap(defRes, "error") } -func decodeGetServiceAccountResponse(resp *http.Response) (res *ServiceAccount, _ error) { +func decodeGetProjectResponse(resp *http.Response) (res *Project, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -2741,7 +3098,7 @@ func decodeGetServiceAccountResponse(resp *http.Response) (res *ServiceAccount, } d := jx.DecodeBytes(buf) - var response ServiceAccount + var response Project if err := func() error { if err := response.Decode(d); err != nil { return err @@ -2758,6 +3115,15 @@ func decodeGetServiceAccountResponse(resp *http.Response) (res *ServiceAccount, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2808,7 +3174,7 @@ func decodeGetServiceAccountResponse(resp *http.Response) (res *ServiceAccount, return res, errors.Wrap(defRes, "error") } -func decodeGetTopologyResponse(resp *http.Response) (res *GetTopologyOutputBody, _ error) { +func decodeGetRepoResponse(resp *http.Response) (res *Repo, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -2824,7 +3190,7 @@ func decodeGetTopologyResponse(resp *http.Response) (res *GetTopologyOutputBody, } d := jx.DecodeBytes(buf) - var response GetTopologyOutputBody + var response Repo if err := func() error { if err := response.Decode(d); err != nil { return err @@ -2900,7 +3266,7 @@ func decodeGetTopologyResponse(resp *http.Response) (res *GetTopologyOutputBody, return res, errors.Wrap(defRes, "error") } -func decodeGetVersionResponse(resp *http.Response) (res *GetVersionOutputBody, _ error) { +func decodeGetRepoCIDeliveryResponse(resp *http.Response) (res *CIDeliveryDetailView, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -2916,7 +3282,7 @@ func decodeGetVersionResponse(resp *http.Response) (res *GetVersionOutputBody, _ } d := jx.DecodeBytes(buf) - var response GetVersionOutputBody + var response CIDeliveryDetailView if err := func() error { if err := response.Decode(d); err != nil { return err @@ -2933,15 +3299,6 @@ func decodeGetVersionResponse(resp *http.Response) (res *GetVersionOutputBody, _ } return res, err } - // Validate response. - if err := func() error { - if err := response.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - return res, errors.Wrap(err, "validate") - } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2992,10 +3349,10 @@ func decodeGetVersionResponse(resp *http.Response) (res *GetVersionOutputBody, _ return res, errors.Wrap(defRes, "error") } -func decodeGrantProjectAccessResponse(resp *http.Response) (res *GrantProjectAccessOutputBody, _ error) { +func decodeGetRepoVisibilityResponse(resp *http.Response) (res *GetRepoVisibilityOutputBody, _ error) { switch resp.StatusCode { - case 201: - // Code 201. + case 200: + // Code 200. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -3008,7 +3365,7 @@ func decodeGrantProjectAccessResponse(resp *http.Response) (res *GrantProjectAcc } d := jx.DecodeBytes(buf) - var response GrantProjectAccessOutputBody + var response GetRepoVisibilityOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -3025,6 +3382,15 @@ func decodeGrantProjectAccessResponse(resp *http.Response) (res *GrantProjectAcc } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3075,10 +3441,10 @@ func decodeGrantProjectAccessResponse(resp *http.Response) (res *GrantProjectAcc return res, errors.Wrap(defRes, "error") } -func decodeGrantRepoAccessResponse(resp *http.Response) (res *GrantRepoAccessOutputBody, _ error) { +func decodeGetServiceAccountResponse(resp *http.Response) (res *ServiceAccount, _ error) { switch resp.StatusCode { - case 201: - // Code 201. + case 200: + // Code 200. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -3091,7 +3457,7 @@ func decodeGrantRepoAccessResponse(resp *http.Response) (res *GrantRepoAccessOut } d := jx.DecodeBytes(buf) - var response GrantRepoAccessOutputBody + var response ServiceAccount if err := func() error { if err := response.Decode(d); err != nil { return err @@ -3158,10 +3524,10 @@ func decodeGrantRepoAccessResponse(resp *http.Response) (res *GrantRepoAccessOut return res, errors.Wrap(defRes, "error") } -func decodeGrantServiceAccountAccessResponse(resp *http.Response) (res *GrantServiceAccountAccessOutputBody, _ error) { +func decodeGetTopologyResponse(resp *http.Response) (res *GetTopologyOutputBody, _ error) { switch resp.StatusCode { - case 201: - // Code 201. + case 200: + // Code 200. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -3174,7 +3540,7 @@ func decodeGrantServiceAccountAccessResponse(resp *http.Response) (res *GrantSer } d := jx.DecodeBytes(buf) - var response GrantServiceAccountAccessOutputBody + var response GetTopologyOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -3191,6 +3557,15 @@ func decodeGrantServiceAccountAccessResponse(resp *http.Response) (res *GrantSer } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3241,7 +3616,7 @@ func decodeGrantServiceAccountAccessResponse(resp *http.Response) (res *GrantSer return res, errors.Wrap(defRes, "error") } -func decodeListAuditEventsResponse(resp *http.Response) (res *ListAuditEventsOutputBody, _ error) { +func decodeGetVersionResponse(resp *http.Response) (res *GetVersionOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -3257,7 +3632,7 @@ func decodeListAuditEventsResponse(resp *http.Response) (res *ListAuditEventsOut } d := jx.DecodeBytes(buf) - var response ListAuditEventsOutputBody + var response GetVersionOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -3333,10 +3708,10 @@ func decodeListAuditEventsResponse(resp *http.Response) (res *ListAuditEventsOut return res, errors.Wrap(defRes, "error") } -func decodeListAvailableMirrorsResponse(resp *http.Response) (res *ListAvailableMirrorsOutputBody, _ error) { +func decodeGrantProjectAccessResponse(resp *http.Response) (res *GrantProjectAccessOutputBody, _ error) { switch resp.StatusCode { - case 200: - // Code 200. + case 201: + // Code 201. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -3349,7 +3724,7 @@ func decodeListAvailableMirrorsResponse(resp *http.Response) (res *ListAvailable } d := jx.DecodeBytes(buf) - var response ListAvailableMirrorsOutputBody + var response GrantProjectAccessOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -3366,14 +3741,88 @@ func decodeListAvailableMirrorsResponse(resp *http.Response) (res *ListAvailable } return res, err } - // Validate response. + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/problem+json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ErrorModel if err := func() error { - if err := response.Validate(); err != nil { + if err := response.Decode(d); err != nil { return err } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } return nil }(); err != nil { - return res, errors.Wrap(err, "validate") + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil + default: + return res, validate.InvalidContentType(ct) + } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} + +func decodeGrantRepoAccessResponse(resp *http.Response) (res *GrantRepoAccessOutputBody, _ error) { + switch resp.StatusCode { + case 201: + // Code 201. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response GrantRepoAccessOutputBody + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err } return &response, nil default: @@ -3425,7 +3874,90 @@ func decodeListAvailableMirrorsResponse(resp *http.Response) (res *ListAvailable return res, errors.Wrap(defRes, "error") } -func decodeListBindingsResponse(resp *http.Response) (res *ListBindingsOutputBody, _ error) { +func decodeGrantServiceAccountAccessResponse(resp *http.Response) (res *GrantServiceAccountAccessOutputBody, _ error) { + switch resp.StatusCode { + case 201: + // Code 201. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response GrantServiceAccountAccessOutputBody + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/problem+json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ErrorModel + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil + default: + return res, validate.InvalidContentType(ct) + } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} + +func decodeListAuditEventsResponse(resp *http.Response) (res *ListAuditEventsOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -3441,7 +3973,7 @@ func decodeListBindingsResponse(resp *http.Response) (res *ListBindingsOutputBod } d := jx.DecodeBytes(buf) - var response ListBindingsOutputBody + var response ListAuditEventsOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -3517,7 +4049,7 @@ func decodeListBindingsResponse(resp *http.Response) (res *ListBindingsOutputBod return res, errors.Wrap(defRes, "error") } -func decodeListClustersResponse(resp *http.Response) (res *ListClustersOutputBody, _ error) { +func decodeListAvailableMirrorsResponse(resp *http.Response) (res *ListAvailableMirrorsOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -3533,7 +4065,7 @@ func decodeListClustersResponse(resp *http.Response) (res *ListClustersOutputBod } d := jx.DecodeBytes(buf) - var response ListClustersOutputBody + var response ListAvailableMirrorsOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -3609,7 +4141,7 @@ func decodeListClustersResponse(resp *http.Response) (res *ListClustersOutputBod return res, errors.Wrap(defRes, "error") } -func decodeListMirrorCollaboratorsResponse(resp *http.Response) (res *ListMirrorCollaboratorsOutputBody, _ error) { +func decodeListBindingsResponse(resp *http.Response) (res *ListBindingsOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -3625,7 +4157,7 @@ func decodeListMirrorCollaboratorsResponse(resp *http.Response) (res *ListMirror } d := jx.DecodeBytes(buf) - var response ListMirrorCollaboratorsOutputBody + var response ListBindingsOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -3701,7 +4233,7 @@ func decodeListMirrorCollaboratorsResponse(resp *http.Response) (res *ListMirror return res, errors.Wrap(defRes, "error") } -func decodeListMirrorsResponse(resp *http.Response) (res *ListMirrorsOutputBody, _ error) { +func decodeListClustersResponse(resp *http.Response) (res *ListClustersOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -3717,7 +4249,7 @@ func decodeListMirrorsResponse(resp *http.Response) (res *ListMirrorsOutputBody, } d := jx.DecodeBytes(buf) - var response ListMirrorsOutputBody + var response ListClustersOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -3793,7 +4325,7 @@ func decodeListMirrorsResponse(resp *http.Response) (res *ListMirrorsOutputBody, return res, errors.Wrap(defRes, "error") } -func decodeListNativeMirrorsResponse(resp *http.Response) (res *ListNativeMirrorsOutputBody, _ error) { +func decodeListMirrorCollaboratorsResponse(resp *http.Response) (res *ListMirrorCollaboratorsOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -3809,7 +4341,7 @@ func decodeListNativeMirrorsResponse(resp *http.Response) (res *ListNativeMirror } d := jx.DecodeBytes(buf) - var response ListNativeMirrorsOutputBody + var response ListMirrorCollaboratorsOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -3885,7 +4417,7 @@ func decodeListNativeMirrorsResponse(resp *http.Response) (res *ListNativeMirror return res, errors.Wrap(defRes, "error") } -func decodeListOIDCProvidersResponse(resp *http.Response) (res *ListOIDCProvidersOutputBody, _ error) { +func decodeListMirrorsResponse(resp *http.Response) (res *ListMirrorsOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -3901,7 +4433,7 @@ func decodeListOIDCProvidersResponse(resp *http.Response) (res *ListOIDCProvider } d := jx.DecodeBytes(buf) - var response ListOIDCProvidersOutputBody + var response ListMirrorsOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -3977,7 +4509,7 @@ func decodeListOIDCProvidersResponse(resp *http.Response) (res *ListOIDCProvider return res, errors.Wrap(defRes, "error") } -func decodeListOrgCIBuildkiteClustersResponse(resp *http.Response) (res *ListOrgCIBuildkiteClustersOutputBody, _ error) { +func decodeListNativeMirrorsResponse(resp *http.Response) (res *ListNativeMirrorsOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -3993,7 +4525,7 @@ func decodeListOrgCIBuildkiteClustersResponse(resp *http.Response) (res *ListOrg } d := jx.DecodeBytes(buf) - var response ListOrgCIBuildkiteClustersOutputBody + var response ListNativeMirrorsOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -4069,7 +4601,7 @@ func decodeListOrgCIBuildkiteClustersResponse(resp *http.Response) (res *ListOrg return res, errors.Wrap(defRes, "error") } -func decodeListOrgCIBuildkiteCredentialsResponse(resp *http.Response) (res *ListOrgCIBuildkiteCredentialsOutputBody, _ error) { +func decodeListOIDCProvidersResponse(resp *http.Response) (res *ListOIDCProvidersOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -4085,7 +4617,7 @@ func decodeListOrgCIBuildkiteCredentialsResponse(resp *http.Response) (res *List } d := jx.DecodeBytes(buf) - var response ListOrgCIBuildkiteCredentialsOutputBody + var response ListOIDCProvidersOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -4161,7 +4693,7 @@ func decodeListOrgCIBuildkiteCredentialsResponse(resp *http.Response) (res *List return res, errors.Wrap(defRes, "error") } -func decodeListOrgMembersResponse(resp *http.Response) (res *ListOrgMembersOutputBody, _ error) { +func decodeListOrgCIBuildkiteClustersResponse(resp *http.Response) (res *ListOrgCIBuildkiteClustersOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -4177,7 +4709,7 @@ func decodeListOrgMembersResponse(resp *http.Response) (res *ListOrgMembersOutpu } d := jx.DecodeBytes(buf) - var response ListOrgMembersOutputBody + var response ListOrgCIBuildkiteClustersOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -4253,7 +4785,7 @@ func decodeListOrgMembersResponse(resp *http.Response) (res *ListOrgMembersOutpu return res, errors.Wrap(defRes, "error") } -func decodeListOrgProjectsResponse(resp *http.Response) (res *ListOrgProjectsOutputBody, _ error) { +func decodeListOrgCIBuildkiteCredentialsResponse(resp *http.Response) (res *ListOrgCIBuildkiteCredentialsOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -4269,7 +4801,7 @@ func decodeListOrgProjectsResponse(resp *http.Response) (res *ListOrgProjectsOut } d := jx.DecodeBytes(buf) - var response ListOrgProjectsOutputBody + var response ListOrgCIBuildkiteCredentialsOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -4345,7 +4877,7 @@ func decodeListOrgProjectsResponse(resp *http.Response) (res *ListOrgProjectsOut return res, errors.Wrap(defRes, "error") } -func decodeListOrgsResponse(resp *http.Response) (res *ListOrgsOutputBodyHeaders, _ error) { +func decodeListOrgCIDepotOrganizationsResponse(resp *http.Response) (res *ListOrgCIDepotOrganizationsOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -4361,7 +4893,7 @@ func decodeListOrgsResponse(resp *http.Response) (res *ListOrgsOutputBodyHeaders } d := jx.DecodeBytes(buf) - var response ListOrgsOutputBody + var response ListOrgCIDepotOrganizationsOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -4378,121 +4910,1081 @@ func decodeListOrgsResponse(resp *http.Response) (res *ListOrgsOutputBodyHeaders } return res, err } - var wrapper ListOrgsOutputBodyHeaders - wrapper.Response = response - h := uri.NewHeaderDecoder(resp.Header) - // Parse "Cache-Control" header. - { - cfg := uri.HeaderParameterDecodingConfig{ - Name: "Cache-Control", - Explode: false, + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err } - if err := func() error { - if err := h.HasParam(cfg); err == nil { - if err := h.DecodeParam(cfg, func(d uri.Decoder) error { - var wrapperDotCacheControlVal string - if err := func() error { - val, err := d.DecodeValue() - if err != nil { - return err - } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/problem+json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ErrorModel + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil + default: + return res, validate.InvalidContentType(ct) + } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} + +func decodeListOrgInvitationsResponse(resp *http.Response) (res *ListOrgInvitationsOutputBody, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ListOrgInvitationsOutputBody + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/problem+json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ErrorModel + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil + default: + return res, validate.InvalidContentType(ct) + } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} + +func decodeListOrgMembersResponse(resp *http.Response) (res *ListOrgMembersOutputBody, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ListOrgMembersOutputBody + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/problem+json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ErrorModel + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil + default: + return res, validate.InvalidContentType(ct) + } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} + +func decodeListOrgPeopleResponse(resp *http.Response) (res *ListOrgPeopleOutputBodyHeaders, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ListOrgPeopleOutputBody + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + var wrapper ListOrgPeopleOutputBodyHeaders + wrapper.Response = response + h := uri.NewHeaderDecoder(resp.Header) + // Parse "Cache-Control" header. + { + cfg := uri.HeaderParameterDecodingConfig{ + Name: "Cache-Control", + Explode: false, + } + if err := func() error { + if err := h.HasParam(cfg); err == nil { + if err := h.DecodeParam(cfg, func(d uri.Decoder) error { + var wrapperDotCacheControlVal string + if err := func() error { + val, err := d.DecodeValue() + if err != nil { + return err + } + + c, err := conv.ToString(val) + if err != nil { + return err + } + + wrapperDotCacheControlVal = c + return nil + }(); err != nil { + return err + } + wrapper.CacheControl.SetTo(wrapperDotCacheControlVal) + return nil + }); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "parse Cache-Control header") + } + } + return &wrapper, nil + default: + return res, validate.InvalidContentType(ct) + } + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/problem+json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ErrorModel + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil + default: + return res, validate.InvalidContentType(ct) + } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} + +func decodeListOrgProjectsResponse(resp *http.Response) (res *ListOrgProjectsOutputBody, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ListOrgProjectsOutputBody + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/problem+json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ErrorModel + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil + default: + return res, validate.InvalidContentType(ct) + } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} + +func decodeListOrgsResponse(resp *http.Response) (res *ListOrgsOutputBodyHeaders, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ListOrgsOutputBody + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + var wrapper ListOrgsOutputBodyHeaders + wrapper.Response = response + h := uri.NewHeaderDecoder(resp.Header) + // Parse "Cache-Control" header. + { + cfg := uri.HeaderParameterDecodingConfig{ + Name: "Cache-Control", + Explode: false, + } + if err := func() error { + if err := h.HasParam(cfg); err == nil { + if err := h.DecodeParam(cfg, func(d uri.Decoder) error { + var wrapperDotCacheControlVal string + if err := func() error { + val, err := d.DecodeValue() + if err != nil { + return err + } + + c, err := conv.ToString(val) + if err != nil { + return err + } + + wrapperDotCacheControlVal = c + return nil + }(); err != nil { + return err + } + wrapper.CacheControl.SetTo(wrapperDotCacheControlVal) + return nil + }); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "parse Cache-Control header") + } + } + // Parse "ETag" header. + { + cfg := uri.HeaderParameterDecodingConfig{ + Name: "ETag", + Explode: false, + } + if err := func() error { + if err := h.HasParam(cfg); err == nil { + if err := h.DecodeParam(cfg, func(d uri.Decoder) error { + var wrapperDotETagVal string + if err := func() error { + val, err := d.DecodeValue() + if err != nil { + return err + } + + c, err := conv.ToString(val) + if err != nil { + return err + } + + wrapperDotETagVal = c + return nil + }(); err != nil { + return err + } + wrapper.ETag.SetTo(wrapperDotETagVal) + return nil + }); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "parse ETag header") + } + } + // Parse "Vary" header. + { + cfg := uri.HeaderParameterDecodingConfig{ + Name: "Vary", + Explode: false, + } + if err := func() error { + if err := h.HasParam(cfg); err == nil { + if err := h.DecodeParam(cfg, func(d uri.Decoder) error { + var wrapperDotVaryVal string + if err := func() error { + val, err := d.DecodeValue() + if err != nil { + return err + } + + c, err := conv.ToString(val) + if err != nil { + return err + } + + wrapperDotVaryVal = c + return nil + }(); err != nil { + return err + } + wrapper.Vary.SetTo(wrapperDotVaryVal) + return nil + }); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "parse Vary header") + } + } + return &wrapper, nil + default: + return res, validate.InvalidContentType(ct) + } + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/problem+json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ErrorModel + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil + default: + return res, validate.InvalidContentType(ct) + } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} + +func decodeListProjectMembersResponse(resp *http.Response) (res *ListProjectMembersOutputBody, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ListProjectMembersOutputBody + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/problem+json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ErrorModel + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil + default: + return res, validate.InvalidContentType(ct) + } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} + +func decodeListProjectPeopleResponse(resp *http.Response) (res *ResourcePeopleOutputBody, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ResourcePeopleOutputBody + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/problem+json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ErrorModel + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil + default: + return res, validate.InvalidContentType(ct) + } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} - c, err := conv.ToString(val) - if err != nil { - return err - } +func decodeListProjectReposResponse(resp *http.Response) (res *ListProjectReposOutputBody, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) - wrapperDotCacheControlVal = c - return nil - }(); err != nil { - return err - } - wrapper.CacheControl.SetTo(wrapperDotCacheControlVal) - return nil - }); err != nil { - return err - } - } - return nil - }(); err != nil { - return res, errors.Wrap(err, "parse Cache-Control header") + var response ListProjectReposOutputBody + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err } - // Parse "ETag" header. - { - cfg := uri.HeaderParameterDecodingConfig{ - Name: "ETag", - Explode: false, + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err } - if err := func() error { - if err := h.HasParam(cfg); err == nil { - if err := h.DecodeParam(cfg, func(d uri.Decoder) error { - var wrapperDotETagVal string - if err := func() error { - val, err := d.DecodeValue() - if err != nil { - return err - } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/problem+json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) - c, err := conv.ToString(val) - if err != nil { - return err - } + var response ErrorModel + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil + default: + return res, validate.InvalidContentType(ct) + } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} - wrapperDotETagVal = c - return nil - }(); err != nil { - return err - } - wrapper.ETag.SetTo(wrapperDotETagVal) - return nil - }); err != nil { - return err - } - } - return nil - }(); err != nil { - return res, errors.Wrap(err, "parse ETag header") +func decodeListProjectsResponse(resp *http.Response) (res *ListProjectsOutputBody, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ListProjectsOutputBody + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, } + return res, err } - // Parse "Vary" header. - { - cfg := uri.HeaderParameterDecodingConfig{ - Name: "Vary", - Explode: false, + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err } - if err := func() error { - if err := h.HasParam(cfg); err == nil { - if err := h.DecodeParam(cfg, func(d uri.Decoder) error { - var wrapperDotVaryVal string - if err := func() error { - val, err := d.DecodeValue() - if err != nil { - return err - } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/problem+json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ErrorModel + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil + default: + return res, validate.InvalidContentType(ct) + } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} - c, err := conv.ToString(val) - if err != nil { - return err - } +func decodeListRepoCIBuildsResponse(resp *http.Response) (res *ListRepoCIBuildsOutputBody, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) - wrapperDotVaryVal = c - return nil - }(); err != nil { - return err - } - wrapper.Vary.SetTo(wrapperDotVaryVal) - return nil - }); err != nil { - return err - } - } - return nil - }(); err != nil { - return res, errors.Wrap(err, "parse Vary header") + var response ListRepoCIBuildsOutputBody + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, } + return res, err } - return &wrapper, nil + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil default: return res, validate.InvalidContentType(ct) } @@ -4542,7 +6034,7 @@ func decodeListOrgsResponse(resp *http.Response) (res *ListOrgsOutputBodyHeaders return res, errors.Wrap(defRes, "error") } -func decodeListProjectMembersResponse(resp *http.Response) (res *ListProjectMembersOutputBody, _ error) { +func decodeListRepoCIDeliveriesResponse(resp *http.Response) (res *ListRepoCIDeliveriesOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -4558,7 +6050,7 @@ func decodeListProjectMembersResponse(resp *http.Response) (res *ListProjectMemb } d := jx.DecodeBytes(buf) - var response ListProjectMembersOutputBody + var response ListRepoCIDeliveriesOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -4634,7 +6126,7 @@ func decodeListProjectMembersResponse(resp *http.Response) (res *ListProjectMemb return res, errors.Wrap(defRes, "error") } -func decodeListProjectReposResponse(resp *http.Response) (res *ListProjectReposOutputBody, _ error) { +func decodeListRepoCIProvidersResponse(resp *http.Response) (res *ListRepoCIProvidersOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -4650,7 +6142,7 @@ func decodeListProjectReposResponse(resp *http.Response) (res *ListProjectReposO } d := jx.DecodeBytes(buf) - var response ListProjectReposOutputBody + var response ListRepoCIProvidersOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -4667,6 +6159,15 @@ func decodeListProjectReposResponse(resp *http.Response) (res *ListProjectReposO } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4717,7 +6218,7 @@ func decodeListProjectReposResponse(resp *http.Response) (res *ListProjectReposO return res, errors.Wrap(defRes, "error") } -func decodeListProjectsResponse(resp *http.Response) (res *ListProjectsOutputBody, _ error) { +func decodeListRepoCIWebhookAuditResponse(resp *http.Response) (res *ListRepoCIWebhookAuditOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -4733,7 +6234,7 @@ func decodeListProjectsResponse(resp *http.Response) (res *ListProjectsOutputBod } d := jx.DecodeBytes(buf) - var response ListProjectsOutputBody + var response ListRepoCIWebhookAuditOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -4809,7 +6310,7 @@ func decodeListProjectsResponse(resp *http.Response) (res *ListProjectsOutputBod return res, errors.Wrap(defRes, "error") } -func decodeListRepoCIBuildsResponse(resp *http.Response) (res *ListRepoCIBuildsOutputBody, _ error) { +func decodeListRepoCIWebhooksResponse(resp *http.Response) (res *ListRepoCIWebhooksOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -4825,7 +6326,7 @@ func decodeListRepoCIBuildsResponse(resp *http.Response) (res *ListRepoCIBuildsO } d := jx.DecodeBytes(buf) - var response ListRepoCIBuildsOutputBody + var response ListRepoCIWebhooksOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -4901,7 +6402,7 @@ func decodeListRepoCIBuildsResponse(resp *http.Response) (res *ListRepoCIBuildsO return res, errors.Wrap(defRes, "error") } -func decodeListRepoCIProvidersResponse(resp *http.Response) (res *ListRepoCIProvidersOutputBody, _ error) { +func decodeListRepoCollaboratorsResponse(resp *http.Response) (res *ListRepoCollaboratorsOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -4917,7 +6418,7 @@ func decodeListRepoCIProvidersResponse(resp *http.Response) (res *ListRepoCIProv } d := jx.DecodeBytes(buf) - var response ListRepoCIProvidersOutputBody + var response ListRepoCollaboratorsOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -4993,7 +6494,7 @@ func decodeListRepoCIProvidersResponse(resp *http.Response) (res *ListRepoCIProv return res, errors.Wrap(defRes, "error") } -func decodeListRepoCIWebhookAuditResponse(resp *http.Response) (res *ListRepoCIWebhookAuditOutputBody, _ error) { +func decodeListRepoGrantsResponse(resp *http.Response) (res *ListRepoGrantsOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -5009,7 +6510,7 @@ func decodeListRepoCIWebhookAuditResponse(resp *http.Response) (res *ListRepoCIW } d := jx.DecodeBytes(buf) - var response ListRepoCIWebhookAuditOutputBody + var response ListRepoGrantsOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -5085,7 +6586,7 @@ func decodeListRepoCIWebhookAuditResponse(resp *http.Response) (res *ListRepoCIW return res, errors.Wrap(defRes, "error") } -func decodeListRepoCIWebhooksResponse(resp *http.Response) (res *ListRepoCIWebhooksOutputBody, _ error) { +func decodeListRepoLanguageFacetsResponse(resp *http.Response) (res *RepoFacetPage, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -5101,7 +6602,7 @@ func decodeListRepoCIWebhooksResponse(resp *http.Response) (res *ListRepoCIWebho } d := jx.DecodeBytes(buf) - var response ListRepoCIWebhooksOutputBody + var response RepoFacetPage if err := func() error { if err := response.Decode(d); err != nil { return err @@ -5177,7 +6678,7 @@ func decodeListRepoCIWebhooksResponse(resp *http.Response) (res *ListRepoCIWebho return res, errors.Wrap(defRes, "error") } -func decodeListRepoCollaboratorsResponse(resp *http.Response) (res *ListRepoCollaboratorsOutputBody, _ error) { +func decodeListRepoOrgFacetsResponse(resp *http.Response) (res *RepoFacetPage, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -5193,7 +6694,7 @@ func decodeListRepoCollaboratorsResponse(resp *http.Response) (res *ListRepoColl } d := jx.DecodeBytes(buf) - var response ListRepoCollaboratorsOutputBody + var response RepoFacetPage if err := func() error { if err := response.Decode(d); err != nil { return err @@ -5269,7 +6770,7 @@ func decodeListRepoCollaboratorsResponse(resp *http.Response) (res *ListRepoColl return res, errors.Wrap(defRes, "error") } -func decodeListRepoGrantsResponse(resp *http.Response) (res *ListRepoGrantsOutputBody, _ error) { +func decodeListRepoPeopleResponse(resp *http.Response) (res *ResourcePeopleOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -5285,7 +6786,7 @@ func decodeListRepoGrantsResponse(resp *http.Response) (res *ListRepoGrantsOutpu } d := jx.DecodeBytes(buf) - var response ListRepoGrantsOutputBody + var response ResourcePeopleOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -5361,7 +6862,7 @@ func decodeListRepoGrantsResponse(resp *http.Response) (res *ListRepoGrantsOutpu return res, errors.Wrap(defRes, "error") } -func decodeListRepoLanguageFacetsResponse(resp *http.Response) (res *RepoFacetPage, _ error) { +func decodeListReposResponse(resp *http.Response) (res *ListReposOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -5377,7 +6878,7 @@ func decodeListRepoLanguageFacetsResponse(resp *http.Response) (res *RepoFacetPa } d := jx.DecodeBytes(buf) - var response RepoFacetPage + var response ListReposOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -5453,7 +6954,7 @@ func decodeListRepoLanguageFacetsResponse(resp *http.Response) (res *RepoFacetPa return res, errors.Wrap(defRes, "error") } -func decodeListRepoOrgFacetsResponse(resp *http.Response) (res *RepoFacetPage, _ error) { +func decodeListServiceAccountGrantsResponse(resp *http.Response) (res *ListServiceAccountGrantsOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -5469,7 +6970,7 @@ func decodeListRepoOrgFacetsResponse(resp *http.Response) (res *RepoFacetPage, _ } d := jx.DecodeBytes(buf) - var response RepoFacetPage + var response ListServiceAccountGrantsOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -5545,7 +7046,7 @@ func decodeListRepoOrgFacetsResponse(resp *http.Response) (res *RepoFacetPage, _ return res, errors.Wrap(defRes, "error") } -func decodeListReposResponse(resp *http.Response) (res *ListReposOutputBody, _ error) { +func decodeListServiceAccountsResponse(resp *http.Response) (res *ListServiceAccountsOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -5561,7 +7062,7 @@ func decodeListReposResponse(resp *http.Response) (res *ListReposOutputBody, _ e } d := jx.DecodeBytes(buf) - var response ListReposOutputBody + var response ListServiceAccountsOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -5637,7 +7138,7 @@ func decodeListReposResponse(resp *http.Response) (res *ListReposOutputBody, _ e return res, errors.Wrap(defRes, "error") } -func decodeListServiceAccountGrantsResponse(resp *http.Response) (res *ListServiceAccountGrantsOutputBody, _ error) { +func decodeLookupRepoBySlugResponse(resp *http.Response) (res *LookupBySlugOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -5653,7 +7154,7 @@ func decodeListServiceAccountGrantsResponse(resp *http.Response) (res *ListServi } d := jx.DecodeBytes(buf) - var response ListServiceAccountGrantsOutputBody + var response LookupBySlugOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -5670,14 +7171,88 @@ func decodeListServiceAccountGrantsResponse(resp *http.Response) (res *ListServi } return res, err } - // Validate response. + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/problem+json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ErrorModel if err := func() error { - if err := response.Validate(); err != nil { + if err := response.Decode(d); err != nil { return err } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } return nil }(); err != nil { - return res, errors.Wrap(err, "validate") + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil + default: + return res, validate.InvalidContentType(ct) + } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} + +func decodeMintOrgCIGitHubActionsCredentialResponse(resp *http.Response) (res *OrgCIGitHubActionsCredentialView, _ error) { + switch resp.StatusCode { + case 201: + // Code 201. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response OrgCIGitHubActionsCredentialView + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err } return &response, nil default: @@ -5729,7 +7304,7 @@ func decodeListServiceAccountGrantsResponse(resp *http.Response) (res *ListServi return res, errors.Wrap(defRes, "error") } -func decodeListServiceAccountsResponse(resp *http.Response) (res *ListServiceAccountsOutputBody, _ error) { +func decodePatchRepoCIWebhookResponse(resp *http.Response) (res *CIWebhookView, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -5745,7 +7320,7 @@ func decodeListServiceAccountsResponse(resp *http.Response) (res *ListServiceAcc } d := jx.DecodeBytes(buf) - var response ListServiceAccountsOutputBody + var response CIWebhookView if err := func() error { if err := response.Decode(d); err != nil { return err @@ -5821,7 +7396,7 @@ func decodeListServiceAccountsResponse(resp *http.Response) (res *ListServiceAcc return res, errors.Wrap(defRes, "error") } -func decodeLookupRepoBySlugResponse(resp *http.Response) (res *LookupBySlugOutputBody, _ error) { +func decodePreviewInvitationResponse(resp *http.Response) (res *PreviewInvitationOKHeaders, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -5837,7 +7412,7 @@ func decodeLookupRepoBySlugResponse(resp *http.Response) (res *LookupBySlugOutpu } d := jx.DecodeBytes(buf) - var response LookupBySlugOutputBody + var response PreviewInvitationOK if err := func() error { if err := response.Decode(d); err != nil { return err @@ -5852,9 +7427,58 @@ func decodeLookupRepoBySlugResponse(resp *http.Response) (res *LookupBySlugOutpu Body: buf, Err: err, } - return res, err + return res, err + } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + var wrapper PreviewInvitationOKHeaders + wrapper.Response = response + h := uri.NewHeaderDecoder(resp.Header) + // Parse "Cache-Control" header. + { + cfg := uri.HeaderParameterDecodingConfig{ + Name: "Cache-Control", + Explode: false, + } + if err := func() error { + if err := h.HasParam(cfg); err == nil { + if err := h.DecodeParam(cfg, func(d uri.Decoder) error { + var wrapperDotCacheControlVal string + if err := func() error { + val, err := d.DecodeValue() + if err != nil { + return err + } + + c, err := conv.ToString(val) + if err != nil { + return err + } + + wrapperDotCacheControlVal = c + return nil + }(); err != nil { + return err + } + wrapper.CacheControl.SetTo(wrapperDotCacheControlVal) + return nil + }); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "parse Cache-Control header") + } } - return &response, nil + return &wrapper, nil default: return res, validate.InvalidContentType(ct) } @@ -5904,7 +7528,7 @@ func decodeLookupRepoBySlugResponse(resp *http.Response) (res *LookupBySlugOutpu return res, errors.Wrap(defRes, "error") } -func decodeMintOrgCIGitHubActionsCredentialResponse(resp *http.Response) (res *OrgCIGitHubActionsCredentialView, _ error) { +func decodeRegisterOrgCIBuildkiteClusterResponse(resp *http.Response) (res *OrgCIBuildkiteClusterView, _ error) { switch resp.StatusCode { case 201: // Code 201. @@ -5920,7 +7544,7 @@ func decodeMintOrgCIGitHubActionsCredentialResponse(resp *http.Response) (res *O } d := jx.DecodeBytes(buf) - var response OrgCIGitHubActionsCredentialView + var response OrgCIBuildkiteClusterView if err := func() error { if err := response.Decode(d); err != nil { return err @@ -5987,52 +7611,11 @@ func decodeMintOrgCIGitHubActionsCredentialResponse(resp *http.Response) (res *O return res, errors.Wrap(defRes, "error") } -func decodePatchRepoCIWebhookResponse(resp *http.Response) (res *CIWebhookView, _ error) { +func decodeRemoveOrgMemberResponse(resp *http.Response) (res *RemoveOrgMemberNoContent, _ error) { switch resp.StatusCode { - case 200: - // Code 200. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response CIWebhookView - if err := func() error { - if err := response.Decode(d); err != nil { - return err - } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") - } - return nil - }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err - } - // Validate response. - if err := func() error { - if err := response.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - return res, errors.Wrap(err, "validate") - } - return &response, nil - default: - return res, validate.InvalidContentType(ct) - } + case 204: + // Code 204. + return &RemoveOrgMemberNoContent{}, nil } // Convenient error response. defRes, err := func() (res *ErrorModelStatusCode, err error) { @@ -6079,10 +7662,10 @@ func decodePatchRepoCIWebhookResponse(resp *http.Response) (res *CIWebhookView, return res, errors.Wrap(defRes, "error") } -func decodeRegisterOrgCIBuildkiteClusterResponse(resp *http.Response) (res *OrgCIBuildkiteClusterView, _ error) { +func decodeResolveHandleResponse(resp *http.Response) (res *ResolvedIdentity, _ error) { switch resp.StatusCode { - case 201: - // Code 201. + case 200: + // Code 200. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -6095,7 +7678,7 @@ func decodeRegisterOrgCIBuildkiteClusterResponse(resp *http.Response) (res *OrgC } d := jx.DecodeBytes(buf) - var response OrgCIBuildkiteClusterView + var response ResolvedIdentity if err := func() error { if err := response.Decode(d); err != nil { return err @@ -6162,27 +7745,23 @@ func decodeRegisterOrgCIBuildkiteClusterResponse(resp *http.Response) (res *OrgC return res, errors.Wrap(defRes, "error") } -func decodeRemoveOrgMemberResponse(resp *http.Response) (res *RemoveOrgMemberNoContent, _ error) { +func decodeResolveMirrorPlacementsResponse(resp *http.Response) (res *ResolvePlacementsOutputBody, _ error) { switch resp.StatusCode { - case 204: - // Code 204. - return &RemoveOrgMemberNoContent{}, nil - } - // Convenient error response. - defRes, err := func() (res *ErrorModelStatusCode, err error) { + case 200: + // Code 200. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") } switch { - case ct == "application/problem+json": + case ct == "application/json": buf, err := io.ReadAll(resp.Body) if err != nil { return res, err } d := jx.DecodeBytes(buf) - var response ErrorModel + var response ResolvePlacementsOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -6199,52 +7778,14 @@ func decodeRemoveOrgMemberResponse(resp *http.Response) (res *RemoveOrgMemberNoC } return res, err } - return &ErrorModelStatusCode{ - StatusCode: resp.StatusCode, - Response: response, - }, nil - default: - return res, validate.InvalidContentType(ct) - } - }() - if err != nil { - return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) - } - return res, errors.Wrap(defRes, "error") -} - -func decodeResolveHandleResponse(resp *http.Response) (res *ResolvedIdentity, _ error) { - switch resp.StatusCode { - case 200: - // Code 200. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response ResolvedIdentity + // Validate response. if err := func() error { - if err := response.Decode(d); err != nil { + if err := response.Validate(); err != nil { return err } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") - } return nil }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err + return res, errors.Wrap(err, "validate") } return &response, nil default: @@ -6296,7 +7837,7 @@ func decodeResolveHandleResponse(resp *http.Response) (res *ResolvedIdentity, _ return res, errors.Wrap(defRes, "error") } -func decodeResolveMirrorPlacementsResponse(resp *http.Response) (res *ResolvePlacementsOutputBody, _ error) { +func decodeResolveProjectResponse(resp *http.Response) (res *ResolveProjectOutputBody, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -6312,7 +7853,7 @@ func decodeResolveMirrorPlacementsResponse(resp *http.Response) (res *ResolvePla } d := jx.DecodeBytes(buf) - var response ResolvePlacementsOutputBody + var response ResolveProjectOutputBody if err := func() error { if err := response.Decode(d); err != nil { return err @@ -6572,6 +8113,57 @@ func decodeResolveReposResponse(resp *http.Response) (res *ResolveReposResponse, return res, errors.Wrap(defRes, "error") } +func decodeRevokeOrgInvitationResponse(resp *http.Response) (res *RevokeOrgInvitationNoContent, _ error) { + switch resp.StatusCode { + case 204: + // Code 204. + return &RevokeOrgInvitationNoContent{}, nil + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/problem+json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ErrorModel + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil + default: + return res, validate.InvalidContentType(ct) + } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} + func decodeRevokeProjectAccessResponse(resp *http.Response) (res *RevokeProjectAccessNoContent, _ error) { switch resp.StatusCode { case 204: @@ -7185,3 +8777,86 @@ func decodeUpdateBranchProtectionResponse(resp *http.Response) (res *BranchProte } return res, errors.Wrap(defRes, "error") } + +func decodeUpdateOrgMemberRoleResponse(resp *http.Response) (res *Membership, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response Membership + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + // Convenient error response. + defRes, err := func() (res *ErrorModelStatusCode, err error) { + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/problem+json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ErrorModel + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &ErrorModelStatusCode{ + StatusCode: resp.StatusCode, + Response: response, + }, nil + default: + return res, validate.InvalidContentType(ct) + } + }() + if err != nil { + return res, errors.Wrapf(err, "default (code %d)", resp.StatusCode) + } + return res, errors.Wrap(defRes, "error") +} diff --git a/internal/coreapi/oas_schemas_gen.go b/internal/coreapi/oas_schemas_gen.go index 55a2096c00..210dc442a0 100644 --- a/internal/coreapi/oas_schemas_gen.go +++ b/internal/coreapi/oas_schemas_gen.go @@ -16,6 +16,188 @@ func (s *ErrorModelStatusCode) Error() string { return fmt.Sprintf("code %d: %+v", s.StatusCode, s.Response) } +// Ref: #/components/schemas/AcceptInvitationInputBody +type AcceptInvitationInputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Token string `json:"token"` + AdditionalProps AcceptInvitationInputBodyAdditional +} + +// GetSchema returns the value of Schema. +func (s *AcceptInvitationInputBody) GetSchema() OptURI { + return s.Schema +} + +// GetToken returns the value of Token. +func (s *AcceptInvitationInputBody) GetToken() string { + return s.Token +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *AcceptInvitationInputBody) GetAdditionalProps() AcceptInvitationInputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *AcceptInvitationInputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetToken sets the value of Token. +func (s *AcceptInvitationInputBody) SetToken(val string) { + s.Token = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *AcceptInvitationInputBody) SetAdditionalProps(val AcceptInvitationInputBodyAdditional) { + s.AdditionalProps = val +} + +type AcceptInvitationInputBodyAdditional map[string]jx.Raw + +func (s *AcceptInvitationInputBodyAdditional) init() AcceptInvitationInputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +type AcceptInvitationOK struct { + Membership Membership `json:"membership"` + OrgId string `json:"orgId"` + OrgName string `json:"orgName"` + AdditionalProps AcceptInvitationOKAdditional +} + +// GetMembership returns the value of Membership. +func (s *AcceptInvitationOK) GetMembership() Membership { + return s.Membership +} + +// GetOrgId returns the value of OrgId. +func (s *AcceptInvitationOK) GetOrgId() string { + return s.OrgId +} + +// GetOrgName returns the value of OrgName. +func (s *AcceptInvitationOK) GetOrgName() string { + return s.OrgName +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *AcceptInvitationOK) GetAdditionalProps() AcceptInvitationOKAdditional { + return s.AdditionalProps +} + +// SetMembership sets the value of Membership. +func (s *AcceptInvitationOK) SetMembership(val Membership) { + s.Membership = val +} + +// SetOrgId sets the value of OrgId. +func (s *AcceptInvitationOK) SetOrgId(val string) { + s.OrgId = val +} + +// SetOrgName sets the value of OrgName. +func (s *AcceptInvitationOK) SetOrgName(val string) { + s.OrgName = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *AcceptInvitationOK) SetAdditionalProps(val AcceptInvitationOKAdditional) { + s.AdditionalProps = val +} + +func (*AcceptInvitationOK) acceptInvitationRes() {} + +type AcceptInvitationOKAdditional map[string]jx.Raw + +func (s *AcceptInvitationOKAdditional) init() AcceptInvitationOKAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/AcceptedInvitation +type AcceptedInvitation struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Membership Membership `json:"membership"` + OrgId string `json:"orgId"` + OrgName string `json:"orgName"` + AdditionalProps AcceptedInvitationAdditional +} + +// GetSchema returns the value of Schema. +func (s *AcceptedInvitation) GetSchema() OptURI { + return s.Schema +} + +// GetMembership returns the value of Membership. +func (s *AcceptedInvitation) GetMembership() Membership { + return s.Membership +} + +// GetOrgId returns the value of OrgId. +func (s *AcceptedInvitation) GetOrgId() string { + return s.OrgId +} + +// GetOrgName returns the value of OrgName. +func (s *AcceptedInvitation) GetOrgName() string { + return s.OrgName +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *AcceptedInvitation) GetAdditionalProps() AcceptedInvitationAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *AcceptedInvitation) SetSchema(val OptURI) { + s.Schema = val +} + +// SetMembership sets the value of Membership. +func (s *AcceptedInvitation) SetMembership(val Membership) { + s.Membership = val +} + +// SetOrgId sets the value of OrgId. +func (s *AcceptedInvitation) SetOrgId(val string) { + s.OrgId = val +} + +// SetOrgName sets the value of OrgName. +func (s *AcceptedInvitation) SetOrgName(val string) { + s.OrgName = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *AcceptedInvitation) SetAdditionalProps(val AcceptedInvitationAdditional) { + s.AdditionalProps = val +} + +func (*AcceptedInvitation) acceptInvitationRes() {} + +type AcceptedInvitationAdditional map[string]jx.Raw + +func (s *AcceptedInvitationAdditional) init() AcceptedInvitationAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + // Ref: #/components/schemas/AddOrgMemberInputBody type AddOrgMemberInputBody struct { // A URL to the JSON Schema for this object. @@ -666,6 +848,57 @@ func (s *BranchRuleAdditional) init() BranchRuleAdditional { return m } +// Ref: #/components/schemas/BranchRuleUpdate +type BranchRuleUpdate struct { + // "HEAD" or a refs/heads/ name, fnmatch wildcards allowed. + Ref string `json:"ref"` + // Sets the level: true for server-side merge only, false for protected. Omit to keep an existing + // rule's level. + ServerSideMergeOnly OptBool `json:"serverSideMergeOnly"` + AdditionalProps BranchRuleUpdateAdditional +} + +// GetRef returns the value of Ref. +func (s *BranchRuleUpdate) GetRef() string { + return s.Ref +} + +// GetServerSideMergeOnly returns the value of ServerSideMergeOnly. +func (s *BranchRuleUpdate) GetServerSideMergeOnly() OptBool { + return s.ServerSideMergeOnly +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *BranchRuleUpdate) GetAdditionalProps() BranchRuleUpdateAdditional { + return s.AdditionalProps +} + +// SetRef sets the value of Ref. +func (s *BranchRuleUpdate) SetRef(val string) { + s.Ref = val +} + +// SetServerSideMergeOnly sets the value of ServerSideMergeOnly. +func (s *BranchRuleUpdate) SetServerSideMergeOnly(val OptBool) { + s.ServerSideMergeOnly = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *BranchRuleUpdate) SetAdditionalProps(val BranchRuleUpdateAdditional) { + s.AdditionalProps = val +} + +type BranchRuleUpdateAdditional map[string]jx.Raw + +func (s *BranchRuleUpdateAdditional) init() BranchRuleUpdateAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + // Ref: #/components/schemas/CIBuildView type CIBuildView struct { BkBuildUUID string `json:"bk_build_uuid"` @@ -890,332 +1123,312 @@ func (s *CIBuildViewAdditional) init() CIBuildViewAdditional { return m } -// Ref: #/components/schemas/CIJobView -type CIJobView struct { - BkJobID string `json:"bk_job_id"` - ExitStatus OptInt64 `json:"exit_status"` - FinishedAt OptDateTime `json:"finished_at"` - Name string `json:"name"` - StartedAt OptDateTime `json:"started_at"` - State string `json:"state"` - StepKey string `json:"step_key"` - Type string `json:"type"` - AdditionalProps CIJobViewAdditional +// Ref: #/components/schemas/CIDeliveryDetailView +type CIDeliveryDetailView struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + // Vendor account (Buildkite org, Depot org). + Account OptString `json:"account"` + // When the delivery started or arrived (UTC). + At time.Time `json:"at"` + // Attempts made; outbound only. + AttemptCount OptInt64 `json:"attempt_count"` + // When an outbound delivery reached a terminal state (UTC). + CompletedAt OptDateTime `json:"completed_at"` + // Outbound or inbound. + Direction string `json:"direction"` + // Subscription display name. + DisplayName OptString `json:"display_name"` + // How long the delivery took, milliseconds. + DurationMs OptInt64 `json:"duration_ms"` + // Vendor event type, e.g. build.finished. + Event OptString `json:"event"` + // HTTP status, absent when no request was made. + HTTPStatus OptInt64 `json:"http_status"` + // Opaque delivery id; pass to the delivery detail route. + ID string `json:"id"` + // Content identity after the change. + NewTarget OptString `json:"new_target"` + // Content identity before the change. + OldTarget OptString `json:"old_target"` + // Five-valued outcome; the vocabularies differ by direction. + Outcome string `json:"outcome"` + // Absent when swept or never stored. + Payload OptCIDeliveryPayloadView `json:"payload"` + // Swept or no_request; empty when a payload is present. + PayloadAbsent OptString `json:"payload_absent"` + // CI provider registry name. + Provider string `json:"provider"` + // Ref that moved. + Ref OptString `json:"ref"` + // Ref operation. Empty means unknown — never guess it from the targets. + RefOp OptString `json:"ref_op"` + // Repository ULID, empty when the delivery resolved to no enrolment. + RepoID OptString `json:"repo_id"` + // Outbound dispatch state. + State OptString `json:"state"` + // Subscription ULID, empty when none was resolved. + SubscriptionID OptString `json:"subscription_id"` + // Vendor target (Buildkite pipeline, Depot run label). + Target OptString `json:"target"` + // The vendor's own id for this delivery. + WireRequestID OptString `json:"wire_request_id"` + AdditionalProps CIDeliveryDetailViewAdditional } -// GetBkJobID returns the value of BkJobID. -func (s *CIJobView) GetBkJobID() string { - return s.BkJobID +// GetSchema returns the value of Schema. +func (s *CIDeliveryDetailView) GetSchema() OptURI { + return s.Schema } -// GetExitStatus returns the value of ExitStatus. -func (s *CIJobView) GetExitStatus() OptInt64 { - return s.ExitStatus +// GetAccount returns the value of Account. +func (s *CIDeliveryDetailView) GetAccount() OptString { + return s.Account } -// GetFinishedAt returns the value of FinishedAt. -func (s *CIJobView) GetFinishedAt() OptDateTime { - return s.FinishedAt +// GetAt returns the value of At. +func (s *CIDeliveryDetailView) GetAt() time.Time { + return s.At } -// GetName returns the value of Name. -func (s *CIJobView) GetName() string { - return s.Name +// GetAttemptCount returns the value of AttemptCount. +func (s *CIDeliveryDetailView) GetAttemptCount() OptInt64 { + return s.AttemptCount } -// GetStartedAt returns the value of StartedAt. -func (s *CIJobView) GetStartedAt() OptDateTime { - return s.StartedAt +// GetCompletedAt returns the value of CompletedAt. +func (s *CIDeliveryDetailView) GetCompletedAt() OptDateTime { + return s.CompletedAt } -// GetState returns the value of State. -func (s *CIJobView) GetState() string { - return s.State +// GetDirection returns the value of Direction. +func (s *CIDeliveryDetailView) GetDirection() string { + return s.Direction } -// GetStepKey returns the value of StepKey. -func (s *CIJobView) GetStepKey() string { - return s.StepKey +// GetDisplayName returns the value of DisplayName. +func (s *CIDeliveryDetailView) GetDisplayName() OptString { + return s.DisplayName } -// GetType returns the value of Type. -func (s *CIJobView) GetType() string { - return s.Type +// GetDurationMs returns the value of DurationMs. +func (s *CIDeliveryDetailView) GetDurationMs() OptInt64 { + return s.DurationMs } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *CIJobView) GetAdditionalProps() CIJobViewAdditional { - return s.AdditionalProps +// GetEvent returns the value of Event. +func (s *CIDeliveryDetailView) GetEvent() OptString { + return s.Event } -// SetBkJobID sets the value of BkJobID. -func (s *CIJobView) SetBkJobID(val string) { - s.BkJobID = val +// GetHTTPStatus returns the value of HTTPStatus. +func (s *CIDeliveryDetailView) GetHTTPStatus() OptInt64 { + return s.HTTPStatus } -// SetExitStatus sets the value of ExitStatus. -func (s *CIJobView) SetExitStatus(val OptInt64) { - s.ExitStatus = val +// GetID returns the value of ID. +func (s *CIDeliveryDetailView) GetID() string { + return s.ID } -// SetFinishedAt sets the value of FinishedAt. -func (s *CIJobView) SetFinishedAt(val OptDateTime) { - s.FinishedAt = val +// GetNewTarget returns the value of NewTarget. +func (s *CIDeliveryDetailView) GetNewTarget() OptString { + return s.NewTarget } -// SetName sets the value of Name. -func (s *CIJobView) SetName(val string) { - s.Name = val +// GetOldTarget returns the value of OldTarget. +func (s *CIDeliveryDetailView) GetOldTarget() OptString { + return s.OldTarget } -// SetStartedAt sets the value of StartedAt. -func (s *CIJobView) SetStartedAt(val OptDateTime) { - s.StartedAt = val +// GetOutcome returns the value of Outcome. +func (s *CIDeliveryDetailView) GetOutcome() string { + return s.Outcome } -// SetState sets the value of State. -func (s *CIJobView) SetState(val string) { - s.State = val +// GetPayload returns the value of Payload. +func (s *CIDeliveryDetailView) GetPayload() OptCIDeliveryPayloadView { + return s.Payload } -// SetStepKey sets the value of StepKey. -func (s *CIJobView) SetStepKey(val string) { - s.StepKey = val +// GetPayloadAbsent returns the value of PayloadAbsent. +func (s *CIDeliveryDetailView) GetPayloadAbsent() OptString { + return s.PayloadAbsent } -// SetType sets the value of Type. -func (s *CIJobView) SetType(val string) { - s.Type = val +// GetProvider returns the value of Provider. +func (s *CIDeliveryDetailView) GetProvider() string { + return s.Provider } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *CIJobView) SetAdditionalProps(val CIJobViewAdditional) { - s.AdditionalProps = val +// GetRef returns the value of Ref. +func (s *CIDeliveryDetailView) GetRef() OptString { + return s.Ref } -type CIJobViewAdditional map[string]jx.Raw +// GetRefOp returns the value of RefOp. +func (s *CIDeliveryDetailView) GetRefOp() OptString { + return s.RefOp +} -func (s *CIJobViewAdditional) init() CIJobViewAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// GetRepoID returns the value of RepoID. +func (s *CIDeliveryDetailView) GetRepoID() OptString { + return s.RepoID } -// Ref: #/components/schemas/CIProviderDescriptor -type CIProviderDescriptor struct { - // Whether this org can enrol into this provider right now. - Enrollable bool `json:"enrollable"` - // Form fields, in the order a client should render them. - Fields []CIProviderField `json:"fields"` - // Human-readable provider name. - Label string `json:"label"` - // Ways of enrolling; exactly one is marked default. - Modes []CIProviderMode `json:"modes"` - // Provider key, posted back as the request's provider. - Name string `json:"name"` - // Why enrolment is unavailable; set only when enrollable is false. - Reason OptString `json:"reason"` - AdditionalProps CIProviderDescriptorAdditional -} - -// GetEnrollable returns the value of Enrollable. -func (s *CIProviderDescriptor) GetEnrollable() bool { - return s.Enrollable -} - -// GetFields returns the value of Fields. -func (s *CIProviderDescriptor) GetFields() []CIProviderField { - return s.Fields -} - -// GetLabel returns the value of Label. -func (s *CIProviderDescriptor) GetLabel() string { - return s.Label +// GetState returns the value of State. +func (s *CIDeliveryDetailView) GetState() OptString { + return s.State } -// GetModes returns the value of Modes. -func (s *CIProviderDescriptor) GetModes() []CIProviderMode { - return s.Modes +// GetSubscriptionID returns the value of SubscriptionID. +func (s *CIDeliveryDetailView) GetSubscriptionID() OptString { + return s.SubscriptionID } -// GetName returns the value of Name. -func (s *CIProviderDescriptor) GetName() string { - return s.Name +// GetTarget returns the value of Target. +func (s *CIDeliveryDetailView) GetTarget() OptString { + return s.Target } -// GetReason returns the value of Reason. -func (s *CIProviderDescriptor) GetReason() OptString { - return s.Reason +// GetWireRequestID returns the value of WireRequestID. +func (s *CIDeliveryDetailView) GetWireRequestID() OptString { + return s.WireRequestID } // GetAdditionalProps returns the value of AdditionalProps. -func (s *CIProviderDescriptor) GetAdditionalProps() CIProviderDescriptorAdditional { +func (s *CIDeliveryDetailView) GetAdditionalProps() CIDeliveryDetailViewAdditional { return s.AdditionalProps } -// SetEnrollable sets the value of Enrollable. -func (s *CIProviderDescriptor) SetEnrollable(val bool) { - s.Enrollable = val -} - -// SetFields sets the value of Fields. -func (s *CIProviderDescriptor) SetFields(val []CIProviderField) { - s.Fields = val -} - -// SetLabel sets the value of Label. -func (s *CIProviderDescriptor) SetLabel(val string) { - s.Label = val -} - -// SetModes sets the value of Modes. -func (s *CIProviderDescriptor) SetModes(val []CIProviderMode) { - s.Modes = val +// SetSchema sets the value of Schema. +func (s *CIDeliveryDetailView) SetSchema(val OptURI) { + s.Schema = val } -// SetName sets the value of Name. -func (s *CIProviderDescriptor) SetName(val string) { - s.Name = val +// SetAccount sets the value of Account. +func (s *CIDeliveryDetailView) SetAccount(val OptString) { + s.Account = val } -// SetReason sets the value of Reason. -func (s *CIProviderDescriptor) SetReason(val OptString) { - s.Reason = val +// SetAt sets the value of At. +func (s *CIDeliveryDetailView) SetAt(val time.Time) { + s.At = val } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *CIProviderDescriptor) SetAdditionalProps(val CIProviderDescriptorAdditional) { - s.AdditionalProps = val +// SetAttemptCount sets the value of AttemptCount. +func (s *CIDeliveryDetailView) SetAttemptCount(val OptInt64) { + s.AttemptCount = val } -type CIProviderDescriptorAdditional map[string]jx.Raw - -func (s *CIProviderDescriptorAdditional) init() CIProviderDescriptorAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// SetCompletedAt sets the value of CompletedAt. +func (s *CIDeliveryDetailView) SetCompletedAt(val OptDateTime) { + s.CompletedAt = val } -// Ref: #/components/schemas/CIProviderField -type CIProviderField struct { - // Longer explanation shown beneath the field. - Help OptString `json:"help"` - // Body key this field's value posts under. - Key string `json:"key"` - // Widget to render: text, select, secret, bool. - Kind string `json:"kind"` - // Human-readable field label. - Label string `json:"label"` - // Choices for a select field; absent for every other kind. - Options []CIProviderOption `json:"options"` - // Placeholder text for an empty field. - Placeholder OptString `json:"placeholder"` - // Mode keys this field is required in; empty means never required. - RequiredIn []string `json:"required_in"` - // Where the value goes: body (top level) or config (opaque map). - Target string `json:"target"` - AdditionalProps CIProviderFieldAdditional +// SetDirection sets the value of Direction. +func (s *CIDeliveryDetailView) SetDirection(val string) { + s.Direction = val } -// GetHelp returns the value of Help. -func (s *CIProviderField) GetHelp() OptString { - return s.Help +// SetDisplayName sets the value of DisplayName. +func (s *CIDeliveryDetailView) SetDisplayName(val OptString) { + s.DisplayName = val } -// GetKey returns the value of Key. -func (s *CIProviderField) GetKey() string { - return s.Key +// SetDurationMs sets the value of DurationMs. +func (s *CIDeliveryDetailView) SetDurationMs(val OptInt64) { + s.DurationMs = val } -// GetKind returns the value of Kind. -func (s *CIProviderField) GetKind() string { - return s.Kind +// SetEvent sets the value of Event. +func (s *CIDeliveryDetailView) SetEvent(val OptString) { + s.Event = val } -// GetLabel returns the value of Label. -func (s *CIProviderField) GetLabel() string { - return s.Label +// SetHTTPStatus sets the value of HTTPStatus. +func (s *CIDeliveryDetailView) SetHTTPStatus(val OptInt64) { + s.HTTPStatus = val } -// GetOptions returns the value of Options. -func (s *CIProviderField) GetOptions() []CIProviderOption { - return s.Options +// SetID sets the value of ID. +func (s *CIDeliveryDetailView) SetID(val string) { + s.ID = val } -// GetPlaceholder returns the value of Placeholder. -func (s *CIProviderField) GetPlaceholder() OptString { - return s.Placeholder +// SetNewTarget sets the value of NewTarget. +func (s *CIDeliveryDetailView) SetNewTarget(val OptString) { + s.NewTarget = val } -// GetRequiredIn returns the value of RequiredIn. -func (s *CIProviderField) GetRequiredIn() []string { - return s.RequiredIn +// SetOldTarget sets the value of OldTarget. +func (s *CIDeliveryDetailView) SetOldTarget(val OptString) { + s.OldTarget = val } -// GetTarget returns the value of Target. -func (s *CIProviderField) GetTarget() string { - return s.Target +// SetOutcome sets the value of Outcome. +func (s *CIDeliveryDetailView) SetOutcome(val string) { + s.Outcome = val } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *CIProviderField) GetAdditionalProps() CIProviderFieldAdditional { - return s.AdditionalProps +// SetPayload sets the value of Payload. +func (s *CIDeliveryDetailView) SetPayload(val OptCIDeliveryPayloadView) { + s.Payload = val } -// SetHelp sets the value of Help. -func (s *CIProviderField) SetHelp(val OptString) { - s.Help = val +// SetPayloadAbsent sets the value of PayloadAbsent. +func (s *CIDeliveryDetailView) SetPayloadAbsent(val OptString) { + s.PayloadAbsent = val } -// SetKey sets the value of Key. -func (s *CIProviderField) SetKey(val string) { - s.Key = val +// SetProvider sets the value of Provider. +func (s *CIDeliveryDetailView) SetProvider(val string) { + s.Provider = val } -// SetKind sets the value of Kind. -func (s *CIProviderField) SetKind(val string) { - s.Kind = val +// SetRef sets the value of Ref. +func (s *CIDeliveryDetailView) SetRef(val OptString) { + s.Ref = val } -// SetLabel sets the value of Label. -func (s *CIProviderField) SetLabel(val string) { - s.Label = val +// SetRefOp sets the value of RefOp. +func (s *CIDeliveryDetailView) SetRefOp(val OptString) { + s.RefOp = val } -// SetOptions sets the value of Options. -func (s *CIProviderField) SetOptions(val []CIProviderOption) { - s.Options = val +// SetRepoID sets the value of RepoID. +func (s *CIDeliveryDetailView) SetRepoID(val OptString) { + s.RepoID = val } -// SetPlaceholder sets the value of Placeholder. -func (s *CIProviderField) SetPlaceholder(val OptString) { - s.Placeholder = val +// SetState sets the value of State. +func (s *CIDeliveryDetailView) SetState(val OptString) { + s.State = val } -// SetRequiredIn sets the value of RequiredIn. -func (s *CIProviderField) SetRequiredIn(val []string) { - s.RequiredIn = val +// SetSubscriptionID sets the value of SubscriptionID. +func (s *CIDeliveryDetailView) SetSubscriptionID(val OptString) { + s.SubscriptionID = val } // SetTarget sets the value of Target. -func (s *CIProviderField) SetTarget(val string) { +func (s *CIDeliveryDetailView) SetTarget(val OptString) { s.Target = val } +// SetWireRequestID sets the value of WireRequestID. +func (s *CIDeliveryDetailView) SetWireRequestID(val OptString) { + s.WireRequestID = val +} + // SetAdditionalProps sets the value of AdditionalProps. -func (s *CIProviderField) SetAdditionalProps(val CIProviderFieldAdditional) { +func (s *CIDeliveryDetailView) SetAdditionalProps(val CIDeliveryDetailViewAdditional) { s.AdditionalProps = val } -type CIProviderFieldAdditional map[string]jx.Raw +type CIDeliveryDetailViewAdditional map[string]jx.Raw -func (s *CIProviderFieldAdditional) init() CIProviderFieldAdditional { +func (s *CIDeliveryDetailViewAdditional) init() CIDeliveryDetailViewAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -1224,122 +1437,120 @@ func (s *CIProviderFieldAdditional) init() CIProviderFieldAdditional { return m } -// Ref: #/components/schemas/CIProviderMode -type CIProviderMode struct { - // Whether a client should preselect this mode. - Default OptBool `json:"default"` - // Longer explanation of what this mode does. - Help OptString `json:"help"` - // Mode key to post back as the request's mode. - Key string `json:"key"` - // Human-readable label. - Label string `json:"label"` - AdditionalProps CIProviderModeAdditional +// Ref: #/components/schemas/CIDeliveryPayloadView +type CIDeliveryPayloadView struct { + // Where the request went, or the path it arrived on. + Endpoint string `json:"endpoint"` + // Which attempt these bytes came from; compare with attempt_count. + FromAttempt int64 `json:"from_attempt"` + // Request body as stored. + RequestBody string `json:"request_body"` + // Stored request headers; an allowlist, signatures truncated. + RequestHeaders CIDeliveryPayloadViewRequestHeaders `json:"request_headers"` + // Request body is at the 16 KiB cap and may be cut. + RequestTruncated bool `json:"request_truncated"` + // Response body as stored. + ResponseBody string `json:"response_body"` + // False means no response arrived, not that it was empty. + ResponsePresent bool `json:"response_present"` + // Response body is at the 16 KiB cap and may be cut. + ResponseTruncated bool `json:"response_truncated"` + AdditionalProps CIDeliveryPayloadViewAdditional } -// GetDefault returns the value of Default. -func (s *CIProviderMode) GetDefault() OptBool { - return s.Default +// GetEndpoint returns the value of Endpoint. +func (s *CIDeliveryPayloadView) GetEndpoint() string { + return s.Endpoint } -// GetHelp returns the value of Help. -func (s *CIProviderMode) GetHelp() OptString { - return s.Help +// GetFromAttempt returns the value of FromAttempt. +func (s *CIDeliveryPayloadView) GetFromAttempt() int64 { + return s.FromAttempt } -// GetKey returns the value of Key. -func (s *CIProviderMode) GetKey() string { - return s.Key +// GetRequestBody returns the value of RequestBody. +func (s *CIDeliveryPayloadView) GetRequestBody() string { + return s.RequestBody } -// GetLabel returns the value of Label. -func (s *CIProviderMode) GetLabel() string { - return s.Label +// GetRequestHeaders returns the value of RequestHeaders. +func (s *CIDeliveryPayloadView) GetRequestHeaders() CIDeliveryPayloadViewRequestHeaders { + return s.RequestHeaders } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *CIProviderMode) GetAdditionalProps() CIProviderModeAdditional { - return s.AdditionalProps +// GetRequestTruncated returns the value of RequestTruncated. +func (s *CIDeliveryPayloadView) GetRequestTruncated() bool { + return s.RequestTruncated } -// SetDefault sets the value of Default. -func (s *CIProviderMode) SetDefault(val OptBool) { - s.Default = val +// GetResponseBody returns the value of ResponseBody. +func (s *CIDeliveryPayloadView) GetResponseBody() string { + return s.ResponseBody } -// SetHelp sets the value of Help. -func (s *CIProviderMode) SetHelp(val OptString) { - s.Help = val +// GetResponsePresent returns the value of ResponsePresent. +func (s *CIDeliveryPayloadView) GetResponsePresent() bool { + return s.ResponsePresent } -// SetKey sets the value of Key. -func (s *CIProviderMode) SetKey(val string) { - s.Key = val +// GetResponseTruncated returns the value of ResponseTruncated. +func (s *CIDeliveryPayloadView) GetResponseTruncated() bool { + return s.ResponseTruncated } -// SetLabel sets the value of Label. -func (s *CIProviderMode) SetLabel(val string) { - s.Label = val +// GetAdditionalProps returns the value of AdditionalProps. +func (s *CIDeliveryPayloadView) GetAdditionalProps() CIDeliveryPayloadViewAdditional { + return s.AdditionalProps } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *CIProviderMode) SetAdditionalProps(val CIProviderModeAdditional) { - s.AdditionalProps = val +// SetEndpoint sets the value of Endpoint. +func (s *CIDeliveryPayloadView) SetEndpoint(val string) { + s.Endpoint = val } -type CIProviderModeAdditional map[string]jx.Raw - -func (s *CIProviderModeAdditional) init() CIProviderModeAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// SetFromAttempt sets the value of FromAttempt. +func (s *CIDeliveryPayloadView) SetFromAttempt(val int64) { + s.FromAttempt = val } -// Ref: #/components/schemas/CIProviderOption -type CIProviderOption struct { - // Human-readable label. - Label string `json:"label"` - // Value to post back for this choice. - Value string `json:"value"` - AdditionalProps CIProviderOptionAdditional +// SetRequestBody sets the value of RequestBody. +func (s *CIDeliveryPayloadView) SetRequestBody(val string) { + s.RequestBody = val } -// GetLabel returns the value of Label. -func (s *CIProviderOption) GetLabel() string { - return s.Label +// SetRequestHeaders sets the value of RequestHeaders. +func (s *CIDeliveryPayloadView) SetRequestHeaders(val CIDeliveryPayloadViewRequestHeaders) { + s.RequestHeaders = val } -// GetValue returns the value of Value. -func (s *CIProviderOption) GetValue() string { - return s.Value +// SetRequestTruncated sets the value of RequestTruncated. +func (s *CIDeliveryPayloadView) SetRequestTruncated(val bool) { + s.RequestTruncated = val } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *CIProviderOption) GetAdditionalProps() CIProviderOptionAdditional { - return s.AdditionalProps +// SetResponseBody sets the value of ResponseBody. +func (s *CIDeliveryPayloadView) SetResponseBody(val string) { + s.ResponseBody = val } -// SetLabel sets the value of Label. -func (s *CIProviderOption) SetLabel(val string) { - s.Label = val +// SetResponsePresent sets the value of ResponsePresent. +func (s *CIDeliveryPayloadView) SetResponsePresent(val bool) { + s.ResponsePresent = val } -// SetValue sets the value of Value. -func (s *CIProviderOption) SetValue(val string) { - s.Value = val +// SetResponseTruncated sets the value of ResponseTruncated. +func (s *CIDeliveryPayloadView) SetResponseTruncated(val bool) { + s.ResponseTruncated = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *CIProviderOption) SetAdditionalProps(val CIProviderOptionAdditional) { +func (s *CIDeliveryPayloadView) SetAdditionalProps(val CIDeliveryPayloadViewAdditional) { s.AdditionalProps = val } -type CIProviderOptionAdditional map[string]jx.Raw +type CIDeliveryPayloadViewAdditional map[string]jx.Raw -func (s *CIProviderOptionAdditional) init() CIProviderOptionAdditional { +func (s *CIDeliveryPayloadViewAdditional) init() CIDeliveryPayloadViewAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -1348,391 +1559,402 @@ func (s *CIProviderOptionAdditional) init() CIProviderOptionAdditional { return m } -// Ref: #/components/schemas/CISetupBlock -type CISetupBlock struct { - // The content itself, ready to use verbatim. - Content string `json:"content"` - // The content's syntax, for highlighting: yaml, json. - Format string `json:"format"` - // Short instruction naming what to do with the content. - Heading string `json:"heading"` - AdditionalProps CISetupBlockAdditional -} +// Stored request headers; an allowlist, signatures truncated. +type CIDeliveryPayloadViewRequestHeaders map[string]string -// GetContent returns the value of Content. -func (s *CISetupBlock) GetContent() string { - return s.Content +func (s *CIDeliveryPayloadViewRequestHeaders) init() CIDeliveryPayloadViewRequestHeaders { + m := *s + if m == nil { + m = map[string]string{} + *s = m + } + return m } -// GetFormat returns the value of Format. -func (s *CISetupBlock) GetFormat() string { - return s.Format -} - -// GetHeading returns the value of Heading. -func (s *CISetupBlock) GetHeading() string { - return s.Heading -} - -// GetAdditionalProps returns the value of AdditionalProps. -func (s *CISetupBlock) GetAdditionalProps() CISetupBlockAdditional { - return s.AdditionalProps +// Ref: #/components/schemas/CIDeliveryView +type CIDeliveryView struct { + // Vendor account (Buildkite org, Depot org). + Account OptString `json:"account"` + // When the delivery started or arrived (UTC). + At time.Time `json:"at"` + // Attempts made; outbound only. + AttemptCount OptInt64 `json:"attempt_count"` + // When an outbound delivery reached a terminal state (UTC). + CompletedAt OptDateTime `json:"completed_at"` + // Outbound or inbound. + Direction string `json:"direction"` + // Subscription display name. + DisplayName OptString `json:"display_name"` + // How long the delivery took, milliseconds. + DurationMs OptInt64 `json:"duration_ms"` + // Vendor event type, e.g. build.finished. + Event OptString `json:"event"` + // HTTP status, absent when no request was made. + HTTPStatus OptInt64 `json:"http_status"` + // Opaque delivery id; pass to the delivery detail route. + ID string `json:"id"` + // Content identity after the change. + NewTarget OptString `json:"new_target"` + // Content identity before the change. + OldTarget OptString `json:"old_target"` + // Five-valued outcome; the vocabularies differ by direction. + Outcome string `json:"outcome"` + // CI provider registry name. + Provider string `json:"provider"` + // Ref that moved. + Ref OptString `json:"ref"` + // Ref operation. Empty means unknown — never guess it from the targets. + RefOp OptString `json:"ref_op"` + // Repository ULID, empty when the delivery resolved to no enrolment. + RepoID OptString `json:"repo_id"` + // Outbound dispatch state. + State OptString `json:"state"` + // Subscription ULID, empty when none was resolved. + SubscriptionID OptString `json:"subscription_id"` + // Vendor target (Buildkite pipeline, Depot run label). + Target OptString `json:"target"` + // The vendor's own id for this delivery. + WireRequestID OptString `json:"wire_request_id"` + AdditionalProps CIDeliveryViewAdditional } -// SetContent sets the value of Content. -func (s *CISetupBlock) SetContent(val string) { - s.Content = val +// GetAccount returns the value of Account. +func (s *CIDeliveryView) GetAccount() OptString { + return s.Account } -// SetFormat sets the value of Format. -func (s *CISetupBlock) SetFormat(val string) { - s.Format = val +// GetAt returns the value of At. +func (s *CIDeliveryView) GetAt() time.Time { + return s.At } -// SetHeading sets the value of Heading. -func (s *CISetupBlock) SetHeading(val string) { - s.Heading = val +// GetAttemptCount returns the value of AttemptCount. +func (s *CIDeliveryView) GetAttemptCount() OptInt64 { + return s.AttemptCount } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *CISetupBlock) SetAdditionalProps(val CISetupBlockAdditional) { - s.AdditionalProps = val +// GetCompletedAt returns the value of CompletedAt. +func (s *CIDeliveryView) GetCompletedAt() OptDateTime { + return s.CompletedAt } -type CISetupBlockAdditional map[string]jx.Raw - -func (s *CISetupBlockAdditional) init() CISetupBlockAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// GetDirection returns the value of Direction. +func (s *CIDeliveryView) GetDirection() string { + return s.Direction } -// Ref: #/components/schemas/CIWebhookAuditActor -type CIWebhookAuditActor struct { - // Entire account ULID that performed the action. - AccountID string `json:"account_id"` - // Actor's primary handle; empty when they have none. - Handle OptString `json:"handle"` - // Provider the handle came from: github, workos, system. - HandleProvider OptString `json:"handle_provider"` - AdditionalProps CIWebhookAuditActorAdditional +// GetDisplayName returns the value of DisplayName. +func (s *CIDeliveryView) GetDisplayName() OptString { + return s.DisplayName } -// GetAccountID returns the value of AccountID. -func (s *CIWebhookAuditActor) GetAccountID() string { - return s.AccountID +// GetDurationMs returns the value of DurationMs. +func (s *CIDeliveryView) GetDurationMs() OptInt64 { + return s.DurationMs } -// GetHandle returns the value of Handle. -func (s *CIWebhookAuditActor) GetHandle() OptString { - return s.Handle +// GetEvent returns the value of Event. +func (s *CIDeliveryView) GetEvent() OptString { + return s.Event } -// GetHandleProvider returns the value of HandleProvider. -func (s *CIWebhookAuditActor) GetHandleProvider() OptString { - return s.HandleProvider +// GetHTTPStatus returns the value of HTTPStatus. +func (s *CIDeliveryView) GetHTTPStatus() OptInt64 { + return s.HTTPStatus } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *CIWebhookAuditActor) GetAdditionalProps() CIWebhookAuditActorAdditional { - return s.AdditionalProps +// GetID returns the value of ID. +func (s *CIDeliveryView) GetID() string { + return s.ID } -// SetAccountID sets the value of AccountID. -func (s *CIWebhookAuditActor) SetAccountID(val string) { - s.AccountID = val +// GetNewTarget returns the value of NewTarget. +func (s *CIDeliveryView) GetNewTarget() OptString { + return s.NewTarget } -// SetHandle sets the value of Handle. -func (s *CIWebhookAuditActor) SetHandle(val OptString) { - s.Handle = val +// GetOldTarget returns the value of OldTarget. +func (s *CIDeliveryView) GetOldTarget() OptString { + return s.OldTarget } -// SetHandleProvider sets the value of HandleProvider. -func (s *CIWebhookAuditActor) SetHandleProvider(val OptString) { - s.HandleProvider = val +// GetOutcome returns the value of Outcome. +func (s *CIDeliveryView) GetOutcome() string { + return s.Outcome } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *CIWebhookAuditActor) SetAdditionalProps(val CIWebhookAuditActorAdditional) { - s.AdditionalProps = val +// GetProvider returns the value of Provider. +func (s *CIDeliveryView) GetProvider() string { + return s.Provider } -type CIWebhookAuditActorAdditional map[string]jx.Raw - -func (s *CIWebhookAuditActorAdditional) init() CIWebhookAuditActorAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// GetRef returns the value of Ref. +func (s *CIDeliveryView) GetRef() OptString { + return s.Ref } -// Ref: #/components/schemas/CIWebhookAuditEventView -type CIWebhookAuditEventView struct { - // Who performed the action. - Actor CIWebhookAuditActor `json:"actor"` - // Ci_webhook_enrolled | ci_webhook_updated | ci_webhook_deleted | ci_webhook_identity_rolled_back | - // ci_webhook_identity_orphaned. - EventType string `json:"event_type"` - // Audit event ULID. - ID string `json:"id"` - // Event detail as recorded, e.g. bk_organization/bk_pipeline. - Metadata OptCIWebhookAuditEventViewMetadata `json:"metadata"` - // When the action was recorded (UTC). - OccurredAt time.Time `json:"occurred_at"` - AdditionalProps CIWebhookAuditEventViewAdditional +// GetRefOp returns the value of RefOp. +func (s *CIDeliveryView) GetRefOp() OptString { + return s.RefOp } -// GetActor returns the value of Actor. -func (s *CIWebhookAuditEventView) GetActor() CIWebhookAuditActor { - return s.Actor +// GetRepoID returns the value of RepoID. +func (s *CIDeliveryView) GetRepoID() OptString { + return s.RepoID } -// GetEventType returns the value of EventType. -func (s *CIWebhookAuditEventView) GetEventType() string { - return s.EventType +// GetState returns the value of State. +func (s *CIDeliveryView) GetState() OptString { + return s.State } -// GetID returns the value of ID. -func (s *CIWebhookAuditEventView) GetID() string { - return s.ID +// GetSubscriptionID returns the value of SubscriptionID. +func (s *CIDeliveryView) GetSubscriptionID() OptString { + return s.SubscriptionID } -// GetMetadata returns the value of Metadata. -func (s *CIWebhookAuditEventView) GetMetadata() OptCIWebhookAuditEventViewMetadata { - return s.Metadata +// GetTarget returns the value of Target. +func (s *CIDeliveryView) GetTarget() OptString { + return s.Target } -// GetOccurredAt returns the value of OccurredAt. -func (s *CIWebhookAuditEventView) GetOccurredAt() time.Time { - return s.OccurredAt +// GetWireRequestID returns the value of WireRequestID. +func (s *CIDeliveryView) GetWireRequestID() OptString { + return s.WireRequestID } // GetAdditionalProps returns the value of AdditionalProps. -func (s *CIWebhookAuditEventView) GetAdditionalProps() CIWebhookAuditEventViewAdditional { +func (s *CIDeliveryView) GetAdditionalProps() CIDeliveryViewAdditional { return s.AdditionalProps } -// SetActor sets the value of Actor. -func (s *CIWebhookAuditEventView) SetActor(val CIWebhookAuditActor) { - s.Actor = val -} - -// SetEventType sets the value of EventType. -func (s *CIWebhookAuditEventView) SetEventType(val string) { - s.EventType = val +// SetAccount sets the value of Account. +func (s *CIDeliveryView) SetAccount(val OptString) { + s.Account = val } -// SetID sets the value of ID. -func (s *CIWebhookAuditEventView) SetID(val string) { - s.ID = val +// SetAt sets the value of At. +func (s *CIDeliveryView) SetAt(val time.Time) { + s.At = val } -// SetMetadata sets the value of Metadata. -func (s *CIWebhookAuditEventView) SetMetadata(val OptCIWebhookAuditEventViewMetadata) { - s.Metadata = val +// SetAttemptCount sets the value of AttemptCount. +func (s *CIDeliveryView) SetAttemptCount(val OptInt64) { + s.AttemptCount = val } -// SetOccurredAt sets the value of OccurredAt. -func (s *CIWebhookAuditEventView) SetOccurredAt(val time.Time) { - s.OccurredAt = val +// SetCompletedAt sets the value of CompletedAt. +func (s *CIDeliveryView) SetCompletedAt(val OptDateTime) { + s.CompletedAt = val } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *CIWebhookAuditEventView) SetAdditionalProps(val CIWebhookAuditEventViewAdditional) { - s.AdditionalProps = val +// SetDirection sets the value of Direction. +func (s *CIDeliveryView) SetDirection(val string) { + s.Direction = val } -type CIWebhookAuditEventViewAdditional map[string]jx.Raw - -func (s *CIWebhookAuditEventViewAdditional) init() CIWebhookAuditEventViewAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// SetDisplayName sets the value of DisplayName. +func (s *CIDeliveryView) SetDisplayName(val OptString) { + s.DisplayName = val } -// Event detail as recorded, e.g. bk_organization/bk_pipeline. -type CIWebhookAuditEventViewMetadata map[string]jx.Raw - -func (s *CIWebhookAuditEventViewMetadata) init() CIWebhookAuditEventViewMetadata { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// SetDurationMs sets the value of DurationMs. +func (s *CIDeliveryView) SetDurationMs(val OptInt64) { + s.DurationMs = val } -// Ref: #/components/schemas/CIWebhookView -type CIWebhookView struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - BkOrganization string `json:"bk_organization"` - BkPipeline string `json:"bk_pipeline"` - CreatedAt time.Time `json:"created_at"` - DisplayName string `json:"display_name"` - Enabled bool `json:"enabled"` - Events []string `json:"events"` - ID string `json:"id"` - Provider string `json:"provider"` - PublishChecks bool `json:"publish_checks"` - RefFilter string `json:"ref_filter"` - RepoID string `json:"repo_id"` - UpdatedAt time.Time `json:"updated_at"` - AdditionalProps CIWebhookViewAdditional +// SetEvent sets the value of Event. +func (s *CIDeliveryView) SetEvent(val OptString) { + s.Event = val } -// GetSchema returns the value of Schema. -func (s *CIWebhookView) GetSchema() OptURI { - return s.Schema +// SetHTTPStatus sets the value of HTTPStatus. +func (s *CIDeliveryView) SetHTTPStatus(val OptInt64) { + s.HTTPStatus = val } -// GetBkOrganization returns the value of BkOrganization. -func (s *CIWebhookView) GetBkOrganization() string { - return s.BkOrganization +// SetID sets the value of ID. +func (s *CIDeliveryView) SetID(val string) { + s.ID = val } -// GetBkPipeline returns the value of BkPipeline. -func (s *CIWebhookView) GetBkPipeline() string { - return s.BkPipeline +// SetNewTarget sets the value of NewTarget. +func (s *CIDeliveryView) SetNewTarget(val OptString) { + s.NewTarget = val } -// GetCreatedAt returns the value of CreatedAt. -func (s *CIWebhookView) GetCreatedAt() time.Time { - return s.CreatedAt +// SetOldTarget sets the value of OldTarget. +func (s *CIDeliveryView) SetOldTarget(val OptString) { + s.OldTarget = val } -// GetDisplayName returns the value of DisplayName. -func (s *CIWebhookView) GetDisplayName() string { - return s.DisplayName +// SetOutcome sets the value of Outcome. +func (s *CIDeliveryView) SetOutcome(val string) { + s.Outcome = val } -// GetEnabled returns the value of Enabled. -func (s *CIWebhookView) GetEnabled() bool { - return s.Enabled +// SetProvider sets the value of Provider. +func (s *CIDeliveryView) SetProvider(val string) { + s.Provider = val } -// GetEvents returns the value of Events. -func (s *CIWebhookView) GetEvents() []string { - return s.Events +// SetRef sets the value of Ref. +func (s *CIDeliveryView) SetRef(val OptString) { + s.Ref = val } -// GetID returns the value of ID. -func (s *CIWebhookView) GetID() string { - return s.ID +// SetRefOp sets the value of RefOp. +func (s *CIDeliveryView) SetRefOp(val OptString) { + s.RefOp = val } -// GetProvider returns the value of Provider. -func (s *CIWebhookView) GetProvider() string { - return s.Provider +// SetRepoID sets the value of RepoID. +func (s *CIDeliveryView) SetRepoID(val OptString) { + s.RepoID = val } -// GetPublishChecks returns the value of PublishChecks. -func (s *CIWebhookView) GetPublishChecks() bool { - return s.PublishChecks +// SetState sets the value of State. +func (s *CIDeliveryView) SetState(val OptString) { + s.State = val } -// GetRefFilter returns the value of RefFilter. -func (s *CIWebhookView) GetRefFilter() string { - return s.RefFilter +// SetSubscriptionID sets the value of SubscriptionID. +func (s *CIDeliveryView) SetSubscriptionID(val OptString) { + s.SubscriptionID = val } -// GetRepoID returns the value of RepoID. -func (s *CIWebhookView) GetRepoID() string { - return s.RepoID +// SetTarget sets the value of Target. +func (s *CIDeliveryView) SetTarget(val OptString) { + s.Target = val } -// GetUpdatedAt returns the value of UpdatedAt. -func (s *CIWebhookView) GetUpdatedAt() time.Time { - return s.UpdatedAt +// SetWireRequestID sets the value of WireRequestID. +func (s *CIDeliveryView) SetWireRequestID(val OptString) { + s.WireRequestID = val } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *CIWebhookView) GetAdditionalProps() CIWebhookViewAdditional { - return s.AdditionalProps +// SetAdditionalProps sets the value of AdditionalProps. +func (s *CIDeliveryView) SetAdditionalProps(val CIDeliveryViewAdditional) { + s.AdditionalProps = val } -// SetSchema sets the value of Schema. -func (s *CIWebhookView) SetSchema(val OptURI) { - s.Schema = val -} +type CIDeliveryViewAdditional map[string]jx.Raw -// SetBkOrganization sets the value of BkOrganization. -func (s *CIWebhookView) SetBkOrganization(val string) { - s.BkOrganization = val +func (s *CIDeliveryViewAdditional) init() CIDeliveryViewAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m } -// SetBkPipeline sets the value of BkPipeline. -func (s *CIWebhookView) SetBkPipeline(val string) { - s.BkPipeline = val -} +// Ref: #/components/schemas/CIJobView +type CIJobView struct { + BkJobID string `json:"bk_job_id"` + ExitStatus OptInt64 `json:"exit_status"` + FinishedAt OptDateTime `json:"finished_at"` + Name string `json:"name"` + StartedAt OptDateTime `json:"started_at"` + State string `json:"state"` + StepKey string `json:"step_key"` + Type string `json:"type"` + AdditionalProps CIJobViewAdditional +} -// SetCreatedAt sets the value of CreatedAt. -func (s *CIWebhookView) SetCreatedAt(val time.Time) { - s.CreatedAt = val +// GetBkJobID returns the value of BkJobID. +func (s *CIJobView) GetBkJobID() string { + return s.BkJobID } -// SetDisplayName sets the value of DisplayName. -func (s *CIWebhookView) SetDisplayName(val string) { - s.DisplayName = val +// GetExitStatus returns the value of ExitStatus. +func (s *CIJobView) GetExitStatus() OptInt64 { + return s.ExitStatus } -// SetEnabled sets the value of Enabled. -func (s *CIWebhookView) SetEnabled(val bool) { - s.Enabled = val +// GetFinishedAt returns the value of FinishedAt. +func (s *CIJobView) GetFinishedAt() OptDateTime { + return s.FinishedAt } -// SetEvents sets the value of Events. -func (s *CIWebhookView) SetEvents(val []string) { - s.Events = val +// GetName returns the value of Name. +func (s *CIJobView) GetName() string { + return s.Name } -// SetID sets the value of ID. -func (s *CIWebhookView) SetID(val string) { - s.ID = val +// GetStartedAt returns the value of StartedAt. +func (s *CIJobView) GetStartedAt() OptDateTime { + return s.StartedAt } -// SetProvider sets the value of Provider. -func (s *CIWebhookView) SetProvider(val string) { - s.Provider = val +// GetState returns the value of State. +func (s *CIJobView) GetState() string { + return s.State } -// SetPublishChecks sets the value of PublishChecks. -func (s *CIWebhookView) SetPublishChecks(val bool) { - s.PublishChecks = val +// GetStepKey returns the value of StepKey. +func (s *CIJobView) GetStepKey() string { + return s.StepKey } -// SetRefFilter sets the value of RefFilter. -func (s *CIWebhookView) SetRefFilter(val string) { - s.RefFilter = val +// GetType returns the value of Type. +func (s *CIJobView) GetType() string { + return s.Type } -// SetRepoID sets the value of RepoID. -func (s *CIWebhookView) SetRepoID(val string) { - s.RepoID = val +// GetAdditionalProps returns the value of AdditionalProps. +func (s *CIJobView) GetAdditionalProps() CIJobViewAdditional { + return s.AdditionalProps } -// SetUpdatedAt sets the value of UpdatedAt. -func (s *CIWebhookView) SetUpdatedAt(val time.Time) { - s.UpdatedAt = val +// SetBkJobID sets the value of BkJobID. +func (s *CIJobView) SetBkJobID(val string) { + s.BkJobID = val +} + +// SetExitStatus sets the value of ExitStatus. +func (s *CIJobView) SetExitStatus(val OptInt64) { + s.ExitStatus = val +} + +// SetFinishedAt sets the value of FinishedAt. +func (s *CIJobView) SetFinishedAt(val OptDateTime) { + s.FinishedAt = val +} + +// SetName sets the value of Name. +func (s *CIJobView) SetName(val string) { + s.Name = val +} + +// SetStartedAt sets the value of StartedAt. +func (s *CIJobView) SetStartedAt(val OptDateTime) { + s.StartedAt = val +} + +// SetState sets the value of State. +func (s *CIJobView) SetState(val string) { + s.State = val +} + +// SetStepKey sets the value of StepKey. +func (s *CIJobView) SetStepKey(val string) { + s.StepKey = val +} + +// SetType sets the value of Type. +func (s *CIJobView) SetType(val string) { + s.Type = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *CIWebhookView) SetAdditionalProps(val CIWebhookViewAdditional) { +func (s *CIJobView) SetAdditionalProps(val CIJobViewAdditional) { s.AdditionalProps = val } -type CIWebhookViewAdditional map[string]jx.Raw +type CIJobViewAdditional map[string]jx.Raw -func (s *CIWebhookViewAdditional) init() CIWebhookViewAdditional { +func (s *CIJobViewAdditional) init() CIJobViewAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -1741,82 +1963,96 @@ func (s *CIWebhookViewAdditional) init() CIWebhookViewAdditional { return m } -// CancelDeletionOK is response for CancelDeletion operation. -type CancelDeletionOK struct{} +// Ref: #/components/schemas/CIProviderDescriptor +type CIProviderDescriptor struct { + // Whether this org can enrol into this provider right now. + Enrollable bool `json:"enrollable"` + // Form fields, in the order a client should render them. + Fields []CIProviderField `json:"fields"` + // Human-readable provider name. + Label string `json:"label"` + // Ways of enrolling; exactly one is marked default. + Modes []CIProviderMode `json:"modes"` + // Provider key, posted back as the request's provider. + Name string `json:"name"` + // Why enrolment is unavailable; set only when enrollable is false. + Reason OptString `json:"reason"` + AdditionalProps CIProviderDescriptorAdditional +} -// Ref: #/components/schemas/Cluster -type Cluster struct { - ApiUrl OptString `json:"apiUrl"` - IsDefault bool `json:"isDefault"` - Jurisdiction string `json:"jurisdiction"` - PublicUrl string `json:"publicUrl"` - Slug string `json:"slug"` - AdditionalProps ClusterAdditional +// GetEnrollable returns the value of Enrollable. +func (s *CIProviderDescriptor) GetEnrollable() bool { + return s.Enrollable } -// GetApiUrl returns the value of ApiUrl. -func (s *Cluster) GetApiUrl() OptString { - return s.ApiUrl +// GetFields returns the value of Fields. +func (s *CIProviderDescriptor) GetFields() []CIProviderField { + return s.Fields } -// GetIsDefault returns the value of IsDefault. -func (s *Cluster) GetIsDefault() bool { - return s.IsDefault +// GetLabel returns the value of Label. +func (s *CIProviderDescriptor) GetLabel() string { + return s.Label } -// GetJurisdiction returns the value of Jurisdiction. -func (s *Cluster) GetJurisdiction() string { - return s.Jurisdiction +// GetModes returns the value of Modes. +func (s *CIProviderDescriptor) GetModes() []CIProviderMode { + return s.Modes } -// GetPublicUrl returns the value of PublicUrl. -func (s *Cluster) GetPublicUrl() string { - return s.PublicUrl +// GetName returns the value of Name. +func (s *CIProviderDescriptor) GetName() string { + return s.Name } -// GetSlug returns the value of Slug. -func (s *Cluster) GetSlug() string { - return s.Slug +// GetReason returns the value of Reason. +func (s *CIProviderDescriptor) GetReason() OptString { + return s.Reason } // GetAdditionalProps returns the value of AdditionalProps. -func (s *Cluster) GetAdditionalProps() ClusterAdditional { +func (s *CIProviderDescriptor) GetAdditionalProps() CIProviderDescriptorAdditional { return s.AdditionalProps } -// SetApiUrl sets the value of ApiUrl. -func (s *Cluster) SetApiUrl(val OptString) { - s.ApiUrl = val +// SetEnrollable sets the value of Enrollable. +func (s *CIProviderDescriptor) SetEnrollable(val bool) { + s.Enrollable = val } -// SetIsDefault sets the value of IsDefault. -func (s *Cluster) SetIsDefault(val bool) { - s.IsDefault = val +// SetFields sets the value of Fields. +func (s *CIProviderDescriptor) SetFields(val []CIProviderField) { + s.Fields = val } -// SetJurisdiction sets the value of Jurisdiction. -func (s *Cluster) SetJurisdiction(val string) { - s.Jurisdiction = val +// SetLabel sets the value of Label. +func (s *CIProviderDescriptor) SetLabel(val string) { + s.Label = val } -// SetPublicUrl sets the value of PublicUrl. -func (s *Cluster) SetPublicUrl(val string) { - s.PublicUrl = val +// SetModes sets the value of Modes. +func (s *CIProviderDescriptor) SetModes(val []CIProviderMode) { + s.Modes = val } -// SetSlug sets the value of Slug. -func (s *Cluster) SetSlug(val string) { - s.Slug = val +// SetName sets the value of Name. +func (s *CIProviderDescriptor) SetName(val string) { + s.Name = val +} + +// SetReason sets the value of Reason. +func (s *CIProviderDescriptor) SetReason(val OptString) { + s.Reason = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *Cluster) SetAdditionalProps(val ClusterAdditional) { +func (s *CIProviderDescriptor) SetAdditionalProps(val CIProviderDescriptorAdditional) { s.AdditionalProps = val } -type ClusterAdditional map[string]jx.Raw +type CIProviderDescriptorAdditional map[string]jx.Raw -func (s *ClusterAdditional) init() ClusterAdditional { +func (s *CIProviderDescriptorAdditional) init() CIProviderDescriptorAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -1825,108 +2061,120 @@ func (s *ClusterAdditional) init() ClusterAdditional { return m } -// Ref: #/components/schemas/CompleteOnboardingOutputBody -type CompleteOnboardingOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - // Always false after onboarding completion is recorded. - NeedsOnboarding bool `json:"needsOnboarding"` - AdditionalProps CompleteOnboardingOutputBodyAdditional +// Ref: #/components/schemas/CIProviderField +type CIProviderField struct { + // Longer explanation shown beneath the field. + Help OptString `json:"help"` + // Body key this field's value posts under. + Key string `json:"key"` + // Widget to render: text, select, secret, bool. + Kind string `json:"kind"` + // Human-readable field label. + Label string `json:"label"` + // Choices for a select field; absent for every other kind. + Options []CIProviderOption `json:"options"` + // Placeholder text for an empty field. + Placeholder OptString `json:"placeholder"` + // Mode keys this field is required in; empty means never required. + RequiredIn []string `json:"required_in"` + // Where the value goes: body (top level) or config (opaque map). + Target string `json:"target"` + AdditionalProps CIProviderFieldAdditional } -// GetSchema returns the value of Schema. -func (s *CompleteOnboardingOutputBody) GetSchema() OptURI { - return s.Schema +// GetHelp returns the value of Help. +func (s *CIProviderField) GetHelp() OptString { + return s.Help } -// GetNeedsOnboarding returns the value of NeedsOnboarding. -func (s *CompleteOnboardingOutputBody) GetNeedsOnboarding() bool { - return s.NeedsOnboarding +// GetKey returns the value of Key. +func (s *CIProviderField) GetKey() string { + return s.Key } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *CompleteOnboardingOutputBody) GetAdditionalProps() CompleteOnboardingOutputBodyAdditional { - return s.AdditionalProps +// GetKind returns the value of Kind. +func (s *CIProviderField) GetKind() string { + return s.Kind } -// SetSchema sets the value of Schema. -func (s *CompleteOnboardingOutputBody) SetSchema(val OptURI) { - s.Schema = val +// GetLabel returns the value of Label. +func (s *CIProviderField) GetLabel() string { + return s.Label } -// SetNeedsOnboarding sets the value of NeedsOnboarding. -func (s *CompleteOnboardingOutputBody) SetNeedsOnboarding(val bool) { - s.NeedsOnboarding = val +// GetOptions returns the value of Options. +func (s *CIProviderField) GetOptions() []CIProviderOption { + return s.Options } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *CompleteOnboardingOutputBody) SetAdditionalProps(val CompleteOnboardingOutputBodyAdditional) { - s.AdditionalProps = val +// GetPlaceholder returns the value of Placeholder. +func (s *CIProviderField) GetPlaceholder() OptString { + return s.Placeholder } -type CompleteOnboardingOutputBodyAdditional map[string]jx.Raw +// GetRequiredIn returns the value of RequiredIn. +func (s *CIProviderField) GetRequiredIn() []string { + return s.RequiredIn +} -func (s *CompleteOnboardingOutputBodyAdditional) init() CompleteOnboardingOutputBodyAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// GetTarget returns the value of Target. +func (s *CIProviderField) GetTarget() string { + return s.Target } -// Ref: #/components/schemas/ConnectOrgCIBuildkiteCredentialInputBody -type ConnectOrgCIBuildkiteCredentialInputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - BkAPIToken string `json:"bk_api_token"` - BkOrganization string `json:"bk_organization"` - AdditionalProps ConnectOrgCIBuildkiteCredentialInputBodyAdditional +// GetAdditionalProps returns the value of AdditionalProps. +func (s *CIProviderField) GetAdditionalProps() CIProviderFieldAdditional { + return s.AdditionalProps } -// GetSchema returns the value of Schema. -func (s *ConnectOrgCIBuildkiteCredentialInputBody) GetSchema() OptURI { - return s.Schema +// SetHelp sets the value of Help. +func (s *CIProviderField) SetHelp(val OptString) { + s.Help = val } -// GetBkAPIToken returns the value of BkAPIToken. -func (s *ConnectOrgCIBuildkiteCredentialInputBody) GetBkAPIToken() string { - return s.BkAPIToken +// SetKey sets the value of Key. +func (s *CIProviderField) SetKey(val string) { + s.Key = val } -// GetBkOrganization returns the value of BkOrganization. -func (s *ConnectOrgCIBuildkiteCredentialInputBody) GetBkOrganization() string { - return s.BkOrganization +// SetKind sets the value of Kind. +func (s *CIProviderField) SetKind(val string) { + s.Kind = val } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *ConnectOrgCIBuildkiteCredentialInputBody) GetAdditionalProps() ConnectOrgCIBuildkiteCredentialInputBodyAdditional { - return s.AdditionalProps +// SetLabel sets the value of Label. +func (s *CIProviderField) SetLabel(val string) { + s.Label = val } -// SetSchema sets the value of Schema. -func (s *ConnectOrgCIBuildkiteCredentialInputBody) SetSchema(val OptURI) { - s.Schema = val +// SetOptions sets the value of Options. +func (s *CIProviderField) SetOptions(val []CIProviderOption) { + s.Options = val } -// SetBkAPIToken sets the value of BkAPIToken. -func (s *ConnectOrgCIBuildkiteCredentialInputBody) SetBkAPIToken(val string) { - s.BkAPIToken = val +// SetPlaceholder sets the value of Placeholder. +func (s *CIProviderField) SetPlaceholder(val OptString) { + s.Placeholder = val } -// SetBkOrganization sets the value of BkOrganization. -func (s *ConnectOrgCIBuildkiteCredentialInputBody) SetBkOrganization(val string) { - s.BkOrganization = val +// SetRequiredIn sets the value of RequiredIn. +func (s *CIProviderField) SetRequiredIn(val []string) { + s.RequiredIn = val +} + +// SetTarget sets the value of Target. +func (s *CIProviderField) SetTarget(val string) { + s.Target = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ConnectOrgCIBuildkiteCredentialInputBody) SetAdditionalProps(val ConnectOrgCIBuildkiteCredentialInputBodyAdditional) { +func (s *CIProviderField) SetAdditionalProps(val CIProviderFieldAdditional) { s.AdditionalProps = val } -type ConnectOrgCIBuildkiteCredentialInputBodyAdditional map[string]jx.Raw +type CIProviderFieldAdditional map[string]jx.Raw -func (s *ConnectOrgCIBuildkiteCredentialInputBodyAdditional) init() ConnectOrgCIBuildkiteCredentialInputBodyAdditional { +func (s *CIProviderFieldAdditional) init() CIProviderFieldAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -1935,59 +2183,72 @@ func (s *ConnectOrgCIBuildkiteCredentialInputBodyAdditional) init() ConnectOrgCI return m } -// Ref: #/components/schemas/CreateBindingInputBody -type CreateBindingInputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - // Exact-match key/value map; empty filter matches any token. - AttributeFilter jx.Raw `json:"attributeFilter"` - ProviderId string `json:"providerId"` - AdditionalProps CreateBindingInputBodyAdditional +// Ref: #/components/schemas/CIProviderMode +type CIProviderMode struct { + // Whether a client should preselect this mode. + Default OptBool `json:"default"` + // Longer explanation of what this mode does. + Help OptString `json:"help"` + // Mode key to post back as the request's mode. + Key string `json:"key"` + // Human-readable label. + Label string `json:"label"` + AdditionalProps CIProviderModeAdditional } -// GetSchema returns the value of Schema. -func (s *CreateBindingInputBody) GetSchema() OptURI { - return s.Schema +// GetDefault returns the value of Default. +func (s *CIProviderMode) GetDefault() OptBool { + return s.Default } -// GetAttributeFilter returns the value of AttributeFilter. -func (s *CreateBindingInputBody) GetAttributeFilter() jx.Raw { - return s.AttributeFilter +// GetHelp returns the value of Help. +func (s *CIProviderMode) GetHelp() OptString { + return s.Help } -// GetProviderId returns the value of ProviderId. -func (s *CreateBindingInputBody) GetProviderId() string { - return s.ProviderId +// GetKey returns the value of Key. +func (s *CIProviderMode) GetKey() string { + return s.Key +} + +// GetLabel returns the value of Label. +func (s *CIProviderMode) GetLabel() string { + return s.Label } // GetAdditionalProps returns the value of AdditionalProps. -func (s *CreateBindingInputBody) GetAdditionalProps() CreateBindingInputBodyAdditional { +func (s *CIProviderMode) GetAdditionalProps() CIProviderModeAdditional { return s.AdditionalProps } -// SetSchema sets the value of Schema. -func (s *CreateBindingInputBody) SetSchema(val OptURI) { - s.Schema = val +// SetDefault sets the value of Default. +func (s *CIProviderMode) SetDefault(val OptBool) { + s.Default = val } -// SetAttributeFilter sets the value of AttributeFilter. -func (s *CreateBindingInputBody) SetAttributeFilter(val jx.Raw) { - s.AttributeFilter = val +// SetHelp sets the value of Help. +func (s *CIProviderMode) SetHelp(val OptString) { + s.Help = val } -// SetProviderId sets the value of ProviderId. -func (s *CreateBindingInputBody) SetProviderId(val string) { - s.ProviderId = val +// SetKey sets the value of Key. +func (s *CIProviderMode) SetKey(val string) { + s.Key = val +} + +// SetLabel sets the value of Label. +func (s *CIProviderMode) SetLabel(val string) { + s.Label = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *CreateBindingInputBody) SetAdditionalProps(val CreateBindingInputBodyAdditional) { +func (s *CIProviderMode) SetAdditionalProps(val CIProviderModeAdditional) { s.AdditionalProps = val } -type CreateBindingInputBodyAdditional map[string]jx.Raw +type CIProviderModeAdditional map[string]jx.Raw -func (s *CreateBindingInputBodyAdditional) init() CreateBindingInputBodyAdditional { +func (s *CIProviderModeAdditional) init() CIProviderModeAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -1996,81 +2257,48 @@ func (s *CreateBindingInputBodyAdditional) init() CreateBindingInputBodyAddition return m } -// Ref: #/components/schemas/CreateMirrorInputBody -type CreateMirrorInputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - // Destination cluster, as either a bare DNS host or the publicUrl returned by GET /api/v1/clusters. - ClusterHost string `json:"clusterHost"` - Owner string `json:"owner"` - Provider CreateMirrorInputBodyProvider `json:"provider"` - Repo string `json:"repo"` - AdditionalProps CreateMirrorInputBodyAdditional -} - -// GetSchema returns the value of Schema. -func (s *CreateMirrorInputBody) GetSchema() OptURI { - return s.Schema -} - -// GetClusterHost returns the value of ClusterHost. -func (s *CreateMirrorInputBody) GetClusterHost() string { - return s.ClusterHost -} - -// GetOwner returns the value of Owner. -func (s *CreateMirrorInputBody) GetOwner() string { - return s.Owner +// Ref: #/components/schemas/CIProviderOption +type CIProviderOption struct { + // Human-readable label. + Label string `json:"label"` + // Value to post back for this choice. + Value string `json:"value"` + AdditionalProps CIProviderOptionAdditional } -// GetProvider returns the value of Provider. -func (s *CreateMirrorInputBody) GetProvider() CreateMirrorInputBodyProvider { - return s.Provider +// GetLabel returns the value of Label. +func (s *CIProviderOption) GetLabel() string { + return s.Label } -// GetRepo returns the value of Repo. -func (s *CreateMirrorInputBody) GetRepo() string { - return s.Repo +// GetValue returns the value of Value. +func (s *CIProviderOption) GetValue() string { + return s.Value } // GetAdditionalProps returns the value of AdditionalProps. -func (s *CreateMirrorInputBody) GetAdditionalProps() CreateMirrorInputBodyAdditional { +func (s *CIProviderOption) GetAdditionalProps() CIProviderOptionAdditional { return s.AdditionalProps } -// SetSchema sets the value of Schema. -func (s *CreateMirrorInputBody) SetSchema(val OptURI) { - s.Schema = val -} - -// SetClusterHost sets the value of ClusterHost. -func (s *CreateMirrorInputBody) SetClusterHost(val string) { - s.ClusterHost = val -} - -// SetOwner sets the value of Owner. -func (s *CreateMirrorInputBody) SetOwner(val string) { - s.Owner = val -} - -// SetProvider sets the value of Provider. -func (s *CreateMirrorInputBody) SetProvider(val CreateMirrorInputBodyProvider) { - s.Provider = val +// SetLabel sets the value of Label. +func (s *CIProviderOption) SetLabel(val string) { + s.Label = val } -// SetRepo sets the value of Repo. -func (s *CreateMirrorInputBody) SetRepo(val string) { - s.Repo = val +// SetValue sets the value of Value. +func (s *CIProviderOption) SetValue(val string) { + s.Value = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *CreateMirrorInputBody) SetAdditionalProps(val CreateMirrorInputBodyAdditional) { +func (s *CIProviderOption) SetAdditionalProps(val CIProviderOptionAdditional) { s.AdditionalProps = val } -type CreateMirrorInputBodyAdditional map[string]jx.Raw +type CIProviderOptionAdditional map[string]jx.Raw -func (s *CreateMirrorInputBodyAdditional) init() CreateMirrorInputBodyAdditional { +func (s *CIProviderOptionAdditional) init() CIProviderOptionAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -2079,115 +2307,60 @@ func (s *CreateMirrorInputBodyAdditional) init() CreateMirrorInputBodyAdditional return m } -type CreateMirrorInputBodyProvider string - -const ( - CreateMirrorInputBodyProviderGithub CreateMirrorInputBodyProvider = "github" -) +// Ref: #/components/schemas/CISetupBlock +type CISetupBlock struct { + // The content itself, ready to use verbatim. + Content string `json:"content"` + // The content's syntax, for highlighting: yaml, json. + Format string `json:"format"` + // Short instruction naming what to do with the content. + Heading string `json:"heading"` + AdditionalProps CISetupBlockAdditional +} -// AllValues returns all CreateMirrorInputBodyProvider values. -func (CreateMirrorInputBodyProvider) AllValues() []CreateMirrorInputBodyProvider { - return []CreateMirrorInputBodyProvider{ - CreateMirrorInputBodyProviderGithub, - } +// GetContent returns the value of Content. +func (s *CISetupBlock) GetContent() string { + return s.Content } -// MarshalText implements encoding.TextMarshaler. -func (s CreateMirrorInputBodyProvider) MarshalText() ([]byte, error) { - switch s { - case CreateMirrorInputBodyProviderGithub: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } +// GetFormat returns the value of Format. +func (s *CISetupBlock) GetFormat() string { + return s.Format } -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *CreateMirrorInputBodyProvider) UnmarshalText(data []byte) error { - switch CreateMirrorInputBodyProvider(data) { - case CreateMirrorInputBodyProviderGithub: - *s = CreateMirrorInputBodyProviderGithub - return nil - default: - return errors.Errorf("invalid value: %q", data) - } -} - -// Ref: #/components/schemas/CreateMirrorRequestInputBody -type CreateMirrorRequestInputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - // Destination cluster, as either a bare DNS host or the publicUrl returned by GET /api/v1/clusters. - ClusterHost string `json:"clusterHost"` - Owner string `json:"owner"` - Provider CreateMirrorRequestInputBodyProvider `json:"provider"` - Repo string `json:"repo"` - AdditionalProps CreateMirrorRequestInputBodyAdditional -} - -// GetSchema returns the value of Schema. -func (s *CreateMirrorRequestInputBody) GetSchema() OptURI { - return s.Schema -} - -// GetClusterHost returns the value of ClusterHost. -func (s *CreateMirrorRequestInputBody) GetClusterHost() string { - return s.ClusterHost -} - -// GetOwner returns the value of Owner. -func (s *CreateMirrorRequestInputBody) GetOwner() string { - return s.Owner -} - -// GetProvider returns the value of Provider. -func (s *CreateMirrorRequestInputBody) GetProvider() CreateMirrorRequestInputBodyProvider { - return s.Provider -} - -// GetRepo returns the value of Repo. -func (s *CreateMirrorRequestInputBody) GetRepo() string { - return s.Repo +// GetHeading returns the value of Heading. +func (s *CISetupBlock) GetHeading() string { + return s.Heading } // GetAdditionalProps returns the value of AdditionalProps. -func (s *CreateMirrorRequestInputBody) GetAdditionalProps() CreateMirrorRequestInputBodyAdditional { +func (s *CISetupBlock) GetAdditionalProps() CISetupBlockAdditional { return s.AdditionalProps } -// SetSchema sets the value of Schema. -func (s *CreateMirrorRequestInputBody) SetSchema(val OptURI) { - s.Schema = val -} - -// SetClusterHost sets the value of ClusterHost. -func (s *CreateMirrorRequestInputBody) SetClusterHost(val string) { - s.ClusterHost = val -} - -// SetOwner sets the value of Owner. -func (s *CreateMirrorRequestInputBody) SetOwner(val string) { - s.Owner = val +// SetContent sets the value of Content. +func (s *CISetupBlock) SetContent(val string) { + s.Content = val } -// SetProvider sets the value of Provider. -func (s *CreateMirrorRequestInputBody) SetProvider(val CreateMirrorRequestInputBodyProvider) { - s.Provider = val +// SetFormat sets the value of Format. +func (s *CISetupBlock) SetFormat(val string) { + s.Format = val } -// SetRepo sets the value of Repo. -func (s *CreateMirrorRequestInputBody) SetRepo(val string) { - s.Repo = val +// SetHeading sets the value of Heading. +func (s *CISetupBlock) SetHeading(val string) { + s.Heading = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *CreateMirrorRequestInputBody) SetAdditionalProps(val CreateMirrorRequestInputBodyAdditional) { +func (s *CISetupBlock) SetAdditionalProps(val CISetupBlockAdditional) { s.AdditionalProps = val } -type CreateMirrorRequestInputBodyAdditional map[string]jx.Raw +type CISetupBlockAdditional map[string]jx.Raw -func (s *CreateMirrorRequestInputBodyAdditional) init() CreateMirrorRequestInputBodyAdditional { +func (s *CISetupBlockAdditional) init() CISetupBlockAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -2196,81 +2369,60 @@ func (s *CreateMirrorRequestInputBodyAdditional) init() CreateMirrorRequestInput return m } -type CreateMirrorRequestInputBodyProvider string - -const ( - CreateMirrorRequestInputBodyProviderGithub CreateMirrorRequestInputBodyProvider = "github" -) - -// AllValues returns all CreateMirrorRequestInputBodyProvider values. -func (CreateMirrorRequestInputBodyProvider) AllValues() []CreateMirrorRequestInputBodyProvider { - return []CreateMirrorRequestInputBodyProvider{ - CreateMirrorRequestInputBodyProviderGithub, - } -} - -// MarshalText implements encoding.TextMarshaler. -func (s CreateMirrorRequestInputBodyProvider) MarshalText() ([]byte, error) { - switch s { - case CreateMirrorRequestInputBodyProviderGithub: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } -} - -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *CreateMirrorRequestInputBodyProvider) UnmarshalText(data []byte) error { - switch CreateMirrorRequestInputBodyProvider(data) { - case CreateMirrorRequestInputBodyProviderGithub: - *s = CreateMirrorRequestInputBodyProviderGithub - return nil - default: - return errors.Errorf("invalid value: %q", data) - } +// Ref: #/components/schemas/CIWebhookAuditActor +type CIWebhookAuditActor struct { + // Entire account ULID that performed the action. + AccountID string `json:"account_id"` + // Actor's primary handle; empty when they have none. + Handle OptString `json:"handle"` + // Provider the handle came from: github, workos, system. + HandleProvider OptString `json:"handle_provider"` + AdditionalProps CIWebhookAuditActorAdditional } -// Ref: #/components/schemas/CreateNativeMirrorInputBody -type CreateNativeMirrorInputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - ClusterSlug string `json:"clusterSlug"` - AdditionalProps CreateNativeMirrorInputBodyAdditional +// GetAccountID returns the value of AccountID. +func (s *CIWebhookAuditActor) GetAccountID() string { + return s.AccountID } -// GetSchema returns the value of Schema. -func (s *CreateNativeMirrorInputBody) GetSchema() OptURI { - return s.Schema +// GetHandle returns the value of Handle. +func (s *CIWebhookAuditActor) GetHandle() OptString { + return s.Handle } -// GetClusterSlug returns the value of ClusterSlug. -func (s *CreateNativeMirrorInputBody) GetClusterSlug() string { - return s.ClusterSlug +// GetHandleProvider returns the value of HandleProvider. +func (s *CIWebhookAuditActor) GetHandleProvider() OptString { + return s.HandleProvider } // GetAdditionalProps returns the value of AdditionalProps. -func (s *CreateNativeMirrorInputBody) GetAdditionalProps() CreateNativeMirrorInputBodyAdditional { +func (s *CIWebhookAuditActor) GetAdditionalProps() CIWebhookAuditActorAdditional { return s.AdditionalProps } -// SetSchema sets the value of Schema. -func (s *CreateNativeMirrorInputBody) SetSchema(val OptURI) { - s.Schema = val +// SetAccountID sets the value of AccountID. +func (s *CIWebhookAuditActor) SetAccountID(val string) { + s.AccountID = val } -// SetClusterSlug sets the value of ClusterSlug. -func (s *CreateNativeMirrorInputBody) SetClusterSlug(val string) { - s.ClusterSlug = val +// SetHandle sets the value of Handle. +func (s *CIWebhookAuditActor) SetHandle(val OptString) { + s.Handle = val +} + +// SetHandleProvider sets the value of HandleProvider. +func (s *CIWebhookAuditActor) SetHandleProvider(val OptString) { + s.HandleProvider = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *CreateNativeMirrorInputBody) SetAdditionalProps(val CreateNativeMirrorInputBodyAdditional) { +func (s *CIWebhookAuditActor) SetAdditionalProps(val CIWebhookAuditActorAdditional) { s.AdditionalProps = val } -type CreateNativeMirrorInputBodyAdditional map[string]jx.Raw +type CIWebhookAuditActorAdditional map[string]jx.Raw -func (s *CreateNativeMirrorInputBodyAdditional) init() CreateNativeMirrorInputBodyAdditional { +func (s *CIWebhookAuditActorAdditional) init() CIWebhookAuditActorAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -2279,60 +2431,85 @@ func (s *CreateNativeMirrorInputBodyAdditional) init() CreateNativeMirrorInputBo return m } -// Ref: #/components/schemas/CreateOrgInputBody -type CreateOrgInputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - // Display name. - Name string `json:"name"` - // Jurisdiction slug; defaults to the server's home jurisdiction. - Region OptString `json:"region"` - AdditionalProps CreateOrgInputBodyAdditional +// Ref: #/components/schemas/CIWebhookAuditEventView +type CIWebhookAuditEventView struct { + // Who performed the action. + Actor CIWebhookAuditActor `json:"actor"` + // Ci_webhook_enrolled | ci_webhook_updated | ci_webhook_deleted | ci_webhook_identity_rolled_back | + // ci_webhook_identity_orphaned. + EventType string `json:"event_type"` + // Audit event ULID. + ID string `json:"id"` + // Event detail as recorded, e.g. bk_organization/bk_pipeline. + Metadata OptCIWebhookAuditEventViewMetadata `json:"metadata"` + // When the action was recorded (UTC). + OccurredAt time.Time `json:"occurred_at"` + AdditionalProps CIWebhookAuditEventViewAdditional } -// GetSchema returns the value of Schema. -func (s *CreateOrgInputBody) GetSchema() OptURI { - return s.Schema +// GetActor returns the value of Actor. +func (s *CIWebhookAuditEventView) GetActor() CIWebhookAuditActor { + return s.Actor } -// GetName returns the value of Name. -func (s *CreateOrgInputBody) GetName() string { - return s.Name +// GetEventType returns the value of EventType. +func (s *CIWebhookAuditEventView) GetEventType() string { + return s.EventType } -// GetRegion returns the value of Region. -func (s *CreateOrgInputBody) GetRegion() OptString { - return s.Region +// GetID returns the value of ID. +func (s *CIWebhookAuditEventView) GetID() string { + return s.ID +} + +// GetMetadata returns the value of Metadata. +func (s *CIWebhookAuditEventView) GetMetadata() OptCIWebhookAuditEventViewMetadata { + return s.Metadata +} + +// GetOccurredAt returns the value of OccurredAt. +func (s *CIWebhookAuditEventView) GetOccurredAt() time.Time { + return s.OccurredAt } // GetAdditionalProps returns the value of AdditionalProps. -func (s *CreateOrgInputBody) GetAdditionalProps() CreateOrgInputBodyAdditional { +func (s *CIWebhookAuditEventView) GetAdditionalProps() CIWebhookAuditEventViewAdditional { return s.AdditionalProps } -// SetSchema sets the value of Schema. -func (s *CreateOrgInputBody) SetSchema(val OptURI) { - s.Schema = val +// SetActor sets the value of Actor. +func (s *CIWebhookAuditEventView) SetActor(val CIWebhookAuditActor) { + s.Actor = val } -// SetName sets the value of Name. -func (s *CreateOrgInputBody) SetName(val string) { - s.Name = val +// SetEventType sets the value of EventType. +func (s *CIWebhookAuditEventView) SetEventType(val string) { + s.EventType = val } -// SetRegion sets the value of Region. -func (s *CreateOrgInputBody) SetRegion(val OptString) { - s.Region = val +// SetID sets the value of ID. +func (s *CIWebhookAuditEventView) SetID(val string) { + s.ID = val +} + +// SetMetadata sets the value of Metadata. +func (s *CIWebhookAuditEventView) SetMetadata(val OptCIWebhookAuditEventViewMetadata) { + s.Metadata = val +} + +// SetOccurredAt sets the value of OccurredAt. +func (s *CIWebhookAuditEventView) SetOccurredAt(val time.Time) { + s.OccurredAt = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *CreateOrgInputBody) SetAdditionalProps(val CreateOrgInputBodyAdditional) { +func (s *CIWebhookAuditEventView) SetAdditionalProps(val CIWebhookAuditEventViewAdditional) { s.AdditionalProps = val } -type CreateOrgInputBodyAdditional map[string]jx.Raw +type CIWebhookAuditEventViewAdditional map[string]jx.Raw -func (s *CreateOrgInputBodyAdditional) init() CreateOrgInputBodyAdditional { +func (s *CIWebhookAuditEventViewAdditional) init() CIWebhookAuditEventViewAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -2341,80 +2518,10 @@ func (s *CreateOrgInputBodyAdditional) init() CreateOrgInputBodyAdditional { return m } -// Ref: #/components/schemas/CreateProjectInputBody -type CreateProjectInputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Name string `json:"name"` - OwnerId string `json:"ownerId"` - OwnerType CreateProjectInputBodyOwnerType `json:"ownerType"` - Region OptString `json:"region"` - AdditionalProps CreateProjectInputBodyAdditional -} - -// GetSchema returns the value of Schema. -func (s *CreateProjectInputBody) GetSchema() OptURI { - return s.Schema -} - -// GetName returns the value of Name. -func (s *CreateProjectInputBody) GetName() string { - return s.Name -} - -// GetOwnerId returns the value of OwnerId. -func (s *CreateProjectInputBody) GetOwnerId() string { - return s.OwnerId -} - -// GetOwnerType returns the value of OwnerType. -func (s *CreateProjectInputBody) GetOwnerType() CreateProjectInputBodyOwnerType { - return s.OwnerType -} - -// GetRegion returns the value of Region. -func (s *CreateProjectInputBody) GetRegion() OptString { - return s.Region -} - -// GetAdditionalProps returns the value of AdditionalProps. -func (s *CreateProjectInputBody) GetAdditionalProps() CreateProjectInputBodyAdditional { - return s.AdditionalProps -} - -// SetSchema sets the value of Schema. -func (s *CreateProjectInputBody) SetSchema(val OptURI) { - s.Schema = val -} - -// SetName sets the value of Name. -func (s *CreateProjectInputBody) SetName(val string) { - s.Name = val -} - -// SetOwnerId sets the value of OwnerId. -func (s *CreateProjectInputBody) SetOwnerId(val string) { - s.OwnerId = val -} - -// SetOwnerType sets the value of OwnerType. -func (s *CreateProjectInputBody) SetOwnerType(val CreateProjectInputBodyOwnerType) { - s.OwnerType = val -} - -// SetRegion sets the value of Region. -func (s *CreateProjectInputBody) SetRegion(val OptString) { - s.Region = val -} - -// SetAdditionalProps sets the value of AdditionalProps. -func (s *CreateProjectInputBody) SetAdditionalProps(val CreateProjectInputBodyAdditional) { - s.AdditionalProps = val -} - -type CreateProjectInputBodyAdditional map[string]jx.Raw +// Event detail as recorded, e.g. bk_organization/bk_pipeline. +type CIWebhookAuditEventViewMetadata map[string]jx.Raw -func (s *CreateProjectInputBodyAdditional) init() CreateProjectInputBodyAdditional { +func (s *CIWebhookAuditEventViewMetadata) init() CIWebhookAuditEventViewMetadata { m := *s if m == nil { m = map[string]jx.Raw{} @@ -2423,260 +2530,201 @@ func (s *CreateProjectInputBodyAdditional) init() CreateProjectInputBodyAddition return m } -type CreateProjectInputBodyOwnerType string - -const ( - CreateProjectInputBodyOwnerTypeOrg CreateProjectInputBodyOwnerType = "org" - CreateProjectInputBodyOwnerTypeAccount CreateProjectInputBodyOwnerType = "account" -) - -// AllValues returns all CreateProjectInputBodyOwnerType values. -func (CreateProjectInputBodyOwnerType) AllValues() []CreateProjectInputBodyOwnerType { - return []CreateProjectInputBodyOwnerType{ - CreateProjectInputBodyOwnerTypeOrg, - CreateProjectInputBodyOwnerTypeAccount, - } -} - -// MarshalText implements encoding.TextMarshaler. -func (s CreateProjectInputBodyOwnerType) MarshalText() ([]byte, error) { - switch s { - case CreateProjectInputBodyOwnerTypeOrg: - return []byte(s), nil - case CreateProjectInputBodyOwnerTypeAccount: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } -} - -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *CreateProjectInputBodyOwnerType) UnmarshalText(data []byte) error { - switch CreateProjectInputBodyOwnerType(data) { - case CreateProjectInputBodyOwnerTypeOrg: - *s = CreateProjectInputBodyOwnerTypeOrg - return nil - case CreateProjectInputBodyOwnerTypeAccount: - *s = CreateProjectInputBodyOwnerTypeAccount - return nil - default: - return errors.Errorf("invalid value: %q", data) - } -} - -// Ref: #/components/schemas/CreateRepoCIWebhookBody -type CreateRepoCIWebhookBody struct { +// Ref: #/components/schemas/CIWebhookView +type CIWebhookView struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - // Entire-core-auth Buildkite plugin ref this pipeline is built with: the registered cluster's - // override, else the pinned default; goes in the bootstrap config's plugins list. - AuthPluginRef string `json:"auth_plugin_ref"` - // Automation (aut_) the enrolled pipeline's builds exchange their OIDC token for; goes in the - // bootstrap config as the automation: resource (ENTIRE_CORE_AUTH_RESOURCE). - AutomationID string `json:"automation_id"` - BkOrganization string `json:"bk_organization"` - BkPipeline string `json:"bk_pipeline"` - // Entire-core base URL the bootstrap auth plugin talks to; goes in the bootstrap config as - // ENTIRE_CORE_AUTH_URL. - CoreURL string `json:"core_url"` - CreatedAt time.Time `json:"created_at"` - DisplayName string `json:"display_name"` - Enabled bool `json:"enabled"` - Events []string `json:"events"` - ID string `json:"id"` - Provider string `json:"provider"` - PublishChecks bool `json:"publish_checks"` - RefFilter string `json:"ref_filter"` - RepoID string `json:"repo_id"` - // What to do next, rendered ready to use. Present on a self-managed enrolment. - Setup OptCISetupBlock `json:"setup"` - UpdatedAt time.Time `json:"updated_at"` - AdditionalProps CreateRepoCIWebhookBodyAdditional + Schema OptURI `json:"$schema"` + BkOrganization string `json:"bk_organization"` + BkPipeline string `json:"bk_pipeline"` + CreatedAt time.Time `json:"created_at"` + DisplayName string `json:"display_name"` + Enabled bool `json:"enabled"` + Events []string `json:"events"` + ID string `json:"id"` + Provider string `json:"provider"` + ProviderAccount string `json:"provider_account"` + PublishChecks bool `json:"publish_checks"` + RefFilter string `json:"ref_filter"` + RepoID string `json:"repo_id"` + RepoWrite bool `json:"repo_write"` + TargetRef string `json:"target_ref"` + UpdatedAt time.Time `json:"updated_at"` + AdditionalProps CIWebhookViewAdditional } // GetSchema returns the value of Schema. -func (s *CreateRepoCIWebhookBody) GetSchema() OptURI { +func (s *CIWebhookView) GetSchema() OptURI { return s.Schema } -// GetAuthPluginRef returns the value of AuthPluginRef. -func (s *CreateRepoCIWebhookBody) GetAuthPluginRef() string { - return s.AuthPluginRef -} - -// GetAutomationID returns the value of AutomationID. -func (s *CreateRepoCIWebhookBody) GetAutomationID() string { - return s.AutomationID -} - // GetBkOrganization returns the value of BkOrganization. -func (s *CreateRepoCIWebhookBody) GetBkOrganization() string { +func (s *CIWebhookView) GetBkOrganization() string { return s.BkOrganization } // GetBkPipeline returns the value of BkPipeline. -func (s *CreateRepoCIWebhookBody) GetBkPipeline() string { +func (s *CIWebhookView) GetBkPipeline() string { return s.BkPipeline } -// GetCoreURL returns the value of CoreURL. -func (s *CreateRepoCIWebhookBody) GetCoreURL() string { - return s.CoreURL -} - // GetCreatedAt returns the value of CreatedAt. -func (s *CreateRepoCIWebhookBody) GetCreatedAt() time.Time { +func (s *CIWebhookView) GetCreatedAt() time.Time { return s.CreatedAt } // GetDisplayName returns the value of DisplayName. -func (s *CreateRepoCIWebhookBody) GetDisplayName() string { +func (s *CIWebhookView) GetDisplayName() string { return s.DisplayName } // GetEnabled returns the value of Enabled. -func (s *CreateRepoCIWebhookBody) GetEnabled() bool { +func (s *CIWebhookView) GetEnabled() bool { return s.Enabled } // GetEvents returns the value of Events. -func (s *CreateRepoCIWebhookBody) GetEvents() []string { +func (s *CIWebhookView) GetEvents() []string { return s.Events } // GetID returns the value of ID. -func (s *CreateRepoCIWebhookBody) GetID() string { +func (s *CIWebhookView) GetID() string { return s.ID } // GetProvider returns the value of Provider. -func (s *CreateRepoCIWebhookBody) GetProvider() string { +func (s *CIWebhookView) GetProvider() string { return s.Provider } +// GetProviderAccount returns the value of ProviderAccount. +func (s *CIWebhookView) GetProviderAccount() string { + return s.ProviderAccount +} + // GetPublishChecks returns the value of PublishChecks. -func (s *CreateRepoCIWebhookBody) GetPublishChecks() bool { +func (s *CIWebhookView) GetPublishChecks() bool { return s.PublishChecks } // GetRefFilter returns the value of RefFilter. -func (s *CreateRepoCIWebhookBody) GetRefFilter() string { +func (s *CIWebhookView) GetRefFilter() string { return s.RefFilter } // GetRepoID returns the value of RepoID. -func (s *CreateRepoCIWebhookBody) GetRepoID() string { +func (s *CIWebhookView) GetRepoID() string { return s.RepoID } -// GetSetup returns the value of Setup. -func (s *CreateRepoCIWebhookBody) GetSetup() OptCISetupBlock { - return s.Setup +// GetRepoWrite returns the value of RepoWrite. +func (s *CIWebhookView) GetRepoWrite() bool { + return s.RepoWrite +} + +// GetTargetRef returns the value of TargetRef. +func (s *CIWebhookView) GetTargetRef() string { + return s.TargetRef } // GetUpdatedAt returns the value of UpdatedAt. -func (s *CreateRepoCIWebhookBody) GetUpdatedAt() time.Time { +func (s *CIWebhookView) GetUpdatedAt() time.Time { return s.UpdatedAt } // GetAdditionalProps returns the value of AdditionalProps. -func (s *CreateRepoCIWebhookBody) GetAdditionalProps() CreateRepoCIWebhookBodyAdditional { +func (s *CIWebhookView) GetAdditionalProps() CIWebhookViewAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *CreateRepoCIWebhookBody) SetSchema(val OptURI) { +func (s *CIWebhookView) SetSchema(val OptURI) { s.Schema = val } -// SetAuthPluginRef sets the value of AuthPluginRef. -func (s *CreateRepoCIWebhookBody) SetAuthPluginRef(val string) { - s.AuthPluginRef = val -} - -// SetAutomationID sets the value of AutomationID. -func (s *CreateRepoCIWebhookBody) SetAutomationID(val string) { - s.AutomationID = val -} - // SetBkOrganization sets the value of BkOrganization. -func (s *CreateRepoCIWebhookBody) SetBkOrganization(val string) { +func (s *CIWebhookView) SetBkOrganization(val string) { s.BkOrganization = val } // SetBkPipeline sets the value of BkPipeline. -func (s *CreateRepoCIWebhookBody) SetBkPipeline(val string) { +func (s *CIWebhookView) SetBkPipeline(val string) { s.BkPipeline = val } -// SetCoreURL sets the value of CoreURL. -func (s *CreateRepoCIWebhookBody) SetCoreURL(val string) { - s.CoreURL = val -} - // SetCreatedAt sets the value of CreatedAt. -func (s *CreateRepoCIWebhookBody) SetCreatedAt(val time.Time) { +func (s *CIWebhookView) SetCreatedAt(val time.Time) { s.CreatedAt = val } // SetDisplayName sets the value of DisplayName. -func (s *CreateRepoCIWebhookBody) SetDisplayName(val string) { +func (s *CIWebhookView) SetDisplayName(val string) { s.DisplayName = val } // SetEnabled sets the value of Enabled. -func (s *CreateRepoCIWebhookBody) SetEnabled(val bool) { +func (s *CIWebhookView) SetEnabled(val bool) { s.Enabled = val } // SetEvents sets the value of Events. -func (s *CreateRepoCIWebhookBody) SetEvents(val []string) { +func (s *CIWebhookView) SetEvents(val []string) { s.Events = val } // SetID sets the value of ID. -func (s *CreateRepoCIWebhookBody) SetID(val string) { +func (s *CIWebhookView) SetID(val string) { s.ID = val } // SetProvider sets the value of Provider. -func (s *CreateRepoCIWebhookBody) SetProvider(val string) { +func (s *CIWebhookView) SetProvider(val string) { s.Provider = val } +// SetProviderAccount sets the value of ProviderAccount. +func (s *CIWebhookView) SetProviderAccount(val string) { + s.ProviderAccount = val +} + // SetPublishChecks sets the value of PublishChecks. -func (s *CreateRepoCIWebhookBody) SetPublishChecks(val bool) { +func (s *CIWebhookView) SetPublishChecks(val bool) { s.PublishChecks = val } // SetRefFilter sets the value of RefFilter. -func (s *CreateRepoCIWebhookBody) SetRefFilter(val string) { +func (s *CIWebhookView) SetRefFilter(val string) { s.RefFilter = val } // SetRepoID sets the value of RepoID. -func (s *CreateRepoCIWebhookBody) SetRepoID(val string) { +func (s *CIWebhookView) SetRepoID(val string) { s.RepoID = val } -// SetSetup sets the value of Setup. -func (s *CreateRepoCIWebhookBody) SetSetup(val OptCISetupBlock) { - s.Setup = val +// SetRepoWrite sets the value of RepoWrite. +func (s *CIWebhookView) SetRepoWrite(val bool) { + s.RepoWrite = val +} + +// SetTargetRef sets the value of TargetRef. +func (s *CIWebhookView) SetTargetRef(val string) { + s.TargetRef = val } // SetUpdatedAt sets the value of UpdatedAt. -func (s *CreateRepoCIWebhookBody) SetUpdatedAt(val time.Time) { +func (s *CIWebhookView) SetUpdatedAt(val time.Time) { s.UpdatedAt = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *CreateRepoCIWebhookBody) SetAdditionalProps(val CreateRepoCIWebhookBodyAdditional) { +func (s *CIWebhookView) SetAdditionalProps(val CIWebhookViewAdditional) { s.AdditionalProps = val } -type CreateRepoCIWebhookBodyAdditional map[string]jx.Raw +type CIWebhookViewAdditional map[string]jx.Raw -func (s *CreateRepoCIWebhookBodyAdditional) init() CreateRepoCIWebhookBodyAdditional { +func (s *CIWebhookViewAdditional) init() CIWebhookViewAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -2685,205 +2733,192 @@ func (s *CreateRepoCIWebhookBodyAdditional) init() CreateRepoCIWebhookBodyAdditi return m } -// Ref: #/components/schemas/CreateRepoCIWebhookInputBody -type CreateRepoCIWebhookInputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - BkClusterID OptString `json:"bk_cluster_id"` - // Overwrite an existing pipeline's configuration with the generated bootstrap step, DISCARDING - // manual edits. Repairs a pipeline left naming an automation that a teardown retired. Requires - // bk_provisioning_token; refused on a self-managed pipeline. - BkForceRescaffold OptBool `json:"bk_force_rescaffold"` - BkOrganization OptString `json:"bk_organization"` - BkPipeline OptString `json:"bk_pipeline"` - // The customer created and maintains this Buildkite pipeline. entire never creates, reconciles or - // reads it, and bk_provisioning_token is neither required nor accepted. - BkPipelineSelfManaged OptBool `json:"bk_pipeline_self_managed"` - // Transient Buildkite token (write_pipelines) to create the pipeline; write-only, never stored. - // Required on first enroll; omit on a routing-only re-enroll. Refused for an existing pipeline - // unless bk_force_rescaffold is also set. - BkProvisioningToken OptString `json:"bk_provisioning_token"` - // Provider-specific values from the providers listing; opaque to core. For buildkite: cluster_id, - // provisioning_token, force_rescaffold. - Config OptCreateRepoCIWebhookInputBodyConfig `json:"config"` - DisplayName OptString `json:"display_name"` - Events []string `json:"events"` - // How to enrol, from the chosen provider's modes. For buildkite: self_managed or provisioned. - Mode OptString `json:"mode"` - Provider string `json:"provider"` - // Vendor-side account to enrol against (for buildkite, the organization slug). Use with - // provider/mode/config; omit when sending the bk_* fields. - ProviderAccount OptString `json:"provider_account"` - RefFilter OptString `json:"ref_filter"` - // Vendor-side build target (for buildkite, the pipeline slug). Defaults to a slug derived from the - // repo. - TargetRef OptString `json:"target_ref"` - AdditionalProps CreateRepoCIWebhookInputBodyAdditional +// CancelDeletionOK is response for CancelDeletion operation. +type CancelDeletionOK struct{} + +// Ref: #/components/schemas/Cluster +type Cluster struct { + ApiUrl OptString `json:"apiUrl"` + IsDefault bool `json:"isDefault"` + Jurisdiction string `json:"jurisdiction"` + PublicUrl string `json:"publicUrl"` + Slug string `json:"slug"` + AdditionalProps ClusterAdditional } -// GetSchema returns the value of Schema. -func (s *CreateRepoCIWebhookInputBody) GetSchema() OptURI { - return s.Schema +// GetApiUrl returns the value of ApiUrl. +func (s *Cluster) GetApiUrl() OptString { + return s.ApiUrl } -// GetBkClusterID returns the value of BkClusterID. -func (s *CreateRepoCIWebhookInputBody) GetBkClusterID() OptString { - return s.BkClusterID +// GetIsDefault returns the value of IsDefault. +func (s *Cluster) GetIsDefault() bool { + return s.IsDefault } -// GetBkForceRescaffold returns the value of BkForceRescaffold. -func (s *CreateRepoCIWebhookInputBody) GetBkForceRescaffold() OptBool { - return s.BkForceRescaffold +// GetJurisdiction returns the value of Jurisdiction. +func (s *Cluster) GetJurisdiction() string { + return s.Jurisdiction } -// GetBkOrganization returns the value of BkOrganization. -func (s *CreateRepoCIWebhookInputBody) GetBkOrganization() OptString { - return s.BkOrganization +// GetPublicUrl returns the value of PublicUrl. +func (s *Cluster) GetPublicUrl() string { + return s.PublicUrl } -// GetBkPipeline returns the value of BkPipeline. -func (s *CreateRepoCIWebhookInputBody) GetBkPipeline() OptString { - return s.BkPipeline +// GetSlug returns the value of Slug. +func (s *Cluster) GetSlug() string { + return s.Slug } -// GetBkPipelineSelfManaged returns the value of BkPipelineSelfManaged. -func (s *CreateRepoCIWebhookInputBody) GetBkPipelineSelfManaged() OptBool { - return s.BkPipelineSelfManaged +// GetAdditionalProps returns the value of AdditionalProps. +func (s *Cluster) GetAdditionalProps() ClusterAdditional { + return s.AdditionalProps } -// GetBkProvisioningToken returns the value of BkProvisioningToken. -func (s *CreateRepoCIWebhookInputBody) GetBkProvisioningToken() OptString { - return s.BkProvisioningToken +// SetApiUrl sets the value of ApiUrl. +func (s *Cluster) SetApiUrl(val OptString) { + s.ApiUrl = val } -// GetConfig returns the value of Config. -func (s *CreateRepoCIWebhookInputBody) GetConfig() OptCreateRepoCIWebhookInputBodyConfig { - return s.Config +// SetIsDefault sets the value of IsDefault. +func (s *Cluster) SetIsDefault(val bool) { + s.IsDefault = val } -// GetDisplayName returns the value of DisplayName. -func (s *CreateRepoCIWebhookInputBody) GetDisplayName() OptString { - return s.DisplayName +// SetJurisdiction sets the value of Jurisdiction. +func (s *Cluster) SetJurisdiction(val string) { + s.Jurisdiction = val } -// GetEvents returns the value of Events. -func (s *CreateRepoCIWebhookInputBody) GetEvents() []string { - return s.Events +// SetPublicUrl sets the value of PublicUrl. +func (s *Cluster) SetPublicUrl(val string) { + s.PublicUrl = val } -// GetMode returns the value of Mode. -func (s *CreateRepoCIWebhookInputBody) GetMode() OptString { - return s.Mode +// SetSlug sets the value of Slug. +func (s *Cluster) SetSlug(val string) { + s.Slug = val } -// GetProvider returns the value of Provider. -func (s *CreateRepoCIWebhookInputBody) GetProvider() string { - return s.Provider +// SetAdditionalProps sets the value of AdditionalProps. +func (s *Cluster) SetAdditionalProps(val ClusterAdditional) { + s.AdditionalProps = val } -// GetProviderAccount returns the value of ProviderAccount. -func (s *CreateRepoCIWebhookInputBody) GetProviderAccount() OptString { - return s.ProviderAccount +type ClusterAdditional map[string]jx.Raw + +func (s *ClusterAdditional) init() ClusterAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m } -// GetRefFilter returns the value of RefFilter. -func (s *CreateRepoCIWebhookInputBody) GetRefFilter() OptString { - return s.RefFilter +// Ref: #/components/schemas/CompleteOnboardingOutputBody +type CompleteOnboardingOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + // Always false after onboarding completion is recorded. + NeedsOnboarding bool `json:"needsOnboarding"` + AdditionalProps CompleteOnboardingOutputBodyAdditional } -// GetTargetRef returns the value of TargetRef. -func (s *CreateRepoCIWebhookInputBody) GetTargetRef() OptString { - return s.TargetRef +// GetSchema returns the value of Schema. +func (s *CompleteOnboardingOutputBody) GetSchema() OptURI { + return s.Schema +} + +// GetNeedsOnboarding returns the value of NeedsOnboarding. +func (s *CompleteOnboardingOutputBody) GetNeedsOnboarding() bool { + return s.NeedsOnboarding } // GetAdditionalProps returns the value of AdditionalProps. -func (s *CreateRepoCIWebhookInputBody) GetAdditionalProps() CreateRepoCIWebhookInputBodyAdditional { +func (s *CompleteOnboardingOutputBody) GetAdditionalProps() CompleteOnboardingOutputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *CreateRepoCIWebhookInputBody) SetSchema(val OptURI) { +func (s *CompleteOnboardingOutputBody) SetSchema(val OptURI) { s.Schema = val } -// SetBkClusterID sets the value of BkClusterID. -func (s *CreateRepoCIWebhookInputBody) SetBkClusterID(val OptString) { - s.BkClusterID = val -} - -// SetBkForceRescaffold sets the value of BkForceRescaffold. -func (s *CreateRepoCIWebhookInputBody) SetBkForceRescaffold(val OptBool) { - s.BkForceRescaffold = val -} - -// SetBkOrganization sets the value of BkOrganization. -func (s *CreateRepoCIWebhookInputBody) SetBkOrganization(val OptString) { - s.BkOrganization = val +// SetNeedsOnboarding sets the value of NeedsOnboarding. +func (s *CompleteOnboardingOutputBody) SetNeedsOnboarding(val bool) { + s.NeedsOnboarding = val } -// SetBkPipeline sets the value of BkPipeline. -func (s *CreateRepoCIWebhookInputBody) SetBkPipeline(val OptString) { - s.BkPipeline = val +// SetAdditionalProps sets the value of AdditionalProps. +func (s *CompleteOnboardingOutputBody) SetAdditionalProps(val CompleteOnboardingOutputBodyAdditional) { + s.AdditionalProps = val } -// SetBkPipelineSelfManaged sets the value of BkPipelineSelfManaged. -func (s *CreateRepoCIWebhookInputBody) SetBkPipelineSelfManaged(val OptBool) { - s.BkPipelineSelfManaged = val -} +type CompleteOnboardingOutputBodyAdditional map[string]jx.Raw -// SetBkProvisioningToken sets the value of BkProvisioningToken. -func (s *CreateRepoCIWebhookInputBody) SetBkProvisioningToken(val OptString) { - s.BkProvisioningToken = val +func (s *CompleteOnboardingOutputBodyAdditional) init() CompleteOnboardingOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m } -// SetConfig sets the value of Config. -func (s *CreateRepoCIWebhookInputBody) SetConfig(val OptCreateRepoCIWebhookInputBodyConfig) { - s.Config = val +// Ref: #/components/schemas/ConnectOrgCIBuildkiteCredentialInputBody +type ConnectOrgCIBuildkiteCredentialInputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + BkAPIToken string `json:"bk_api_token"` + BkOrganization string `json:"bk_organization"` + AdditionalProps ConnectOrgCIBuildkiteCredentialInputBodyAdditional } -// SetDisplayName sets the value of DisplayName. -func (s *CreateRepoCIWebhookInputBody) SetDisplayName(val OptString) { - s.DisplayName = val +// GetSchema returns the value of Schema. +func (s *ConnectOrgCIBuildkiteCredentialInputBody) GetSchema() OptURI { + return s.Schema } -// SetEvents sets the value of Events. -func (s *CreateRepoCIWebhookInputBody) SetEvents(val []string) { - s.Events = val +// GetBkAPIToken returns the value of BkAPIToken. +func (s *ConnectOrgCIBuildkiteCredentialInputBody) GetBkAPIToken() string { + return s.BkAPIToken } -// SetMode sets the value of Mode. -func (s *CreateRepoCIWebhookInputBody) SetMode(val OptString) { - s.Mode = val +// GetBkOrganization returns the value of BkOrganization. +func (s *ConnectOrgCIBuildkiteCredentialInputBody) GetBkOrganization() string { + return s.BkOrganization } -// SetProvider sets the value of Provider. -func (s *CreateRepoCIWebhookInputBody) SetProvider(val string) { - s.Provider = val +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ConnectOrgCIBuildkiteCredentialInputBody) GetAdditionalProps() ConnectOrgCIBuildkiteCredentialInputBodyAdditional { + return s.AdditionalProps } -// SetProviderAccount sets the value of ProviderAccount. -func (s *CreateRepoCIWebhookInputBody) SetProviderAccount(val OptString) { - s.ProviderAccount = val +// SetSchema sets the value of Schema. +func (s *ConnectOrgCIBuildkiteCredentialInputBody) SetSchema(val OptURI) { + s.Schema = val } -// SetRefFilter sets the value of RefFilter. -func (s *CreateRepoCIWebhookInputBody) SetRefFilter(val OptString) { - s.RefFilter = val +// SetBkAPIToken sets the value of BkAPIToken. +func (s *ConnectOrgCIBuildkiteCredentialInputBody) SetBkAPIToken(val string) { + s.BkAPIToken = val } -// SetTargetRef sets the value of TargetRef. -func (s *CreateRepoCIWebhookInputBody) SetTargetRef(val OptString) { - s.TargetRef = val +// SetBkOrganization sets the value of BkOrganization. +func (s *ConnectOrgCIBuildkiteCredentialInputBody) SetBkOrganization(val string) { + s.BkOrganization = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *CreateRepoCIWebhookInputBody) SetAdditionalProps(val CreateRepoCIWebhookInputBodyAdditional) { +func (s *ConnectOrgCIBuildkiteCredentialInputBody) SetAdditionalProps(val ConnectOrgCIBuildkiteCredentialInputBodyAdditional) { s.AdditionalProps = val } -type CreateRepoCIWebhookInputBodyAdditional map[string]jx.Raw +type ConnectOrgCIBuildkiteCredentialInputBodyAdditional map[string]jx.Raw -func (s *CreateRepoCIWebhookInputBodyAdditional) init() CreateRepoCIWebhookInputBodyAdditional { +func (s *ConnectOrgCIBuildkiteCredentialInputBodyAdditional) init() ConnectOrgCIBuildkiteCredentialInputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -2892,96 +2927,48 @@ func (s *CreateRepoCIWebhookInputBodyAdditional) init() CreateRepoCIWebhookInput return m } -// Provider-specific values from the providers listing; opaque to core. For buildkite: cluster_id, -// provisioning_token, force_rescaffold. -type CreateRepoCIWebhookInputBodyConfig map[string]string - -func (s *CreateRepoCIWebhookInputBodyConfig) init() CreateRepoCIWebhookInputBodyConfig { - m := *s - if m == nil { - m = map[string]string{} - *s = m - } - return m -} - -// Ref: #/components/schemas/CreateRepoInputBody -type CreateRepoInputBody struct { +// Ref: #/components/schemas/ConnectOrgCIDepotOrganizationInputBody +type ConnectOrgCIDepotOrganizationInputBody struct { // A URL to the JSON Schema for this object. Schema OptURI `json:"$schema"` - // Public host of the cluster to pin the repo to (e.g. royalcanin.partial.to); empty lands on the - // jurisdiction default. - ClusterHost OptString `json:"clusterHost"` - Name string `json:"name"` - // Hash format; defaults to sha1. - ObjectFormat OptCreateRepoInputBodyObjectFormat `json:"objectFormat"` - ProjectId string `json:"projectId"` - AdditionalProps CreateRepoInputBodyAdditional + // Depot organisation id, as Depot's provisioning call returns it. + Account string `json:"account"` + AdditionalProps ConnectOrgCIDepotOrganizationInputBodyAdditional } // GetSchema returns the value of Schema. -func (s *CreateRepoInputBody) GetSchema() OptURI { +func (s *ConnectOrgCIDepotOrganizationInputBody) GetSchema() OptURI { return s.Schema } -// GetClusterHost returns the value of ClusterHost. -func (s *CreateRepoInputBody) GetClusterHost() OptString { - return s.ClusterHost -} - -// GetName returns the value of Name. -func (s *CreateRepoInputBody) GetName() string { - return s.Name -} - -// GetObjectFormat returns the value of ObjectFormat. -func (s *CreateRepoInputBody) GetObjectFormat() OptCreateRepoInputBodyObjectFormat { - return s.ObjectFormat -} - -// GetProjectId returns the value of ProjectId. -func (s *CreateRepoInputBody) GetProjectId() string { - return s.ProjectId +// GetAccount returns the value of Account. +func (s *ConnectOrgCIDepotOrganizationInputBody) GetAccount() string { + return s.Account } // GetAdditionalProps returns the value of AdditionalProps. -func (s *CreateRepoInputBody) GetAdditionalProps() CreateRepoInputBodyAdditional { +func (s *ConnectOrgCIDepotOrganizationInputBody) GetAdditionalProps() ConnectOrgCIDepotOrganizationInputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *CreateRepoInputBody) SetSchema(val OptURI) { +func (s *ConnectOrgCIDepotOrganizationInputBody) SetSchema(val OptURI) { s.Schema = val } -// SetClusterHost sets the value of ClusterHost. -func (s *CreateRepoInputBody) SetClusterHost(val OptString) { - s.ClusterHost = val -} - -// SetName sets the value of Name. -func (s *CreateRepoInputBody) SetName(val string) { - s.Name = val -} - -// SetObjectFormat sets the value of ObjectFormat. -func (s *CreateRepoInputBody) SetObjectFormat(val OptCreateRepoInputBodyObjectFormat) { - s.ObjectFormat = val -} - -// SetProjectId sets the value of ProjectId. -func (s *CreateRepoInputBody) SetProjectId(val string) { - s.ProjectId = val +// SetAccount sets the value of Account. +func (s *ConnectOrgCIDepotOrganizationInputBody) SetAccount(val string) { + s.Account = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *CreateRepoInputBody) SetAdditionalProps(val CreateRepoInputBodyAdditional) { +func (s *ConnectOrgCIDepotOrganizationInputBody) SetAdditionalProps(val ConnectOrgCIDepotOrganizationInputBodyAdditional) { s.AdditionalProps = val } -type CreateRepoInputBodyAdditional map[string]jx.Raw +type ConnectOrgCIDepotOrganizationInputBodyAdditional map[string]jx.Raw -func (s *CreateRepoInputBodyAdditional) init() CreateRepoInputBodyAdditional { +func (s *ConnectOrgCIDepotOrganizationInputBodyAdditional) init() ConnectOrgCIDepotOrganizationInputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -2990,100 +2977,59 @@ func (s *CreateRepoInputBodyAdditional) init() CreateRepoInputBodyAdditional { return m } -// Hash format; defaults to sha1. -type CreateRepoInputBodyObjectFormat string - -const ( - CreateRepoInputBodyObjectFormatSHA1 CreateRepoInputBodyObjectFormat = "sha1" - CreateRepoInputBodyObjectFormatSHA256 CreateRepoInputBodyObjectFormat = "sha256" -) - -// AllValues returns all CreateRepoInputBodyObjectFormat values. -func (CreateRepoInputBodyObjectFormat) AllValues() []CreateRepoInputBodyObjectFormat { - return []CreateRepoInputBodyObjectFormat{ - CreateRepoInputBodyObjectFormatSHA1, - CreateRepoInputBodyObjectFormatSHA256, - } -} - -// MarshalText implements encoding.TextMarshaler. -func (s CreateRepoInputBodyObjectFormat) MarshalText() ([]byte, error) { - switch s { - case CreateRepoInputBodyObjectFormatSHA1: - return []byte(s), nil - case CreateRepoInputBodyObjectFormatSHA256: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } -} - -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *CreateRepoInputBodyObjectFormat) UnmarshalText(data []byte) error { - switch CreateRepoInputBodyObjectFormat(data) { - case CreateRepoInputBodyObjectFormatSHA1: - *s = CreateRepoInputBodyObjectFormatSHA1 - return nil - case CreateRepoInputBodyObjectFormatSHA256: - *s = CreateRepoInputBodyObjectFormatSHA256 - return nil - default: - return errors.Errorf("invalid value: %q", data) - } -} - -// Ref: #/components/schemas/CreateServiceAccountInputBody -type CreateServiceAccountInputBody struct { +// Ref: #/components/schemas/CreateBindingInputBody +type CreateBindingInputBody struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Name string `json:"name"` - OrgId string `json:"orgId"` - AdditionalProps CreateServiceAccountInputBodyAdditional + Schema OptURI `json:"$schema"` + // Exact-match key/value map; empty filter matches any token. + AttributeFilter jx.Raw `json:"attributeFilter"` + ProviderId string `json:"providerId"` + AdditionalProps CreateBindingInputBodyAdditional } // GetSchema returns the value of Schema. -func (s *CreateServiceAccountInputBody) GetSchema() OptURI { +func (s *CreateBindingInputBody) GetSchema() OptURI { return s.Schema } -// GetName returns the value of Name. -func (s *CreateServiceAccountInputBody) GetName() string { - return s.Name +// GetAttributeFilter returns the value of AttributeFilter. +func (s *CreateBindingInputBody) GetAttributeFilter() jx.Raw { + return s.AttributeFilter } -// GetOrgId returns the value of OrgId. -func (s *CreateServiceAccountInputBody) GetOrgId() string { - return s.OrgId +// GetProviderId returns the value of ProviderId. +func (s *CreateBindingInputBody) GetProviderId() string { + return s.ProviderId } // GetAdditionalProps returns the value of AdditionalProps. -func (s *CreateServiceAccountInputBody) GetAdditionalProps() CreateServiceAccountInputBodyAdditional { +func (s *CreateBindingInputBody) GetAdditionalProps() CreateBindingInputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *CreateServiceAccountInputBody) SetSchema(val OptURI) { +func (s *CreateBindingInputBody) SetSchema(val OptURI) { s.Schema = val } -// SetName sets the value of Name. -func (s *CreateServiceAccountInputBody) SetName(val string) { - s.Name = val +// SetAttributeFilter sets the value of AttributeFilter. +func (s *CreateBindingInputBody) SetAttributeFilter(val jx.Raw) { + s.AttributeFilter = val } -// SetOrgId sets the value of OrgId. -func (s *CreateServiceAccountInputBody) SetOrgId(val string) { - s.OrgId = val +// SetProviderId sets the value of ProviderId. +func (s *CreateBindingInputBody) SetProviderId(val string) { + s.ProviderId = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *CreateServiceAccountInputBody) SetAdditionalProps(val CreateServiceAccountInputBodyAdditional) { +func (s *CreateBindingInputBody) SetAdditionalProps(val CreateBindingInputBodyAdditional) { s.AdditionalProps = val } -type CreateServiceAccountInputBodyAdditional map[string]jx.Raw +type CreateBindingInputBodyAdditional map[string]jx.Raw -func (s *CreateServiceAccountInputBodyAdditional) init() CreateServiceAccountInputBodyAdditional { +func (s *CreateBindingInputBodyAdditional) init() CreateBindingInputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -3092,106 +3038,81 @@ func (s *CreateServiceAccountInputBodyAdditional) init() CreateServiceAccountInp return m } -// Ref: #/components/schemas/CreatedMirror -type CreatedMirror struct { +// Ref: #/components/schemas/CreateMirrorRequestInputBody +type CreateMirrorRequestInputBody struct { // A URL to the JSON Schema for this object. Schema OptURI `json:"$schema"` - // True on fresh creation; false when an existing mirror was returned. - Created bool `json:"created"` - // Deprecated: always false. Poll the mirror status instead — an empty upstream still reaches - // 'ready'. - Empty bool `json:"empty"` - MirrorId string `json:"mirrorId"` - MirrorUrl string `json:"mirrorUrl"` - PublicUrl string `json:"publicUrl"` - // True when an existing placement was returned that an admin suspended. - Suspended bool `json:"suspended"` - AdditionalProps CreatedMirrorAdditional + // Destination cluster, as either a bare DNS host or the publicUrl returned by GET /api/v1/clusters. + ClusterHost string `json:"clusterHost"` + Owner string `json:"owner"` + Provider CreateMirrorRequestInputBodyProvider `json:"provider"` + Repo string `json:"repo"` + AdditionalProps CreateMirrorRequestInputBodyAdditional } // GetSchema returns the value of Schema. -func (s *CreatedMirror) GetSchema() OptURI { +func (s *CreateMirrorRequestInputBody) GetSchema() OptURI { return s.Schema } -// GetCreated returns the value of Created. -func (s *CreatedMirror) GetCreated() bool { - return s.Created -} - -// GetEmpty returns the value of Empty. -func (s *CreatedMirror) GetEmpty() bool { - return s.Empty -} - -// GetMirrorId returns the value of MirrorId. -func (s *CreatedMirror) GetMirrorId() string { - return s.MirrorId +// GetClusterHost returns the value of ClusterHost. +func (s *CreateMirrorRequestInputBody) GetClusterHost() string { + return s.ClusterHost } -// GetMirrorUrl returns the value of MirrorUrl. -func (s *CreatedMirror) GetMirrorUrl() string { - return s.MirrorUrl +// GetOwner returns the value of Owner. +func (s *CreateMirrorRequestInputBody) GetOwner() string { + return s.Owner } -// GetPublicUrl returns the value of PublicUrl. -func (s *CreatedMirror) GetPublicUrl() string { - return s.PublicUrl +// GetProvider returns the value of Provider. +func (s *CreateMirrorRequestInputBody) GetProvider() CreateMirrorRequestInputBodyProvider { + return s.Provider } -// GetSuspended returns the value of Suspended. -func (s *CreatedMirror) GetSuspended() bool { - return s.Suspended +// GetRepo returns the value of Repo. +func (s *CreateMirrorRequestInputBody) GetRepo() string { + return s.Repo } // GetAdditionalProps returns the value of AdditionalProps. -func (s *CreatedMirror) GetAdditionalProps() CreatedMirrorAdditional { +func (s *CreateMirrorRequestInputBody) GetAdditionalProps() CreateMirrorRequestInputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *CreatedMirror) SetSchema(val OptURI) { +func (s *CreateMirrorRequestInputBody) SetSchema(val OptURI) { s.Schema = val } -// SetCreated sets the value of Created. -func (s *CreatedMirror) SetCreated(val bool) { - s.Created = val -} - -// SetEmpty sets the value of Empty. -func (s *CreatedMirror) SetEmpty(val bool) { - s.Empty = val -} - -// SetMirrorId sets the value of MirrorId. -func (s *CreatedMirror) SetMirrorId(val string) { - s.MirrorId = val +// SetClusterHost sets the value of ClusterHost. +func (s *CreateMirrorRequestInputBody) SetClusterHost(val string) { + s.ClusterHost = val } -// SetMirrorUrl sets the value of MirrorUrl. -func (s *CreatedMirror) SetMirrorUrl(val string) { - s.MirrorUrl = val +// SetOwner sets the value of Owner. +func (s *CreateMirrorRequestInputBody) SetOwner(val string) { + s.Owner = val } -// SetPublicUrl sets the value of PublicUrl. -func (s *CreatedMirror) SetPublicUrl(val string) { - s.PublicUrl = val +// SetProvider sets the value of Provider. +func (s *CreateMirrorRequestInputBody) SetProvider(val CreateMirrorRequestInputBodyProvider) { + s.Provider = val } -// SetSuspended sets the value of Suspended. -func (s *CreatedMirror) SetSuspended(val bool) { - s.Suspended = val +// SetRepo sets the value of Repo. +func (s *CreateMirrorRequestInputBody) SetRepo(val string) { + s.Repo = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *CreatedMirror) SetAdditionalProps(val CreatedMirrorAdditional) { +func (s *CreateMirrorRequestInputBody) SetAdditionalProps(val CreateMirrorRequestInputBodyAdditional) { s.AdditionalProps = val } -type CreatedMirrorAdditional map[string]jx.Raw +type CreateMirrorRequestInputBodyAdditional map[string]jx.Raw -func (s *CreatedMirrorAdditional) init() CreatedMirrorAdditional { +func (s *CreateMirrorRequestInputBodyAdditional) init() CreateMirrorRequestInputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -3200,32 +3121,23 @@ func (s *CreatedMirrorAdditional) init() CreatedMirrorAdditional { return m } -// DeleteBindingNoContent is response for DeleteBinding operation. -type DeleteBindingNoContent struct{} - -// DeleteMeAccepted is response for DeleteMe operation. -type DeleteMeAccepted struct{} - -// DeleteMirrorNoContent is response for DeleteMirror operation. -type DeleteMirrorNoContent struct{} - -type DeleteMirrorProvider string +type CreateMirrorRequestInputBodyProvider string const ( - DeleteMirrorProviderGithub DeleteMirrorProvider = "github" + CreateMirrorRequestInputBodyProviderGithub CreateMirrorRequestInputBodyProvider = "github" ) -// AllValues returns all DeleteMirrorProvider values. -func (DeleteMirrorProvider) AllValues() []DeleteMirrorProvider { - return []DeleteMirrorProvider{ - DeleteMirrorProviderGithub, +// AllValues returns all CreateMirrorRequestInputBodyProvider values. +func (CreateMirrorRequestInputBodyProvider) AllValues() []CreateMirrorRequestInputBodyProvider { + return []CreateMirrorRequestInputBodyProvider{ + CreateMirrorRequestInputBodyProviderGithub, } } // MarshalText implements encoding.TextMarshaler. -func (s DeleteMirrorProvider) MarshalText() ([]byte, error) { +func (s CreateMirrorRequestInputBodyProvider) MarshalText() ([]byte, error) { switch s { - case DeleteMirrorProviderGithub: + case CreateMirrorRequestInputBodyProviderGithub: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) @@ -3233,117 +3145,119 @@ func (s DeleteMirrorProvider) MarshalText() ([]byte, error) { } // UnmarshalText implements encoding.TextUnmarshaler. -func (s *DeleteMirrorProvider) UnmarshalText(data []byte) error { - switch DeleteMirrorProvider(data) { - case DeleteMirrorProviderGithub: - *s = DeleteMirrorProviderGithub +func (s *CreateMirrorRequestInputBodyProvider) UnmarshalText(data []byte) error { + switch CreateMirrorRequestInputBodyProvider(data) { + case CreateMirrorRequestInputBodyProviderGithub: + *s = CreateMirrorRequestInputBodyProviderGithub return nil default: return errors.Errorf("invalid value: %q", data) } } -// DeleteOrgCIBuildkiteClusterNoContent is response for DeleteOrgCIBuildkiteCluster operation. -type DeleteOrgCIBuildkiteClusterNoContent struct{} +// Ref: #/components/schemas/CreateNativeMirrorInputBody +type CreateNativeMirrorInputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + ClusterSlug string `json:"clusterSlug"` + AdditionalProps CreateNativeMirrorInputBodyAdditional +} -// DeleteOrgCIBuildkiteCredentialNoContent is response for DeleteOrgCIBuildkiteCredential operation. -type DeleteOrgCIBuildkiteCredentialNoContent struct{} - -// DeleteOrgNoContent is response for DeleteOrg operation. -type DeleteOrgNoContent struct{} - -// DeleteProjectNoContent is response for DeleteProject operation. -type DeleteProjectNoContent struct{} - -// DeleteRepoCIWebhookNoContent is response for DeleteRepoCIWebhook operation. -type DeleteRepoCIWebhookNoContent struct{} - -// DeleteRepoNoContent is response for DeleteRepo operation. -type DeleteRepoNoContent struct{} +// GetSchema returns the value of Schema. +func (s *CreateNativeMirrorInputBody) GetSchema() OptURI { + return s.Schema +} -// DeleteServiceAccountNoContent is response for DeleteServiceAccount operation. -type DeleteServiceAccountNoContent struct{} +// GetClusterSlug returns the value of ClusterSlug. +func (s *CreateNativeMirrorInputBody) GetClusterSlug() string { + return s.ClusterSlug +} -// Ref: #/components/schemas/DeletionBlocker -type DeletionBlocker struct { - // True when the account can self-serve delete this org (it is the only member and the org has no - // projects). When false, the org has other members or data and must be transferred/removed via - // support. The UI should offer a delete action only when this is true. - Deletable bool `json:"deletable"` - // Resource ID (org ULID). - ID string `json:"id"` - // Blocker kind. Currently always 'owned_org'. - Kind DeletionBlockerKind `json:"kind"` - // Copy explaining how to clear the blocker. - Message string `json:"message"` - // Human-readable resource name. - Name string `json:"name"` - AdditionalProps DeletionBlockerAdditional +// GetAdditionalProps returns the value of AdditionalProps. +func (s *CreateNativeMirrorInputBody) GetAdditionalProps() CreateNativeMirrorInputBodyAdditional { + return s.AdditionalProps } -// GetDeletable returns the value of Deletable. -func (s *DeletionBlocker) GetDeletable() bool { - return s.Deletable +// SetSchema sets the value of Schema. +func (s *CreateNativeMirrorInputBody) SetSchema(val OptURI) { + s.Schema = val } -// GetID returns the value of ID. -func (s *DeletionBlocker) GetID() string { - return s.ID +// SetClusterSlug sets the value of ClusterSlug. +func (s *CreateNativeMirrorInputBody) SetClusterSlug(val string) { + s.ClusterSlug = val } -// GetKind returns the value of Kind. -func (s *DeletionBlocker) GetKind() DeletionBlockerKind { - return s.Kind +// SetAdditionalProps sets the value of AdditionalProps. +func (s *CreateNativeMirrorInputBody) SetAdditionalProps(val CreateNativeMirrorInputBodyAdditional) { + s.AdditionalProps = val } -// GetMessage returns the value of Message. -func (s *DeletionBlocker) GetMessage() string { - return s.Message +type CreateNativeMirrorInputBodyAdditional map[string]jx.Raw + +func (s *CreateNativeMirrorInputBodyAdditional) init() CreateNativeMirrorInputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m } -// GetName returns the value of Name. -func (s *DeletionBlocker) GetName() string { - return s.Name +// Ref: #/components/schemas/CreateOrgInputBody +type CreateOrgInputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + // Display name. + Name string `json:"name"` + // Jurisdiction slug; defaults to the server's home jurisdiction. + Region OptString `json:"region"` + AdditionalProps CreateOrgInputBodyAdditional } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *DeletionBlocker) GetAdditionalProps() DeletionBlockerAdditional { - return s.AdditionalProps +// GetSchema returns the value of Schema. +func (s *CreateOrgInputBody) GetSchema() OptURI { + return s.Schema } -// SetDeletable sets the value of Deletable. -func (s *DeletionBlocker) SetDeletable(val bool) { - s.Deletable = val +// GetName returns the value of Name. +func (s *CreateOrgInputBody) GetName() string { + return s.Name } -// SetID sets the value of ID. -func (s *DeletionBlocker) SetID(val string) { - s.ID = val +// GetRegion returns the value of Region. +func (s *CreateOrgInputBody) GetRegion() OptString { + return s.Region } -// SetKind sets the value of Kind. -func (s *DeletionBlocker) SetKind(val DeletionBlockerKind) { - s.Kind = val +// GetAdditionalProps returns the value of AdditionalProps. +func (s *CreateOrgInputBody) GetAdditionalProps() CreateOrgInputBodyAdditional { + return s.AdditionalProps } -// SetMessage sets the value of Message. -func (s *DeletionBlocker) SetMessage(val string) { - s.Message = val +// SetSchema sets the value of Schema. +func (s *CreateOrgInputBody) SetSchema(val OptURI) { + s.Schema = val } // SetName sets the value of Name. -func (s *DeletionBlocker) SetName(val string) { +func (s *CreateOrgInputBody) SetName(val string) { s.Name = val } +// SetRegion sets the value of Region. +func (s *CreateOrgInputBody) SetRegion(val OptString) { + s.Region = val +} + // SetAdditionalProps sets the value of AdditionalProps. -func (s *DeletionBlocker) SetAdditionalProps(val DeletionBlockerAdditional) { +func (s *CreateOrgInputBody) SetAdditionalProps(val CreateOrgInputBodyAdditional) { s.AdditionalProps = val } -type DeletionBlockerAdditional map[string]jx.Raw +type CreateOrgInputBodyAdditional map[string]jx.Raw -func (s *DeletionBlockerAdditional) init() DeletionBlockerAdditional { +func (s *CreateOrgInputBodyAdditional) init() CreateOrgInputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -3352,119 +3266,62 @@ func (s *DeletionBlockerAdditional) init() DeletionBlockerAdditional { return m } -// Blocker kind. Currently always 'owned_org'. -type DeletionBlockerKind string - -const ( - DeletionBlockerKindOwnedOrg DeletionBlockerKind = "owned_org" -) - -// AllValues returns all DeletionBlockerKind values. -func (DeletionBlockerKind) AllValues() []DeletionBlockerKind { - return []DeletionBlockerKind{ - DeletionBlockerKindOwnedOrg, - } -} - -// MarshalText implements encoding.TextMarshaler. -func (s DeletionBlockerKind) MarshalText() ([]byte, error) { - switch s { - case DeletionBlockerKindOwnedOrg: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } -} - -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *DeletionBlockerKind) UnmarshalText(data []byte) error { - switch DeletionBlockerKind(data) { - case DeletionBlockerKindOwnedOrg: - *s = DeletionBlockerKindOwnedOrg - return nil - default: - return errors.Errorf("invalid value: %q", data) - } -} - -// Ref: #/components/schemas/DeletionGrant -type DeletionGrant struct { - // Region the repo lives in (us/eu/au); empty for project grants. - Jurisdiction OptString `json:"jurisdiction"` - // Granted resource ULID. - ResourceId string `json:"resourceId"` - // Granted resource name. - ResourceName string `json:"resourceName"` - // Granted resource type. - ResourceType DeletionGrantResourceType `json:"resourceType"` - // Granted role. - Role string `json:"role"` - AdditionalProps DeletionGrantAdditional -} +type CreateOrgInvitationCreated Invitation -// GetJurisdiction returns the value of Jurisdiction. -func (s *DeletionGrant) GetJurisdiction() OptString { - return s.Jurisdiction -} +func (*CreateOrgInvitationCreated) createOrgInvitationRes() {} -// GetResourceId returns the value of ResourceId. -func (s *DeletionGrant) GetResourceId() string { - return s.ResourceId +// Ref: #/components/schemas/CreateOrgInvitationInputBody +type CreateOrgInvitationInputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Email string `json:"email"` + Role CreateOrgInvitationInputBodyRole `json:"role"` + AdditionalProps CreateOrgInvitationInputBodyAdditional } -// GetResourceName returns the value of ResourceName. -func (s *DeletionGrant) GetResourceName() string { - return s.ResourceName +// GetSchema returns the value of Schema. +func (s *CreateOrgInvitationInputBody) GetSchema() OptURI { + return s.Schema } -// GetResourceType returns the value of ResourceType. -func (s *DeletionGrant) GetResourceType() DeletionGrantResourceType { - return s.ResourceType +// GetEmail returns the value of Email. +func (s *CreateOrgInvitationInputBody) GetEmail() string { + return s.Email } // GetRole returns the value of Role. -func (s *DeletionGrant) GetRole() string { +func (s *CreateOrgInvitationInputBody) GetRole() CreateOrgInvitationInputBodyRole { return s.Role } // GetAdditionalProps returns the value of AdditionalProps. -func (s *DeletionGrant) GetAdditionalProps() DeletionGrantAdditional { +func (s *CreateOrgInvitationInputBody) GetAdditionalProps() CreateOrgInvitationInputBodyAdditional { return s.AdditionalProps } -// SetJurisdiction sets the value of Jurisdiction. -func (s *DeletionGrant) SetJurisdiction(val OptString) { - s.Jurisdiction = val -} - -// SetResourceId sets the value of ResourceId. -func (s *DeletionGrant) SetResourceId(val string) { - s.ResourceId = val -} - -// SetResourceName sets the value of ResourceName. -func (s *DeletionGrant) SetResourceName(val string) { - s.ResourceName = val +// SetSchema sets the value of Schema. +func (s *CreateOrgInvitationInputBody) SetSchema(val OptURI) { + s.Schema = val } -// SetResourceType sets the value of ResourceType. -func (s *DeletionGrant) SetResourceType(val DeletionGrantResourceType) { - s.ResourceType = val +// SetEmail sets the value of Email. +func (s *CreateOrgInvitationInputBody) SetEmail(val string) { + s.Email = val } // SetRole sets the value of Role. -func (s *DeletionGrant) SetRole(val string) { +func (s *CreateOrgInvitationInputBody) SetRole(val CreateOrgInvitationInputBodyRole) { s.Role = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *DeletionGrant) SetAdditionalProps(val DeletionGrantAdditional) { +func (s *CreateOrgInvitationInputBody) SetAdditionalProps(val CreateOrgInvitationInputBodyAdditional) { s.AdditionalProps = val } -type DeletionGrantAdditional map[string]jx.Raw +type CreateOrgInvitationInputBodyAdditional map[string]jx.Raw -func (s *DeletionGrantAdditional) init() DeletionGrantAdditional { +func (s *CreateOrgInvitationInputBodyAdditional) init() CreateOrgInvitationInputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -3473,28 +3330,31 @@ func (s *DeletionGrantAdditional) init() DeletionGrantAdditional { return m } -// Granted resource type. -type DeletionGrantResourceType string +type CreateOrgInvitationInputBodyRole string const ( - DeletionGrantResourceTypeProject DeletionGrantResourceType = "project" - DeletionGrantResourceTypeRepo DeletionGrantResourceType = "repo" + CreateOrgInvitationInputBodyRoleOwner CreateOrgInvitationInputBodyRole = "owner" + CreateOrgInvitationInputBodyRoleAdmin CreateOrgInvitationInputBodyRole = "admin" + CreateOrgInvitationInputBodyRoleMember CreateOrgInvitationInputBodyRole = "member" ) -// AllValues returns all DeletionGrantResourceType values. -func (DeletionGrantResourceType) AllValues() []DeletionGrantResourceType { - return []DeletionGrantResourceType{ - DeletionGrantResourceTypeProject, - DeletionGrantResourceTypeRepo, +// AllValues returns all CreateOrgInvitationInputBodyRole values. +func (CreateOrgInvitationInputBodyRole) AllValues() []CreateOrgInvitationInputBodyRole { + return []CreateOrgInvitationInputBodyRole{ + CreateOrgInvitationInputBodyRoleOwner, + CreateOrgInvitationInputBodyRoleAdmin, + CreateOrgInvitationInputBodyRoleMember, } } // MarshalText implements encoding.TextMarshaler. -func (s DeletionGrantResourceType) MarshalText() ([]byte, error) { +func (s CreateOrgInvitationInputBodyRole) MarshalText() ([]byte, error) { switch s { - case DeletionGrantResourceTypeProject: + case CreateOrgInvitationInputBodyRoleOwner: return []byte(s), nil - case DeletionGrantResourceTypeRepo: + case CreateOrgInvitationInputBodyRoleAdmin: + return []byte(s), nil + case CreateOrgInvitationInputBodyRoleMember: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) @@ -3502,123 +3362,100 @@ func (s DeletionGrantResourceType) MarshalText() ([]byte, error) { } // UnmarshalText implements encoding.TextUnmarshaler. -func (s *DeletionGrantResourceType) UnmarshalText(data []byte) error { - switch DeletionGrantResourceType(data) { - case DeletionGrantResourceTypeProject: - *s = DeletionGrantResourceTypeProject +func (s *CreateOrgInvitationInputBodyRole) UnmarshalText(data []byte) error { + switch CreateOrgInvitationInputBodyRole(data) { + case CreateOrgInvitationInputBodyRoleOwner: + *s = CreateOrgInvitationInputBodyRoleOwner return nil - case DeletionGrantResourceTypeRepo: - *s = DeletionGrantResourceTypeRepo + case CreateOrgInvitationInputBodyRoleAdmin: + *s = CreateOrgInvitationInputBodyRoleAdmin + return nil + case CreateOrgInvitationInputBodyRoleMember: + *s = CreateOrgInvitationInputBodyRoleMember return nil default: return errors.Errorf("invalid value: %q", data) } } -// Ref: #/components/schemas/DeletionMembership -type DeletionMembership struct { - // Org name. - Name string `json:"name"` - // Org ULID. - OrgId string `json:"orgId"` - AdditionalProps DeletionMembershipAdditional -} - -// GetName returns the value of Name. -func (s *DeletionMembership) GetName() string { - return s.Name -} +type CreateOrgInvitationOK Invitation -// GetOrgId returns the value of OrgId. -func (s *DeletionMembership) GetOrgId() string { - return s.OrgId -} +func (*CreateOrgInvitationOK) createOrgInvitationRes() {} -// GetAdditionalProps returns the value of AdditionalProps. -func (s *DeletionMembership) GetAdditionalProps() DeletionMembershipAdditional { - return s.AdditionalProps -} - -// SetName sets the value of Name. -func (s *DeletionMembership) SetName(val string) { - s.Name = val +// Ref: #/components/schemas/CreateProjectInputBody +type CreateProjectInputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Name string `json:"name"` + OwnerId string `json:"ownerId"` + OwnerType CreateProjectInputBodyOwnerType `json:"ownerType"` + Region OptString `json:"region"` + AdditionalProps CreateProjectInputBodyAdditional } -// SetOrgId sets the value of OrgId. -func (s *DeletionMembership) SetOrgId(val string) { - s.OrgId = val +// GetSchema returns the value of Schema. +func (s *CreateProjectInputBody) GetSchema() OptURI { + return s.Schema } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *DeletionMembership) SetAdditionalProps(val DeletionMembershipAdditional) { - s.AdditionalProps = val +// GetName returns the value of Name. +func (s *CreateProjectInputBody) GetName() string { + return s.Name } -type DeletionMembershipAdditional map[string]jx.Raw - -func (s *DeletionMembershipAdditional) init() DeletionMembershipAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// GetOwnerId returns the value of OwnerId. +func (s *CreateProjectInputBody) GetOwnerId() string { + return s.OwnerId } -// Ref: #/components/schemas/DeletionRepo -type DeletionRepo struct { - // Cluster slug the repo is placed on, if known. - Cluster OptString `json:"cluster"` - // Repo ULID. - ID string `json:"id"` - // Repo name. - Name string `json:"name"` - AdditionalProps DeletionRepoAdditional +// GetOwnerType returns the value of OwnerType. +func (s *CreateProjectInputBody) GetOwnerType() CreateProjectInputBodyOwnerType { + return s.OwnerType } -// GetCluster returns the value of Cluster. -func (s *DeletionRepo) GetCluster() OptString { - return s.Cluster +// GetRegion returns the value of Region. +func (s *CreateProjectInputBody) GetRegion() OptString { + return s.Region } -// GetID returns the value of ID. -func (s *DeletionRepo) GetID() string { - return s.ID +// GetAdditionalProps returns the value of AdditionalProps. +func (s *CreateProjectInputBody) GetAdditionalProps() CreateProjectInputBodyAdditional { + return s.AdditionalProps } -// GetName returns the value of Name. -func (s *DeletionRepo) GetName() string { - return s.Name +// SetSchema sets the value of Schema. +func (s *CreateProjectInputBody) SetSchema(val OptURI) { + s.Schema = val } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *DeletionRepo) GetAdditionalProps() DeletionRepoAdditional { - return s.AdditionalProps +// SetName sets the value of Name. +func (s *CreateProjectInputBody) SetName(val string) { + s.Name = val } -// SetCluster sets the value of Cluster. -func (s *DeletionRepo) SetCluster(val OptString) { - s.Cluster = val +// SetOwnerId sets the value of OwnerId. +func (s *CreateProjectInputBody) SetOwnerId(val string) { + s.OwnerId = val } -// SetID sets the value of ID. -func (s *DeletionRepo) SetID(val string) { - s.ID = val +// SetOwnerType sets the value of OwnerType. +func (s *CreateProjectInputBody) SetOwnerType(val CreateProjectInputBodyOwnerType) { + s.OwnerType = val } -// SetName sets the value of Name. -func (s *DeletionRepo) SetName(val string) { - s.Name = val +// SetRegion sets the value of Region. +func (s *CreateProjectInputBody) SetRegion(val OptString) { + s.Region = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *DeletionRepo) SetAdditionalProps(val DeletionRepoAdditional) { +func (s *CreateProjectInputBody) SetAdditionalProps(val CreateProjectInputBodyAdditional) { s.AdditionalProps = val } -type DeletionRepoAdditional map[string]jx.Raw +type CreateProjectInputBodyAdditional map[string]jx.Raw -func (s *DeletionRepoAdditional) init() DeletionRepoAdditional { +func (s *CreateProjectInputBodyAdditional) init() CreateProjectInputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -3627,245 +3464,293 @@ func (s *DeletionRepoAdditional) init() DeletionRepoAdditional { return m } -// Ref: #/components/schemas/ErrorDetail -type ErrorDetail struct { - // Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'. - Location OptString `json:"location"` - // Error message text. - Message OptString `json:"message"` - // The value at the given location. - Value jx.Raw `json:"value"` - AdditionalProps ErrorDetailAdditional -} +type CreateProjectInputBodyOwnerType string -// GetLocation returns the value of Location. -func (s *ErrorDetail) GetLocation() OptString { - return s.Location -} +const ( + CreateProjectInputBodyOwnerTypeOrg CreateProjectInputBodyOwnerType = "org" + CreateProjectInputBodyOwnerTypeAccount CreateProjectInputBodyOwnerType = "account" +) -// GetMessage returns the value of Message. -func (s *ErrorDetail) GetMessage() OptString { - return s.Message +// AllValues returns all CreateProjectInputBodyOwnerType values. +func (CreateProjectInputBodyOwnerType) AllValues() []CreateProjectInputBodyOwnerType { + return []CreateProjectInputBodyOwnerType{ + CreateProjectInputBodyOwnerTypeOrg, + CreateProjectInputBodyOwnerTypeAccount, + } } -// GetValue returns the value of Value. -func (s *ErrorDetail) GetValue() jx.Raw { - return s.Value +// MarshalText implements encoding.TextMarshaler. +func (s CreateProjectInputBodyOwnerType) MarshalText() ([]byte, error) { + switch s { + case CreateProjectInputBodyOwnerTypeOrg: + return []byte(s), nil + case CreateProjectInputBodyOwnerTypeAccount: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *ErrorDetail) GetAdditionalProps() ErrorDetailAdditional { - return s.AdditionalProps +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *CreateProjectInputBodyOwnerType) UnmarshalText(data []byte) error { + switch CreateProjectInputBodyOwnerType(data) { + case CreateProjectInputBodyOwnerTypeOrg: + *s = CreateProjectInputBodyOwnerTypeOrg + return nil + case CreateProjectInputBodyOwnerTypeAccount: + *s = CreateProjectInputBodyOwnerTypeAccount + return nil + default: + return errors.Errorf("invalid value: %q", data) + } } -// SetLocation sets the value of Location. -func (s *ErrorDetail) SetLocation(val OptString) { - s.Location = val +// Ref: #/components/schemas/CreateRepoCIWebhookBody +type CreateRepoCIWebhookBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + // Entire-core-auth Buildkite plugin ref this pipeline is built with: the registered cluster's + // override, else the pinned default; goes in the bootstrap config's plugins list. + AuthPluginRef string `json:"auth_plugin_ref"` + // Automation (aut_) the enrolled pipeline's builds exchange their OIDC token for; goes in the + // bootstrap config as the automation: resource (ENTIRE_CORE_AUTH_RESOURCE). + AutomationID string `json:"automation_id"` + BkOrganization string `json:"bk_organization"` + BkPipeline string `json:"bk_pipeline"` + // Entire-core base URL the bootstrap auth plugin talks to; goes in the bootstrap config as + // ENTIRE_CORE_AUTH_URL. + CoreURL string `json:"core_url"` + CreatedAt time.Time `json:"created_at"` + DisplayName string `json:"display_name"` + Enabled bool `json:"enabled"` + Events []string `json:"events"` + ID string `json:"id"` + Provider string `json:"provider"` + ProviderAccount string `json:"provider_account"` + PublishChecks bool `json:"publish_checks"` + RefFilter string `json:"ref_filter"` + RepoID string `json:"repo_id"` + RepoWrite bool `json:"repo_write"` + // What to do next, rendered ready to use. Present on a self-managed enrolment. + Setup OptCISetupBlock `json:"setup"` + TargetRef string `json:"target_ref"` + UpdatedAt time.Time `json:"updated_at"` + AdditionalProps CreateRepoCIWebhookBodyAdditional } -// SetMessage sets the value of Message. -func (s *ErrorDetail) SetMessage(val OptString) { - s.Message = val +// GetSchema returns the value of Schema. +func (s *CreateRepoCIWebhookBody) GetSchema() OptURI { + return s.Schema } -// SetValue sets the value of Value. -func (s *ErrorDetail) SetValue(val jx.Raw) { - s.Value = val +// GetAuthPluginRef returns the value of AuthPluginRef. +func (s *CreateRepoCIWebhookBody) GetAuthPluginRef() string { + return s.AuthPluginRef } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *ErrorDetail) SetAdditionalProps(val ErrorDetailAdditional) { - s.AdditionalProps = val +// GetAutomationID returns the value of AutomationID. +func (s *CreateRepoCIWebhookBody) GetAutomationID() string { + return s.AutomationID } -type ErrorDetailAdditional map[string]jx.Raw - -func (s *ErrorDetailAdditional) init() ErrorDetailAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// GetBkOrganization returns the value of BkOrganization. +func (s *CreateRepoCIWebhookBody) GetBkOrganization() string { + return s.BkOrganization } -// Ref: #/components/schemas/ErrorModel -type ErrorModel struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - // A human-readable explanation specific to this occurrence of the problem. - Detail OptString `json:"detail"` - // Optional list of individual error details. - Errors []ErrorDetail `json:"errors"` - // A URI reference that identifies the specific occurrence of the problem. - Instance OptURI `json:"instance"` - // HTTP status code. - Status OptInt64 `json:"status"` - // A short, human-readable summary of the problem type. This value should not change between - // occurrences of the error. - Title OptString `json:"title"` - // A URI reference to human-readable documentation for the error. - Type OptURI `json:"type"` - AdditionalProps ErrorModelAdditional +// GetBkPipeline returns the value of BkPipeline. +func (s *CreateRepoCIWebhookBody) GetBkPipeline() string { + return s.BkPipeline } -// GetSchema returns the value of Schema. -func (s *ErrorModel) GetSchema() OptURI { - return s.Schema +// GetCoreURL returns the value of CoreURL. +func (s *CreateRepoCIWebhookBody) GetCoreURL() string { + return s.CoreURL } -// GetDetail returns the value of Detail. -func (s *ErrorModel) GetDetail() OptString { - return s.Detail +// GetCreatedAt returns the value of CreatedAt. +func (s *CreateRepoCIWebhookBody) GetCreatedAt() time.Time { + return s.CreatedAt } -// GetErrors returns the value of Errors. -func (s *ErrorModel) GetErrors() []ErrorDetail { - return s.Errors +// GetDisplayName returns the value of DisplayName. +func (s *CreateRepoCIWebhookBody) GetDisplayName() string { + return s.DisplayName } -// GetInstance returns the value of Instance. -func (s *ErrorModel) GetInstance() OptURI { - return s.Instance +// GetEnabled returns the value of Enabled. +func (s *CreateRepoCIWebhookBody) GetEnabled() bool { + return s.Enabled } -// GetStatus returns the value of Status. -func (s *ErrorModel) GetStatus() OptInt64 { - return s.Status +// GetEvents returns the value of Events. +func (s *CreateRepoCIWebhookBody) GetEvents() []string { + return s.Events } -// GetTitle returns the value of Title. -func (s *ErrorModel) GetTitle() OptString { - return s.Title +// GetID returns the value of ID. +func (s *CreateRepoCIWebhookBody) GetID() string { + return s.ID } -// GetType returns the value of Type. -func (s *ErrorModel) GetType() OptURI { - return s.Type +// GetProvider returns the value of Provider. +func (s *CreateRepoCIWebhookBody) GetProvider() string { + return s.Provider +} + +// GetProviderAccount returns the value of ProviderAccount. +func (s *CreateRepoCIWebhookBody) GetProviderAccount() string { + return s.ProviderAccount +} + +// GetPublishChecks returns the value of PublishChecks. +func (s *CreateRepoCIWebhookBody) GetPublishChecks() bool { + return s.PublishChecks +} + +// GetRefFilter returns the value of RefFilter. +func (s *CreateRepoCIWebhookBody) GetRefFilter() string { + return s.RefFilter +} + +// GetRepoID returns the value of RepoID. +func (s *CreateRepoCIWebhookBody) GetRepoID() string { + return s.RepoID +} + +// GetRepoWrite returns the value of RepoWrite. +func (s *CreateRepoCIWebhookBody) GetRepoWrite() bool { + return s.RepoWrite +} + +// GetSetup returns the value of Setup. +func (s *CreateRepoCIWebhookBody) GetSetup() OptCISetupBlock { + return s.Setup +} + +// GetTargetRef returns the value of TargetRef. +func (s *CreateRepoCIWebhookBody) GetTargetRef() string { + return s.TargetRef +} + +// GetUpdatedAt returns the value of UpdatedAt. +func (s *CreateRepoCIWebhookBody) GetUpdatedAt() time.Time { + return s.UpdatedAt } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ErrorModel) GetAdditionalProps() ErrorModelAdditional { +func (s *CreateRepoCIWebhookBody) GetAdditionalProps() CreateRepoCIWebhookBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *ErrorModel) SetSchema(val OptURI) { +func (s *CreateRepoCIWebhookBody) SetSchema(val OptURI) { s.Schema = val } -// SetDetail sets the value of Detail. -func (s *ErrorModel) SetDetail(val OptString) { - s.Detail = val +// SetAuthPluginRef sets the value of AuthPluginRef. +func (s *CreateRepoCIWebhookBody) SetAuthPluginRef(val string) { + s.AuthPluginRef = val } -// SetErrors sets the value of Errors. -func (s *ErrorModel) SetErrors(val []ErrorDetail) { - s.Errors = val +// SetAutomationID sets the value of AutomationID. +func (s *CreateRepoCIWebhookBody) SetAutomationID(val string) { + s.AutomationID = val } -// SetInstance sets the value of Instance. -func (s *ErrorModel) SetInstance(val OptURI) { - s.Instance = val +// SetBkOrganization sets the value of BkOrganization. +func (s *CreateRepoCIWebhookBody) SetBkOrganization(val string) { + s.BkOrganization = val } -// SetStatus sets the value of Status. -func (s *ErrorModel) SetStatus(val OptInt64) { - s.Status = val +// SetBkPipeline sets the value of BkPipeline. +func (s *CreateRepoCIWebhookBody) SetBkPipeline(val string) { + s.BkPipeline = val } -// SetTitle sets the value of Title. -func (s *ErrorModel) SetTitle(val OptString) { - s.Title = val +// SetCoreURL sets the value of CoreURL. +func (s *CreateRepoCIWebhookBody) SetCoreURL(val string) { + s.CoreURL = val } -// SetType sets the value of Type. -func (s *ErrorModel) SetType(val OptURI) { - s.Type = val +// SetCreatedAt sets the value of CreatedAt. +func (s *CreateRepoCIWebhookBody) SetCreatedAt(val time.Time) { + s.CreatedAt = val } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *ErrorModel) SetAdditionalProps(val ErrorModelAdditional) { - s.AdditionalProps = val +// SetDisplayName sets the value of DisplayName. +func (s *CreateRepoCIWebhookBody) SetDisplayName(val string) { + s.DisplayName = val } -type ErrorModelAdditional map[string]jx.Raw - -func (s *ErrorModelAdditional) init() ErrorModelAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// SetEnabled sets the value of Enabled. +func (s *CreateRepoCIWebhookBody) SetEnabled(val bool) { + s.Enabled = val } -// ErrorModelStatusCode wraps ErrorModel with StatusCode. -type ErrorModelStatusCode struct { - StatusCode int - Response ErrorModel +// SetEvents sets the value of Events. +func (s *CreateRepoCIWebhookBody) SetEvents(val []string) { + s.Events = val } -// GetStatusCode returns the value of StatusCode. -func (s *ErrorModelStatusCode) GetStatusCode() int { - return s.StatusCode +// SetID sets the value of ID. +func (s *CreateRepoCIWebhookBody) SetID(val string) { + s.ID = val } -// GetResponse returns the value of Response. -func (s *ErrorModelStatusCode) GetResponse() ErrorModel { - return s.Response +// SetProvider sets the value of Provider. +func (s *CreateRepoCIWebhookBody) SetProvider(val string) { + s.Provider = val } -// SetStatusCode sets the value of StatusCode. -func (s *ErrorModelStatusCode) SetStatusCode(val int) { - s.StatusCode = val +// SetProviderAccount sets the value of ProviderAccount. +func (s *CreateRepoCIWebhookBody) SetProviderAccount(val string) { + s.ProviderAccount = val } -// SetResponse sets the value of Response. -func (s *ErrorModelStatusCode) SetResponse(val ErrorModel) { - s.Response = val +// SetPublishChecks sets the value of PublishChecks. +func (s *CreateRepoCIWebhookBody) SetPublishChecks(val bool) { + s.PublishChecks = val } -// Ref: #/components/schemas/ForgeRepoIdentity -type ForgeRepoIdentity struct { - Forge string `json:"forge"` - RepoID string `json:"repo_id"` - AdditionalProps ForgeRepoIdentityAdditional +// SetRefFilter sets the value of RefFilter. +func (s *CreateRepoCIWebhookBody) SetRefFilter(val string) { + s.RefFilter = val } -// GetForge returns the value of Forge. -func (s *ForgeRepoIdentity) GetForge() string { - return s.Forge +// SetRepoID sets the value of RepoID. +func (s *CreateRepoCIWebhookBody) SetRepoID(val string) { + s.RepoID = val } -// GetRepoID returns the value of RepoID. -func (s *ForgeRepoIdentity) GetRepoID() string { - return s.RepoID +// SetRepoWrite sets the value of RepoWrite. +func (s *CreateRepoCIWebhookBody) SetRepoWrite(val bool) { + s.RepoWrite = val } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *ForgeRepoIdentity) GetAdditionalProps() ForgeRepoIdentityAdditional { - return s.AdditionalProps +// SetSetup sets the value of Setup. +func (s *CreateRepoCIWebhookBody) SetSetup(val OptCISetupBlock) { + s.Setup = val } -// SetForge sets the value of Forge. -func (s *ForgeRepoIdentity) SetForge(val string) { - s.Forge = val +// SetTargetRef sets the value of TargetRef. +func (s *CreateRepoCIWebhookBody) SetTargetRef(val string) { + s.TargetRef = val } -// SetRepoID sets the value of RepoID. -func (s *ForgeRepoIdentity) SetRepoID(val string) { - s.RepoID = val +// SetUpdatedAt sets the value of UpdatedAt. +func (s *CreateRepoCIWebhookBody) SetUpdatedAt(val time.Time) { + s.UpdatedAt = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ForgeRepoIdentity) SetAdditionalProps(val ForgeRepoIdentityAdditional) { +func (s *CreateRepoCIWebhookBody) SetAdditionalProps(val CreateRepoCIWebhookBodyAdditional) { s.AdditionalProps = val } -type ForgeRepoIdentityAdditional map[string]jx.Raw +type CreateRepoCIWebhookBodyAdditional map[string]jx.Raw -func (s *ForgeRepoIdentityAdditional) init() ForgeRepoIdentityAdditional { +func (s *CreateRepoCIWebhookBodyAdditional) init() CreateRepoCIWebhookBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -3874,198 +3759,205 @@ func (s *ForgeRepoIdentityAdditional) init() ForgeRepoIdentityAdditional { return m } -// Ref: #/components/schemas/GetDeletionPreviewOutputBody -type GetDeletionPreviewOutputBody struct { +// Ref: #/components/schemas/CreateRepoCIWebhookInputBody +type CreateRepoCIWebhookInputBody struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - // True when Blockers is non-empty: DELETE /me will be refused with 409. - Blocked bool `json:"blocked"` - // Resources that must be resolved before deletion (owned orgs). - Blockers []DeletionBlocker `json:"blockers"` - WillDelete WillDeleteStruct `json:"willDelete"` - WillUnlink WillUnlinkStruct `json:"willUnlink"` - AdditionalProps GetDeletionPreviewOutputBodyAdditional + Schema OptURI `json:"$schema"` + BkClusterID OptString `json:"bk_cluster_id"` + // Overwrite an existing pipeline's configuration with the generated bootstrap step, DISCARDING + // manual edits. Repairs a pipeline left naming an automation that a teardown retired. Requires + // bk_provisioning_token; refused on a self-managed pipeline. + BkForceRescaffold OptBool `json:"bk_force_rescaffold"` + BkOrganization OptString `json:"bk_organization"` + BkPipeline OptString `json:"bk_pipeline"` + // The customer created and maintains this Buildkite pipeline. entire never creates, reconciles or + // reads it, and bk_provisioning_token is neither required nor accepted. + BkPipelineSelfManaged OptBool `json:"bk_pipeline_self_managed"` + // Transient Buildkite token (write_pipelines) to create the pipeline; write-only, never stored. + // Required on first enroll; omit on a routing-only re-enroll. Refused for an existing pipeline + // unless bk_force_rescaffold is also set. + BkProvisioningToken OptString `json:"bk_provisioning_token"` + // Provider-specific values from the providers listing; opaque to core. For buildkite: cluster_id, + // provisioning_token, force_rescaffold. + Config OptCreateRepoCIWebhookInputBodyConfig `json:"config"` + DisplayName OptString `json:"display_name"` + Events []string `json:"events"` + // How to enrol, from the chosen provider's modes. For buildkite: self_managed or provisioned. + Mode OptString `json:"mode"` + Provider string `json:"provider"` + // Vendor-side account to enrol against (for buildkite, the organization slug). Use with + // provider/mode/config; omit when sending the bk_* fields. + ProviderAccount OptString `json:"provider_account"` + RefFilter OptString `json:"ref_filter"` + // Vendor-side build target (for buildkite, the pipeline slug). Defaults to a slug derived from the + // repo. + TargetRef OptString `json:"target_ref"` + AdditionalProps CreateRepoCIWebhookInputBodyAdditional } // GetSchema returns the value of Schema. -func (s *GetDeletionPreviewOutputBody) GetSchema() OptURI { +func (s *CreateRepoCIWebhookInputBody) GetSchema() OptURI { return s.Schema } -// GetBlocked returns the value of Blocked. -func (s *GetDeletionPreviewOutputBody) GetBlocked() bool { - return s.Blocked +// GetBkClusterID returns the value of BkClusterID. +func (s *CreateRepoCIWebhookInputBody) GetBkClusterID() OptString { + return s.BkClusterID } -// GetBlockers returns the value of Blockers. -func (s *GetDeletionPreviewOutputBody) GetBlockers() []DeletionBlocker { - return s.Blockers +// GetBkForceRescaffold returns the value of BkForceRescaffold. +func (s *CreateRepoCIWebhookInputBody) GetBkForceRescaffold() OptBool { + return s.BkForceRescaffold } -// GetWillDelete returns the value of WillDelete. -func (s *GetDeletionPreviewOutputBody) GetWillDelete() WillDeleteStruct { - return s.WillDelete +// GetBkOrganization returns the value of BkOrganization. +func (s *CreateRepoCIWebhookInputBody) GetBkOrganization() OptString { + return s.BkOrganization } -// GetWillUnlink returns the value of WillUnlink. -func (s *GetDeletionPreviewOutputBody) GetWillUnlink() WillUnlinkStruct { - return s.WillUnlink +// GetBkPipeline returns the value of BkPipeline. +func (s *CreateRepoCIWebhookInputBody) GetBkPipeline() OptString { + return s.BkPipeline } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *GetDeletionPreviewOutputBody) GetAdditionalProps() GetDeletionPreviewOutputBodyAdditional { - return s.AdditionalProps +// GetBkPipelineSelfManaged returns the value of BkPipelineSelfManaged. +func (s *CreateRepoCIWebhookInputBody) GetBkPipelineSelfManaged() OptBool { + return s.BkPipelineSelfManaged } -// SetSchema sets the value of Schema. -func (s *GetDeletionPreviewOutputBody) SetSchema(val OptURI) { - s.Schema = val +// GetBkProvisioningToken returns the value of BkProvisioningToken. +func (s *CreateRepoCIWebhookInputBody) GetBkProvisioningToken() OptString { + return s.BkProvisioningToken } -// SetBlocked sets the value of Blocked. -func (s *GetDeletionPreviewOutputBody) SetBlocked(val bool) { - s.Blocked = val +// GetConfig returns the value of Config. +func (s *CreateRepoCIWebhookInputBody) GetConfig() OptCreateRepoCIWebhookInputBodyConfig { + return s.Config } -// SetBlockers sets the value of Blockers. -func (s *GetDeletionPreviewOutputBody) SetBlockers(val []DeletionBlocker) { - s.Blockers = val +// GetDisplayName returns the value of DisplayName. +func (s *CreateRepoCIWebhookInputBody) GetDisplayName() OptString { + return s.DisplayName } -// SetWillDelete sets the value of WillDelete. -func (s *GetDeletionPreviewOutputBody) SetWillDelete(val WillDeleteStruct) { - s.WillDelete = val +// GetEvents returns the value of Events. +func (s *CreateRepoCIWebhookInputBody) GetEvents() []string { + return s.Events } -// SetWillUnlink sets the value of WillUnlink. -func (s *GetDeletionPreviewOutputBody) SetWillUnlink(val WillUnlinkStruct) { - s.WillUnlink = val +// GetMode returns the value of Mode. +func (s *CreateRepoCIWebhookInputBody) GetMode() OptString { + return s.Mode } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *GetDeletionPreviewOutputBody) SetAdditionalProps(val GetDeletionPreviewOutputBodyAdditional) { - s.AdditionalProps = val +// GetProvider returns the value of Provider. +func (s *CreateRepoCIWebhookInputBody) GetProvider() string { + return s.Provider } -type GetDeletionPreviewOutputBodyAdditional map[string]jx.Raw - -func (s *GetDeletionPreviewOutputBodyAdditional) init() GetDeletionPreviewOutputBodyAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// GetProviderAccount returns the value of ProviderAccount. +func (s *CreateRepoCIWebhookInputBody) GetProviderAccount() OptString { + return s.ProviderAccount } -// Ref: #/components/schemas/GetMeOutputBody -type GetMeOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Auth MeAuth `json:"auth"` - // Present only when a deletion is pending; carries the cooldown window. - Deletion OptMeDeletion `json:"deletion"` - Global MeGlobal `json:"global"` - Jurisdiction OptString `json:"jurisdiction"` - Mode OptGetMeOutputBodyMode `json:"mode"` - Regional OptMeRegional `json:"regional"` - RegionalUnavailable OptMeRegionalUnavailable `json:"regionalUnavailable"` - AdditionalProps GetMeOutputBodyAdditional +// GetRefFilter returns the value of RefFilter. +func (s *CreateRepoCIWebhookInputBody) GetRefFilter() OptString { + return s.RefFilter } -// GetSchema returns the value of Schema. -func (s *GetMeOutputBody) GetSchema() OptURI { - return s.Schema +// GetTargetRef returns the value of TargetRef. +func (s *CreateRepoCIWebhookInputBody) GetTargetRef() OptString { + return s.TargetRef } -// GetAuth returns the value of Auth. -func (s *GetMeOutputBody) GetAuth() MeAuth { - return s.Auth +// GetAdditionalProps returns the value of AdditionalProps. +func (s *CreateRepoCIWebhookInputBody) GetAdditionalProps() CreateRepoCIWebhookInputBodyAdditional { + return s.AdditionalProps } -// GetDeletion returns the value of Deletion. -func (s *GetMeOutputBody) GetDeletion() OptMeDeletion { - return s.Deletion +// SetSchema sets the value of Schema. +func (s *CreateRepoCIWebhookInputBody) SetSchema(val OptURI) { + s.Schema = val } -// GetGlobal returns the value of Global. -func (s *GetMeOutputBody) GetGlobal() MeGlobal { - return s.Global +// SetBkClusterID sets the value of BkClusterID. +func (s *CreateRepoCIWebhookInputBody) SetBkClusterID(val OptString) { + s.BkClusterID = val } -// GetJurisdiction returns the value of Jurisdiction. -func (s *GetMeOutputBody) GetJurisdiction() OptString { - return s.Jurisdiction +// SetBkForceRescaffold sets the value of BkForceRescaffold. +func (s *CreateRepoCIWebhookInputBody) SetBkForceRescaffold(val OptBool) { + s.BkForceRescaffold = val } -// GetMode returns the value of Mode. -func (s *GetMeOutputBody) GetMode() OptGetMeOutputBodyMode { - return s.Mode +// SetBkOrganization sets the value of BkOrganization. +func (s *CreateRepoCIWebhookInputBody) SetBkOrganization(val OptString) { + s.BkOrganization = val } -// GetRegional returns the value of Regional. -func (s *GetMeOutputBody) GetRegional() OptMeRegional { - return s.Regional +// SetBkPipeline sets the value of BkPipeline. +func (s *CreateRepoCIWebhookInputBody) SetBkPipeline(val OptString) { + s.BkPipeline = val } -// GetRegionalUnavailable returns the value of RegionalUnavailable. -func (s *GetMeOutputBody) GetRegionalUnavailable() OptMeRegionalUnavailable { - return s.RegionalUnavailable +// SetBkPipelineSelfManaged sets the value of BkPipelineSelfManaged. +func (s *CreateRepoCIWebhookInputBody) SetBkPipelineSelfManaged(val OptBool) { + s.BkPipelineSelfManaged = val } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *GetMeOutputBody) GetAdditionalProps() GetMeOutputBodyAdditional { - return s.AdditionalProps +// SetBkProvisioningToken sets the value of BkProvisioningToken. +func (s *CreateRepoCIWebhookInputBody) SetBkProvisioningToken(val OptString) { + s.BkProvisioningToken = val } -// SetSchema sets the value of Schema. -func (s *GetMeOutputBody) SetSchema(val OptURI) { - s.Schema = val +// SetConfig sets the value of Config. +func (s *CreateRepoCIWebhookInputBody) SetConfig(val OptCreateRepoCIWebhookInputBodyConfig) { + s.Config = val } -// SetAuth sets the value of Auth. -func (s *GetMeOutputBody) SetAuth(val MeAuth) { - s.Auth = val +// SetDisplayName sets the value of DisplayName. +func (s *CreateRepoCIWebhookInputBody) SetDisplayName(val OptString) { + s.DisplayName = val } -// SetDeletion sets the value of Deletion. -func (s *GetMeOutputBody) SetDeletion(val OptMeDeletion) { - s.Deletion = val +// SetEvents sets the value of Events. +func (s *CreateRepoCIWebhookInputBody) SetEvents(val []string) { + s.Events = val } -// SetGlobal sets the value of Global. -func (s *GetMeOutputBody) SetGlobal(val MeGlobal) { - s.Global = val +// SetMode sets the value of Mode. +func (s *CreateRepoCIWebhookInputBody) SetMode(val OptString) { + s.Mode = val } -// SetJurisdiction sets the value of Jurisdiction. -func (s *GetMeOutputBody) SetJurisdiction(val OptString) { - s.Jurisdiction = val +// SetProvider sets the value of Provider. +func (s *CreateRepoCIWebhookInputBody) SetProvider(val string) { + s.Provider = val } -// SetMode sets the value of Mode. -func (s *GetMeOutputBody) SetMode(val OptGetMeOutputBodyMode) { - s.Mode = val +// SetProviderAccount sets the value of ProviderAccount. +func (s *CreateRepoCIWebhookInputBody) SetProviderAccount(val OptString) { + s.ProviderAccount = val } -// SetRegional sets the value of Regional. -func (s *GetMeOutputBody) SetRegional(val OptMeRegional) { - s.Regional = val +// SetRefFilter sets the value of RefFilter. +func (s *CreateRepoCIWebhookInputBody) SetRefFilter(val OptString) { + s.RefFilter = val } -// SetRegionalUnavailable sets the value of RegionalUnavailable. -func (s *GetMeOutputBody) SetRegionalUnavailable(val OptMeRegionalUnavailable) { - s.RegionalUnavailable = val +// SetTargetRef sets the value of TargetRef. +func (s *CreateRepoCIWebhookInputBody) SetTargetRef(val OptString) { + s.TargetRef = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *GetMeOutputBody) SetAdditionalProps(val GetMeOutputBodyAdditional) { +func (s *CreateRepoCIWebhookInputBody) SetAdditionalProps(val CreateRepoCIWebhookInputBodyAdditional) { s.AdditionalProps = val } -type GetMeOutputBodyAdditional map[string]jx.Raw +type CreateRepoCIWebhookInputBodyAdditional map[string]jx.Raw -func (s *GetMeOutputBodyAdditional) init() GetMeOutputBodyAdditional { +func (s *CreateRepoCIWebhookInputBodyAdditional) init() CreateRepoCIWebhookInputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -4074,194 +3966,96 @@ func (s *GetMeOutputBodyAdditional) init() GetMeOutputBodyAdditional { return m } -type GetMeOutputBodyMode string - -const ( - GetMeOutputBodyModeGlobal GetMeOutputBodyMode = "global" - GetMeOutputBodyModeRegional GetMeOutputBodyMode = "regional" -) - -// AllValues returns all GetMeOutputBodyMode values. -func (GetMeOutputBodyMode) AllValues() []GetMeOutputBodyMode { - return []GetMeOutputBodyMode{ - GetMeOutputBodyModeGlobal, - GetMeOutputBodyModeRegional, - } -} - -// MarshalText implements encoding.TextMarshaler. -func (s GetMeOutputBodyMode) MarshalText() ([]byte, error) { - switch s { - case GetMeOutputBodyModeGlobal: - return []byte(s), nil - case GetMeOutputBodyModeRegional: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } -} +// Provider-specific values from the providers listing; opaque to core. For buildkite: cluster_id, +// provisioning_token, force_rescaffold. +type CreateRepoCIWebhookInputBodyConfig map[string]string -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *GetMeOutputBodyMode) UnmarshalText(data []byte) error { - switch GetMeOutputBodyMode(data) { - case GetMeOutputBodyModeGlobal: - *s = GetMeOutputBodyModeGlobal - return nil - case GetMeOutputBodyModeRegional: - *s = GetMeOutputBodyModeRegional - return nil - default: - return errors.Errorf("invalid value: %q", data) +func (s *CreateRepoCIWebhookInputBodyConfig) init() CreateRepoCIWebhookInputBodyConfig { + m := *s + if m == nil { + m = map[string]string{} + *s = m } + return m } -// Ref: #/components/schemas/GetOnboardingStatusOutputBody -type GetOnboardingStatusOutputBody struct { +// Ref: #/components/schemas/CreateRepoInputBody +type CreateRepoInputBody struct { // A URL to the JSON Schema for this object. Schema OptURI `json:"$schema"` - // True once the account has completed a CLI login (either grant type). - CliLoggedIn bool `json:"cliLoggedIn"` - // True until the account completes web onboarding at least once. - NeedsOnboarding bool `json:"needsOnboarding"` - AdditionalProps GetOnboardingStatusOutputBodyAdditional + // Public host of the cluster to pin the repo to (e.g. royalcanin.partial.to); must be in the + // project's processing cell. Empty takes that cell's cluster. + ClusterHost OptString `json:"clusterHost"` + Name string `json:"name"` + // Hash format; defaults to sha1. + ObjectFormat OptCreateRepoInputBodyObjectFormat `json:"objectFormat"` + ProjectId string `json:"projectId"` + AdditionalProps CreateRepoInputBodyAdditional } // GetSchema returns the value of Schema. -func (s *GetOnboardingStatusOutputBody) GetSchema() OptURI { +func (s *CreateRepoInputBody) GetSchema() OptURI { return s.Schema } -// GetCliLoggedIn returns the value of CliLoggedIn. -func (s *GetOnboardingStatusOutputBody) GetCliLoggedIn() bool { - return s.CliLoggedIn -} - -// GetNeedsOnboarding returns the value of NeedsOnboarding. -func (s *GetOnboardingStatusOutputBody) GetNeedsOnboarding() bool { - return s.NeedsOnboarding +// GetClusterHost returns the value of ClusterHost. +func (s *CreateRepoInputBody) GetClusterHost() OptString { + return s.ClusterHost } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *GetOnboardingStatusOutputBody) GetAdditionalProps() GetOnboardingStatusOutputBodyAdditional { - return s.AdditionalProps +// GetName returns the value of Name. +func (s *CreateRepoInputBody) GetName() string { + return s.Name } -// SetSchema sets the value of Schema. -func (s *GetOnboardingStatusOutputBody) SetSchema(val OptURI) { - s.Schema = val -} - -// SetCliLoggedIn sets the value of CliLoggedIn. -func (s *GetOnboardingStatusOutputBody) SetCliLoggedIn(val bool) { - s.CliLoggedIn = val -} - -// SetNeedsOnboarding sets the value of NeedsOnboarding. -func (s *GetOnboardingStatusOutputBody) SetNeedsOnboarding(val bool) { - s.NeedsOnboarding = val -} - -// SetAdditionalProps sets the value of AdditionalProps. -func (s *GetOnboardingStatusOutputBody) SetAdditionalProps(val GetOnboardingStatusOutputBodyAdditional) { - s.AdditionalProps = val -} - -type GetOnboardingStatusOutputBodyAdditional map[string]jx.Raw - -func (s *GetOnboardingStatusOutputBodyAdditional) init() GetOnboardingStatusOutputBodyAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m -} - -// Ref: #/components/schemas/GetPermissionsOutputBody -type GetPermissionsOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Explain OptGetPermissionsOutputBodyExplain `json:"explain"` - Permissions []GetPermissionsOutputBodyPermissionsItem `json:"permissions"` - ResourceId string `json:"resourceId"` - ResourceType string `json:"resourceType"` - AdditionalProps GetPermissionsOutputBodyAdditional -} - -// GetSchema returns the value of Schema. -func (s *GetPermissionsOutputBody) GetSchema() OptURI { - return s.Schema -} - -// GetExplain returns the value of Explain. -func (s *GetPermissionsOutputBody) GetExplain() OptGetPermissionsOutputBodyExplain { - return s.Explain -} - -// GetPermissions returns the value of Permissions. -func (s *GetPermissionsOutputBody) GetPermissions() []GetPermissionsOutputBodyPermissionsItem { - return s.Permissions -} - -// GetResourceId returns the value of ResourceId. -func (s *GetPermissionsOutputBody) GetResourceId() string { - return s.ResourceId +// GetObjectFormat returns the value of ObjectFormat. +func (s *CreateRepoInputBody) GetObjectFormat() OptCreateRepoInputBodyObjectFormat { + return s.ObjectFormat } -// GetResourceType returns the value of ResourceType. -func (s *GetPermissionsOutputBody) GetResourceType() string { - return s.ResourceType +// GetProjectId returns the value of ProjectId. +func (s *CreateRepoInputBody) GetProjectId() string { + return s.ProjectId } // GetAdditionalProps returns the value of AdditionalProps. -func (s *GetPermissionsOutputBody) GetAdditionalProps() GetPermissionsOutputBodyAdditional { +func (s *CreateRepoInputBody) GetAdditionalProps() CreateRepoInputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *GetPermissionsOutputBody) SetSchema(val OptURI) { +func (s *CreateRepoInputBody) SetSchema(val OptURI) { s.Schema = val } -// SetExplain sets the value of Explain. -func (s *GetPermissionsOutputBody) SetExplain(val OptGetPermissionsOutputBodyExplain) { - s.Explain = val +// SetClusterHost sets the value of ClusterHost. +func (s *CreateRepoInputBody) SetClusterHost(val OptString) { + s.ClusterHost = val } -// SetPermissions sets the value of Permissions. -func (s *GetPermissionsOutputBody) SetPermissions(val []GetPermissionsOutputBodyPermissionsItem) { - s.Permissions = val +// SetName sets the value of Name. +func (s *CreateRepoInputBody) SetName(val string) { + s.Name = val } -// SetResourceId sets the value of ResourceId. -func (s *GetPermissionsOutputBody) SetResourceId(val string) { - s.ResourceId = val +// SetObjectFormat sets the value of ObjectFormat. +func (s *CreateRepoInputBody) SetObjectFormat(val OptCreateRepoInputBodyObjectFormat) { + s.ObjectFormat = val } -// SetResourceType sets the value of ResourceType. -func (s *GetPermissionsOutputBody) SetResourceType(val string) { - s.ResourceType = val +// SetProjectId sets the value of ProjectId. +func (s *CreateRepoInputBody) SetProjectId(val string) { + s.ProjectId = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *GetPermissionsOutputBody) SetAdditionalProps(val GetPermissionsOutputBodyAdditional) { +func (s *CreateRepoInputBody) SetAdditionalProps(val CreateRepoInputBodyAdditional) { s.AdditionalProps = val } -type GetPermissionsOutputBodyAdditional map[string]jx.Raw - -func (s *GetPermissionsOutputBodyAdditional) init() GetPermissionsOutputBodyAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m -} - -type GetPermissionsOutputBodyExplain map[string]jx.Raw +type CreateRepoInputBodyAdditional map[string]jx.Raw -func (s *GetPermissionsOutputBodyExplain) init() GetPermissionsOutputBodyExplain { +func (s *CreateRepoInputBodyAdditional) init() CreateRepoInputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -4270,55 +4064,28 @@ func (s *GetPermissionsOutputBodyExplain) init() GetPermissionsOutputBodyExplain return m } -type GetPermissionsOutputBodyPermissionsItem string +// Hash format; defaults to sha1. +type CreateRepoInputBodyObjectFormat string const ( - GetPermissionsOutputBodyPermissionsItemManage GetPermissionsOutputBodyPermissionsItem = "manage" - GetPermissionsOutputBodyPermissionsItemView GetPermissionsOutputBodyPermissionsItem = "view" - GetPermissionsOutputBodyPermissionsItemRead GetPermissionsOutputBodyPermissionsItem = "read" - GetPermissionsOutputBodyPermissionsItemWrite GetPermissionsOutputBodyPermissionsItem = "write" - GetPermissionsOutputBodyPermissionsItemPush GetPermissionsOutputBodyPermissionsItem = "push" - GetPermissionsOutputBodyPermissionsItemPull GetPermissionsOutputBodyPermissionsItem = "pull" - GetPermissionsOutputBodyPermissionsItemCreateRepo GetPermissionsOutputBodyPermissionsItem = "create_repo" - GetPermissionsOutputBodyPermissionsItemAdmin GetPermissionsOutputBodyPermissionsItem = "admin" - GetPermissionsOutputBodyPermissionsItemAdminRead GetPermissionsOutputBodyPermissionsItem = "admin_read" + CreateRepoInputBodyObjectFormatSHA1 CreateRepoInputBodyObjectFormat = "sha1" + CreateRepoInputBodyObjectFormatSHA256 CreateRepoInputBodyObjectFormat = "sha256" ) -// AllValues returns all GetPermissionsOutputBodyPermissionsItem values. -func (GetPermissionsOutputBodyPermissionsItem) AllValues() []GetPermissionsOutputBodyPermissionsItem { - return []GetPermissionsOutputBodyPermissionsItem{ - GetPermissionsOutputBodyPermissionsItemManage, - GetPermissionsOutputBodyPermissionsItemView, - GetPermissionsOutputBodyPermissionsItemRead, - GetPermissionsOutputBodyPermissionsItemWrite, - GetPermissionsOutputBodyPermissionsItemPush, - GetPermissionsOutputBodyPermissionsItemPull, - GetPermissionsOutputBodyPermissionsItemCreateRepo, - GetPermissionsOutputBodyPermissionsItemAdmin, - GetPermissionsOutputBodyPermissionsItemAdminRead, +// AllValues returns all CreateRepoInputBodyObjectFormat values. +func (CreateRepoInputBodyObjectFormat) AllValues() []CreateRepoInputBodyObjectFormat { + return []CreateRepoInputBodyObjectFormat{ + CreateRepoInputBodyObjectFormatSHA1, + CreateRepoInputBodyObjectFormatSHA256, } } // MarshalText implements encoding.TextMarshaler. -func (s GetPermissionsOutputBodyPermissionsItem) MarshalText() ([]byte, error) { +func (s CreateRepoInputBodyObjectFormat) MarshalText() ([]byte, error) { switch s { - case GetPermissionsOutputBodyPermissionsItemManage: - return []byte(s), nil - case GetPermissionsOutputBodyPermissionsItemView: - return []byte(s), nil - case GetPermissionsOutputBodyPermissionsItemRead: - return []byte(s), nil - case GetPermissionsOutputBodyPermissionsItemWrite: - return []byte(s), nil - case GetPermissionsOutputBodyPermissionsItemPush: - return []byte(s), nil - case GetPermissionsOutputBodyPermissionsItemPull: - return []byte(s), nil - case GetPermissionsOutputBodyPermissionsItemCreateRepo: - return []byte(s), nil - case GetPermissionsOutputBodyPermissionsItemAdmin: + case CreateRepoInputBodyObjectFormatSHA1: return []byte(s), nil - case GetPermissionsOutputBodyPermissionsItemAdminRead: + case CreateRepoInputBodyObjectFormatSHA256: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) @@ -4326,81 +4093,71 @@ func (s GetPermissionsOutputBodyPermissionsItem) MarshalText() ([]byte, error) { } // UnmarshalText implements encoding.TextUnmarshaler. -func (s *GetPermissionsOutputBodyPermissionsItem) UnmarshalText(data []byte) error { - switch GetPermissionsOutputBodyPermissionsItem(data) { - case GetPermissionsOutputBodyPermissionsItemManage: - *s = GetPermissionsOutputBodyPermissionsItemManage - return nil - case GetPermissionsOutputBodyPermissionsItemView: - *s = GetPermissionsOutputBodyPermissionsItemView - return nil - case GetPermissionsOutputBodyPermissionsItemRead: - *s = GetPermissionsOutputBodyPermissionsItemRead - return nil - case GetPermissionsOutputBodyPermissionsItemWrite: - *s = GetPermissionsOutputBodyPermissionsItemWrite - return nil - case GetPermissionsOutputBodyPermissionsItemPush: - *s = GetPermissionsOutputBodyPermissionsItemPush - return nil - case GetPermissionsOutputBodyPermissionsItemPull: - *s = GetPermissionsOutputBodyPermissionsItemPull - return nil - case GetPermissionsOutputBodyPermissionsItemCreateRepo: - *s = GetPermissionsOutputBodyPermissionsItemCreateRepo - return nil - case GetPermissionsOutputBodyPermissionsItemAdmin: - *s = GetPermissionsOutputBodyPermissionsItemAdmin +func (s *CreateRepoInputBodyObjectFormat) UnmarshalText(data []byte) error { + switch CreateRepoInputBodyObjectFormat(data) { + case CreateRepoInputBodyObjectFormatSHA1: + *s = CreateRepoInputBodyObjectFormatSHA1 return nil - case GetPermissionsOutputBodyPermissionsItemAdminRead: - *s = GetPermissionsOutputBodyPermissionsItemAdminRead + case CreateRepoInputBodyObjectFormatSHA256: + *s = CreateRepoInputBodyObjectFormatSHA256 return nil default: return errors.Errorf("invalid value: %q", data) } } -// Ref: #/components/schemas/GetRepoVisibilityOutputBody -type GetRepoVisibilityOutputBody struct { +// Ref: #/components/schemas/CreateServiceAccountInputBody +type CreateServiceAccountInputBody struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Visibility GetRepoVisibilityOutputBodyVisibility `json:"visibility"` - AdditionalProps GetRepoVisibilityOutputBodyAdditional + Schema OptURI `json:"$schema"` + Name string `json:"name"` + OrgId string `json:"orgId"` + AdditionalProps CreateServiceAccountInputBodyAdditional } // GetSchema returns the value of Schema. -func (s *GetRepoVisibilityOutputBody) GetSchema() OptURI { +func (s *CreateServiceAccountInputBody) GetSchema() OptURI { return s.Schema } -// GetVisibility returns the value of Visibility. -func (s *GetRepoVisibilityOutputBody) GetVisibility() GetRepoVisibilityOutputBodyVisibility { - return s.Visibility +// GetName returns the value of Name. +func (s *CreateServiceAccountInputBody) GetName() string { + return s.Name +} + +// GetOrgId returns the value of OrgId. +func (s *CreateServiceAccountInputBody) GetOrgId() string { + return s.OrgId } // GetAdditionalProps returns the value of AdditionalProps. -func (s *GetRepoVisibilityOutputBody) GetAdditionalProps() GetRepoVisibilityOutputBodyAdditional { +func (s *CreateServiceAccountInputBody) GetAdditionalProps() CreateServiceAccountInputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *GetRepoVisibilityOutputBody) SetSchema(val OptURI) { +func (s *CreateServiceAccountInputBody) SetSchema(val OptURI) { s.Schema = val } -// SetVisibility sets the value of Visibility. -func (s *GetRepoVisibilityOutputBody) SetVisibility(val GetRepoVisibilityOutputBodyVisibility) { - s.Visibility = val +// SetName sets the value of Name. +func (s *CreateServiceAccountInputBody) SetName(val string) { + s.Name = val +} + +// SetOrgId sets the value of OrgId. +func (s *CreateServiceAccountInputBody) SetOrgId(val string) { + s.OrgId = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *GetRepoVisibilityOutputBody) SetAdditionalProps(val GetRepoVisibilityOutputBodyAdditional) { +func (s *CreateServiceAccountInputBody) SetAdditionalProps(val CreateServiceAccountInputBodyAdditional) { s.AdditionalProps = val } -type GetRepoVisibilityOutputBodyAdditional map[string]jx.Raw +type CreateServiceAccountInputBodyAdditional map[string]jx.Raw -func (s *GetRepoVisibilityOutputBodyAdditional) init() GetRepoVisibilityOutputBodyAdditional { +func (s *CreateServiceAccountInputBodyAdditional) init() CreateServiceAccountInputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -4409,88 +4166,116 @@ func (s *GetRepoVisibilityOutputBodyAdditional) init() GetRepoVisibilityOutputBo return m } -type GetRepoVisibilityOutputBodyVisibility string +// Ref: #/components/schemas/CreatedOrg +type CreatedOrg struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Capabilities OptOrgCapabilities `json:"capabilities"` + // Deprecated: read the X-Entire-Commit-Token response header instead. + // + // Deprecated: schema marks this property as deprecated. + CommitToken OptString `json:"commitToken"` + CreatedAt time.Time `json:"createdAt"` + ID string `json:"id"` + Name string `json:"name"` + Region string `json:"region"` + WorkosOrganizationId OptString `json:"workosOrganizationId"` + AdditionalProps CreatedOrgAdditional +} -const ( - GetRepoVisibilityOutputBodyVisibilityPublic GetRepoVisibilityOutputBodyVisibility = "public" - GetRepoVisibilityOutputBodyVisibilityPrivate GetRepoVisibilityOutputBodyVisibility = "private" -) +// GetSchema returns the value of Schema. +func (s *CreatedOrg) GetSchema() OptURI { + return s.Schema +} -// AllValues returns all GetRepoVisibilityOutputBodyVisibility values. -func (GetRepoVisibilityOutputBodyVisibility) AllValues() []GetRepoVisibilityOutputBodyVisibility { - return []GetRepoVisibilityOutputBodyVisibility{ - GetRepoVisibilityOutputBodyVisibilityPublic, - GetRepoVisibilityOutputBodyVisibilityPrivate, - } +// GetCapabilities returns the value of Capabilities. +func (s *CreatedOrg) GetCapabilities() OptOrgCapabilities { + return s.Capabilities } -// MarshalText implements encoding.TextMarshaler. -func (s GetRepoVisibilityOutputBodyVisibility) MarshalText() ([]byte, error) { - switch s { - case GetRepoVisibilityOutputBodyVisibilityPublic: - return []byte(s), nil - case GetRepoVisibilityOutputBodyVisibilityPrivate: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } +// GetCommitToken returns the value of CommitToken. +func (s *CreatedOrg) GetCommitToken() OptString { + return s.CommitToken } -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *GetRepoVisibilityOutputBodyVisibility) UnmarshalText(data []byte) error { - switch GetRepoVisibilityOutputBodyVisibility(data) { - case GetRepoVisibilityOutputBodyVisibilityPublic: - *s = GetRepoVisibilityOutputBodyVisibilityPublic - return nil - case GetRepoVisibilityOutputBodyVisibilityPrivate: - *s = GetRepoVisibilityOutputBodyVisibilityPrivate - return nil - default: - return errors.Errorf("invalid value: %q", data) - } +// GetCreatedAt returns the value of CreatedAt. +func (s *CreatedOrg) GetCreatedAt() time.Time { + return s.CreatedAt } -// Ref: #/components/schemas/GetTopologyOutputBody -type GetTopologyOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Jurisdictions []TopologyJurisdiction `json:"jurisdictions"` - AdditionalProps GetTopologyOutputBodyAdditional +// GetID returns the value of ID. +func (s *CreatedOrg) GetID() string { + return s.ID } -// GetSchema returns the value of Schema. -func (s *GetTopologyOutputBody) GetSchema() OptURI { - return s.Schema +// GetName returns the value of Name. +func (s *CreatedOrg) GetName() string { + return s.Name } -// GetJurisdictions returns the value of Jurisdictions. -func (s *GetTopologyOutputBody) GetJurisdictions() []TopologyJurisdiction { - return s.Jurisdictions +// GetRegion returns the value of Region. +func (s *CreatedOrg) GetRegion() string { + return s.Region +} + +// GetWorkosOrganizationId returns the value of WorkosOrganizationId. +func (s *CreatedOrg) GetWorkosOrganizationId() OptString { + return s.WorkosOrganizationId } // GetAdditionalProps returns the value of AdditionalProps. -func (s *GetTopologyOutputBody) GetAdditionalProps() GetTopologyOutputBodyAdditional { +func (s *CreatedOrg) GetAdditionalProps() CreatedOrgAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *GetTopologyOutputBody) SetSchema(val OptURI) { +func (s *CreatedOrg) SetSchema(val OptURI) { s.Schema = val } -// SetJurisdictions sets the value of Jurisdictions. -func (s *GetTopologyOutputBody) SetJurisdictions(val []TopologyJurisdiction) { - s.Jurisdictions = val +// SetCapabilities sets the value of Capabilities. +func (s *CreatedOrg) SetCapabilities(val OptOrgCapabilities) { + s.Capabilities = val +} + +// SetCommitToken sets the value of CommitToken. +func (s *CreatedOrg) SetCommitToken(val OptString) { + s.CommitToken = val +} + +// SetCreatedAt sets the value of CreatedAt. +func (s *CreatedOrg) SetCreatedAt(val time.Time) { + s.CreatedAt = val +} + +// SetID sets the value of ID. +func (s *CreatedOrg) SetID(val string) { + s.ID = val +} + +// SetName sets the value of Name. +func (s *CreatedOrg) SetName(val string) { + s.Name = val +} + +// SetRegion sets the value of Region. +func (s *CreatedOrg) SetRegion(val string) { + s.Region = val +} + +// SetWorkosOrganizationId sets the value of WorkosOrganizationId. +func (s *CreatedOrg) SetWorkosOrganizationId(val OptString) { + s.WorkosOrganizationId = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *GetTopologyOutputBody) SetAdditionalProps(val GetTopologyOutputBodyAdditional) { +func (s *CreatedOrg) SetAdditionalProps(val CreatedOrgAdditional) { s.AdditionalProps = val } -type GetTopologyOutputBodyAdditional map[string]jx.Raw +type CreatedOrgAdditional map[string]jx.Raw -func (s *GetTopologyOutputBodyAdditional) init() GetTopologyOutputBodyAdditional { +func (s *CreatedOrgAdditional) init() CreatedOrgAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -4499,184 +4284,202 @@ func (s *GetTopologyOutputBodyAdditional) init() GetTopologyOutputBodyAdditional return m } -// Ref: #/components/schemas/GetVersionOutputBody -type GetVersionOutputBody struct { +// CreatedOrgHeaders wraps CreatedOrg with response headers. +type CreatedOrgHeaders struct { + XEntireCommitToken OptString + Response CreatedOrg +} + +// GetXEntireCommitToken returns the value of XEntireCommitToken. +func (s *CreatedOrgHeaders) GetXEntireCommitToken() OptString { + return s.XEntireCommitToken +} + +// GetResponse returns the value of Response. +func (s *CreatedOrgHeaders) GetResponse() CreatedOrg { + return s.Response +} + +// SetXEntireCommitToken sets the value of XEntireCommitToken. +func (s *CreatedOrgHeaders) SetXEntireCommitToken(val OptString) { + s.XEntireCommitToken = val +} + +// SetResponse sets the value of Response. +func (s *CreatedOrgHeaders) SetResponse(val CreatedOrg) { + s.Response = val +} + +// Ref: #/components/schemas/CreatedProject +type CreatedProject struct { // A URL to the JSON Schema for this object. Schema OptURI `json:"$schema"` - // Server mode. - Mode OptGetVersionOutputBodyMode `json:"mode"` - // Git commit SHA of the running entire-core binary, or "dev" for an untagged local build. - Version string `json:"version"` - AdditionalProps GetVersionOutputBodyAdditional + // Public entire-api base URL for the assigned cell. Empty when unassigned or routing is unavailable; + // do not fall back to another cell. + ApiUrl OptString `json:"apiUrl"` + Capabilities OptProjectCapabilities `json:"capabilities"` + // Deprecated: read the X-Entire-Commit-Token response header instead. + // + // Deprecated: schema marks this property as deprecated. + CommitToken OptString `json:"commitToken"` + CreatedAt time.Time `json:"createdAt"` + ID string `json:"id"` + Name string `json:"name"` + OwnerId string `json:"ownerId"` + OwnerName OptString `json:"ownerName"` + OwnerType CreatedProjectOwnerType `json:"ownerType"` + // Stored processing cell ID, not a cluster slug. Empty when the project is unassigned. + PrimaryProcessingCell OptString `json:"primaryProcessingCell"` + Region string `json:"region"` + // Published logical repositories in paginated project listings. Omitted without project-wide view + // permission or when unavailable. + RepositoryCount OptInt64 `json:"repositoryCount"` + AdditionalProps CreatedProjectAdditional } // GetSchema returns the value of Schema. -func (s *GetVersionOutputBody) GetSchema() OptURI { +func (s *CreatedProject) GetSchema() OptURI { return s.Schema } -// GetMode returns the value of Mode. -func (s *GetVersionOutputBody) GetMode() OptGetVersionOutputBodyMode { - return s.Mode +// GetApiUrl returns the value of ApiUrl. +func (s *CreatedProject) GetApiUrl() OptString { + return s.ApiUrl } -// GetVersion returns the value of Version. -func (s *GetVersionOutputBody) GetVersion() string { - return s.Version +// GetCapabilities returns the value of Capabilities. +func (s *CreatedProject) GetCapabilities() OptProjectCapabilities { + return s.Capabilities } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *GetVersionOutputBody) GetAdditionalProps() GetVersionOutputBodyAdditional { - return s.AdditionalProps +// GetCommitToken returns the value of CommitToken. +func (s *CreatedProject) GetCommitToken() OptString { + return s.CommitToken } -// SetSchema sets the value of Schema. -func (s *GetVersionOutputBody) SetSchema(val OptURI) { - s.Schema = val +// GetCreatedAt returns the value of CreatedAt. +func (s *CreatedProject) GetCreatedAt() time.Time { + return s.CreatedAt } -// SetMode sets the value of Mode. -func (s *GetVersionOutputBody) SetMode(val OptGetVersionOutputBodyMode) { - s.Mode = val +// GetID returns the value of ID. +func (s *CreatedProject) GetID() string { + return s.ID } -// SetVersion sets the value of Version. -func (s *GetVersionOutputBody) SetVersion(val string) { - s.Version = val +// GetName returns the value of Name. +func (s *CreatedProject) GetName() string { + return s.Name } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *GetVersionOutputBody) SetAdditionalProps(val GetVersionOutputBodyAdditional) { - s.AdditionalProps = val +// GetOwnerId returns the value of OwnerId. +func (s *CreatedProject) GetOwnerId() string { + return s.OwnerId } -type GetVersionOutputBodyAdditional map[string]jx.Raw +// GetOwnerName returns the value of OwnerName. +func (s *CreatedProject) GetOwnerName() OptString { + return s.OwnerName +} -func (s *GetVersionOutputBodyAdditional) init() GetVersionOutputBodyAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// GetOwnerType returns the value of OwnerType. +func (s *CreatedProject) GetOwnerType() CreatedProjectOwnerType { + return s.OwnerType } -// Server mode. -type GetVersionOutputBodyMode string +// GetPrimaryProcessingCell returns the value of PrimaryProcessingCell. +func (s *CreatedProject) GetPrimaryProcessingCell() OptString { + return s.PrimaryProcessingCell +} -const ( - GetVersionOutputBodyModeGlobal GetVersionOutputBodyMode = "global" - GetVersionOutputBodyModeRegional GetVersionOutputBodyMode = "regional" -) +// GetRegion returns the value of Region. +func (s *CreatedProject) GetRegion() string { + return s.Region +} -// AllValues returns all GetVersionOutputBodyMode values. -func (GetVersionOutputBodyMode) AllValues() []GetVersionOutputBodyMode { - return []GetVersionOutputBodyMode{ - GetVersionOutputBodyModeGlobal, - GetVersionOutputBodyModeRegional, - } +// GetRepositoryCount returns the value of RepositoryCount. +func (s *CreatedProject) GetRepositoryCount() OptInt64 { + return s.RepositoryCount } -// MarshalText implements encoding.TextMarshaler. -func (s GetVersionOutputBodyMode) MarshalText() ([]byte, error) { - switch s { - case GetVersionOutputBodyModeGlobal: - return []byte(s), nil - case GetVersionOutputBodyModeRegional: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } +// GetAdditionalProps returns the value of AdditionalProps. +func (s *CreatedProject) GetAdditionalProps() CreatedProjectAdditional { + return s.AdditionalProps } -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *GetVersionOutputBodyMode) UnmarshalText(data []byte) error { - switch GetVersionOutputBodyMode(data) { - case GetVersionOutputBodyModeGlobal: - *s = GetVersionOutputBodyModeGlobal - return nil - case GetVersionOutputBodyModeRegional: - *s = GetVersionOutputBodyModeRegional - return nil - default: - return errors.Errorf("invalid value: %q", data) - } +// SetSchema sets the value of Schema. +func (s *CreatedProject) SetSchema(val OptURI) { + s.Schema = val } -// Ref: #/components/schemas/GrantProjectAccessInputBody -type GrantProjectAccessInputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - GranteeType OptGrantProjectAccessInputBodyGranteeType `json:"granteeType"` - Provider string `json:"provider"` - ProviderUserId string `json:"providerUserId"` - Role GrantProjectAccessInputBodyRole `json:"role"` - AdditionalProps GrantProjectAccessInputBodyAdditional +// SetApiUrl sets the value of ApiUrl. +func (s *CreatedProject) SetApiUrl(val OptString) { + s.ApiUrl = val } -// GetSchema returns the value of Schema. -func (s *GrantProjectAccessInputBody) GetSchema() OptURI { - return s.Schema +// SetCapabilities sets the value of Capabilities. +func (s *CreatedProject) SetCapabilities(val OptProjectCapabilities) { + s.Capabilities = val } -// GetGranteeType returns the value of GranteeType. -func (s *GrantProjectAccessInputBody) GetGranteeType() OptGrantProjectAccessInputBodyGranteeType { - return s.GranteeType +// SetCommitToken sets the value of CommitToken. +func (s *CreatedProject) SetCommitToken(val OptString) { + s.CommitToken = val } -// GetProvider returns the value of Provider. -func (s *GrantProjectAccessInputBody) GetProvider() string { - return s.Provider +// SetCreatedAt sets the value of CreatedAt. +func (s *CreatedProject) SetCreatedAt(val time.Time) { + s.CreatedAt = val } -// GetProviderUserId returns the value of ProviderUserId. -func (s *GrantProjectAccessInputBody) GetProviderUserId() string { - return s.ProviderUserId +// SetID sets the value of ID. +func (s *CreatedProject) SetID(val string) { + s.ID = val } -// GetRole returns the value of Role. -func (s *GrantProjectAccessInputBody) GetRole() GrantProjectAccessInputBodyRole { - return s.Role +// SetName sets the value of Name. +func (s *CreatedProject) SetName(val string) { + s.Name = val } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *GrantProjectAccessInputBody) GetAdditionalProps() GrantProjectAccessInputBodyAdditional { - return s.AdditionalProps +// SetOwnerId sets the value of OwnerId. +func (s *CreatedProject) SetOwnerId(val string) { + s.OwnerId = val } -// SetSchema sets the value of Schema. -func (s *GrantProjectAccessInputBody) SetSchema(val OptURI) { - s.Schema = val +// SetOwnerName sets the value of OwnerName. +func (s *CreatedProject) SetOwnerName(val OptString) { + s.OwnerName = val } -// SetGranteeType sets the value of GranteeType. -func (s *GrantProjectAccessInputBody) SetGranteeType(val OptGrantProjectAccessInputBodyGranteeType) { - s.GranteeType = val +// SetOwnerType sets the value of OwnerType. +func (s *CreatedProject) SetOwnerType(val CreatedProjectOwnerType) { + s.OwnerType = val } -// SetProvider sets the value of Provider. -func (s *GrantProjectAccessInputBody) SetProvider(val string) { - s.Provider = val +// SetPrimaryProcessingCell sets the value of PrimaryProcessingCell. +func (s *CreatedProject) SetPrimaryProcessingCell(val OptString) { + s.PrimaryProcessingCell = val } -// SetProviderUserId sets the value of ProviderUserId. -func (s *GrantProjectAccessInputBody) SetProviderUserId(val string) { - s.ProviderUserId = val +// SetRegion sets the value of Region. +func (s *CreatedProject) SetRegion(val string) { + s.Region = val } -// SetRole sets the value of Role. -func (s *GrantProjectAccessInputBody) SetRole(val GrantProjectAccessInputBodyRole) { - s.Role = val +// SetRepositoryCount sets the value of RepositoryCount. +func (s *CreatedProject) SetRepositoryCount(val OptInt64) { + s.RepositoryCount = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *GrantProjectAccessInputBody) SetAdditionalProps(val GrantProjectAccessInputBodyAdditional) { +func (s *CreatedProject) SetAdditionalProps(val CreatedProjectAdditional) { s.AdditionalProps = val } -type GrantProjectAccessInputBodyAdditional map[string]jx.Raw +type CreatedProjectAdditional map[string]jx.Raw -func (s *GrantProjectAccessInputBodyAdditional) init() GrantProjectAccessInputBodyAdditional { +func (s *CreatedProjectAdditional) init() CreatedProjectAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -4685,65 +4488,53 @@ func (s *GrantProjectAccessInputBodyAdditional) init() GrantProjectAccessInputBo return m } -type GrantProjectAccessInputBodyGranteeType string +// CreatedProjectHeaders wraps CreatedProject with response headers. +type CreatedProjectHeaders struct { + XEntireCommitToken OptString + Response CreatedProject +} -const ( - GrantProjectAccessInputBodyGranteeTypeAccount GrantProjectAccessInputBodyGranteeType = "account" -) +// GetXEntireCommitToken returns the value of XEntireCommitToken. +func (s *CreatedProjectHeaders) GetXEntireCommitToken() OptString { + return s.XEntireCommitToken +} -// AllValues returns all GrantProjectAccessInputBodyGranteeType values. -func (GrantProjectAccessInputBodyGranteeType) AllValues() []GrantProjectAccessInputBodyGranteeType { - return []GrantProjectAccessInputBodyGranteeType{ - GrantProjectAccessInputBodyGranteeTypeAccount, - } +// GetResponse returns the value of Response. +func (s *CreatedProjectHeaders) GetResponse() CreatedProject { + return s.Response } -// MarshalText implements encoding.TextMarshaler. -func (s GrantProjectAccessInputBodyGranteeType) MarshalText() ([]byte, error) { - switch s { - case GrantProjectAccessInputBodyGranteeTypeAccount: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } +// SetXEntireCommitToken sets the value of XEntireCommitToken. +func (s *CreatedProjectHeaders) SetXEntireCommitToken(val OptString) { + s.XEntireCommitToken = val } -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *GrantProjectAccessInputBodyGranteeType) UnmarshalText(data []byte) error { - switch GrantProjectAccessInputBodyGranteeType(data) { - case GrantProjectAccessInputBodyGranteeTypeAccount: - *s = GrantProjectAccessInputBodyGranteeTypeAccount - return nil - default: - return errors.Errorf("invalid value: %q", data) - } +// SetResponse sets the value of Response. +func (s *CreatedProjectHeaders) SetResponse(val CreatedProject) { + s.Response = val } -type GrantProjectAccessInputBodyRole string +type CreatedProjectOwnerType string const ( - GrantProjectAccessInputBodyRoleReader GrantProjectAccessInputBodyRole = "reader" - GrantProjectAccessInputBodyRoleWriter GrantProjectAccessInputBodyRole = "writer" - GrantProjectAccessInputBodyRoleAdmin GrantProjectAccessInputBodyRole = "admin" + CreatedProjectOwnerTypeOrg CreatedProjectOwnerType = "org" + CreatedProjectOwnerTypeAccount CreatedProjectOwnerType = "account" ) -// AllValues returns all GrantProjectAccessInputBodyRole values. -func (GrantProjectAccessInputBodyRole) AllValues() []GrantProjectAccessInputBodyRole { - return []GrantProjectAccessInputBodyRole{ - GrantProjectAccessInputBodyRoleReader, - GrantProjectAccessInputBodyRoleWriter, - GrantProjectAccessInputBodyRoleAdmin, +// AllValues returns all CreatedProjectOwnerType values. +func (CreatedProjectOwnerType) AllValues() []CreatedProjectOwnerType { + return []CreatedProjectOwnerType{ + CreatedProjectOwnerTypeOrg, + CreatedProjectOwnerTypeAccount, } } // MarshalText implements encoding.TextMarshaler. -func (s GrantProjectAccessInputBodyRole) MarshalText() ([]byte, error) { +func (s CreatedProjectOwnerType) MarshalText() ([]byte, error) { switch s { - case GrantProjectAccessInputBodyRoleReader: + case CreatedProjectOwnerTypeOrg: return []byte(s), nil - case GrantProjectAccessInputBodyRoleWriter: - return []byte(s), nil - case GrantProjectAccessInputBodyRoleAdmin: + case CreatedProjectOwnerTypeAccount: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) @@ -4751,347 +4542,295 @@ func (s GrantProjectAccessInputBodyRole) MarshalText() ([]byte, error) { } // UnmarshalText implements encoding.TextUnmarshaler. -func (s *GrantProjectAccessInputBodyRole) UnmarshalText(data []byte) error { - switch GrantProjectAccessInputBodyRole(data) { - case GrantProjectAccessInputBodyRoleReader: - *s = GrantProjectAccessInputBodyRoleReader - return nil - case GrantProjectAccessInputBodyRoleWriter: - *s = GrantProjectAccessInputBodyRoleWriter +func (s *CreatedProjectOwnerType) UnmarshalText(data []byte) error { + switch CreatedProjectOwnerType(data) { + case CreatedProjectOwnerTypeOrg: + *s = CreatedProjectOwnerTypeOrg return nil - case GrantProjectAccessInputBodyRoleAdmin: - *s = GrantProjectAccessInputBodyRoleAdmin + case CreatedProjectOwnerTypeAccount: + *s = CreatedProjectOwnerTypeAccount return nil default: return errors.Errorf("invalid value: %q", data) } } -// Ref: #/components/schemas/GrantProjectAccessOutputBody -type GrantProjectAccessOutputBody struct { +// Ref: #/components/schemas/CreatedRepo +type CreatedRepo struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Status string `json:"status"` - AdditionalProps GrantProjectAccessOutputBodyAdditional + Schema OptURI `json:"$schema"` + Capabilities OptRepoCapabilities `json:"capabilities"` + ClusterHost OptString `json:"clusterHost"` + ClusterSlug OptString `json:"clusterSlug"` + // Deprecated: read the X-Entire-Commit-Token response header instead. + // + // Deprecated: schema marks this property as deprecated. + CommitToken OptString `json:"commitToken"` + Foreign OptBool `json:"foreign"` + FullName OptString `json:"fullName"` + ID string `json:"id"` + Jurisdiction OptString `json:"jurisdiction"` + MirrorSuspended OptBool `json:"mirrorSuspended"` + MirrorSuspendedAt OptString `json:"mirrorSuspendedAt"` + Name string `json:"name"` + ObjectFormat OptString `json:"objectFormat"` + OwningProjectId string `json:"owningProjectId"` + Path OptString `json:"path"` + Placements []RepoPlacement `json:"placements"` + Primaries OptRepoPrimaries `json:"primaries"` + Provider OptString `json:"provider"` + ProvisionAttempts OptInt64 `json:"provisionAttempts"` + ProvisionReason OptString `json:"provisionReason"` + RepoGroupId OptString `json:"repoGroupId"` + // Provisioning lifecycle. A mirror is active from creation, before its initial clone completes. + State OptString `json:"state"` + Visibility OptString `json:"visibility"` + AdditionalProps CreatedRepoAdditional } // GetSchema returns the value of Schema. -func (s *GrantProjectAccessOutputBody) GetSchema() OptURI { +func (s *CreatedRepo) GetSchema() OptURI { return s.Schema } -// GetStatus returns the value of Status. -func (s *GrantProjectAccessOutputBody) GetStatus() string { - return s.Status +// GetCapabilities returns the value of Capabilities. +func (s *CreatedRepo) GetCapabilities() OptRepoCapabilities { + return s.Capabilities } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *GrantProjectAccessOutputBody) GetAdditionalProps() GrantProjectAccessOutputBodyAdditional { - return s.AdditionalProps +// GetClusterHost returns the value of ClusterHost. +func (s *CreatedRepo) GetClusterHost() OptString { + return s.ClusterHost } -// SetSchema sets the value of Schema. -func (s *GrantProjectAccessOutputBody) SetSchema(val OptURI) { - s.Schema = val +// GetClusterSlug returns the value of ClusterSlug. +func (s *CreatedRepo) GetClusterSlug() OptString { + return s.ClusterSlug } -// SetStatus sets the value of Status. -func (s *GrantProjectAccessOutputBody) SetStatus(val string) { - s.Status = val +// GetCommitToken returns the value of CommitToken. +func (s *CreatedRepo) GetCommitToken() OptString { + return s.CommitToken } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *GrantProjectAccessOutputBody) SetAdditionalProps(val GrantProjectAccessOutputBodyAdditional) { - s.AdditionalProps = val +// GetForeign returns the value of Foreign. +func (s *CreatedRepo) GetForeign() OptBool { + return s.Foreign } -type GrantProjectAccessOutputBodyAdditional map[string]jx.Raw +// GetFullName returns the value of FullName. +func (s *CreatedRepo) GetFullName() OptString { + return s.FullName +} -func (s *GrantProjectAccessOutputBodyAdditional) init() GrantProjectAccessOutputBodyAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// GetID returns the value of ID. +func (s *CreatedRepo) GetID() string { + return s.ID } -// Ref: #/components/schemas/GrantRepoAccessInputBody -type GrantRepoAccessInputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - GranteeType OptGrantRepoAccessInputBodyGranteeType `json:"granteeType"` - Provider string `json:"provider"` - ProviderUserId string `json:"providerUserId"` - Role GrantRepoAccessInputBodyRole `json:"role"` - AdditionalProps GrantRepoAccessInputBodyAdditional +// GetJurisdiction returns the value of Jurisdiction. +func (s *CreatedRepo) GetJurisdiction() OptString { + return s.Jurisdiction } -// GetSchema returns the value of Schema. -func (s *GrantRepoAccessInputBody) GetSchema() OptURI { - return s.Schema +// GetMirrorSuspended returns the value of MirrorSuspended. +func (s *CreatedRepo) GetMirrorSuspended() OptBool { + return s.MirrorSuspended } -// GetGranteeType returns the value of GranteeType. -func (s *GrantRepoAccessInputBody) GetGranteeType() OptGrantRepoAccessInputBodyGranteeType { - return s.GranteeType +// GetMirrorSuspendedAt returns the value of MirrorSuspendedAt. +func (s *CreatedRepo) GetMirrorSuspendedAt() OptString { + return s.MirrorSuspendedAt } -// GetProvider returns the value of Provider. -func (s *GrantRepoAccessInputBody) GetProvider() string { - return s.Provider +// GetName returns the value of Name. +func (s *CreatedRepo) GetName() string { + return s.Name } -// GetProviderUserId returns the value of ProviderUserId. -func (s *GrantRepoAccessInputBody) GetProviderUserId() string { - return s.ProviderUserId +// GetObjectFormat returns the value of ObjectFormat. +func (s *CreatedRepo) GetObjectFormat() OptString { + return s.ObjectFormat } -// GetRole returns the value of Role. -func (s *GrantRepoAccessInputBody) GetRole() GrantRepoAccessInputBodyRole { - return s.Role +// GetOwningProjectId returns the value of OwningProjectId. +func (s *CreatedRepo) GetOwningProjectId() string { + return s.OwningProjectId } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *GrantRepoAccessInputBody) GetAdditionalProps() GrantRepoAccessInputBodyAdditional { - return s.AdditionalProps +// GetPath returns the value of Path. +func (s *CreatedRepo) GetPath() OptString { + return s.Path } -// SetSchema sets the value of Schema. -func (s *GrantRepoAccessInputBody) SetSchema(val OptURI) { - s.Schema = val +// GetPlacements returns the value of Placements. +func (s *CreatedRepo) GetPlacements() []RepoPlacement { + return s.Placements } -// SetGranteeType sets the value of GranteeType. -func (s *GrantRepoAccessInputBody) SetGranteeType(val OptGrantRepoAccessInputBodyGranteeType) { - s.GranteeType = val +// GetPrimaries returns the value of Primaries. +func (s *CreatedRepo) GetPrimaries() OptRepoPrimaries { + return s.Primaries } -// SetProvider sets the value of Provider. -func (s *GrantRepoAccessInputBody) SetProvider(val string) { - s.Provider = val +// GetProvider returns the value of Provider. +func (s *CreatedRepo) GetProvider() OptString { + return s.Provider } -// SetProviderUserId sets the value of ProviderUserId. -func (s *GrantRepoAccessInputBody) SetProviderUserId(val string) { - s.ProviderUserId = val +// GetProvisionAttempts returns the value of ProvisionAttempts. +func (s *CreatedRepo) GetProvisionAttempts() OptInt64 { + return s.ProvisionAttempts } -// SetRole sets the value of Role. -func (s *GrantRepoAccessInputBody) SetRole(val GrantRepoAccessInputBodyRole) { - s.Role = val +// GetProvisionReason returns the value of ProvisionReason. +func (s *CreatedRepo) GetProvisionReason() OptString { + return s.ProvisionReason } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *GrantRepoAccessInputBody) SetAdditionalProps(val GrantRepoAccessInputBodyAdditional) { - s.AdditionalProps = val +// GetRepoGroupId returns the value of RepoGroupId. +func (s *CreatedRepo) GetRepoGroupId() OptString { + return s.RepoGroupId } -type GrantRepoAccessInputBodyAdditional map[string]jx.Raw - -func (s *GrantRepoAccessInputBodyAdditional) init() GrantRepoAccessInputBodyAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// GetState returns the value of State. +func (s *CreatedRepo) GetState() OptString { + return s.State } -type GrantRepoAccessInputBodyGranteeType string - -const ( - GrantRepoAccessInputBodyGranteeTypeAccount GrantRepoAccessInputBodyGranteeType = "account" -) - -// AllValues returns all GrantRepoAccessInputBodyGranteeType values. -func (GrantRepoAccessInputBodyGranteeType) AllValues() []GrantRepoAccessInputBodyGranteeType { - return []GrantRepoAccessInputBodyGranteeType{ - GrantRepoAccessInputBodyGranteeTypeAccount, - } +// GetVisibility returns the value of Visibility. +func (s *CreatedRepo) GetVisibility() OptString { + return s.Visibility } -// MarshalText implements encoding.TextMarshaler. -func (s GrantRepoAccessInputBodyGranteeType) MarshalText() ([]byte, error) { - switch s { - case GrantRepoAccessInputBodyGranteeTypeAccount: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } +// GetAdditionalProps returns the value of AdditionalProps. +func (s *CreatedRepo) GetAdditionalProps() CreatedRepoAdditional { + return s.AdditionalProps } -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *GrantRepoAccessInputBodyGranteeType) UnmarshalText(data []byte) error { - switch GrantRepoAccessInputBodyGranteeType(data) { - case GrantRepoAccessInputBodyGranteeTypeAccount: - *s = GrantRepoAccessInputBodyGranteeTypeAccount - return nil - default: - return errors.Errorf("invalid value: %q", data) - } +// SetSchema sets the value of Schema. +func (s *CreatedRepo) SetSchema(val OptURI) { + s.Schema = val } -type GrantRepoAccessInputBodyRole string - -const ( - GrantRepoAccessInputBodyRoleReader GrantRepoAccessInputBodyRole = "reader" - GrantRepoAccessInputBodyRoleWriter GrantRepoAccessInputBodyRole = "writer" - GrantRepoAccessInputBodyRoleAdmin GrantRepoAccessInputBodyRole = "admin" -) - -// AllValues returns all GrantRepoAccessInputBodyRole values. -func (GrantRepoAccessInputBodyRole) AllValues() []GrantRepoAccessInputBodyRole { - return []GrantRepoAccessInputBodyRole{ - GrantRepoAccessInputBodyRoleReader, - GrantRepoAccessInputBodyRoleWriter, - GrantRepoAccessInputBodyRoleAdmin, - } +// SetCapabilities sets the value of Capabilities. +func (s *CreatedRepo) SetCapabilities(val OptRepoCapabilities) { + s.Capabilities = val } -// MarshalText implements encoding.TextMarshaler. -func (s GrantRepoAccessInputBodyRole) MarshalText() ([]byte, error) { - switch s { - case GrantRepoAccessInputBodyRoleReader: - return []byte(s), nil - case GrantRepoAccessInputBodyRoleWriter: - return []byte(s), nil - case GrantRepoAccessInputBodyRoleAdmin: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } +// SetClusterHost sets the value of ClusterHost. +func (s *CreatedRepo) SetClusterHost(val OptString) { + s.ClusterHost = val } -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *GrantRepoAccessInputBodyRole) UnmarshalText(data []byte) error { - switch GrantRepoAccessInputBodyRole(data) { - case GrantRepoAccessInputBodyRoleReader: - *s = GrantRepoAccessInputBodyRoleReader - return nil - case GrantRepoAccessInputBodyRoleWriter: - *s = GrantRepoAccessInputBodyRoleWriter - return nil - case GrantRepoAccessInputBodyRoleAdmin: - *s = GrantRepoAccessInputBodyRoleAdmin - return nil - default: - return errors.Errorf("invalid value: %q", data) - } +// SetClusterSlug sets the value of ClusterSlug. +func (s *CreatedRepo) SetClusterSlug(val OptString) { + s.ClusterSlug = val } -// Ref: #/components/schemas/GrantRepoAccessOutputBody -type GrantRepoAccessOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Status string `json:"status"` - AdditionalProps GrantRepoAccessOutputBodyAdditional +// SetCommitToken sets the value of CommitToken. +func (s *CreatedRepo) SetCommitToken(val OptString) { + s.CommitToken = val } -// GetSchema returns the value of Schema. -func (s *GrantRepoAccessOutputBody) GetSchema() OptURI { - return s.Schema +// SetForeign sets the value of Foreign. +func (s *CreatedRepo) SetForeign(val OptBool) { + s.Foreign = val } -// GetStatus returns the value of Status. -func (s *GrantRepoAccessOutputBody) GetStatus() string { - return s.Status +// SetFullName sets the value of FullName. +func (s *CreatedRepo) SetFullName(val OptString) { + s.FullName = val } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *GrantRepoAccessOutputBody) GetAdditionalProps() GrantRepoAccessOutputBodyAdditional { - return s.AdditionalProps +// SetID sets the value of ID. +func (s *CreatedRepo) SetID(val string) { + s.ID = val } -// SetSchema sets the value of Schema. -func (s *GrantRepoAccessOutputBody) SetSchema(val OptURI) { - s.Schema = val +// SetJurisdiction sets the value of Jurisdiction. +func (s *CreatedRepo) SetJurisdiction(val OptString) { + s.Jurisdiction = val } -// SetStatus sets the value of Status. -func (s *GrantRepoAccessOutputBody) SetStatus(val string) { - s.Status = val +// SetMirrorSuspended sets the value of MirrorSuspended. +func (s *CreatedRepo) SetMirrorSuspended(val OptBool) { + s.MirrorSuspended = val } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *GrantRepoAccessOutputBody) SetAdditionalProps(val GrantRepoAccessOutputBodyAdditional) { - s.AdditionalProps = val +// SetMirrorSuspendedAt sets the value of MirrorSuspendedAt. +func (s *CreatedRepo) SetMirrorSuspendedAt(val OptString) { + s.MirrorSuspendedAt = val } -type GrantRepoAccessOutputBodyAdditional map[string]jx.Raw +// SetName sets the value of Name. +func (s *CreatedRepo) SetName(val string) { + s.Name = val +} -func (s *GrantRepoAccessOutputBodyAdditional) init() GrantRepoAccessOutputBodyAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// SetObjectFormat sets the value of ObjectFormat. +func (s *CreatedRepo) SetObjectFormat(val OptString) { + s.ObjectFormat = val } -// Ref: #/components/schemas/GrantServiceAccountAccessInputBody -type GrantServiceAccountAccessInputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - ResourceId string `json:"resourceId"` - ResourceType GrantServiceAccountAccessInputBodyResourceType `json:"resourceType"` - Role GrantServiceAccountAccessInputBodyRole `json:"role"` - AdditionalProps GrantServiceAccountAccessInputBodyAdditional +// SetOwningProjectId sets the value of OwningProjectId. +func (s *CreatedRepo) SetOwningProjectId(val string) { + s.OwningProjectId = val } -// GetSchema returns the value of Schema. -func (s *GrantServiceAccountAccessInputBody) GetSchema() OptURI { - return s.Schema +// SetPath sets the value of Path. +func (s *CreatedRepo) SetPath(val OptString) { + s.Path = val } -// GetResourceId returns the value of ResourceId. -func (s *GrantServiceAccountAccessInputBody) GetResourceId() string { - return s.ResourceId +// SetPlacements sets the value of Placements. +func (s *CreatedRepo) SetPlacements(val []RepoPlacement) { + s.Placements = val } -// GetResourceType returns the value of ResourceType. -func (s *GrantServiceAccountAccessInputBody) GetResourceType() GrantServiceAccountAccessInputBodyResourceType { - return s.ResourceType +// SetPrimaries sets the value of Primaries. +func (s *CreatedRepo) SetPrimaries(val OptRepoPrimaries) { + s.Primaries = val } -// GetRole returns the value of Role. -func (s *GrantServiceAccountAccessInputBody) GetRole() GrantServiceAccountAccessInputBodyRole { - return s.Role +// SetProvider sets the value of Provider. +func (s *CreatedRepo) SetProvider(val OptString) { + s.Provider = val } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *GrantServiceAccountAccessInputBody) GetAdditionalProps() GrantServiceAccountAccessInputBodyAdditional { - return s.AdditionalProps +// SetProvisionAttempts sets the value of ProvisionAttempts. +func (s *CreatedRepo) SetProvisionAttempts(val OptInt64) { + s.ProvisionAttempts = val } -// SetSchema sets the value of Schema. -func (s *GrantServiceAccountAccessInputBody) SetSchema(val OptURI) { - s.Schema = val +// SetProvisionReason sets the value of ProvisionReason. +func (s *CreatedRepo) SetProvisionReason(val OptString) { + s.ProvisionReason = val } -// SetResourceId sets the value of ResourceId. -func (s *GrantServiceAccountAccessInputBody) SetResourceId(val string) { - s.ResourceId = val +// SetRepoGroupId sets the value of RepoGroupId. +func (s *CreatedRepo) SetRepoGroupId(val OptString) { + s.RepoGroupId = val } -// SetResourceType sets the value of ResourceType. -func (s *GrantServiceAccountAccessInputBody) SetResourceType(val GrantServiceAccountAccessInputBodyResourceType) { - s.ResourceType = val +// SetState sets the value of State. +func (s *CreatedRepo) SetState(val OptString) { + s.State = val } -// SetRole sets the value of Role. -func (s *GrantServiceAccountAccessInputBody) SetRole(val GrantServiceAccountAccessInputBodyRole) { - s.Role = val +// SetVisibility sets the value of Visibility. +func (s *CreatedRepo) SetVisibility(val OptString) { + s.Visibility = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *GrantServiceAccountAccessInputBody) SetAdditionalProps(val GrantServiceAccountAccessInputBodyAdditional) { +func (s *CreatedRepo) SetAdditionalProps(val CreatedRepoAdditional) { s.AdditionalProps = val } -type GrantServiceAccountAccessInputBodyAdditional map[string]jx.Raw +type CreatedRepoAdditional map[string]jx.Raw -func (s *GrantServiceAccountAccessInputBodyAdditional) init() GrantServiceAccountAccessInputBodyAdditional { +func (s *CreatedRepoAdditional) init() CreatedRepoAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -5100,27 +4839,58 @@ func (s *GrantServiceAccountAccessInputBodyAdditional) init() GrantServiceAccoun return m } -type GrantServiceAccountAccessInputBodyResourceType string +// CreatedRepoHeaders wraps CreatedRepo with response headers. +type CreatedRepoHeaders struct { + XEntireCommitToken OptString + Response CreatedRepo +} + +// GetXEntireCommitToken returns the value of XEntireCommitToken. +func (s *CreatedRepoHeaders) GetXEntireCommitToken() OptString { + return s.XEntireCommitToken +} + +// GetResponse returns the value of Response. +func (s *CreatedRepoHeaders) GetResponse() CreatedRepo { + return s.Response +} + +// SetXEntireCommitToken sets the value of XEntireCommitToken. +func (s *CreatedRepoHeaders) SetXEntireCommitToken(val OptString) { + s.XEntireCommitToken = val +} + +// SetResponse sets the value of Response. +func (s *CreatedRepoHeaders) SetResponse(val CreatedRepo) { + s.Response = val +} + +// DeleteBindingNoContent is response for DeleteBinding operation. +type DeleteBindingNoContent struct{} + +// DeleteMeAccepted is response for DeleteMe operation. +type DeleteMeAccepted struct{} + +// DeleteMirrorNoContent is response for DeleteMirror operation. +type DeleteMirrorNoContent struct{} + +type DeleteMirrorProvider string const ( - GrantServiceAccountAccessInputBodyResourceTypeRepo GrantServiceAccountAccessInputBodyResourceType = "repo" - GrantServiceAccountAccessInputBodyResourceTypeProject GrantServiceAccountAccessInputBodyResourceType = "project" + DeleteMirrorProviderGithub DeleteMirrorProvider = "github" ) -// AllValues returns all GrantServiceAccountAccessInputBodyResourceType values. -func (GrantServiceAccountAccessInputBodyResourceType) AllValues() []GrantServiceAccountAccessInputBodyResourceType { - return []GrantServiceAccountAccessInputBodyResourceType{ - GrantServiceAccountAccessInputBodyResourceTypeRepo, - GrantServiceAccountAccessInputBodyResourceTypeProject, +// AllValues returns all DeleteMirrorProvider values. +func (DeleteMirrorProvider) AllValues() []DeleteMirrorProvider { + return []DeleteMirrorProvider{ + DeleteMirrorProviderGithub, } } // MarshalText implements encoding.TextMarshaler. -func (s GrantServiceAccountAccessInputBodyResourceType) MarshalText() ([]byte, error) { +func (s DeleteMirrorProvider) MarshalText() ([]byte, error) { switch s { - case GrantServiceAccountAccessInputBodyResourceTypeRepo: - return []byte(s), nil - case GrantServiceAccountAccessInputBodyResourceTypeProject: + case DeleteMirrorProviderGithub: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) @@ -5128,169 +4898,153 @@ func (s GrantServiceAccountAccessInputBodyResourceType) MarshalText() ([]byte, e } // UnmarshalText implements encoding.TextUnmarshaler. -func (s *GrantServiceAccountAccessInputBodyResourceType) UnmarshalText(data []byte) error { - switch GrantServiceAccountAccessInputBodyResourceType(data) { - case GrantServiceAccountAccessInputBodyResourceTypeRepo: - *s = GrantServiceAccountAccessInputBodyResourceTypeRepo - return nil - case GrantServiceAccountAccessInputBodyResourceTypeProject: - *s = GrantServiceAccountAccessInputBodyResourceTypeProject +func (s *DeleteMirrorProvider) UnmarshalText(data []byte) error { + switch DeleteMirrorProvider(data) { + case DeleteMirrorProviderGithub: + *s = DeleteMirrorProviderGithub return nil default: return errors.Errorf("invalid value: %q", data) } } -type GrantServiceAccountAccessInputBodyRole string +// DeleteOrgCIBuildkiteClusterNoContent is response for DeleteOrgCIBuildkiteCluster operation. +type DeleteOrgCIBuildkiteClusterNoContent struct{} -const ( - GrantServiceAccountAccessInputBodyRoleReader GrantServiceAccountAccessInputBodyRole = "reader" - GrantServiceAccountAccessInputBodyRoleWriter GrantServiceAccountAccessInputBodyRole = "writer" - GrantServiceAccountAccessInputBodyRoleAdmin GrantServiceAccountAccessInputBodyRole = "admin" -) +// DeleteOrgCIBuildkiteCredentialNoContent is response for DeleteOrgCIBuildkiteCredential operation. +type DeleteOrgCIBuildkiteCredentialNoContent struct{} -// AllValues returns all GrantServiceAccountAccessInputBodyRole values. -func (GrantServiceAccountAccessInputBodyRole) AllValues() []GrantServiceAccountAccessInputBodyRole { - return []GrantServiceAccountAccessInputBodyRole{ - GrantServiceAccountAccessInputBodyRoleReader, - GrantServiceAccountAccessInputBodyRoleWriter, - GrantServiceAccountAccessInputBodyRoleAdmin, - } +// DeleteOrgNoContent is response for DeleteOrg operation. +type DeleteOrgNoContent struct { + XEntireCommitToken OptString } -// MarshalText implements encoding.TextMarshaler. -func (s GrantServiceAccountAccessInputBodyRole) MarshalText() ([]byte, error) { - switch s { - case GrantServiceAccountAccessInputBodyRoleReader: - return []byte(s), nil - case GrantServiceAccountAccessInputBodyRoleWriter: - return []byte(s), nil - case GrantServiceAccountAccessInputBodyRoleAdmin: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } +// GetXEntireCommitToken returns the value of XEntireCommitToken. +func (s *DeleteOrgNoContent) GetXEntireCommitToken() OptString { + return s.XEntireCommitToken } -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *GrantServiceAccountAccessInputBodyRole) UnmarshalText(data []byte) error { - switch GrantServiceAccountAccessInputBodyRole(data) { - case GrantServiceAccountAccessInputBodyRoleReader: - *s = GrantServiceAccountAccessInputBodyRoleReader - return nil - case GrantServiceAccountAccessInputBodyRoleWriter: - *s = GrantServiceAccountAccessInputBodyRoleWriter - return nil - case GrantServiceAccountAccessInputBodyRoleAdmin: - *s = GrantServiceAccountAccessInputBodyRoleAdmin - return nil - default: - return errors.Errorf("invalid value: %q", data) - } +// SetXEntireCommitToken sets the value of XEntireCommitToken. +func (s *DeleteOrgNoContent) SetXEntireCommitToken(val OptString) { + s.XEntireCommitToken = val } -// Ref: #/components/schemas/GrantServiceAccountAccessOutputBody -type GrantServiceAccountAccessOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Status string `json:"status"` - AdditionalProps GrantServiceAccountAccessOutputBodyAdditional +// DeleteProjectNoContent is response for DeleteProject operation. +type DeleteProjectNoContent struct { + XEntireCommitToken OptString } -// GetSchema returns the value of Schema. -func (s *GrantServiceAccountAccessOutputBody) GetSchema() OptURI { - return s.Schema +// GetXEntireCommitToken returns the value of XEntireCommitToken. +func (s *DeleteProjectNoContent) GetXEntireCommitToken() OptString { + return s.XEntireCommitToken } -// GetStatus returns the value of Status. -func (s *GrantServiceAccountAccessOutputBody) GetStatus() string { - return s.Status +// SetXEntireCommitToken sets the value of XEntireCommitToken. +func (s *DeleteProjectNoContent) SetXEntireCommitToken(val OptString) { + s.XEntireCommitToken = val } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *GrantServiceAccountAccessOutputBody) GetAdditionalProps() GrantServiceAccountAccessOutputBodyAdditional { - return s.AdditionalProps -} +// DeleteRepoCIWebhookNoContent is response for DeleteRepoCIWebhook operation. +type DeleteRepoCIWebhookNoContent struct{} -// SetSchema sets the value of Schema. -func (s *GrantServiceAccountAccessOutputBody) SetSchema(val OptURI) { - s.Schema = val +// DeleteRepoNoContent is response for DeleteRepo operation. +type DeleteRepoNoContent struct { + XEntireCommitToken OptString } -// SetStatus sets the value of Status. -func (s *GrantServiceAccountAccessOutputBody) SetStatus(val string) { - s.Status = val +// GetXEntireCommitToken returns the value of XEntireCommitToken. +func (s *DeleteRepoNoContent) GetXEntireCommitToken() OptString { + return s.XEntireCommitToken } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *GrantServiceAccountAccessOutputBody) SetAdditionalProps(val GrantServiceAccountAccessOutputBodyAdditional) { - s.AdditionalProps = val +// SetXEntireCommitToken sets the value of XEntireCommitToken. +func (s *DeleteRepoNoContent) SetXEntireCommitToken(val OptString) { + s.XEntireCommitToken = val } -type GrantServiceAccountAccessOutputBodyAdditional map[string]jx.Raw +// DeleteServiceAccountNoContent is response for DeleteServiceAccount operation. +type DeleteServiceAccountNoContent struct{} -func (s *GrantServiceAccountAccessOutputBodyAdditional) init() GrantServiceAccountAccessOutputBodyAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// Ref: #/components/schemas/DeletionBlocker +type DeletionBlocker struct { + // True when the account can self-serve delete this org (it is the only member and the org has no + // projects). When false, the org has other members or data and must be transferred/removed via + // support. The UI should offer a delete action only when this is true. + Deletable bool `json:"deletable"` + // Resource ID (org ULID). + ID string `json:"id"` + // Blocker kind. Currently always 'owned_org'. + Kind DeletionBlockerKind `json:"kind"` + // Copy explaining how to clear the blocker. + Message string `json:"message"` + // Human-readable resource name. + Name string `json:"name"` + AdditionalProps DeletionBlockerAdditional } -// Ref: #/components/schemas/ListAuditEventsOutputBody -type ListAuditEventsOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Events []AuditEvent `json:"events"` - // Pass back to fetch the next page; empty when no more entries. - NextPageToken OptString `json:"nextPageToken"` - AdditionalProps ListAuditEventsOutputBodyAdditional +// GetDeletable returns the value of Deletable. +func (s *DeletionBlocker) GetDeletable() bool { + return s.Deletable } -// GetSchema returns the value of Schema. -func (s *ListAuditEventsOutputBody) GetSchema() OptURI { - return s.Schema +// GetID returns the value of ID. +func (s *DeletionBlocker) GetID() string { + return s.ID } -// GetEvents returns the value of Events. -func (s *ListAuditEventsOutputBody) GetEvents() []AuditEvent { - return s.Events +// GetKind returns the value of Kind. +func (s *DeletionBlocker) GetKind() DeletionBlockerKind { + return s.Kind } -// GetNextPageToken returns the value of NextPageToken. -func (s *ListAuditEventsOutputBody) GetNextPageToken() OptString { - return s.NextPageToken +// GetMessage returns the value of Message. +func (s *DeletionBlocker) GetMessage() string { + return s.Message +} + +// GetName returns the value of Name. +func (s *DeletionBlocker) GetName() string { + return s.Name } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListAuditEventsOutputBody) GetAdditionalProps() ListAuditEventsOutputBodyAdditional { +func (s *DeletionBlocker) GetAdditionalProps() DeletionBlockerAdditional { return s.AdditionalProps } -// SetSchema sets the value of Schema. -func (s *ListAuditEventsOutputBody) SetSchema(val OptURI) { - s.Schema = val +// SetDeletable sets the value of Deletable. +func (s *DeletionBlocker) SetDeletable(val bool) { + s.Deletable = val } -// SetEvents sets the value of Events. -func (s *ListAuditEventsOutputBody) SetEvents(val []AuditEvent) { - s.Events = val +// SetID sets the value of ID. +func (s *DeletionBlocker) SetID(val string) { + s.ID = val } -// SetNextPageToken sets the value of NextPageToken. -func (s *ListAuditEventsOutputBody) SetNextPageToken(val OptString) { - s.NextPageToken = val +// SetKind sets the value of Kind. +func (s *DeletionBlocker) SetKind(val DeletionBlockerKind) { + s.Kind = val +} + +// SetMessage sets the value of Message. +func (s *DeletionBlocker) SetMessage(val string) { + s.Message = val +} + +// SetName sets the value of Name. +func (s *DeletionBlocker) SetName(val string) { + s.Name = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListAuditEventsOutputBody) SetAdditionalProps(val ListAuditEventsOutputBodyAdditional) { +func (s *DeletionBlocker) SetAdditionalProps(val DeletionBlockerAdditional) { s.AdditionalProps = val } -type ListAuditEventsOutputBodyAdditional map[string]jx.Raw +type DeletionBlockerAdditional map[string]jx.Raw -func (s *ListAuditEventsOutputBodyAdditional) init() ListAuditEventsOutputBodyAdditional { +func (s *DeletionBlockerAdditional) init() DeletionBlockerAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -5299,108 +5053,119 @@ func (s *ListAuditEventsOutputBodyAdditional) init() ListAuditEventsOutputBodyAd return m } -// Ref: #/components/schemas/ListAvailableMirrorsOutputBody -type ListAvailableMirrorsOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Available []AvailableMirror `json:"available"` - AdditionalProps ListAvailableMirrorsOutputBodyAdditional -} - -// GetSchema returns the value of Schema. -func (s *ListAvailableMirrorsOutputBody) GetSchema() OptURI { - return s.Schema -} +// Blocker kind. Currently always 'owned_org'. +type DeletionBlockerKind string -// GetAvailable returns the value of Available. -func (s *ListAvailableMirrorsOutputBody) GetAvailable() []AvailableMirror { - return s.Available -} +const ( + DeletionBlockerKindOwnedOrg DeletionBlockerKind = "owned_org" +) -// GetAdditionalProps returns the value of AdditionalProps. -func (s *ListAvailableMirrorsOutputBody) GetAdditionalProps() ListAvailableMirrorsOutputBodyAdditional { - return s.AdditionalProps +// AllValues returns all DeletionBlockerKind values. +func (DeletionBlockerKind) AllValues() []DeletionBlockerKind { + return []DeletionBlockerKind{ + DeletionBlockerKindOwnedOrg, + } } -// SetSchema sets the value of Schema. -func (s *ListAvailableMirrorsOutputBody) SetSchema(val OptURI) { - s.Schema = val +// MarshalText implements encoding.TextMarshaler. +func (s DeletionBlockerKind) MarshalText() ([]byte, error) { + switch s { + case DeletionBlockerKindOwnedOrg: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// SetAvailable sets the value of Available. -func (s *ListAvailableMirrorsOutputBody) SetAvailable(val []AvailableMirror) { - s.Available = val +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *DeletionBlockerKind) UnmarshalText(data []byte) error { + switch DeletionBlockerKind(data) { + case DeletionBlockerKindOwnedOrg: + *s = DeletionBlockerKindOwnedOrg + return nil + default: + return errors.Errorf("invalid value: %q", data) + } } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *ListAvailableMirrorsOutputBody) SetAdditionalProps(val ListAvailableMirrorsOutputBodyAdditional) { - s.AdditionalProps = val +// Ref: #/components/schemas/DeletionGrant +type DeletionGrant struct { + // Region the repo lives in (us/eu/au); empty for project grants. + Jurisdiction OptString `json:"jurisdiction"` + // Granted resource ULID. + ResourceId string `json:"resourceId"` + // Granted resource name. + ResourceName string `json:"resourceName"` + // Granted resource type. + ResourceType DeletionGrantResourceType `json:"resourceType"` + // Granted role. + Role string `json:"role"` + AdditionalProps DeletionGrantAdditional } -type ListAvailableMirrorsOutputBodyAdditional map[string]jx.Raw - -func (s *ListAvailableMirrorsOutputBodyAdditional) init() ListAvailableMirrorsOutputBodyAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// GetJurisdiction returns the value of Jurisdiction. +func (s *DeletionGrant) GetJurisdiction() OptString { + return s.Jurisdiction } -// Ref: #/components/schemas/ListBindingsOutputBody -type ListBindingsOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Bindings []Binding `json:"bindings"` - // Pass back to fetch the next page; empty when no more entries. - NextPageToken OptString `json:"nextPageToken"` - AdditionalProps ListBindingsOutputBodyAdditional +// GetResourceId returns the value of ResourceId. +func (s *DeletionGrant) GetResourceId() string { + return s.ResourceId } -// GetSchema returns the value of Schema. -func (s *ListBindingsOutputBody) GetSchema() OptURI { - return s.Schema +// GetResourceName returns the value of ResourceName. +func (s *DeletionGrant) GetResourceName() string { + return s.ResourceName } -// GetBindings returns the value of Bindings. -func (s *ListBindingsOutputBody) GetBindings() []Binding { - return s.Bindings +// GetResourceType returns the value of ResourceType. +func (s *DeletionGrant) GetResourceType() DeletionGrantResourceType { + return s.ResourceType } -// GetNextPageToken returns the value of NextPageToken. -func (s *ListBindingsOutputBody) GetNextPageToken() OptString { - return s.NextPageToken +// GetRole returns the value of Role. +func (s *DeletionGrant) GetRole() string { + return s.Role } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListBindingsOutputBody) GetAdditionalProps() ListBindingsOutputBodyAdditional { +func (s *DeletionGrant) GetAdditionalProps() DeletionGrantAdditional { return s.AdditionalProps } -// SetSchema sets the value of Schema. -func (s *ListBindingsOutputBody) SetSchema(val OptURI) { - s.Schema = val +// SetJurisdiction sets the value of Jurisdiction. +func (s *DeletionGrant) SetJurisdiction(val OptString) { + s.Jurisdiction = val } -// SetBindings sets the value of Bindings. -func (s *ListBindingsOutputBody) SetBindings(val []Binding) { - s.Bindings = val +// SetResourceId sets the value of ResourceId. +func (s *DeletionGrant) SetResourceId(val string) { + s.ResourceId = val } -// SetNextPageToken sets the value of NextPageToken. -func (s *ListBindingsOutputBody) SetNextPageToken(val OptString) { - s.NextPageToken = val +// SetResourceName sets the value of ResourceName. +func (s *DeletionGrant) SetResourceName(val string) { + s.ResourceName = val +} + +// SetResourceType sets the value of ResourceType. +func (s *DeletionGrant) SetResourceType(val DeletionGrantResourceType) { + s.ResourceType = val +} + +// SetRole sets the value of Role. +func (s *DeletionGrant) SetRole(val string) { + s.Role = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListBindingsOutputBody) SetAdditionalProps(val ListBindingsOutputBodyAdditional) { +func (s *DeletionGrant) SetAdditionalProps(val DeletionGrantAdditional) { s.AdditionalProps = val } -type ListBindingsOutputBodyAdditional map[string]jx.Raw +type DeletionGrantAdditional map[string]jx.Raw -func (s *ListBindingsOutputBodyAdditional) init() ListBindingsOutputBodyAdditional { +func (s *DeletionGrantAdditional) init() DeletionGrantAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -5409,47 +5174,90 @@ func (s *ListBindingsOutputBodyAdditional) init() ListBindingsOutputBodyAddition return m } -// Ref: #/components/schemas/ListClustersOutputBody -type ListClustersOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Clusters []Cluster `json:"clusters"` - AdditionalProps ListClustersOutputBodyAdditional +// Granted resource type. +type DeletionGrantResourceType string + +const ( + DeletionGrantResourceTypeProject DeletionGrantResourceType = "project" + DeletionGrantResourceTypeRepo DeletionGrantResourceType = "repo" +) + +// AllValues returns all DeletionGrantResourceType values. +func (DeletionGrantResourceType) AllValues() []DeletionGrantResourceType { + return []DeletionGrantResourceType{ + DeletionGrantResourceTypeProject, + DeletionGrantResourceTypeRepo, + } } -// GetSchema returns the value of Schema. -func (s *ListClustersOutputBody) GetSchema() OptURI { - return s.Schema +// MarshalText implements encoding.TextMarshaler. +func (s DeletionGrantResourceType) MarshalText() ([]byte, error) { + switch s { + case DeletionGrantResourceTypeProject: + return []byte(s), nil + case DeletionGrantResourceTypeRepo: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// GetClusters returns the value of Clusters. -func (s *ListClustersOutputBody) GetClusters() []Cluster { - return s.Clusters +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *DeletionGrantResourceType) UnmarshalText(data []byte) error { + switch DeletionGrantResourceType(data) { + case DeletionGrantResourceTypeProject: + *s = DeletionGrantResourceTypeProject + return nil + case DeletionGrantResourceTypeRepo: + *s = DeletionGrantResourceTypeRepo + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// Ref: #/components/schemas/DeletionMembership +type DeletionMembership struct { + // Org name. + Name string `json:"name"` + // Org ULID. + OrgId string `json:"orgId"` + AdditionalProps DeletionMembershipAdditional +} + +// GetName returns the value of Name. +func (s *DeletionMembership) GetName() string { + return s.Name +} + +// GetOrgId returns the value of OrgId. +func (s *DeletionMembership) GetOrgId() string { + return s.OrgId } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListClustersOutputBody) GetAdditionalProps() ListClustersOutputBodyAdditional { +func (s *DeletionMembership) GetAdditionalProps() DeletionMembershipAdditional { return s.AdditionalProps } -// SetSchema sets the value of Schema. -func (s *ListClustersOutputBody) SetSchema(val OptURI) { - s.Schema = val +// SetName sets the value of Name. +func (s *DeletionMembership) SetName(val string) { + s.Name = val } -// SetClusters sets the value of Clusters. -func (s *ListClustersOutputBody) SetClusters(val []Cluster) { - s.Clusters = val +// SetOrgId sets the value of OrgId. +func (s *DeletionMembership) SetOrgId(val string) { + s.OrgId = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListClustersOutputBody) SetAdditionalProps(val ListClustersOutputBodyAdditional) { +func (s *DeletionMembership) SetAdditionalProps(val DeletionMembershipAdditional) { s.AdditionalProps = val } -type ListClustersOutputBodyAdditional map[string]jx.Raw +type DeletionMembershipAdditional map[string]jx.Raw -func (s *ListClustersOutputBodyAdditional) init() ListClustersOutputBodyAdditional { +func (s *DeletionMembershipAdditional) init() DeletionMembershipAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -5458,47 +5266,60 @@ func (s *ListClustersOutputBodyAdditional) init() ListClustersOutputBodyAddition return m } -// Ref: #/components/schemas/ListMirrorCollaboratorsOutputBody -type ListMirrorCollaboratorsOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Collaborators []MirrorCollaborator `json:"collaborators"` - AdditionalProps ListMirrorCollaboratorsOutputBodyAdditional +// Ref: #/components/schemas/DeletionRepo +type DeletionRepo struct { + // Cluster slug the repo is placed on, if known. + Cluster OptString `json:"cluster"` + // Repo ULID. + ID string `json:"id"` + // Repo name. + Name string `json:"name"` + AdditionalProps DeletionRepoAdditional } -// GetSchema returns the value of Schema. -func (s *ListMirrorCollaboratorsOutputBody) GetSchema() OptURI { - return s.Schema +// GetCluster returns the value of Cluster. +func (s *DeletionRepo) GetCluster() OptString { + return s.Cluster } -// GetCollaborators returns the value of Collaborators. -func (s *ListMirrorCollaboratorsOutputBody) GetCollaborators() []MirrorCollaborator { - return s.Collaborators +// GetID returns the value of ID. +func (s *DeletionRepo) GetID() string { + return s.ID +} + +// GetName returns the value of Name. +func (s *DeletionRepo) GetName() string { + return s.Name } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListMirrorCollaboratorsOutputBody) GetAdditionalProps() ListMirrorCollaboratorsOutputBodyAdditional { +func (s *DeletionRepo) GetAdditionalProps() DeletionRepoAdditional { return s.AdditionalProps } -// SetSchema sets the value of Schema. -func (s *ListMirrorCollaboratorsOutputBody) SetSchema(val OptURI) { - s.Schema = val +// SetCluster sets the value of Cluster. +func (s *DeletionRepo) SetCluster(val OptString) { + s.Cluster = val } -// SetCollaborators sets the value of Collaborators. -func (s *ListMirrorCollaboratorsOutputBody) SetCollaborators(val []MirrorCollaborator) { - s.Collaborators = val +// SetID sets the value of ID. +func (s *DeletionRepo) SetID(val string) { + s.ID = val +} + +// SetName sets the value of Name. +func (s *DeletionRepo) SetName(val string) { + s.Name = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListMirrorCollaboratorsOutputBody) SetAdditionalProps(val ListMirrorCollaboratorsOutputBodyAdditional) { +func (s *DeletionRepo) SetAdditionalProps(val DeletionRepoAdditional) { s.AdditionalProps = val } -type ListMirrorCollaboratorsOutputBodyAdditional map[string]jx.Raw +type DeletionRepoAdditional map[string]jx.Raw -func (s *ListMirrorCollaboratorsOutputBodyAdditional) init() ListMirrorCollaboratorsOutputBodyAdditional { +func (s *DeletionRepoAdditional) init() DeletionRepoAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -5507,23 +5328,31 @@ func (s *ListMirrorCollaboratorsOutputBodyAdditional) init() ListMirrorCollabora return m } -type ListMirrorCollaboratorsProvider string +// DetachMyHandleNoContent is response for DetachMyHandle operation. +type DetachMyHandleNoContent struct{} + +// Sign-in provider of the handle to detach. +type DetachMyHandleProvider string const ( - ListMirrorCollaboratorsProviderGithub ListMirrorCollaboratorsProvider = "github" + DetachMyHandleProviderGoogle DetachMyHandleProvider = "google" + DetachMyHandleProviderGithub DetachMyHandleProvider = "github" ) -// AllValues returns all ListMirrorCollaboratorsProvider values. -func (ListMirrorCollaboratorsProvider) AllValues() []ListMirrorCollaboratorsProvider { - return []ListMirrorCollaboratorsProvider{ - ListMirrorCollaboratorsProviderGithub, +// AllValues returns all DetachMyHandleProvider values. +func (DetachMyHandleProvider) AllValues() []DetachMyHandleProvider { + return []DetachMyHandleProvider{ + DetachMyHandleProviderGoogle, + DetachMyHandleProviderGithub, } } // MarshalText implements encoding.TextMarshaler. -func (s ListMirrorCollaboratorsProvider) MarshalText() ([]byte, error) { +func (s DetachMyHandleProvider) MarshalText() ([]byte, error) { switch s { - case ListMirrorCollaboratorsProviderGithub: + case DetachMyHandleProviderGoogle: + return []byte(s), nil + case DetachMyHandleProviderGithub: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) @@ -5531,69 +5360,76 @@ func (s ListMirrorCollaboratorsProvider) MarshalText() ([]byte, error) { } // UnmarshalText implements encoding.TextUnmarshaler. -func (s *ListMirrorCollaboratorsProvider) UnmarshalText(data []byte) error { - switch ListMirrorCollaboratorsProvider(data) { - case ListMirrorCollaboratorsProviderGithub: - *s = ListMirrorCollaboratorsProviderGithub +func (s *DetachMyHandleProvider) UnmarshalText(data []byte) error { + switch DetachMyHandleProvider(data) { + case DetachMyHandleProviderGoogle: + *s = DetachMyHandleProviderGoogle + return nil + case DetachMyHandleProviderGithub: + *s = DetachMyHandleProviderGithub return nil default: return errors.Errorf("invalid value: %q", data) } } -// Ref: #/components/schemas/ListMirrorsOutputBody -type ListMirrorsOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Mirrors []Mirror `json:"mirrors"` - // Pass back to fetch the next page; empty when no more entries. - NextPageToken OptString `json:"nextPageToken"` - AdditionalProps ListMirrorsOutputBodyAdditional +// DisconnectOrgCIDepotOrganizationNoContent is response for DisconnectOrgCIDepotOrganization operation. +type DisconnectOrgCIDepotOrganizationNoContent struct{} + +// Ref: #/components/schemas/ErrorDetail +type ErrorDetail struct { + // Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'. + Location OptString `json:"location"` + // Error message text. + Message OptString `json:"message"` + // The value at the given location. + Value jx.Raw `json:"value"` + AdditionalProps ErrorDetailAdditional } -// GetSchema returns the value of Schema. -func (s *ListMirrorsOutputBody) GetSchema() OptURI { - return s.Schema +// GetLocation returns the value of Location. +func (s *ErrorDetail) GetLocation() OptString { + return s.Location } -// GetMirrors returns the value of Mirrors. -func (s *ListMirrorsOutputBody) GetMirrors() []Mirror { - return s.Mirrors +// GetMessage returns the value of Message. +func (s *ErrorDetail) GetMessage() OptString { + return s.Message } -// GetNextPageToken returns the value of NextPageToken. -func (s *ListMirrorsOutputBody) GetNextPageToken() OptString { - return s.NextPageToken +// GetValue returns the value of Value. +func (s *ErrorDetail) GetValue() jx.Raw { + return s.Value } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListMirrorsOutputBody) GetAdditionalProps() ListMirrorsOutputBodyAdditional { +func (s *ErrorDetail) GetAdditionalProps() ErrorDetailAdditional { return s.AdditionalProps } -// SetSchema sets the value of Schema. -func (s *ListMirrorsOutputBody) SetSchema(val OptURI) { - s.Schema = val +// SetLocation sets the value of Location. +func (s *ErrorDetail) SetLocation(val OptString) { + s.Location = val } -// SetMirrors sets the value of Mirrors. -func (s *ListMirrorsOutputBody) SetMirrors(val []Mirror) { - s.Mirrors = val +// SetMessage sets the value of Message. +func (s *ErrorDetail) SetMessage(val OptString) { + s.Message = val } -// SetNextPageToken sets the value of NextPageToken. -func (s *ListMirrorsOutputBody) SetNextPageToken(val OptString) { - s.NextPageToken = val +// SetValue sets the value of Value. +func (s *ErrorDetail) SetValue(val jx.Raw) { + s.Value = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListMirrorsOutputBody) SetAdditionalProps(val ListMirrorsOutputBodyAdditional) { +func (s *ErrorDetail) SetAdditionalProps(val ErrorDetailAdditional) { s.AdditionalProps = val } -type ListMirrorsOutputBodyAdditional map[string]jx.Raw +type ErrorDetailAdditional map[string]jx.Raw -func (s *ListMirrorsOutputBodyAdditional) init() ListMirrorsOutputBodyAdditional { +func (s *ErrorDetailAdditional) init() ErrorDetailAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -5602,108 +5438,109 @@ func (s *ListMirrorsOutputBodyAdditional) init() ListMirrorsOutputBodyAdditional return m } -// Ref: #/components/schemas/ListNativeMirrorsOutputBody -type ListNativeMirrorsOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - NativeMirrors []NativeMirrorPlacement `json:"nativeMirrors"` - AdditionalProps ListNativeMirrorsOutputBodyAdditional +// Ref: #/components/schemas/ErrorModel +type ErrorModel struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + // A human-readable explanation specific to this occurrence of the problem. + Detail OptString `json:"detail"` + // Optional list of individual error details. + Errors []ErrorDetail `json:"errors"` + // A URI reference that identifies the specific occurrence of the problem. + Instance OptURI `json:"instance"` + // HTTP status code. + Status OptInt64 `json:"status"` + // A short, human-readable summary of the problem type. This value should not change between + // occurrences of the error. + Title OptString `json:"title"` + // A URI reference to human-readable documentation for the error. + Type OptURI `json:"type"` + AdditionalProps ErrorModelAdditional } // GetSchema returns the value of Schema. -func (s *ListNativeMirrorsOutputBody) GetSchema() OptURI { +func (s *ErrorModel) GetSchema() OptURI { return s.Schema } -// GetNativeMirrors returns the value of NativeMirrors. -func (s *ListNativeMirrorsOutputBody) GetNativeMirrors() []NativeMirrorPlacement { - return s.NativeMirrors +// GetDetail returns the value of Detail. +func (s *ErrorModel) GetDetail() OptString { + return s.Detail } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *ListNativeMirrorsOutputBody) GetAdditionalProps() ListNativeMirrorsOutputBodyAdditional { - return s.AdditionalProps +// GetErrors returns the value of Errors. +func (s *ErrorModel) GetErrors() []ErrorDetail { + return s.Errors } -// SetSchema sets the value of Schema. -func (s *ListNativeMirrorsOutputBody) SetSchema(val OptURI) { - s.Schema = val +// GetInstance returns the value of Instance. +func (s *ErrorModel) GetInstance() OptURI { + return s.Instance } -// SetNativeMirrors sets the value of NativeMirrors. -func (s *ListNativeMirrorsOutputBody) SetNativeMirrors(val []NativeMirrorPlacement) { - s.NativeMirrors = val +// GetStatus returns the value of Status. +func (s *ErrorModel) GetStatus() OptInt64 { + return s.Status } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *ListNativeMirrorsOutputBody) SetAdditionalProps(val ListNativeMirrorsOutputBodyAdditional) { - s.AdditionalProps = val +// GetTitle returns the value of Title. +func (s *ErrorModel) GetTitle() OptString { + return s.Title } -type ListNativeMirrorsOutputBodyAdditional map[string]jx.Raw - -func (s *ListNativeMirrorsOutputBodyAdditional) init() ListNativeMirrorsOutputBodyAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// GetType returns the value of Type. +func (s *ErrorModel) GetType() OptURI { + return s.Type } -// Ref: #/components/schemas/ListOIDCProvidersOutputBody -type ListOIDCProvidersOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - // Pass back to fetch the next page; empty when no more entries. - NextPageToken OptString `json:"nextPageToken"` - Providers []OIDCProvider `json:"providers"` - AdditionalProps ListOIDCProvidersOutputBodyAdditional +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ErrorModel) GetAdditionalProps() ErrorModelAdditional { + return s.AdditionalProps } -// GetSchema returns the value of Schema. -func (s *ListOIDCProvidersOutputBody) GetSchema() OptURI { - return s.Schema +// SetSchema sets the value of Schema. +func (s *ErrorModel) SetSchema(val OptURI) { + s.Schema = val } -// GetNextPageToken returns the value of NextPageToken. -func (s *ListOIDCProvidersOutputBody) GetNextPageToken() OptString { - return s.NextPageToken +// SetDetail sets the value of Detail. +func (s *ErrorModel) SetDetail(val OptString) { + s.Detail = val } -// GetProviders returns the value of Providers. -func (s *ListOIDCProvidersOutputBody) GetProviders() []OIDCProvider { - return s.Providers +// SetErrors sets the value of Errors. +func (s *ErrorModel) SetErrors(val []ErrorDetail) { + s.Errors = val } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *ListOIDCProvidersOutputBody) GetAdditionalProps() ListOIDCProvidersOutputBodyAdditional { - return s.AdditionalProps +// SetInstance sets the value of Instance. +func (s *ErrorModel) SetInstance(val OptURI) { + s.Instance = val } -// SetSchema sets the value of Schema. -func (s *ListOIDCProvidersOutputBody) SetSchema(val OptURI) { - s.Schema = val +// SetStatus sets the value of Status. +func (s *ErrorModel) SetStatus(val OptInt64) { + s.Status = val } -// SetNextPageToken sets the value of NextPageToken. -func (s *ListOIDCProvidersOutputBody) SetNextPageToken(val OptString) { - s.NextPageToken = val +// SetTitle sets the value of Title. +func (s *ErrorModel) SetTitle(val OptString) { + s.Title = val } -// SetProviders sets the value of Providers. -func (s *ListOIDCProvidersOutputBody) SetProviders(val []OIDCProvider) { - s.Providers = val +// SetType sets the value of Type. +func (s *ErrorModel) SetType(val OptURI) { + s.Type = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListOIDCProvidersOutputBody) SetAdditionalProps(val ListOIDCProvidersOutputBodyAdditional) { +func (s *ErrorModel) SetAdditionalProps(val ErrorModelAdditional) { s.AdditionalProps = val } -type ListOIDCProvidersOutputBodyAdditional map[string]jx.Raw +type ErrorModelAdditional map[string]jx.Raw -func (s *ListOIDCProvidersOutputBodyAdditional) init() ListOIDCProvidersOutputBodyAdditional { +func (s *ErrorModelAdditional) init() ErrorModelAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -5712,47 +5549,72 @@ func (s *ListOIDCProvidersOutputBodyAdditional) init() ListOIDCProvidersOutputBo return m } -// Ref: #/components/schemas/ListOrgCIBuildkiteClustersOutputBody -type ListOrgCIBuildkiteClustersOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Clusters []OrgCIBuildkiteClusterView `json:"clusters"` - AdditionalProps ListOrgCIBuildkiteClustersOutputBodyAdditional +// ErrorModelStatusCode wraps ErrorModel with StatusCode. +type ErrorModelStatusCode struct { + StatusCode int + Response ErrorModel } -// GetSchema returns the value of Schema. -func (s *ListOrgCIBuildkiteClustersOutputBody) GetSchema() OptURI { - return s.Schema +// GetStatusCode returns the value of StatusCode. +func (s *ErrorModelStatusCode) GetStatusCode() int { + return s.StatusCode } -// GetClusters returns the value of Clusters. -func (s *ListOrgCIBuildkiteClustersOutputBody) GetClusters() []OrgCIBuildkiteClusterView { - return s.Clusters +// GetResponse returns the value of Response. +func (s *ErrorModelStatusCode) GetResponse() ErrorModel { + return s.Response +} + +// SetStatusCode sets the value of StatusCode. +func (s *ErrorModelStatusCode) SetStatusCode(val int) { + s.StatusCode = val +} + +// SetResponse sets the value of Response. +func (s *ErrorModelStatusCode) SetResponse(val ErrorModel) { + s.Response = val +} + +// Ref: #/components/schemas/ForgeRepoIdentity +type ForgeRepoIdentity struct { + Forge string `json:"forge"` + RepoID string `json:"repo_id"` + AdditionalProps ForgeRepoIdentityAdditional +} + +// GetForge returns the value of Forge. +func (s *ForgeRepoIdentity) GetForge() string { + return s.Forge +} + +// GetRepoID returns the value of RepoID. +func (s *ForgeRepoIdentity) GetRepoID() string { + return s.RepoID } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListOrgCIBuildkiteClustersOutputBody) GetAdditionalProps() ListOrgCIBuildkiteClustersOutputBodyAdditional { +func (s *ForgeRepoIdentity) GetAdditionalProps() ForgeRepoIdentityAdditional { return s.AdditionalProps } -// SetSchema sets the value of Schema. -func (s *ListOrgCIBuildkiteClustersOutputBody) SetSchema(val OptURI) { - s.Schema = val +// SetForge sets the value of Forge. +func (s *ForgeRepoIdentity) SetForge(val string) { + s.Forge = val } -// SetClusters sets the value of Clusters. -func (s *ListOrgCIBuildkiteClustersOutputBody) SetClusters(val []OrgCIBuildkiteClusterView) { - s.Clusters = val +// SetRepoID sets the value of RepoID. +func (s *ForgeRepoIdentity) SetRepoID(val string) { + s.RepoID = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListOrgCIBuildkiteClustersOutputBody) SetAdditionalProps(val ListOrgCIBuildkiteClustersOutputBodyAdditional) { +func (s *ForgeRepoIdentity) SetAdditionalProps(val ForgeRepoIdentityAdditional) { s.AdditionalProps = val } -type ListOrgCIBuildkiteClustersOutputBodyAdditional map[string]jx.Raw +type ForgeRepoIdentityAdditional map[string]jx.Raw -func (s *ListOrgCIBuildkiteClustersOutputBodyAdditional) init() ListOrgCIBuildkiteClustersOutputBodyAdditional { +func (s *ForgeRepoIdentityAdditional) init() ForgeRepoIdentityAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -5761,108 +5623,198 @@ func (s *ListOrgCIBuildkiteClustersOutputBodyAdditional) init() ListOrgCIBuildki return m } -// Ref: #/components/schemas/ListOrgCIBuildkiteCredentialsOutputBody -type ListOrgCIBuildkiteCredentialsOutputBody struct { +// Ref: #/components/schemas/GetDeletionPreviewOutputBody +type GetDeletionPreviewOutputBody struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Credentials []OrgCIBuildkiteCredentialView `json:"credentials"` - AdditionalProps ListOrgCIBuildkiteCredentialsOutputBodyAdditional + Schema OptURI `json:"$schema"` + // True when Blockers is non-empty: DELETE /me will be refused with 409. + Blocked bool `json:"blocked"` + // Resources that must be resolved before deletion (owned orgs). + Blockers []DeletionBlocker `json:"blockers"` + WillDelete WillDeleteStruct `json:"willDelete"` + WillUnlink WillUnlinkStruct `json:"willUnlink"` + AdditionalProps GetDeletionPreviewOutputBodyAdditional } // GetSchema returns the value of Schema. -func (s *ListOrgCIBuildkiteCredentialsOutputBody) GetSchema() OptURI { +func (s *GetDeletionPreviewOutputBody) GetSchema() OptURI { return s.Schema } -// GetCredentials returns the value of Credentials. -func (s *ListOrgCIBuildkiteCredentialsOutputBody) GetCredentials() []OrgCIBuildkiteCredentialView { - return s.Credentials +// GetBlocked returns the value of Blocked. +func (s *GetDeletionPreviewOutputBody) GetBlocked() bool { + return s.Blocked +} + +// GetBlockers returns the value of Blockers. +func (s *GetDeletionPreviewOutputBody) GetBlockers() []DeletionBlocker { + return s.Blockers +} + +// GetWillDelete returns the value of WillDelete. +func (s *GetDeletionPreviewOutputBody) GetWillDelete() WillDeleteStruct { + return s.WillDelete +} + +// GetWillUnlink returns the value of WillUnlink. +func (s *GetDeletionPreviewOutputBody) GetWillUnlink() WillUnlinkStruct { + return s.WillUnlink } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListOrgCIBuildkiteCredentialsOutputBody) GetAdditionalProps() ListOrgCIBuildkiteCredentialsOutputBodyAdditional { +func (s *GetDeletionPreviewOutputBody) GetAdditionalProps() GetDeletionPreviewOutputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *ListOrgCIBuildkiteCredentialsOutputBody) SetSchema(val OptURI) { +func (s *GetDeletionPreviewOutputBody) SetSchema(val OptURI) { s.Schema = val } -// SetCredentials sets the value of Credentials. -func (s *ListOrgCIBuildkiteCredentialsOutputBody) SetCredentials(val []OrgCIBuildkiteCredentialView) { - s.Credentials = val +// SetBlocked sets the value of Blocked. +func (s *GetDeletionPreviewOutputBody) SetBlocked(val bool) { + s.Blocked = val } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *ListOrgCIBuildkiteCredentialsOutputBody) SetAdditionalProps(val ListOrgCIBuildkiteCredentialsOutputBodyAdditional) { - s.AdditionalProps = val +// SetBlockers sets the value of Blockers. +func (s *GetDeletionPreviewOutputBody) SetBlockers(val []DeletionBlocker) { + s.Blockers = val } -type ListOrgCIBuildkiteCredentialsOutputBodyAdditional map[string]jx.Raw +// SetWillDelete sets the value of WillDelete. +func (s *GetDeletionPreviewOutputBody) SetWillDelete(val WillDeleteStruct) { + s.WillDelete = val +} -func (s *ListOrgCIBuildkiteCredentialsOutputBodyAdditional) init() ListOrgCIBuildkiteCredentialsOutputBodyAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} +// SetWillUnlink sets the value of WillUnlink. +func (s *GetDeletionPreviewOutputBody) SetWillUnlink(val WillUnlinkStruct) { + s.WillUnlink = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *GetDeletionPreviewOutputBody) SetAdditionalProps(val GetDeletionPreviewOutputBodyAdditional) { + s.AdditionalProps = val +} + +type GetDeletionPreviewOutputBodyAdditional map[string]jx.Raw + +func (s *GetDeletionPreviewOutputBodyAdditional) init() GetDeletionPreviewOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} *s = m } return m } -// Ref: #/components/schemas/ListOrgMembersOutputBody -type ListOrgMembersOutputBody struct { +// Ref: #/components/schemas/GetMeOutputBody +type GetMeOutputBody struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Members []Membership `json:"members"` - // Pass back to fetch the next page; empty when no more entries. - NextPageToken OptString `json:"nextPageToken"` - AdditionalProps ListOrgMembersOutputBodyAdditional + Schema OptURI `json:"$schema"` + Auth MeAuth `json:"auth"` + // Present only when a deletion is pending; carries the cooldown window. + Deletion OptMeDeletion `json:"deletion"` + Global MeGlobal `json:"global"` + Jurisdiction OptString `json:"jurisdiction"` + Mode OptGetMeOutputBodyMode `json:"mode"` + Regional OptMeRegional `json:"regional"` + RegionalUnavailable OptMeRegionalUnavailable `json:"regionalUnavailable"` + AdditionalProps GetMeOutputBodyAdditional } // GetSchema returns the value of Schema. -func (s *ListOrgMembersOutputBody) GetSchema() OptURI { +func (s *GetMeOutputBody) GetSchema() OptURI { return s.Schema } -// GetMembers returns the value of Members. -func (s *ListOrgMembersOutputBody) GetMembers() []Membership { - return s.Members +// GetAuth returns the value of Auth. +func (s *GetMeOutputBody) GetAuth() MeAuth { + return s.Auth } -// GetNextPageToken returns the value of NextPageToken. -func (s *ListOrgMembersOutputBody) GetNextPageToken() OptString { - return s.NextPageToken +// GetDeletion returns the value of Deletion. +func (s *GetMeOutputBody) GetDeletion() OptMeDeletion { + return s.Deletion +} + +// GetGlobal returns the value of Global. +func (s *GetMeOutputBody) GetGlobal() MeGlobal { + return s.Global +} + +// GetJurisdiction returns the value of Jurisdiction. +func (s *GetMeOutputBody) GetJurisdiction() OptString { + return s.Jurisdiction +} + +// GetMode returns the value of Mode. +func (s *GetMeOutputBody) GetMode() OptGetMeOutputBodyMode { + return s.Mode +} + +// GetRegional returns the value of Regional. +func (s *GetMeOutputBody) GetRegional() OptMeRegional { + return s.Regional +} + +// GetRegionalUnavailable returns the value of RegionalUnavailable. +func (s *GetMeOutputBody) GetRegionalUnavailable() OptMeRegionalUnavailable { + return s.RegionalUnavailable } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListOrgMembersOutputBody) GetAdditionalProps() ListOrgMembersOutputBodyAdditional { +func (s *GetMeOutputBody) GetAdditionalProps() GetMeOutputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *ListOrgMembersOutputBody) SetSchema(val OptURI) { +func (s *GetMeOutputBody) SetSchema(val OptURI) { s.Schema = val } -// SetMembers sets the value of Members. -func (s *ListOrgMembersOutputBody) SetMembers(val []Membership) { - s.Members = val +// SetAuth sets the value of Auth. +func (s *GetMeOutputBody) SetAuth(val MeAuth) { + s.Auth = val } -// SetNextPageToken sets the value of NextPageToken. -func (s *ListOrgMembersOutputBody) SetNextPageToken(val OptString) { - s.NextPageToken = val +// SetDeletion sets the value of Deletion. +func (s *GetMeOutputBody) SetDeletion(val OptMeDeletion) { + s.Deletion = val +} + +// SetGlobal sets the value of Global. +func (s *GetMeOutputBody) SetGlobal(val MeGlobal) { + s.Global = val +} + +// SetJurisdiction sets the value of Jurisdiction. +func (s *GetMeOutputBody) SetJurisdiction(val OptString) { + s.Jurisdiction = val +} + +// SetMode sets the value of Mode. +func (s *GetMeOutputBody) SetMode(val OptGetMeOutputBodyMode) { + s.Mode = val +} + +// SetRegional sets the value of Regional. +func (s *GetMeOutputBody) SetRegional(val OptMeRegional) { + s.Regional = val +} + +// SetRegionalUnavailable sets the value of RegionalUnavailable. +func (s *GetMeOutputBody) SetRegionalUnavailable(val OptMeRegionalUnavailable) { + s.RegionalUnavailable = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListOrgMembersOutputBody) SetAdditionalProps(val ListOrgMembersOutputBodyAdditional) { +func (s *GetMeOutputBody) SetAdditionalProps(val GetMeOutputBodyAdditional) { s.AdditionalProps = val } -type ListOrgMembersOutputBodyAdditional map[string]jx.Raw +type GetMeOutputBodyAdditional map[string]jx.Raw -func (s *ListOrgMembersOutputBodyAdditional) init() ListOrgMembersOutputBodyAdditional { +func (s *GetMeOutputBodyAdditional) init() GetMeOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -5871,70 +5823,101 @@ func (s *ListOrgMembersOutputBodyAdditional) init() ListOrgMembersOutputBodyAddi return m } -// Ref: #/components/schemas/ListOrgProjectsOutputBody -type ListOrgProjectsOutputBody struct { +type GetMeOutputBodyMode string + +const ( + GetMeOutputBodyModeGlobal GetMeOutputBodyMode = "global" + GetMeOutputBodyModeRegional GetMeOutputBodyMode = "regional" +) + +// AllValues returns all GetMeOutputBodyMode values. +func (GetMeOutputBodyMode) AllValues() []GetMeOutputBodyMode { + return []GetMeOutputBodyMode{ + GetMeOutputBodyModeGlobal, + GetMeOutputBodyModeRegional, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s GetMeOutputBodyMode) MarshalText() ([]byte, error) { + switch s { + case GetMeOutputBodyModeGlobal: + return []byte(s), nil + case GetMeOutputBodyModeRegional: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *GetMeOutputBodyMode) UnmarshalText(data []byte) error { + switch GetMeOutputBodyMode(data) { + case GetMeOutputBodyModeGlobal: + *s = GetMeOutputBodyModeGlobal + return nil + case GetMeOutputBodyModeRegional: + *s = GetMeOutputBodyModeRegional + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// Ref: #/components/schemas/GetOnboardingStatusOutputBody +type GetOnboardingStatusOutputBody struct { // A URL to the JSON Schema for this object. Schema OptURI `json:"$schema"` - // Pass back to fetch the next page; empty when no more entries. - NextPageToken OptString `json:"nextPageToken"` - Project OptProject `json:"project"` - Projects []Project `json:"projects"` - AdditionalProps ListOrgProjectsOutputBodyAdditional + // True once the account has completed a CLI login (either grant type). + CliLoggedIn bool `json:"cliLoggedIn"` + // True until the account completes web onboarding at least once. + NeedsOnboarding bool `json:"needsOnboarding"` + AdditionalProps GetOnboardingStatusOutputBodyAdditional } // GetSchema returns the value of Schema. -func (s *ListOrgProjectsOutputBody) GetSchema() OptURI { +func (s *GetOnboardingStatusOutputBody) GetSchema() OptURI { return s.Schema } -// GetNextPageToken returns the value of NextPageToken. -func (s *ListOrgProjectsOutputBody) GetNextPageToken() OptString { - return s.NextPageToken -} - -// GetProject returns the value of Project. -func (s *ListOrgProjectsOutputBody) GetProject() OptProject { - return s.Project +// GetCliLoggedIn returns the value of CliLoggedIn. +func (s *GetOnboardingStatusOutputBody) GetCliLoggedIn() bool { + return s.CliLoggedIn } -// GetProjects returns the value of Projects. -func (s *ListOrgProjectsOutputBody) GetProjects() []Project { - return s.Projects +// GetNeedsOnboarding returns the value of NeedsOnboarding. +func (s *GetOnboardingStatusOutputBody) GetNeedsOnboarding() bool { + return s.NeedsOnboarding } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListOrgProjectsOutputBody) GetAdditionalProps() ListOrgProjectsOutputBodyAdditional { +func (s *GetOnboardingStatusOutputBody) GetAdditionalProps() GetOnboardingStatusOutputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *ListOrgProjectsOutputBody) SetSchema(val OptURI) { +func (s *GetOnboardingStatusOutputBody) SetSchema(val OptURI) { s.Schema = val } -// SetNextPageToken sets the value of NextPageToken. -func (s *ListOrgProjectsOutputBody) SetNextPageToken(val OptString) { - s.NextPageToken = val -} - -// SetProject sets the value of Project. -func (s *ListOrgProjectsOutputBody) SetProject(val OptProject) { - s.Project = val +// SetCliLoggedIn sets the value of CliLoggedIn. +func (s *GetOnboardingStatusOutputBody) SetCliLoggedIn(val bool) { + s.CliLoggedIn = val } -// SetProjects sets the value of Projects. -func (s *ListOrgProjectsOutputBody) SetProjects(val []Project) { - s.Projects = val +// SetNeedsOnboarding sets the value of NeedsOnboarding. +func (s *GetOnboardingStatusOutputBody) SetNeedsOnboarding(val bool) { + s.NeedsOnboarding = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListOrgProjectsOutputBody) SetAdditionalProps(val ListOrgProjectsOutputBodyAdditional) { +func (s *GetOnboardingStatusOutputBody) SetAdditionalProps(val GetOnboardingStatusOutputBodyAdditional) { s.AdditionalProps = val } -type ListOrgProjectsOutputBodyAdditional map[string]jx.Raw +type GetOnboardingStatusOutputBodyAdditional map[string]jx.Raw -func (s *ListOrgProjectsOutputBodyAdditional) init() ListOrgProjectsOutputBodyAdditional { +func (s *GetOnboardingStatusOutputBodyAdditional) init() GetOnboardingStatusOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -5943,70 +5926,47 @@ func (s *ListOrgProjectsOutputBodyAdditional) init() ListOrgProjectsOutputBodyAd return m } -// Ref: #/components/schemas/ListOrgsOutputBody -type ListOrgsOutputBody struct { +// Ref: #/components/schemas/GetRepoVisibilityOutputBody +type GetRepoVisibilityOutputBody struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - // Pass back to fetch the next page; empty when no more entries. - NextPageToken OptString `json:"nextPageToken"` - Org OptOrg `json:"org"` - Orgs []Org `json:"orgs"` - AdditionalProps ListOrgsOutputBodyAdditional + Schema OptURI `json:"$schema"` + Visibility GetRepoVisibilityOutputBodyVisibility `json:"visibility"` + AdditionalProps GetRepoVisibilityOutputBodyAdditional } // GetSchema returns the value of Schema. -func (s *ListOrgsOutputBody) GetSchema() OptURI { +func (s *GetRepoVisibilityOutputBody) GetSchema() OptURI { return s.Schema } -// GetNextPageToken returns the value of NextPageToken. -func (s *ListOrgsOutputBody) GetNextPageToken() OptString { - return s.NextPageToken -} - -// GetOrg returns the value of Org. -func (s *ListOrgsOutputBody) GetOrg() OptOrg { - return s.Org -} - -// GetOrgs returns the value of Orgs. -func (s *ListOrgsOutputBody) GetOrgs() []Org { - return s.Orgs +// GetVisibility returns the value of Visibility. +func (s *GetRepoVisibilityOutputBody) GetVisibility() GetRepoVisibilityOutputBodyVisibility { + return s.Visibility } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListOrgsOutputBody) GetAdditionalProps() ListOrgsOutputBodyAdditional { +func (s *GetRepoVisibilityOutputBody) GetAdditionalProps() GetRepoVisibilityOutputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *ListOrgsOutputBody) SetSchema(val OptURI) { +func (s *GetRepoVisibilityOutputBody) SetSchema(val OptURI) { s.Schema = val } -// SetNextPageToken sets the value of NextPageToken. -func (s *ListOrgsOutputBody) SetNextPageToken(val OptString) { - s.NextPageToken = val -} - -// SetOrg sets the value of Org. -func (s *ListOrgsOutputBody) SetOrg(val OptOrg) { - s.Org = val -} - -// SetOrgs sets the value of Orgs. -func (s *ListOrgsOutputBody) SetOrgs(val []Org) { - s.Orgs = val +// SetVisibility sets the value of Visibility. +func (s *GetRepoVisibilityOutputBody) SetVisibility(val GetRepoVisibilityOutputBodyVisibility) { + s.Visibility = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListOrgsOutputBody) SetAdditionalProps(val ListOrgsOutputBodyAdditional) { +func (s *GetRepoVisibilityOutputBody) SetAdditionalProps(val GetRepoVisibilityOutputBodyAdditional) { s.AdditionalProps = val } -type ListOrgsOutputBodyAdditional map[string]jx.Raw +type GetRepoVisibilityOutputBodyAdditional map[string]jx.Raw -func (s *ListOrgsOutputBodyAdditional) init() ListOrgsOutputBodyAdditional { +func (s *GetRepoVisibilityOutputBodyAdditional) init() GetRepoVisibilityOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -6015,107 +5975,88 @@ func (s *ListOrgsOutputBodyAdditional) init() ListOrgsOutputBodyAdditional { return m } -// ListOrgsOutputBodyHeaders wraps ListOrgsOutputBody with response headers. -type ListOrgsOutputBodyHeaders struct { - CacheControl OptString - ETag OptString - Vary OptString - Response ListOrgsOutputBody -} - -// GetCacheControl returns the value of CacheControl. -func (s *ListOrgsOutputBodyHeaders) GetCacheControl() OptString { - return s.CacheControl -} - -// GetETag returns the value of ETag. -func (s *ListOrgsOutputBodyHeaders) GetETag() OptString { - return s.ETag -} - -// GetVary returns the value of Vary. -func (s *ListOrgsOutputBodyHeaders) GetVary() OptString { - return s.Vary -} - -// GetResponse returns the value of Response. -func (s *ListOrgsOutputBodyHeaders) GetResponse() ListOrgsOutputBody { - return s.Response -} +type GetRepoVisibilityOutputBodyVisibility string -// SetCacheControl sets the value of CacheControl. -func (s *ListOrgsOutputBodyHeaders) SetCacheControl(val OptString) { - s.CacheControl = val -} +const ( + GetRepoVisibilityOutputBodyVisibilityPublic GetRepoVisibilityOutputBodyVisibility = "public" + GetRepoVisibilityOutputBodyVisibilityPrivate GetRepoVisibilityOutputBodyVisibility = "private" +) -// SetETag sets the value of ETag. -func (s *ListOrgsOutputBodyHeaders) SetETag(val OptString) { - s.ETag = val +// AllValues returns all GetRepoVisibilityOutputBodyVisibility values. +func (GetRepoVisibilityOutputBodyVisibility) AllValues() []GetRepoVisibilityOutputBodyVisibility { + return []GetRepoVisibilityOutputBodyVisibility{ + GetRepoVisibilityOutputBodyVisibilityPublic, + GetRepoVisibilityOutputBodyVisibilityPrivate, + } } -// SetVary sets the value of Vary. -func (s *ListOrgsOutputBodyHeaders) SetVary(val OptString) { - s.Vary = val +// MarshalText implements encoding.TextMarshaler. +func (s GetRepoVisibilityOutputBodyVisibility) MarshalText() ([]byte, error) { + switch s { + case GetRepoVisibilityOutputBodyVisibilityPublic: + return []byte(s), nil + case GetRepoVisibilityOutputBodyVisibilityPrivate: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// SetResponse sets the value of Response. -func (s *ListOrgsOutputBodyHeaders) SetResponse(val ListOrgsOutputBody) { - s.Response = val +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *GetRepoVisibilityOutputBodyVisibility) UnmarshalText(data []byte) error { + switch GetRepoVisibilityOutputBodyVisibility(data) { + case GetRepoVisibilityOutputBodyVisibilityPublic: + *s = GetRepoVisibilityOutputBodyVisibilityPublic + return nil + case GetRepoVisibilityOutputBodyVisibilityPrivate: + *s = GetRepoVisibilityOutputBodyVisibilityPrivate + return nil + default: + return errors.Errorf("invalid value: %q", data) + } } -// Ref: #/components/schemas/ListProjectMembersOutputBody -type ListProjectMembersOutputBody struct { +// Ref: #/components/schemas/GetTopologyOutputBody +type GetTopologyOutputBody struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Members []ProjectGrant `json:"members"` - // Pass back to fetch the next page; empty when no more entries. - NextPageToken OptString `json:"nextPageToken"` - AdditionalProps ListProjectMembersOutputBodyAdditional + Schema OptURI `json:"$schema"` + Jurisdictions []TopologyJurisdiction `json:"jurisdictions"` + AdditionalProps GetTopologyOutputBodyAdditional } // GetSchema returns the value of Schema. -func (s *ListProjectMembersOutputBody) GetSchema() OptURI { +func (s *GetTopologyOutputBody) GetSchema() OptURI { return s.Schema } -// GetMembers returns the value of Members. -func (s *ListProjectMembersOutputBody) GetMembers() []ProjectGrant { - return s.Members -} - -// GetNextPageToken returns the value of NextPageToken. -func (s *ListProjectMembersOutputBody) GetNextPageToken() OptString { - return s.NextPageToken +// GetJurisdictions returns the value of Jurisdictions. +func (s *GetTopologyOutputBody) GetJurisdictions() []TopologyJurisdiction { + return s.Jurisdictions } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListProjectMembersOutputBody) GetAdditionalProps() ListProjectMembersOutputBodyAdditional { +func (s *GetTopologyOutputBody) GetAdditionalProps() GetTopologyOutputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *ListProjectMembersOutputBody) SetSchema(val OptURI) { +func (s *GetTopologyOutputBody) SetSchema(val OptURI) { s.Schema = val } -// SetMembers sets the value of Members. -func (s *ListProjectMembersOutputBody) SetMembers(val []ProjectGrant) { - s.Members = val -} - -// SetNextPageToken sets the value of NextPageToken. -func (s *ListProjectMembersOutputBody) SetNextPageToken(val OptString) { - s.NextPageToken = val +// SetJurisdictions sets the value of Jurisdictions. +func (s *GetTopologyOutputBody) SetJurisdictions(val []TopologyJurisdiction) { + s.Jurisdictions = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListProjectMembersOutputBody) SetAdditionalProps(val ListProjectMembersOutputBodyAdditional) { +func (s *GetTopologyOutputBody) SetAdditionalProps(val GetTopologyOutputBodyAdditional) { s.AdditionalProps = val } -type ListProjectMembersOutputBodyAdditional map[string]jx.Raw +type GetTopologyOutputBodyAdditional map[string]jx.Raw -func (s *ListProjectMembersOutputBodyAdditional) init() ListProjectMembersOutputBodyAdditional { +func (s *GetTopologyOutputBodyAdditional) init() GetTopologyOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -6124,70 +6065,60 @@ func (s *ListProjectMembersOutputBodyAdditional) init() ListProjectMembersOutput return m } -// Ref: #/components/schemas/ListProjectReposOutputBody -type ListProjectReposOutputBody struct { +// Ref: #/components/schemas/GetVersionOutputBody +type GetVersionOutputBody struct { // A URL to the JSON Schema for this object. Schema OptURI `json:"$schema"` - // Pass back to fetch the next page; empty when no more entries. - NextPageToken OptString `json:"nextPageToken"` - Repo OptRepo `json:"repo"` - Repos []Repo `json:"repos"` - AdditionalProps ListProjectReposOutputBodyAdditional + // Server mode. + Mode OptGetVersionOutputBodyMode `json:"mode"` + // Git commit SHA of the running entire-core binary, or "dev" for an untagged local build. + Version string `json:"version"` + AdditionalProps GetVersionOutputBodyAdditional } // GetSchema returns the value of Schema. -func (s *ListProjectReposOutputBody) GetSchema() OptURI { +func (s *GetVersionOutputBody) GetSchema() OptURI { return s.Schema } -// GetNextPageToken returns the value of NextPageToken. -func (s *ListProjectReposOutputBody) GetNextPageToken() OptString { - return s.NextPageToken -} - -// GetRepo returns the value of Repo. -func (s *ListProjectReposOutputBody) GetRepo() OptRepo { - return s.Repo +// GetMode returns the value of Mode. +func (s *GetVersionOutputBody) GetMode() OptGetVersionOutputBodyMode { + return s.Mode } -// GetRepos returns the value of Repos. -func (s *ListProjectReposOutputBody) GetRepos() []Repo { - return s.Repos +// GetVersion returns the value of Version. +func (s *GetVersionOutputBody) GetVersion() string { + return s.Version } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListProjectReposOutputBody) GetAdditionalProps() ListProjectReposOutputBodyAdditional { +func (s *GetVersionOutputBody) GetAdditionalProps() GetVersionOutputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *ListProjectReposOutputBody) SetSchema(val OptURI) { +func (s *GetVersionOutputBody) SetSchema(val OptURI) { s.Schema = val } -// SetNextPageToken sets the value of NextPageToken. -func (s *ListProjectReposOutputBody) SetNextPageToken(val OptString) { - s.NextPageToken = val -} - -// SetRepo sets the value of Repo. -func (s *ListProjectReposOutputBody) SetRepo(val OptRepo) { - s.Repo = val +// SetMode sets the value of Mode. +func (s *GetVersionOutputBody) SetMode(val OptGetVersionOutputBodyMode) { + s.Mode = val } -// SetRepos sets the value of Repos. -func (s *ListProjectReposOutputBody) SetRepos(val []Repo) { - s.Repos = val +// SetVersion sets the value of Version. +func (s *GetVersionOutputBody) SetVersion(val string) { + s.Version = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListProjectReposOutputBody) SetAdditionalProps(val ListProjectReposOutputBodyAdditional) { +func (s *GetVersionOutputBody) SetAdditionalProps(val GetVersionOutputBodyAdditional) { s.AdditionalProps = val } -type ListProjectReposOutputBodyAdditional map[string]jx.Raw +type GetVersionOutputBodyAdditional map[string]jx.Raw -func (s *ListProjectReposOutputBodyAdditional) init() ListProjectReposOutputBodyAdditional { +func (s *GetVersionOutputBodyAdditional) init() GetVersionOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -6196,119 +6127,151 @@ func (s *ListProjectReposOutputBodyAdditional) init() ListProjectReposOutputBody return m } -// Ref: #/components/schemas/ListProjectsOutputBody -type ListProjectsOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - // Pass back to fetch the next page; empty when no more entries. - NextPageToken OptString `json:"nextPageToken"` - Project OptProject `json:"project"` - Projects []Project `json:"projects"` - AdditionalProps ListProjectsOutputBodyAdditional +// Server mode. +type GetVersionOutputBodyMode string + +const ( + GetVersionOutputBodyModeGlobal GetVersionOutputBodyMode = "global" + GetVersionOutputBodyModeRegional GetVersionOutputBodyMode = "regional" +) + +// AllValues returns all GetVersionOutputBodyMode values. +func (GetVersionOutputBodyMode) AllValues() []GetVersionOutputBodyMode { + return []GetVersionOutputBodyMode{ + GetVersionOutputBodyModeGlobal, + GetVersionOutputBodyModeRegional, + } } -// GetSchema returns the value of Schema. -func (s *ListProjectsOutputBody) GetSchema() OptURI { - return s.Schema +// MarshalText implements encoding.TextMarshaler. +func (s GetVersionOutputBodyMode) MarshalText() ([]byte, error) { + switch s { + case GetVersionOutputBodyModeGlobal: + return []byte(s), nil + case GetVersionOutputBodyModeRegional: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// GetNextPageToken returns the value of NextPageToken. -func (s *ListProjectsOutputBody) GetNextPageToken() OptString { - return s.NextPageToken +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *GetVersionOutputBodyMode) UnmarshalText(data []byte) error { + switch GetVersionOutputBodyMode(data) { + case GetVersionOutputBodyModeGlobal: + *s = GetVersionOutputBodyModeGlobal + return nil + case GetVersionOutputBodyModeRegional: + *s = GetVersionOutputBodyModeRegional + return nil + default: + return errors.Errorf("invalid value: %q", data) + } } -// GetProject returns the value of Project. -func (s *ListProjectsOutputBody) GetProject() OptProject { - return s.Project +// Ref: #/components/schemas/GitHubInstallation +type GitHubInstallation struct { + AccountLogin string `json:"accountLogin"` + AccountType GitHubInstallationAccountType `json:"accountType"` + ID string `json:"id"` + State GitHubInstallationState `json:"state"` + AdditionalProps GitHubInstallationAdditional } -// GetProjects returns the value of Projects. -func (s *ListProjectsOutputBody) GetProjects() []Project { - return s.Projects +// GetAccountLogin returns the value of AccountLogin. +func (s *GitHubInstallation) GetAccountLogin() string { + return s.AccountLogin } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *ListProjectsOutputBody) GetAdditionalProps() ListProjectsOutputBodyAdditional { - return s.AdditionalProps +// GetAccountType returns the value of AccountType. +func (s *GitHubInstallation) GetAccountType() GitHubInstallationAccountType { + return s.AccountType } -// SetSchema sets the value of Schema. -func (s *ListProjectsOutputBody) SetSchema(val OptURI) { - s.Schema = val +// GetID returns the value of ID. +func (s *GitHubInstallation) GetID() string { + return s.ID } -// SetNextPageToken sets the value of NextPageToken. -func (s *ListProjectsOutputBody) SetNextPageToken(val OptString) { - s.NextPageToken = val +// GetState returns the value of State. +func (s *GitHubInstallation) GetState() GitHubInstallationState { + return s.State } -// SetProject sets the value of Project. -func (s *ListProjectsOutputBody) SetProject(val OptProject) { - s.Project = val +// GetAdditionalProps returns the value of AdditionalProps. +func (s *GitHubInstallation) GetAdditionalProps() GitHubInstallationAdditional { + return s.AdditionalProps } -// SetProjects sets the value of Projects. -func (s *ListProjectsOutputBody) SetProjects(val []Project) { - s.Projects = val +// SetAccountLogin sets the value of AccountLogin. +func (s *GitHubInstallation) SetAccountLogin(val string) { + s.AccountLogin = val } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *ListProjectsOutputBody) SetAdditionalProps(val ListProjectsOutputBodyAdditional) { - s.AdditionalProps = val +// SetAccountType sets the value of AccountType. +func (s *GitHubInstallation) SetAccountType(val GitHubInstallationAccountType) { + s.AccountType = val } -type ListProjectsOutputBodyAdditional map[string]jx.Raw - -func (s *ListProjectsOutputBodyAdditional) init() ListProjectsOutputBodyAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// SetID sets the value of ID. +func (s *GitHubInstallation) SetID(val string) { + s.ID = val } -// Ref: #/components/schemas/ListRepoCIBuildsOutputBody -type ListRepoCIBuildsOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Builds []CIBuildView `json:"builds"` - AdditionalProps ListRepoCIBuildsOutputBodyAdditional +// SetState sets the value of State. +func (s *GitHubInstallation) SetState(val GitHubInstallationState) { + s.State = val } -// GetSchema returns the value of Schema. -func (s *ListRepoCIBuildsOutputBody) GetSchema() OptURI { - return s.Schema +// SetAdditionalProps sets the value of AdditionalProps. +func (s *GitHubInstallation) SetAdditionalProps(val GitHubInstallationAdditional) { + s.AdditionalProps = val } -// GetBuilds returns the value of Builds. -func (s *ListRepoCIBuildsOutputBody) GetBuilds() []CIBuildView { - return s.Builds -} +type GitHubInstallationAccountType string -// GetAdditionalProps returns the value of AdditionalProps. -func (s *ListRepoCIBuildsOutputBody) GetAdditionalProps() ListRepoCIBuildsOutputBodyAdditional { - return s.AdditionalProps -} +const ( + GitHubInstallationAccountTypeUser GitHubInstallationAccountType = "user" + GitHubInstallationAccountTypeOrganization GitHubInstallationAccountType = "organization" +) -// SetSchema sets the value of Schema. -func (s *ListRepoCIBuildsOutputBody) SetSchema(val OptURI) { - s.Schema = val +// AllValues returns all GitHubInstallationAccountType values. +func (GitHubInstallationAccountType) AllValues() []GitHubInstallationAccountType { + return []GitHubInstallationAccountType{ + GitHubInstallationAccountTypeUser, + GitHubInstallationAccountTypeOrganization, + } } -// SetBuilds sets the value of Builds. -func (s *ListRepoCIBuildsOutputBody) SetBuilds(val []CIBuildView) { - s.Builds = val +// MarshalText implements encoding.TextMarshaler. +func (s GitHubInstallationAccountType) MarshalText() ([]byte, error) { + switch s { + case GitHubInstallationAccountTypeUser: + return []byte(s), nil + case GitHubInstallationAccountTypeOrganization: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *ListRepoCIBuildsOutputBody) SetAdditionalProps(val ListRepoCIBuildsOutputBodyAdditional) { - s.AdditionalProps = val +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *GitHubInstallationAccountType) UnmarshalText(data []byte) error { + switch GitHubInstallationAccountType(data) { + case GitHubInstallationAccountTypeUser: + *s = GitHubInstallationAccountTypeUser + return nil + case GitHubInstallationAccountTypeOrganization: + *s = GitHubInstallationAccountTypeOrganization + return nil + default: + return errors.Errorf("invalid value: %q", data) + } } -type ListRepoCIBuildsOutputBodyAdditional map[string]jx.Raw +type GitHubInstallationAdditional map[string]jx.Raw -func (s *ListRepoCIBuildsOutputBodyAdditional) init() ListRepoCIBuildsOutputBodyAdditional { +func (s *GitHubInstallationAdditional) init() GitHubInstallationAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -6317,47 +6280,87 @@ func (s *ListRepoCIBuildsOutputBodyAdditional) init() ListRepoCIBuildsOutputBody return m } -// Ref: #/components/schemas/ListRepoCIProvidersOutputBody -type ListRepoCIProvidersOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Providers []CIProviderDescriptor `json:"providers"` - AdditionalProps ListRepoCIProvidersOutputBodyAdditional +type GitHubInstallationState string + +const ( + GitHubInstallationStateActive GitHubInstallationState = "active" + GitHubInstallationStateSuspended GitHubInstallationState = "suspended" +) + +// AllValues returns all GitHubInstallationState values. +func (GitHubInstallationState) AllValues() []GitHubInstallationState { + return []GitHubInstallationState{ + GitHubInstallationStateActive, + GitHubInstallationStateSuspended, + } } -// GetSchema returns the value of Schema. -func (s *ListRepoCIProvidersOutputBody) GetSchema() OptURI { - return s.Schema +// MarshalText implements encoding.TextMarshaler. +func (s GitHubInstallationState) MarshalText() ([]byte, error) { + switch s { + case GitHubInstallationStateActive: + return []byte(s), nil + case GitHubInstallationStateSuspended: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// GetProviders returns the value of Providers. -func (s *ListRepoCIProvidersOutputBody) GetProviders() []CIProviderDescriptor { - return s.Providers +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *GitHubInstallationState) UnmarshalText(data []byte) error { + switch GitHubInstallationState(data) { + case GitHubInstallationStateActive: + *s = GitHubInstallationStateActive + return nil + case GitHubInstallationStateSuspended: + *s = GitHubInstallationStateSuspended + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// Ref: #/components/schemas/GitHubInstallations +type GitHubInstallations struct { + Items []GitHubInstallation `json:"items"` + Status GitHubInstallationsStatus `json:"status"` + AdditionalProps GitHubInstallationsAdditional +} + +// GetItems returns the value of Items. +func (s *GitHubInstallations) GetItems() []GitHubInstallation { + return s.Items +} + +// GetStatus returns the value of Status. +func (s *GitHubInstallations) GetStatus() GitHubInstallationsStatus { + return s.Status } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListRepoCIProvidersOutputBody) GetAdditionalProps() ListRepoCIProvidersOutputBodyAdditional { +func (s *GitHubInstallations) GetAdditionalProps() GitHubInstallationsAdditional { return s.AdditionalProps } -// SetSchema sets the value of Schema. -func (s *ListRepoCIProvidersOutputBody) SetSchema(val OptURI) { - s.Schema = val +// SetItems sets the value of Items. +func (s *GitHubInstallations) SetItems(val []GitHubInstallation) { + s.Items = val } -// SetProviders sets the value of Providers. -func (s *ListRepoCIProvidersOutputBody) SetProviders(val []CIProviderDescriptor) { - s.Providers = val +// SetStatus sets the value of Status. +func (s *GitHubInstallations) SetStatus(val GitHubInstallationsStatus) { + s.Status = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListRepoCIProvidersOutputBody) SetAdditionalProps(val ListRepoCIProvidersOutputBodyAdditional) { +func (s *GitHubInstallations) SetAdditionalProps(val GitHubInstallationsAdditional) { s.AdditionalProps = val } -type ListRepoCIProvidersOutputBodyAdditional map[string]jx.Raw +type GitHubInstallationsAdditional map[string]jx.Raw -func (s *ListRepoCIProvidersOutputBodyAdditional) init() ListRepoCIProvidersOutputBodyAdditional { +func (s *GitHubInstallationsAdditional) init() GitHubInstallationsAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -6366,96 +6369,136 @@ func (s *ListRepoCIProvidersOutputBodyAdditional) init() ListRepoCIProvidersOutp return m } -// Ref: #/components/schemas/ListRepoCIWebhookAuditOutputBody -type ListRepoCIWebhookAuditOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Events []CIWebhookAuditEventView `json:"events"` - AdditionalProps ListRepoCIWebhookAuditOutputBodyAdditional -} +type GitHubInstallationsStatus string -// GetSchema returns the value of Schema. -func (s *ListRepoCIWebhookAuditOutputBody) GetSchema() OptURI { - return s.Schema -} +const ( + GitHubInstallationsStatusOk GitHubInstallationsStatus = "ok" + GitHubInstallationsStatusUnavailable GitHubInstallationsStatus = "unavailable" +) -// GetEvents returns the value of Events. -func (s *ListRepoCIWebhookAuditOutputBody) GetEvents() []CIWebhookAuditEventView { - return s.Events +// AllValues returns all GitHubInstallationsStatus values. +func (GitHubInstallationsStatus) AllValues() []GitHubInstallationsStatus { + return []GitHubInstallationsStatus{ + GitHubInstallationsStatusOk, + GitHubInstallationsStatusUnavailable, + } } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *ListRepoCIWebhookAuditOutputBody) GetAdditionalProps() ListRepoCIWebhookAuditOutputBodyAdditional { - return s.AdditionalProps +// MarshalText implements encoding.TextMarshaler. +func (s GitHubInstallationsStatus) MarshalText() ([]byte, error) { + switch s { + case GitHubInstallationsStatusOk: + return []byte(s), nil + case GitHubInstallationsStatusUnavailable: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// SetSchema sets the value of Schema. -func (s *ListRepoCIWebhookAuditOutputBody) SetSchema(val OptURI) { - s.Schema = val +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *GitHubInstallationsStatus) UnmarshalText(data []byte) error { + switch GitHubInstallationsStatus(data) { + case GitHubInstallationsStatusOk: + *s = GitHubInstallationsStatusOk + return nil + case GitHubInstallationsStatusUnavailable: + *s = GitHubInstallationsStatusUnavailable + return nil + default: + return errors.Errorf("invalid value: %q", data) + } } -// SetEvents sets the value of Events. -func (s *ListRepoCIWebhookAuditOutputBody) SetEvents(val []CIWebhookAuditEventView) { - s.Events = val +// Ref: #/components/schemas/GrantAccessBody +type GrantAccessBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + // Entire account ULID to grant directly. Mutually exclusive with provider/providerUserId; the + // account must exist. + AccountId OptString `json:"accountId"` + GranteeType OptGrantAccessBodyGranteeType `json:"granteeType"` + // Legacy identity selector; requires providerUserId and must not be combined with accountId. + Provider OptString `json:"provider"` + // Legacy provider user ID; requires provider and must not be combined with accountId. + ProviderUserId OptString `json:"providerUserId"` + Role GrantAccessBodyRole `json:"role"` + AdditionalProps GrantAccessBodyAdditional } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *ListRepoCIWebhookAuditOutputBody) SetAdditionalProps(val ListRepoCIWebhookAuditOutputBodyAdditional) { - s.AdditionalProps = val +// GetSchema returns the value of Schema. +func (s *GrantAccessBody) GetSchema() OptURI { + return s.Schema } -type ListRepoCIWebhookAuditOutputBodyAdditional map[string]jx.Raw +// GetAccountId returns the value of AccountId. +func (s *GrantAccessBody) GetAccountId() OptString { + return s.AccountId +} -func (s *ListRepoCIWebhookAuditOutputBodyAdditional) init() ListRepoCIWebhookAuditOutputBodyAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// GetGranteeType returns the value of GranteeType. +func (s *GrantAccessBody) GetGranteeType() OptGrantAccessBodyGranteeType { + return s.GranteeType } -// Ref: #/components/schemas/ListRepoCIWebhooksOutputBody -type ListRepoCIWebhooksOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Subscriptions []CIWebhookView `json:"subscriptions"` - AdditionalProps ListRepoCIWebhooksOutputBodyAdditional +// GetProvider returns the value of Provider. +func (s *GrantAccessBody) GetProvider() OptString { + return s.Provider } -// GetSchema returns the value of Schema. -func (s *ListRepoCIWebhooksOutputBody) GetSchema() OptURI { - return s.Schema +// GetProviderUserId returns the value of ProviderUserId. +func (s *GrantAccessBody) GetProviderUserId() OptString { + return s.ProviderUserId } -// GetSubscriptions returns the value of Subscriptions. -func (s *ListRepoCIWebhooksOutputBody) GetSubscriptions() []CIWebhookView { - return s.Subscriptions +// GetRole returns the value of Role. +func (s *GrantAccessBody) GetRole() GrantAccessBodyRole { + return s.Role } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListRepoCIWebhooksOutputBody) GetAdditionalProps() ListRepoCIWebhooksOutputBodyAdditional { +func (s *GrantAccessBody) GetAdditionalProps() GrantAccessBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *ListRepoCIWebhooksOutputBody) SetSchema(val OptURI) { +func (s *GrantAccessBody) SetSchema(val OptURI) { s.Schema = val } -// SetSubscriptions sets the value of Subscriptions. -func (s *ListRepoCIWebhooksOutputBody) SetSubscriptions(val []CIWebhookView) { - s.Subscriptions = val +// SetAccountId sets the value of AccountId. +func (s *GrantAccessBody) SetAccountId(val OptString) { + s.AccountId = val +} + +// SetGranteeType sets the value of GranteeType. +func (s *GrantAccessBody) SetGranteeType(val OptGrantAccessBodyGranteeType) { + s.GranteeType = val +} + +// SetProvider sets the value of Provider. +func (s *GrantAccessBody) SetProvider(val OptString) { + s.Provider = val +} + +// SetProviderUserId sets the value of ProviderUserId. +func (s *GrantAccessBody) SetProviderUserId(val OptString) { + s.ProviderUserId = val +} + +// SetRole sets the value of Role. +func (s *GrantAccessBody) SetRole(val GrantAccessBodyRole) { + s.Role = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListRepoCIWebhooksOutputBody) SetAdditionalProps(val ListRepoCIWebhooksOutputBodyAdditional) { +func (s *GrantAccessBody) SetAdditionalProps(val GrantAccessBodyAdditional) { s.AdditionalProps = val } -type ListRepoCIWebhooksOutputBodyAdditional map[string]jx.Raw +type GrantAccessBodyAdditional map[string]jx.Raw -func (s *ListRepoCIWebhooksOutputBodyAdditional) init() ListRepoCIWebhooksOutputBodyAdditional { +func (s *GrantAccessBodyAdditional) init() GrantAccessBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -6464,59 +6507,178 @@ func (s *ListRepoCIWebhooksOutputBodyAdditional) init() ListRepoCIWebhooksOutput return m } -// Ref: #/components/schemas/ListRepoCollaboratorsOutputBody -type ListRepoCollaboratorsOutputBody struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Collaborators []RepoCollaborator `json:"collaborators"` - // Pass back to fetch the next page; empty when no more entries. - NextPageToken OptString `json:"nextPageToken"` - AdditionalProps ListRepoCollaboratorsOutputBodyAdditional +type GrantAccessBodyGranteeType string + +const ( + GrantAccessBodyGranteeTypeAccount GrantAccessBodyGranteeType = "account" +) + +// AllValues returns all GrantAccessBodyGranteeType values. +func (GrantAccessBodyGranteeType) AllValues() []GrantAccessBodyGranteeType { + return []GrantAccessBodyGranteeType{ + GrantAccessBodyGranteeTypeAccount, + } } -// GetSchema returns the value of Schema. -func (s *ListRepoCollaboratorsOutputBody) GetSchema() OptURI { - return s.Schema +// MarshalText implements encoding.TextMarshaler. +func (s GrantAccessBodyGranteeType) MarshalText() ([]byte, error) { + switch s { + case GrantAccessBodyGranteeTypeAccount: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// GetCollaborators returns the value of Collaborators. -func (s *ListRepoCollaboratorsOutputBody) GetCollaborators() []RepoCollaborator { - return s.Collaborators +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *GrantAccessBodyGranteeType) UnmarshalText(data []byte) error { + switch GrantAccessBodyGranteeType(data) { + case GrantAccessBodyGranteeTypeAccount: + *s = GrantAccessBodyGranteeTypeAccount + return nil + default: + return errors.Errorf("invalid value: %q", data) + } } -// GetNextPageToken returns the value of NextPageToken. -func (s *ListRepoCollaboratorsOutputBody) GetNextPageToken() OptString { - return s.NextPageToken +type GrantAccessBodyRole string + +const ( + GrantAccessBodyRoleReader GrantAccessBodyRole = "reader" + GrantAccessBodyRoleWriter GrantAccessBodyRole = "writer" + GrantAccessBodyRoleAdmin GrantAccessBodyRole = "admin" +) + +// AllValues returns all GrantAccessBodyRole values. +func (GrantAccessBodyRole) AllValues() []GrantAccessBodyRole { + return []GrantAccessBodyRole{ + GrantAccessBodyRoleReader, + GrantAccessBodyRoleWriter, + GrantAccessBodyRoleAdmin, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s GrantAccessBodyRole) MarshalText() ([]byte, error) { + switch s { + case GrantAccessBodyRoleReader: + return []byte(s), nil + case GrantAccessBodyRoleWriter: + return []byte(s), nil + case GrantAccessBodyRoleAdmin: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *GrantAccessBodyRole) UnmarshalText(data []byte) error { + switch GrantAccessBodyRole(data) { + case GrantAccessBodyRoleReader: + *s = GrantAccessBodyRoleReader + return nil + case GrantAccessBodyRoleWriter: + *s = GrantAccessBodyRoleWriter + return nil + case GrantAccessBodyRoleAdmin: + *s = GrantAccessBodyRoleAdmin + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// Ref: #/components/schemas/GrantProjectAccessOutputBody +type GrantProjectAccessOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Status string `json:"status"` + AdditionalProps GrantProjectAccessOutputBodyAdditional +} + +// GetSchema returns the value of Schema. +func (s *GrantProjectAccessOutputBody) GetSchema() OptURI { + return s.Schema +} + +// GetStatus returns the value of Status. +func (s *GrantProjectAccessOutputBody) GetStatus() string { + return s.Status } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListRepoCollaboratorsOutputBody) GetAdditionalProps() ListRepoCollaboratorsOutputBodyAdditional { +func (s *GrantProjectAccessOutputBody) GetAdditionalProps() GrantProjectAccessOutputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *ListRepoCollaboratorsOutputBody) SetSchema(val OptURI) { +func (s *GrantProjectAccessOutputBody) SetSchema(val OptURI) { s.Schema = val } -// SetCollaborators sets the value of Collaborators. -func (s *ListRepoCollaboratorsOutputBody) SetCollaborators(val []RepoCollaborator) { - s.Collaborators = val +// SetStatus sets the value of Status. +func (s *GrantProjectAccessOutputBody) SetStatus(val string) { + s.Status = val } -// SetNextPageToken sets the value of NextPageToken. -func (s *ListRepoCollaboratorsOutputBody) SetNextPageToken(val OptString) { - s.NextPageToken = val +// SetAdditionalProps sets the value of AdditionalProps. +func (s *GrantProjectAccessOutputBody) SetAdditionalProps(val GrantProjectAccessOutputBodyAdditional) { + s.AdditionalProps = val +} + +type GrantProjectAccessOutputBodyAdditional map[string]jx.Raw + +func (s *GrantProjectAccessOutputBodyAdditional) init() GrantProjectAccessOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/GrantRepoAccessOutputBody +type GrantRepoAccessOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Status string `json:"status"` + AdditionalProps GrantRepoAccessOutputBodyAdditional +} + +// GetSchema returns the value of Schema. +func (s *GrantRepoAccessOutputBody) GetSchema() OptURI { + return s.Schema +} + +// GetStatus returns the value of Status. +func (s *GrantRepoAccessOutputBody) GetStatus() string { + return s.Status +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *GrantRepoAccessOutputBody) GetAdditionalProps() GrantRepoAccessOutputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *GrantRepoAccessOutputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetStatus sets the value of Status. +func (s *GrantRepoAccessOutputBody) SetStatus(val string) { + s.Status = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListRepoCollaboratorsOutputBody) SetAdditionalProps(val ListRepoCollaboratorsOutputBodyAdditional) { +func (s *GrantRepoAccessOutputBody) SetAdditionalProps(val GrantRepoAccessOutputBodyAdditional) { s.AdditionalProps = val } -type ListRepoCollaboratorsOutputBodyAdditional map[string]jx.Raw +type GrantRepoAccessOutputBodyAdditional map[string]jx.Raw -func (s *ListRepoCollaboratorsOutputBodyAdditional) init() ListRepoCollaboratorsOutputBodyAdditional { +func (s *GrantRepoAccessOutputBodyAdditional) init() GrantRepoAccessOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -6525,59 +6687,69 @@ func (s *ListRepoCollaboratorsOutputBodyAdditional) init() ListRepoCollaborators return m } -// Ref: #/components/schemas/ListRepoGrantsOutputBody -type ListRepoGrantsOutputBody struct { +// Ref: #/components/schemas/GrantServiceAccountAccessInputBody +type GrantServiceAccountAccessInputBody struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Grants []RepoGrant `json:"grants"` - // Pass back to fetch the next page; empty when no more entries. - NextPageToken OptString `json:"nextPageToken"` - AdditionalProps ListRepoGrantsOutputBodyAdditional + Schema OptURI `json:"$schema"` + ResourceId string `json:"resourceId"` + ResourceType GrantServiceAccountAccessInputBodyResourceType `json:"resourceType"` + Role GrantServiceAccountAccessInputBodyRole `json:"role"` + AdditionalProps GrantServiceAccountAccessInputBodyAdditional } // GetSchema returns the value of Schema. -func (s *ListRepoGrantsOutputBody) GetSchema() OptURI { +func (s *GrantServiceAccountAccessInputBody) GetSchema() OptURI { return s.Schema } -// GetGrants returns the value of Grants. -func (s *ListRepoGrantsOutputBody) GetGrants() []RepoGrant { - return s.Grants +// GetResourceId returns the value of ResourceId. +func (s *GrantServiceAccountAccessInputBody) GetResourceId() string { + return s.ResourceId } -// GetNextPageToken returns the value of NextPageToken. -func (s *ListRepoGrantsOutputBody) GetNextPageToken() OptString { - return s.NextPageToken +// GetResourceType returns the value of ResourceType. +func (s *GrantServiceAccountAccessInputBody) GetResourceType() GrantServiceAccountAccessInputBodyResourceType { + return s.ResourceType +} + +// GetRole returns the value of Role. +func (s *GrantServiceAccountAccessInputBody) GetRole() GrantServiceAccountAccessInputBodyRole { + return s.Role } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListRepoGrantsOutputBody) GetAdditionalProps() ListRepoGrantsOutputBodyAdditional { +func (s *GrantServiceAccountAccessInputBody) GetAdditionalProps() GrantServiceAccountAccessInputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *ListRepoGrantsOutputBody) SetSchema(val OptURI) { +func (s *GrantServiceAccountAccessInputBody) SetSchema(val OptURI) { s.Schema = val } -// SetGrants sets the value of Grants. -func (s *ListRepoGrantsOutputBody) SetGrants(val []RepoGrant) { - s.Grants = val +// SetResourceId sets the value of ResourceId. +func (s *GrantServiceAccountAccessInputBody) SetResourceId(val string) { + s.ResourceId = val } -// SetNextPageToken sets the value of NextPageToken. -func (s *ListRepoGrantsOutputBody) SetNextPageToken(val OptString) { - s.NextPageToken = val +// SetResourceType sets the value of ResourceType. +func (s *GrantServiceAccountAccessInputBody) SetResourceType(val GrantServiceAccountAccessInputBodyResourceType) { + s.ResourceType = val +} + +// SetRole sets the value of Role. +func (s *GrantServiceAccountAccessInputBody) SetRole(val GrantServiceAccountAccessInputBodyRole) { + s.Role = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListRepoGrantsOutputBody) SetAdditionalProps(val ListRepoGrantsOutputBodyAdditional) { +func (s *GrantServiceAccountAccessInputBody) SetAdditionalProps(val GrantServiceAccountAccessInputBodyAdditional) { s.AdditionalProps = val } -type ListRepoGrantsOutputBodyAdditional map[string]jx.Raw +type GrantServiceAccountAccessInputBodyAdditional map[string]jx.Raw -func (s *ListRepoGrantsOutputBodyAdditional) init() ListRepoGrantsOutputBodyAdditional { +func (s *GrantServiceAccountAccessInputBodyAdditional) init() GrantServiceAccountAccessInputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -6586,28 +6758,27 @@ func (s *ListRepoGrantsOutputBodyAdditional) init() ListRepoGrantsOutputBodyAddi return m } -// Filter on repo_facts.archived. -type ListReposArchived string +type GrantServiceAccountAccessInputBodyResourceType string const ( - ListReposArchivedTrue ListReposArchived = "true" - ListReposArchivedFalse ListReposArchived = "false" + GrantServiceAccountAccessInputBodyResourceTypeRepo GrantServiceAccountAccessInputBodyResourceType = "repo" + GrantServiceAccountAccessInputBodyResourceTypeProject GrantServiceAccountAccessInputBodyResourceType = "project" ) -// AllValues returns all ListReposArchived values. -func (ListReposArchived) AllValues() []ListReposArchived { - return []ListReposArchived{ - ListReposArchivedTrue, - ListReposArchivedFalse, +// AllValues returns all GrantServiceAccountAccessInputBodyResourceType values. +func (GrantServiceAccountAccessInputBodyResourceType) AllValues() []GrantServiceAccountAccessInputBodyResourceType { + return []GrantServiceAccountAccessInputBodyResourceType{ + GrantServiceAccountAccessInputBodyResourceTypeRepo, + GrantServiceAccountAccessInputBodyResourceTypeProject, } } // MarshalText implements encoding.TextMarshaler. -func (s ListReposArchived) MarshalText() ([]byte, error) { +func (s GrantServiceAccountAccessInputBodyResourceType) MarshalText() ([]byte, error) { switch s { - case ListReposArchivedTrue: + case GrantServiceAccountAccessInputBodyResourceTypeRepo: return []byte(s), nil - case ListReposArchivedFalse: + case GrantServiceAccountAccessInputBodyResourceTypeProject: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) @@ -6615,41 +6786,44 @@ func (s ListReposArchived) MarshalText() ([]byte, error) { } // UnmarshalText implements encoding.TextUnmarshaler. -func (s *ListReposArchived) UnmarshalText(data []byte) error { - switch ListReposArchived(data) { - case ListReposArchivedTrue: - *s = ListReposArchivedTrue +func (s *GrantServiceAccountAccessInputBodyResourceType) UnmarshalText(data []byte) error { + switch GrantServiceAccountAccessInputBodyResourceType(data) { + case GrantServiceAccountAccessInputBodyResourceTypeRepo: + *s = GrantServiceAccountAccessInputBodyResourceTypeRepo return nil - case ListReposArchivedFalse: - *s = ListReposArchivedFalse + case GrantServiceAccountAccessInputBodyResourceTypeProject: + *s = GrantServiceAccountAccessInputBodyResourceTypeProject return nil default: return errors.Errorf("invalid value: %q", data) } } -// True: repo_facts.checkpoint_count > 0; false: no checkpoints (0 or unobserved). -type ListReposHasCheckpoints string +type GrantServiceAccountAccessInputBodyRole string const ( - ListReposHasCheckpointsTrue ListReposHasCheckpoints = "true" - ListReposHasCheckpointsFalse ListReposHasCheckpoints = "false" + GrantServiceAccountAccessInputBodyRoleReader GrantServiceAccountAccessInputBodyRole = "reader" + GrantServiceAccountAccessInputBodyRoleWriter GrantServiceAccountAccessInputBodyRole = "writer" + GrantServiceAccountAccessInputBodyRoleAdmin GrantServiceAccountAccessInputBodyRole = "admin" ) -// AllValues returns all ListReposHasCheckpoints values. -func (ListReposHasCheckpoints) AllValues() []ListReposHasCheckpoints { - return []ListReposHasCheckpoints{ - ListReposHasCheckpointsTrue, - ListReposHasCheckpointsFalse, +// AllValues returns all GrantServiceAccountAccessInputBodyRole values. +func (GrantServiceAccountAccessInputBodyRole) AllValues() []GrantServiceAccountAccessInputBodyRole { + return []GrantServiceAccountAccessInputBodyRole{ + GrantServiceAccountAccessInputBodyRoleReader, + GrantServiceAccountAccessInputBodyRoleWriter, + GrantServiceAccountAccessInputBodyRoleAdmin, } } // MarshalText implements encoding.TextMarshaler. -func (s ListReposHasCheckpoints) MarshalText() ([]byte, error) { +func (s GrantServiceAccountAccessInputBodyRole) MarshalText() ([]byte, error) { switch s { - case ListReposHasCheckpointsTrue: + case GrantServiceAccountAccessInputBodyRoleReader: return []byte(s), nil - case ListReposHasCheckpointsFalse: + case GrantServiceAccountAccessInputBodyRoleWriter: + return []byte(s), nil + case GrantServiceAccountAccessInputBodyRoleAdmin: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) @@ -6657,137 +6831,215 @@ func (s ListReposHasCheckpoints) MarshalText() ([]byte, error) { } // UnmarshalText implements encoding.TextUnmarshaler. -func (s *ListReposHasCheckpoints) UnmarshalText(data []byte) error { - switch ListReposHasCheckpoints(data) { - case ListReposHasCheckpointsTrue: - *s = ListReposHasCheckpointsTrue - return nil - case ListReposHasCheckpointsFalse: - *s = ListReposHasCheckpointsFalse +func (s *GrantServiceAccountAccessInputBodyRole) UnmarshalText(data []byte) error { + switch GrantServiceAccountAccessInputBodyRole(data) { + case GrantServiceAccountAccessInputBodyRoleReader: + *s = GrantServiceAccountAccessInputBodyRoleReader + return nil + case GrantServiceAccountAccessInputBodyRoleWriter: + *s = GrantServiceAccountAccessInputBodyRoleWriter + return nil + case GrantServiceAccountAccessInputBodyRoleAdmin: + *s = GrantServiceAccountAccessInputBodyRoleAdmin return nil default: return errors.Errorf("invalid value: %q", data) } } -// Direction for a single bare sort key; defaults to asc. Ignored when sort carries per-key -// :asc/:desc suffixes. Encoded into the cursor (authoritative on continuation). -type ListReposOrder string +// Ref: #/components/schemas/GrantServiceAccountAccessOutputBody +type GrantServiceAccountAccessOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Status string `json:"status"` + AdditionalProps GrantServiceAccountAccessOutputBodyAdditional +} -const ( - ListReposOrderAsc ListReposOrder = "asc" - ListReposOrderDesc ListReposOrder = "desc" -) +// GetSchema returns the value of Schema. +func (s *GrantServiceAccountAccessOutputBody) GetSchema() OptURI { + return s.Schema +} -// AllValues returns all ListReposOrder values. -func (ListReposOrder) AllValues() []ListReposOrder { - return []ListReposOrder{ - ListReposOrderAsc, - ListReposOrderDesc, - } +// GetStatus returns the value of Status. +func (s *GrantServiceAccountAccessOutputBody) GetStatus() string { + return s.Status } -// MarshalText implements encoding.TextMarshaler. -func (s ListReposOrder) MarshalText() ([]byte, error) { - switch s { - case ListReposOrderAsc: - return []byte(s), nil - case ListReposOrderDesc: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } +// GetAdditionalProps returns the value of AdditionalProps. +func (s *GrantServiceAccountAccessOutputBody) GetAdditionalProps() GrantServiceAccountAccessOutputBodyAdditional { + return s.AdditionalProps } -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *ListReposOrder) UnmarshalText(data []byte) error { - switch ListReposOrder(data) { - case ListReposOrderAsc: - *s = ListReposOrderAsc - return nil - case ListReposOrderDesc: - *s = ListReposOrderDesc - return nil - default: - return errors.Errorf("invalid value: %q", data) +// SetSchema sets the value of Schema. +func (s *GrantServiceAccountAccessOutputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetStatus sets the value of Status. +func (s *GrantServiceAccountAccessOutputBody) SetStatus(val string) { + s.Status = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *GrantServiceAccountAccessOutputBody) SetAdditionalProps(val GrantServiceAccountAccessOutputBodyAdditional) { + s.AdditionalProps = val +} + +type GrantServiceAccountAccessOutputBodyAdditional map[string]jx.Raw + +func (s *GrantServiceAccountAccessOutputBodyAdditional) init() GrantServiceAccountAccessOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m } + return m } -// Ref: #/components/schemas/ListReposOutputBody -type ListReposOutputBody struct { +// Ref: #/components/schemas/Invitation +type Invitation struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - CandidatesIncomplete OptBool `json:"candidatesIncomplete"` - // Pass back to fetch the next page; empty when no more entries. - NextPageToken OptString `json:"nextPageToken"` - Repos []RepoIndexEntry `json:"repos"` - Truncated bool `json:"truncated"` - AdditionalProps ListReposOutputBodyAdditional + Schema OptURI `json:"$schema"` + AcceptedAt OptDateTime `json:"acceptedAt"` + // Account ID that used the token. Empty until the invitation is accepted. + AcceptedBy OptString `json:"acceptedBy"` + CreatedAt time.Time `json:"createdAt"` + // The invited address, normalized to lowercase. + Email string `json:"email"` + ExpiresAt time.Time `json:"expiresAt"` + ID string `json:"id"` + // Account ID of the manager who created the invitation. + InvitedBy string `json:"invitedBy"` + RevokedAt OptDateTime `json:"revokedAt"` + Role string `json:"role"` + // Derived from the outcome columns at read time. + Status string `json:"status"` + AdditionalProps InvitationAdditional } // GetSchema returns the value of Schema. -func (s *ListReposOutputBody) GetSchema() OptURI { +func (s *Invitation) GetSchema() OptURI { return s.Schema } -// GetCandidatesIncomplete returns the value of CandidatesIncomplete. -func (s *ListReposOutputBody) GetCandidatesIncomplete() OptBool { - return s.CandidatesIncomplete +// GetAcceptedAt returns the value of AcceptedAt. +func (s *Invitation) GetAcceptedAt() OptDateTime { + return s.AcceptedAt } -// GetNextPageToken returns the value of NextPageToken. -func (s *ListReposOutputBody) GetNextPageToken() OptString { - return s.NextPageToken +// GetAcceptedBy returns the value of AcceptedBy. +func (s *Invitation) GetAcceptedBy() OptString { + return s.AcceptedBy } -// GetRepos returns the value of Repos. -func (s *ListReposOutputBody) GetRepos() []RepoIndexEntry { - return s.Repos +// GetCreatedAt returns the value of CreatedAt. +func (s *Invitation) GetCreatedAt() time.Time { + return s.CreatedAt } -// GetTruncated returns the value of Truncated. -func (s *ListReposOutputBody) GetTruncated() bool { - return s.Truncated +// GetEmail returns the value of Email. +func (s *Invitation) GetEmail() string { + return s.Email +} + +// GetExpiresAt returns the value of ExpiresAt. +func (s *Invitation) GetExpiresAt() time.Time { + return s.ExpiresAt +} + +// GetID returns the value of ID. +func (s *Invitation) GetID() string { + return s.ID +} + +// GetInvitedBy returns the value of InvitedBy. +func (s *Invitation) GetInvitedBy() string { + return s.InvitedBy +} + +// GetRevokedAt returns the value of RevokedAt. +func (s *Invitation) GetRevokedAt() OptDateTime { + return s.RevokedAt +} + +// GetRole returns the value of Role. +func (s *Invitation) GetRole() string { + return s.Role +} + +// GetStatus returns the value of Status. +func (s *Invitation) GetStatus() string { + return s.Status } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListReposOutputBody) GetAdditionalProps() ListReposOutputBodyAdditional { +func (s *Invitation) GetAdditionalProps() InvitationAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *ListReposOutputBody) SetSchema(val OptURI) { +func (s *Invitation) SetSchema(val OptURI) { s.Schema = val } -// SetCandidatesIncomplete sets the value of CandidatesIncomplete. -func (s *ListReposOutputBody) SetCandidatesIncomplete(val OptBool) { - s.CandidatesIncomplete = val +// SetAcceptedAt sets the value of AcceptedAt. +func (s *Invitation) SetAcceptedAt(val OptDateTime) { + s.AcceptedAt = val } -// SetNextPageToken sets the value of NextPageToken. -func (s *ListReposOutputBody) SetNextPageToken(val OptString) { - s.NextPageToken = val +// SetAcceptedBy sets the value of AcceptedBy. +func (s *Invitation) SetAcceptedBy(val OptString) { + s.AcceptedBy = val } -// SetRepos sets the value of Repos. -func (s *ListReposOutputBody) SetRepos(val []RepoIndexEntry) { - s.Repos = val +// SetCreatedAt sets the value of CreatedAt. +func (s *Invitation) SetCreatedAt(val time.Time) { + s.CreatedAt = val } -// SetTruncated sets the value of Truncated. -func (s *ListReposOutputBody) SetTruncated(val bool) { - s.Truncated = val +// SetEmail sets the value of Email. +func (s *Invitation) SetEmail(val string) { + s.Email = val +} + +// SetExpiresAt sets the value of ExpiresAt. +func (s *Invitation) SetExpiresAt(val time.Time) { + s.ExpiresAt = val +} + +// SetID sets the value of ID. +func (s *Invitation) SetID(val string) { + s.ID = val +} + +// SetInvitedBy sets the value of InvitedBy. +func (s *Invitation) SetInvitedBy(val string) { + s.InvitedBy = val +} + +// SetRevokedAt sets the value of RevokedAt. +func (s *Invitation) SetRevokedAt(val OptDateTime) { + s.RevokedAt = val +} + +// SetRole sets the value of Role. +func (s *Invitation) SetRole(val string) { + s.Role = val +} + +// SetStatus sets the value of Status. +func (s *Invitation) SetStatus(val string) { + s.Status = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListReposOutputBody) SetAdditionalProps(val ListReposOutputBodyAdditional) { +func (s *Invitation) SetAdditionalProps(val InvitationAdditional) { s.AdditionalProps = val } -type ListReposOutputBodyAdditional map[string]jx.Raw +type InvitationAdditional map[string]jx.Raw -func (s *ListReposOutputBodyAdditional) init() ListReposOutputBodyAdditional { +func (s *InvitationAdditional) init() InvitationAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -6796,245 +7048,180 @@ func (s *ListReposOutputBodyAdditional) init() ListReposOutputBodyAdditional { return m } -// Minimum caller access tier: read (all), write (write+admin), or admin. Also accepts permission[eq]; -// -// permission[ne] is rejected. -type ListReposPermission string - -const ( - ListReposPermissionRead ListReposPermission = "read" - ListReposPermissionWrite ListReposPermission = "write" - ListReposPermissionAdmin ListReposPermission = "admin" -) +// Ref: #/components/schemas/ListAuditEventsOutputBody +type ListAuditEventsOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Events []AuditEvent `json:"events"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + AdditionalProps ListAuditEventsOutputBodyAdditional +} -// AllValues returns all ListReposPermission values. -func (ListReposPermission) AllValues() []ListReposPermission { - return []ListReposPermission{ - ListReposPermissionRead, - ListReposPermissionWrite, - ListReposPermissionAdmin, - } +// GetSchema returns the value of Schema. +func (s *ListAuditEventsOutputBody) GetSchema() OptURI { + return s.Schema } -// MarshalText implements encoding.TextMarshaler. -func (s ListReposPermission) MarshalText() ([]byte, error) { - switch s { - case ListReposPermissionRead: - return []byte(s), nil - case ListReposPermissionWrite: - return []byte(s), nil - case ListReposPermissionAdmin: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } +// GetEvents returns the value of Events. +func (s *ListAuditEventsOutputBody) GetEvents() []AuditEvent { + return s.Events } -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *ListReposPermission) UnmarshalText(data []byte) error { - switch ListReposPermission(data) { - case ListReposPermissionRead: - *s = ListReposPermissionRead - return nil - case ListReposPermissionWrite: - *s = ListReposPermissionWrite - return nil - case ListReposPermissionAdmin: - *s = ListReposPermissionAdmin - return nil - default: - return errors.Errorf("invalid value: %q", data) - } +// GetNextPageToken returns the value of NextPageToken. +func (s *ListAuditEventsOutputBody) GetNextPageToken() OptString { + return s.NextPageToken } -// Onboarded (default): repos in Entire; all: also include onboardable GitHub candidates. -type ListReposScope string +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ListAuditEventsOutputBody) GetAdditionalProps() ListAuditEventsOutputBodyAdditional { + return s.AdditionalProps +} -const ( - ListReposScopeOnboarded ListReposScope = "onboarded" - ListReposScopeAll ListReposScope = "all" -) +// SetSchema sets the value of Schema. +func (s *ListAuditEventsOutputBody) SetSchema(val OptURI) { + s.Schema = val +} -// AllValues returns all ListReposScope values. -func (ListReposScope) AllValues() []ListReposScope { - return []ListReposScope{ - ListReposScopeOnboarded, - ListReposScopeAll, - } +// SetEvents sets the value of Events. +func (s *ListAuditEventsOutputBody) SetEvents(val []AuditEvent) { + s.Events = val } -// MarshalText implements encoding.TextMarshaler. -func (s ListReposScope) MarshalText() ([]byte, error) { - switch s { - case ListReposScopeOnboarded: - return []byte(s), nil - case ListReposScopeAll: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } +// SetNextPageToken sets the value of NextPageToken. +func (s *ListAuditEventsOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val } -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *ListReposScope) UnmarshalText(data []byte) error { - switch ListReposScope(data) { - case ListReposScopeOnboarded: - *s = ListReposScopeOnboarded - return nil - case ListReposScopeAll: - *s = ListReposScopeAll - return nil - default: - return errors.Errorf("invalid value: %q", data) +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ListAuditEventsOutputBody) SetAdditionalProps(val ListAuditEventsOutputBodyAdditional) { + s.AdditionalProps = val +} + +type ListAuditEventsOutputBodyAdditional map[string]jx.Raw + +func (s *ListAuditEventsOutputBodyAdditional) init() ListAuditEventsOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m } + return m } -// Filter on placement/candidacy lifecycle. inactive requires scope=all. Also accepts -// status[eq]/status[ne]. -type ListReposStatus string +// Ref: #/components/schemas/ListAvailableMirrorsOutputBody +type ListAvailableMirrorsOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Available []AvailableMirror `json:"available"` + GithubInstallations GitHubInstallations `json:"githubInstallations"` + AdditionalProps ListAvailableMirrorsOutputBodyAdditional +} -const ( - ListReposStatusMirrored ListReposStatus = "mirrored" - ListReposStatusProcessing ListReposStatus = "processing" - ListReposStatusInactive ListReposStatus = "inactive" -) +// GetSchema returns the value of Schema. +func (s *ListAvailableMirrorsOutputBody) GetSchema() OptURI { + return s.Schema +} -// AllValues returns all ListReposStatus values. -func (ListReposStatus) AllValues() []ListReposStatus { - return []ListReposStatus{ - ListReposStatusMirrored, - ListReposStatusProcessing, - ListReposStatusInactive, - } +// GetAvailable returns the value of Available. +func (s *ListAvailableMirrorsOutputBody) GetAvailable() []AvailableMirror { + return s.Available } -// MarshalText implements encoding.TextMarshaler. -func (s ListReposStatus) MarshalText() ([]byte, error) { - switch s { - case ListReposStatusMirrored: - return []byte(s), nil - case ListReposStatusProcessing: - return []byte(s), nil - case ListReposStatusInactive: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } +// GetGithubInstallations returns the value of GithubInstallations. +func (s *ListAvailableMirrorsOutputBody) GetGithubInstallations() GitHubInstallations { + return s.GithubInstallations } -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *ListReposStatus) UnmarshalText(data []byte) error { - switch ListReposStatus(data) { - case ListReposStatusMirrored: - *s = ListReposStatusMirrored - return nil - case ListReposStatusProcessing: - *s = ListReposStatusProcessing - return nil - case ListReposStatusInactive: - *s = ListReposStatusInactive - return nil - default: - return errors.Errorf("invalid value: %q", data) - } +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ListAvailableMirrorsOutputBody) GetAdditionalProps() ListAvailableMirrorsOutputBodyAdditional { + return s.AdditionalProps } -// Filter on the observed repo_facts.private fact (public: private=false; private: private=true). -// Also accepts visibility[eq]/visibility[ne]. -type ListReposVisibility string +// SetSchema sets the value of Schema. +func (s *ListAvailableMirrorsOutputBody) SetSchema(val OptURI) { + s.Schema = val +} -const ( - ListReposVisibilityPublic ListReposVisibility = "public" - ListReposVisibilityPrivate ListReposVisibility = "private" -) +// SetAvailable sets the value of Available. +func (s *ListAvailableMirrorsOutputBody) SetAvailable(val []AvailableMirror) { + s.Available = val +} -// AllValues returns all ListReposVisibility values. -func (ListReposVisibility) AllValues() []ListReposVisibility { - return []ListReposVisibility{ - ListReposVisibilityPublic, - ListReposVisibilityPrivate, - } +// SetGithubInstallations sets the value of GithubInstallations. +func (s *ListAvailableMirrorsOutputBody) SetGithubInstallations(val GitHubInstallations) { + s.GithubInstallations = val } -// MarshalText implements encoding.TextMarshaler. -func (s ListReposVisibility) MarshalText() ([]byte, error) { - switch s { - case ListReposVisibilityPublic: - return []byte(s), nil - case ListReposVisibilityPrivate: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ListAvailableMirrorsOutputBody) SetAdditionalProps(val ListAvailableMirrorsOutputBodyAdditional) { + s.AdditionalProps = val } -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *ListReposVisibility) UnmarshalText(data []byte) error { - switch ListReposVisibility(data) { - case ListReposVisibilityPublic: - *s = ListReposVisibilityPublic - return nil - case ListReposVisibilityPrivate: - *s = ListReposVisibilityPrivate - return nil - default: - return errors.Errorf("invalid value: %q", data) +type ListAvailableMirrorsOutputBodyAdditional map[string]jx.Raw + +func (s *ListAvailableMirrorsOutputBodyAdditional) init() ListAvailableMirrorsOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m } + return m } -// Ref: #/components/schemas/ListServiceAccountGrantsOutputBody -type ListServiceAccountGrantsOutputBody struct { +// Ref: #/components/schemas/ListBindingsOutputBody +type ListBindingsOutputBody struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Grants []ServiceAccountGrant `json:"grants"` + Schema OptURI `json:"$schema"` + Bindings []Binding `json:"bindings"` // Pass back to fetch the next page; empty when no more entries. NextPageToken OptString `json:"nextPageToken"` - AdditionalProps ListServiceAccountGrantsOutputBodyAdditional + AdditionalProps ListBindingsOutputBodyAdditional } // GetSchema returns the value of Schema. -func (s *ListServiceAccountGrantsOutputBody) GetSchema() OptURI { +func (s *ListBindingsOutputBody) GetSchema() OptURI { return s.Schema } -// GetGrants returns the value of Grants. -func (s *ListServiceAccountGrantsOutputBody) GetGrants() []ServiceAccountGrant { - return s.Grants +// GetBindings returns the value of Bindings. +func (s *ListBindingsOutputBody) GetBindings() []Binding { + return s.Bindings } // GetNextPageToken returns the value of NextPageToken. -func (s *ListServiceAccountGrantsOutputBody) GetNextPageToken() OptString { +func (s *ListBindingsOutputBody) GetNextPageToken() OptString { return s.NextPageToken } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListServiceAccountGrantsOutputBody) GetAdditionalProps() ListServiceAccountGrantsOutputBodyAdditional { +func (s *ListBindingsOutputBody) GetAdditionalProps() ListBindingsOutputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *ListServiceAccountGrantsOutputBody) SetSchema(val OptURI) { +func (s *ListBindingsOutputBody) SetSchema(val OptURI) { s.Schema = val } -// SetGrants sets the value of Grants. -func (s *ListServiceAccountGrantsOutputBody) SetGrants(val []ServiceAccountGrant) { - s.Grants = val +// SetBindings sets the value of Bindings. +func (s *ListBindingsOutputBody) SetBindings(val []Binding) { + s.Bindings = val } // SetNextPageToken sets the value of NextPageToken. -func (s *ListServiceAccountGrantsOutputBody) SetNextPageToken(val OptString) { +func (s *ListBindingsOutputBody) SetNextPageToken(val OptString) { s.NextPageToken = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListServiceAccountGrantsOutputBody) SetAdditionalProps(val ListServiceAccountGrantsOutputBodyAdditional) { +func (s *ListBindingsOutputBody) SetAdditionalProps(val ListBindingsOutputBodyAdditional) { s.AdditionalProps = val } -type ListServiceAccountGrantsOutputBodyAdditional map[string]jx.Raw +type ListBindingsOutputBodyAdditional map[string]jx.Raw -func (s *ListServiceAccountGrantsOutputBodyAdditional) init() ListServiceAccountGrantsOutputBodyAdditional { +func (s *ListBindingsOutputBodyAdditional) init() ListBindingsOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -7043,59 +7230,47 @@ func (s *ListServiceAccountGrantsOutputBodyAdditional) init() ListServiceAccount return m } -// Ref: #/components/schemas/ListServiceAccountsOutputBody -type ListServiceAccountsOutputBody struct { +// Ref: #/components/schemas/ListClustersOutputBody +type ListClustersOutputBody struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - // Pass back to fetch the next page; empty when no more entries. - NextPageToken OptString `json:"nextPageToken"` - ServiceAccounts []ServiceAccountWithGrants `json:"serviceAccounts"` - AdditionalProps ListServiceAccountsOutputBodyAdditional + Schema OptURI `json:"$schema"` + Clusters []Cluster `json:"clusters"` + AdditionalProps ListClustersOutputBodyAdditional } // GetSchema returns the value of Schema. -func (s *ListServiceAccountsOutputBody) GetSchema() OptURI { +func (s *ListClustersOutputBody) GetSchema() OptURI { return s.Schema } -// GetNextPageToken returns the value of NextPageToken. -func (s *ListServiceAccountsOutputBody) GetNextPageToken() OptString { - return s.NextPageToken -} - -// GetServiceAccounts returns the value of ServiceAccounts. -func (s *ListServiceAccountsOutputBody) GetServiceAccounts() []ServiceAccountWithGrants { - return s.ServiceAccounts +// GetClusters returns the value of Clusters. +func (s *ListClustersOutputBody) GetClusters() []Cluster { + return s.Clusters } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ListServiceAccountsOutputBody) GetAdditionalProps() ListServiceAccountsOutputBodyAdditional { +func (s *ListClustersOutputBody) GetAdditionalProps() ListClustersOutputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *ListServiceAccountsOutputBody) SetSchema(val OptURI) { +func (s *ListClustersOutputBody) SetSchema(val OptURI) { s.Schema = val } -// SetNextPageToken sets the value of NextPageToken. -func (s *ListServiceAccountsOutputBody) SetNextPageToken(val OptString) { - s.NextPageToken = val -} - -// SetServiceAccounts sets the value of ServiceAccounts. -func (s *ListServiceAccountsOutputBody) SetServiceAccounts(val []ServiceAccountWithGrants) { - s.ServiceAccounts = val +// SetClusters sets the value of Clusters. +func (s *ListClustersOutputBody) SetClusters(val []Cluster) { + s.Clusters = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ListServiceAccountsOutputBody) SetAdditionalProps(val ListServiceAccountsOutputBodyAdditional) { +func (s *ListClustersOutputBody) SetAdditionalProps(val ListClustersOutputBodyAdditional) { s.AdditionalProps = val } -type ListServiceAccountsOutputBodyAdditional map[string]jx.Raw +type ListClustersOutputBodyAdditional map[string]jx.Raw -func (s *ListServiceAccountsOutputBodyAdditional) init() ListServiceAccountsOutputBodyAdditional { +func (s *ListClustersOutputBodyAdditional) init() ListClustersOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -7104,91 +7279,142 @@ func (s *ListServiceAccountsOutputBodyAdditional) init() ListServiceAccountsOutp return m } -// Ref: #/components/schemas/LookupBySlugOutputBody -type LookupBySlugOutputBody struct { +// Ref: #/components/schemas/ListMirrorCollaboratorsOutputBody +type ListMirrorCollaboratorsOutputBody struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Cell string `json:"cell"` - Jurisdiction string `json:"jurisdiction"` - Owner string `json:"owner"` - Repo string `json:"repo"` - RepoId string `json:"repoId"` - AdditionalProps LookupBySlugOutputBodyAdditional + Schema OptURI `json:"$schema"` + Collaborators []MirrorCollaborator `json:"collaborators"` + AdditionalProps ListMirrorCollaboratorsOutputBodyAdditional } // GetSchema returns the value of Schema. -func (s *LookupBySlugOutputBody) GetSchema() OptURI { +func (s *ListMirrorCollaboratorsOutputBody) GetSchema() OptURI { return s.Schema } -// GetCell returns the value of Cell. -func (s *LookupBySlugOutputBody) GetCell() string { - return s.Cell +// GetCollaborators returns the value of Collaborators. +func (s *ListMirrorCollaboratorsOutputBody) GetCollaborators() []MirrorCollaborator { + return s.Collaborators } -// GetJurisdiction returns the value of Jurisdiction. -func (s *LookupBySlugOutputBody) GetJurisdiction() string { - return s.Jurisdiction +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ListMirrorCollaboratorsOutputBody) GetAdditionalProps() ListMirrorCollaboratorsOutputBodyAdditional { + return s.AdditionalProps } -// GetOwner returns the value of Owner. -func (s *LookupBySlugOutputBody) GetOwner() string { - return s.Owner +// SetSchema sets the value of Schema. +func (s *ListMirrorCollaboratorsOutputBody) SetSchema(val OptURI) { + s.Schema = val } -// GetRepo returns the value of Repo. -func (s *LookupBySlugOutputBody) GetRepo() string { - return s.Repo +// SetCollaborators sets the value of Collaborators. +func (s *ListMirrorCollaboratorsOutputBody) SetCollaborators(val []MirrorCollaborator) { + s.Collaborators = val } -// GetRepoId returns the value of RepoId. -func (s *LookupBySlugOutputBody) GetRepoId() string { - return s.RepoId +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ListMirrorCollaboratorsOutputBody) SetAdditionalProps(val ListMirrorCollaboratorsOutputBodyAdditional) { + s.AdditionalProps = val } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *LookupBySlugOutputBody) GetAdditionalProps() LookupBySlugOutputBodyAdditional { - return s.AdditionalProps +type ListMirrorCollaboratorsOutputBodyAdditional map[string]jx.Raw + +func (s *ListMirrorCollaboratorsOutputBodyAdditional) init() ListMirrorCollaboratorsOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m } -// SetSchema sets the value of Schema. -func (s *LookupBySlugOutputBody) SetSchema(val OptURI) { - s.Schema = val +type ListMirrorCollaboratorsProvider string + +const ( + ListMirrorCollaboratorsProviderGithub ListMirrorCollaboratorsProvider = "github" +) + +// AllValues returns all ListMirrorCollaboratorsProvider values. +func (ListMirrorCollaboratorsProvider) AllValues() []ListMirrorCollaboratorsProvider { + return []ListMirrorCollaboratorsProvider{ + ListMirrorCollaboratorsProviderGithub, + } } -// SetCell sets the value of Cell. -func (s *LookupBySlugOutputBody) SetCell(val string) { - s.Cell = val +// MarshalText implements encoding.TextMarshaler. +func (s ListMirrorCollaboratorsProvider) MarshalText() ([]byte, error) { + switch s { + case ListMirrorCollaboratorsProviderGithub: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// SetJurisdiction sets the value of Jurisdiction. -func (s *LookupBySlugOutputBody) SetJurisdiction(val string) { - s.Jurisdiction = val +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ListMirrorCollaboratorsProvider) UnmarshalText(data []byte) error { + switch ListMirrorCollaboratorsProvider(data) { + case ListMirrorCollaboratorsProviderGithub: + *s = ListMirrorCollaboratorsProviderGithub + return nil + default: + return errors.Errorf("invalid value: %q", data) + } } -// SetOwner sets the value of Owner. -func (s *LookupBySlugOutputBody) SetOwner(val string) { - s.Owner = val +// Ref: #/components/schemas/ListMirrorsOutputBody +type ListMirrorsOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Mirrors []Mirror `json:"mirrors"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + AdditionalProps ListMirrorsOutputBodyAdditional } -// SetRepo sets the value of Repo. -func (s *LookupBySlugOutputBody) SetRepo(val string) { - s.Repo = val +// GetSchema returns the value of Schema. +func (s *ListMirrorsOutputBody) GetSchema() OptURI { + return s.Schema } -// SetRepoId sets the value of RepoId. -func (s *LookupBySlugOutputBody) SetRepoId(val string) { - s.RepoId = val +// GetMirrors returns the value of Mirrors. +func (s *ListMirrorsOutputBody) GetMirrors() []Mirror { + return s.Mirrors +} + +// GetNextPageToken returns the value of NextPageToken. +func (s *ListMirrorsOutputBody) GetNextPageToken() OptString { + return s.NextPageToken +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ListMirrorsOutputBody) GetAdditionalProps() ListMirrorsOutputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *ListMirrorsOutputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetMirrors sets the value of Mirrors. +func (s *ListMirrorsOutputBody) SetMirrors(val []Mirror) { + s.Mirrors = val +} + +// SetNextPageToken sets the value of NextPageToken. +func (s *ListMirrorsOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *LookupBySlugOutputBody) SetAdditionalProps(val LookupBySlugOutputBodyAdditional) { +func (s *ListMirrorsOutputBody) SetAdditionalProps(val ListMirrorsOutputBodyAdditional) { s.AdditionalProps = val } -type LookupBySlugOutputBodyAdditional map[string]jx.Raw +type ListMirrorsOutputBodyAdditional map[string]jx.Raw -func (s *LookupBySlugOutputBodyAdditional) init() LookupBySlugOutputBodyAdditional { +func (s *ListMirrorsOutputBodyAdditional) init() ListMirrorsOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -7197,46 +7423,47 @@ func (s *LookupBySlugOutputBodyAdditional) init() LookupBySlugOutputBodyAddition return m } -// Ref: #/components/schemas/MeAuth -type MeAuth struct { - Provider string `json:"provider"` - ProviderUserId string `json:"providerUserId"` - AdditionalProps MeAuthAdditional +// Ref: #/components/schemas/ListNativeMirrorsOutputBody +type ListNativeMirrorsOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + NativeMirrors []NativeMirrorPlacement `json:"nativeMirrors"` + AdditionalProps ListNativeMirrorsOutputBodyAdditional } -// GetProvider returns the value of Provider. -func (s *MeAuth) GetProvider() string { - return s.Provider +// GetSchema returns the value of Schema. +func (s *ListNativeMirrorsOutputBody) GetSchema() OptURI { + return s.Schema } -// GetProviderUserId returns the value of ProviderUserId. -func (s *MeAuth) GetProviderUserId() string { - return s.ProviderUserId +// GetNativeMirrors returns the value of NativeMirrors. +func (s *ListNativeMirrorsOutputBody) GetNativeMirrors() []NativeMirrorPlacement { + return s.NativeMirrors } // GetAdditionalProps returns the value of AdditionalProps. -func (s *MeAuth) GetAdditionalProps() MeAuthAdditional { +func (s *ListNativeMirrorsOutputBody) GetAdditionalProps() ListNativeMirrorsOutputBodyAdditional { return s.AdditionalProps } -// SetProvider sets the value of Provider. -func (s *MeAuth) SetProvider(val string) { - s.Provider = val +// SetSchema sets the value of Schema. +func (s *ListNativeMirrorsOutputBody) SetSchema(val OptURI) { + s.Schema = val } -// SetProviderUserId sets the value of ProviderUserId. -func (s *MeAuth) SetProviderUserId(val string) { - s.ProviderUserId = val +// SetNativeMirrors sets the value of NativeMirrors. +func (s *ListNativeMirrorsOutputBody) SetNativeMirrors(val []NativeMirrorPlacement) { + s.NativeMirrors = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *MeAuth) SetAdditionalProps(val MeAuthAdditional) { +func (s *ListNativeMirrorsOutputBody) SetAdditionalProps(val ListNativeMirrorsOutputBodyAdditional) { s.AdditionalProps = val } -type MeAuthAdditional map[string]jx.Raw +type ListNativeMirrorsOutputBodyAdditional map[string]jx.Raw -func (s *MeAuthAdditional) init() MeAuthAdditional { +func (s *ListNativeMirrorsOutputBodyAdditional) init() ListNativeMirrorsOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -7245,48 +7472,59 @@ func (s *MeAuthAdditional) init() MeAuthAdditional { return m } -// Ref: #/components/schemas/MeDeletion -type MeDeletion struct { - // When the cooldown elapses and the account becomes eligible for irreversible hard-deletion. - CooldownEndsAt time.Time `json:"cooldownEndsAt"` - // When deletion was requested (deletion_requested_at). - RequestedAt time.Time `json:"requestedAt"` - AdditionalProps MeDeletionAdditional +// Ref: #/components/schemas/ListOIDCProvidersOutputBody +type ListOIDCProvidersOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + Providers []OIDCProvider `json:"providers"` + AdditionalProps ListOIDCProvidersOutputBodyAdditional } -// GetCooldownEndsAt returns the value of CooldownEndsAt. -func (s *MeDeletion) GetCooldownEndsAt() time.Time { - return s.CooldownEndsAt +// GetSchema returns the value of Schema. +func (s *ListOIDCProvidersOutputBody) GetSchema() OptURI { + return s.Schema } -// GetRequestedAt returns the value of RequestedAt. -func (s *MeDeletion) GetRequestedAt() time.Time { - return s.RequestedAt +// GetNextPageToken returns the value of NextPageToken. +func (s *ListOIDCProvidersOutputBody) GetNextPageToken() OptString { + return s.NextPageToken +} + +// GetProviders returns the value of Providers. +func (s *ListOIDCProvidersOutputBody) GetProviders() []OIDCProvider { + return s.Providers } // GetAdditionalProps returns the value of AdditionalProps. -func (s *MeDeletion) GetAdditionalProps() MeDeletionAdditional { +func (s *ListOIDCProvidersOutputBody) GetAdditionalProps() ListOIDCProvidersOutputBodyAdditional { return s.AdditionalProps } -// SetCooldownEndsAt sets the value of CooldownEndsAt. -func (s *MeDeletion) SetCooldownEndsAt(val time.Time) { - s.CooldownEndsAt = val +// SetSchema sets the value of Schema. +func (s *ListOIDCProvidersOutputBody) SetSchema(val OptURI) { + s.Schema = val } -// SetRequestedAt sets the value of RequestedAt. -func (s *MeDeletion) SetRequestedAt(val time.Time) { - s.RequestedAt = val +// SetNextPageToken sets the value of NextPageToken. +func (s *ListOIDCProvidersOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val +} + +// SetProviders sets the value of Providers. +func (s *ListOIDCProvidersOutputBody) SetProviders(val []OIDCProvider) { + s.Providers = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *MeDeletion) SetAdditionalProps(val MeDeletionAdditional) { +func (s *ListOIDCProvidersOutputBody) SetAdditionalProps(val ListOIDCProvidersOutputBodyAdditional) { s.AdditionalProps = val } -type MeDeletionAdditional map[string]jx.Raw +type ListOIDCProvidersOutputBodyAdditional map[string]jx.Raw -func (s *MeDeletionAdditional) init() MeDeletionAdditional { +func (s *ListOIDCProvidersOutputBodyAdditional) init() ListOIDCProvidersOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -7295,91 +7533,47 @@ func (s *MeDeletionAdditional) init() MeDeletionAdditional { return m } -// Ref: #/components/schemas/MeGlobal -type MeGlobal struct { - AccountId string `json:"accountId"` - AvatarUrl OptString `json:"avatarUrl"` - // When the account was created (accounts.created_at). - CreatedAt time.Time `json:"createdAt"` - Handle OptString `json:"handle"` - Handles []MeIdentityHandle `json:"handles"` - HomeJurisdiction OptString `json:"homeJurisdiction"` - AdditionalProps MeGlobalAdditional +// Ref: #/components/schemas/ListOrgCIBuildkiteClustersOutputBody +type ListOrgCIBuildkiteClustersOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Clusters []OrgCIBuildkiteClusterView `json:"clusters"` + AdditionalProps ListOrgCIBuildkiteClustersOutputBodyAdditional } -// GetAccountId returns the value of AccountId. -func (s *MeGlobal) GetAccountId() string { - return s.AccountId +// GetSchema returns the value of Schema. +func (s *ListOrgCIBuildkiteClustersOutputBody) GetSchema() OptURI { + return s.Schema } -// GetAvatarUrl returns the value of AvatarUrl. -func (s *MeGlobal) GetAvatarUrl() OptString { - return s.AvatarUrl +// GetClusters returns the value of Clusters. +func (s *ListOrgCIBuildkiteClustersOutputBody) GetClusters() []OrgCIBuildkiteClusterView { + return s.Clusters } -// GetCreatedAt returns the value of CreatedAt. -func (s *MeGlobal) GetCreatedAt() time.Time { - return s.CreatedAt +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ListOrgCIBuildkiteClustersOutputBody) GetAdditionalProps() ListOrgCIBuildkiteClustersOutputBodyAdditional { + return s.AdditionalProps } -// GetHandle returns the value of Handle. -func (s *MeGlobal) GetHandle() OptString { - return s.Handle -} - -// GetHandles returns the value of Handles. -func (s *MeGlobal) GetHandles() []MeIdentityHandle { - return s.Handles -} - -// GetHomeJurisdiction returns the value of HomeJurisdiction. -func (s *MeGlobal) GetHomeJurisdiction() OptString { - return s.HomeJurisdiction -} - -// GetAdditionalProps returns the value of AdditionalProps. -func (s *MeGlobal) GetAdditionalProps() MeGlobalAdditional { - return s.AdditionalProps -} - -// SetAccountId sets the value of AccountId. -func (s *MeGlobal) SetAccountId(val string) { - s.AccountId = val -} - -// SetAvatarUrl sets the value of AvatarUrl. -func (s *MeGlobal) SetAvatarUrl(val OptString) { - s.AvatarUrl = val -} - -// SetCreatedAt sets the value of CreatedAt. -func (s *MeGlobal) SetCreatedAt(val time.Time) { - s.CreatedAt = val -} - -// SetHandle sets the value of Handle. -func (s *MeGlobal) SetHandle(val OptString) { - s.Handle = val -} - -// SetHandles sets the value of Handles. -func (s *MeGlobal) SetHandles(val []MeIdentityHandle) { - s.Handles = val +// SetSchema sets the value of Schema. +func (s *ListOrgCIBuildkiteClustersOutputBody) SetSchema(val OptURI) { + s.Schema = val } -// SetHomeJurisdiction sets the value of HomeJurisdiction. -func (s *MeGlobal) SetHomeJurisdiction(val OptString) { - s.HomeJurisdiction = val +// SetClusters sets the value of Clusters. +func (s *ListOrgCIBuildkiteClustersOutputBody) SetClusters(val []OrgCIBuildkiteClusterView) { + s.Clusters = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *MeGlobal) SetAdditionalProps(val MeGlobalAdditional) { +func (s *ListOrgCIBuildkiteClustersOutputBody) SetAdditionalProps(val ListOrgCIBuildkiteClustersOutputBodyAdditional) { s.AdditionalProps = val } -type MeGlobalAdditional map[string]jx.Raw +type ListOrgCIBuildkiteClustersOutputBodyAdditional map[string]jx.Raw -func (s *MeGlobalAdditional) init() MeGlobalAdditional { +func (s *ListOrgCIBuildkiteClustersOutputBodyAdditional) init() ListOrgCIBuildkiteClustersOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -7388,70 +7582,47 @@ func (s *MeGlobalAdditional) init() MeGlobalAdditional { return m } -// Ref: #/components/schemas/MeIdentityHandle -type MeIdentityHandle struct { - // The provider's publicly-visible profile email (from the provider at login; may be empty). NOT the - // account's contact email. - Email OptString `json:"email"` - Handle string `json:"handle"` - Provider string `json:"provider"` - ProviderUserId string `json:"providerUserId"` - AdditionalProps MeIdentityHandleAdditional -} - -// GetEmail returns the value of Email. -func (s *MeIdentityHandle) GetEmail() OptString { - return s.Email -} - -// GetHandle returns the value of Handle. -func (s *MeIdentityHandle) GetHandle() string { - return s.Handle +// Ref: #/components/schemas/ListOrgCIBuildkiteCredentialsOutputBody +type ListOrgCIBuildkiteCredentialsOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Credentials []OrgCIBuildkiteCredentialView `json:"credentials"` + AdditionalProps ListOrgCIBuildkiteCredentialsOutputBodyAdditional } -// GetProvider returns the value of Provider. -func (s *MeIdentityHandle) GetProvider() string { - return s.Provider +// GetSchema returns the value of Schema. +func (s *ListOrgCIBuildkiteCredentialsOutputBody) GetSchema() OptURI { + return s.Schema } -// GetProviderUserId returns the value of ProviderUserId. -func (s *MeIdentityHandle) GetProviderUserId() string { - return s.ProviderUserId +// GetCredentials returns the value of Credentials. +func (s *ListOrgCIBuildkiteCredentialsOutputBody) GetCredentials() []OrgCIBuildkiteCredentialView { + return s.Credentials } // GetAdditionalProps returns the value of AdditionalProps. -func (s *MeIdentityHandle) GetAdditionalProps() MeIdentityHandleAdditional { +func (s *ListOrgCIBuildkiteCredentialsOutputBody) GetAdditionalProps() ListOrgCIBuildkiteCredentialsOutputBodyAdditional { return s.AdditionalProps } -// SetEmail sets the value of Email. -func (s *MeIdentityHandle) SetEmail(val OptString) { - s.Email = val -} - -// SetHandle sets the value of Handle. -func (s *MeIdentityHandle) SetHandle(val string) { - s.Handle = val -} - -// SetProvider sets the value of Provider. -func (s *MeIdentityHandle) SetProvider(val string) { - s.Provider = val +// SetSchema sets the value of Schema. +func (s *ListOrgCIBuildkiteCredentialsOutputBody) SetSchema(val OptURI) { + s.Schema = val } -// SetProviderUserId sets the value of ProviderUserId. -func (s *MeIdentityHandle) SetProviderUserId(val string) { - s.ProviderUserId = val +// SetCredentials sets the value of Credentials. +func (s *ListOrgCIBuildkiteCredentialsOutputBody) SetCredentials(val []OrgCIBuildkiteCredentialView) { + s.Credentials = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *MeIdentityHandle) SetAdditionalProps(val MeIdentityHandleAdditional) { +func (s *ListOrgCIBuildkiteCredentialsOutputBody) SetAdditionalProps(val ListOrgCIBuildkiteCredentialsOutputBodyAdditional) { s.AdditionalProps = val } -type MeIdentityHandleAdditional map[string]jx.Raw +type ListOrgCIBuildkiteCredentialsOutputBodyAdditional map[string]jx.Raw -func (s *MeIdentityHandleAdditional) init() MeIdentityHandleAdditional { +func (s *ListOrgCIBuildkiteCredentialsOutputBodyAdditional) init() ListOrgCIBuildkiteCredentialsOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -7460,79 +7631,47 @@ func (s *MeIdentityHandleAdditional) init() MeIdentityHandleAdditional { return m } -// Ref: #/components/schemas/MeRegional -type MeRegional struct { - Bio OptString `json:"bio"` - Company OptString `json:"company"` - DisplayName OptString `json:"displayName"` - Email OptString `json:"email"` - Location OptString `json:"location"` - AdditionalProps MeRegionalAdditional -} - -// GetBio returns the value of Bio. -func (s *MeRegional) GetBio() OptString { - return s.Bio -} - -// GetCompany returns the value of Company. -func (s *MeRegional) GetCompany() OptString { - return s.Company -} - -// GetDisplayName returns the value of DisplayName. -func (s *MeRegional) GetDisplayName() OptString { - return s.DisplayName +// Ref: #/components/schemas/ListOrgCIDepotOrganizationsOutputBody +type ListOrgCIDepotOrganizationsOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Connections []OrgCIDepotConnectionView `json:"connections"` + AdditionalProps ListOrgCIDepotOrganizationsOutputBodyAdditional } -// GetEmail returns the value of Email. -func (s *MeRegional) GetEmail() OptString { - return s.Email +// GetSchema returns the value of Schema. +func (s *ListOrgCIDepotOrganizationsOutputBody) GetSchema() OptURI { + return s.Schema } -// GetLocation returns the value of Location. -func (s *MeRegional) GetLocation() OptString { - return s.Location +// GetConnections returns the value of Connections. +func (s *ListOrgCIDepotOrganizationsOutputBody) GetConnections() []OrgCIDepotConnectionView { + return s.Connections } // GetAdditionalProps returns the value of AdditionalProps. -func (s *MeRegional) GetAdditionalProps() MeRegionalAdditional { +func (s *ListOrgCIDepotOrganizationsOutputBody) GetAdditionalProps() ListOrgCIDepotOrganizationsOutputBodyAdditional { return s.AdditionalProps } -// SetBio sets the value of Bio. -func (s *MeRegional) SetBio(val OptString) { - s.Bio = val -} - -// SetCompany sets the value of Company. -func (s *MeRegional) SetCompany(val OptString) { - s.Company = val -} - -// SetDisplayName sets the value of DisplayName. -func (s *MeRegional) SetDisplayName(val OptString) { - s.DisplayName = val -} - -// SetEmail sets the value of Email. -func (s *MeRegional) SetEmail(val OptString) { - s.Email = val +// SetSchema sets the value of Schema. +func (s *ListOrgCIDepotOrganizationsOutputBody) SetSchema(val OptURI) { + s.Schema = val } -// SetLocation sets the value of Location. -func (s *MeRegional) SetLocation(val OptString) { - s.Location = val +// SetConnections sets the value of Connections. +func (s *ListOrgCIDepotOrganizationsOutputBody) SetConnections(val []OrgCIDepotConnectionView) { + s.Connections = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *MeRegional) SetAdditionalProps(val MeRegionalAdditional) { +func (s *ListOrgCIDepotOrganizationsOutputBody) SetAdditionalProps(val ListOrgCIDepotOrganizationsOutputBodyAdditional) { s.AdditionalProps = val } -type MeRegionalAdditional map[string]jx.Raw +type ListOrgCIDepotOrganizationsOutputBodyAdditional map[string]jx.Raw -func (s *MeRegionalAdditional) init() MeRegionalAdditional { +func (s *ListOrgCIDepotOrganizationsOutputBodyAdditional) init() ListOrgCIDepotOrganizationsOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -7541,73 +7680,59 @@ func (s *MeRegionalAdditional) init() MeRegionalAdditional { return m } -// Ref: #/components/schemas/MeRegionalUnavailable -type MeRegionalUnavailable struct { - // Always 'foreign_jurisdiction'. Discriminator for client-side state machines. - Error MeRegionalUnavailableError `json:"error"` - // Origin of the account's home core — its OIDC issuer, e.g. 'https://us.auth.entire.io'. Not a - // browser link and not the console. - HomeCoreUrl string `json:"homeCoreUrl"` - // The account's home jurisdiction (e.g. 'us', 'eu'). - Jurisdiction string `json:"jurisdiction"` - // Human-readable copy ready to surface in a UI. - Message string `json:"message"` - AdditionalProps MeRegionalUnavailableAdditional -} - -// GetError returns the value of Error. -func (s *MeRegionalUnavailable) GetError() MeRegionalUnavailableError { - return s.Error +// Ref: #/components/schemas/ListOrgInvitationsOutputBody +type ListOrgInvitationsOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Invitations []Invitation `json:"invitations"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + AdditionalProps ListOrgInvitationsOutputBodyAdditional } -// GetHomeCoreUrl returns the value of HomeCoreUrl. -func (s *MeRegionalUnavailable) GetHomeCoreUrl() string { - return s.HomeCoreUrl +// GetSchema returns the value of Schema. +func (s *ListOrgInvitationsOutputBody) GetSchema() OptURI { + return s.Schema } -// GetJurisdiction returns the value of Jurisdiction. -func (s *MeRegionalUnavailable) GetJurisdiction() string { - return s.Jurisdiction +// GetInvitations returns the value of Invitations. +func (s *ListOrgInvitationsOutputBody) GetInvitations() []Invitation { + return s.Invitations } -// GetMessage returns the value of Message. -func (s *MeRegionalUnavailable) GetMessage() string { - return s.Message +// GetNextPageToken returns the value of NextPageToken. +func (s *ListOrgInvitationsOutputBody) GetNextPageToken() OptString { + return s.NextPageToken } // GetAdditionalProps returns the value of AdditionalProps. -func (s *MeRegionalUnavailable) GetAdditionalProps() MeRegionalUnavailableAdditional { +func (s *ListOrgInvitationsOutputBody) GetAdditionalProps() ListOrgInvitationsOutputBodyAdditional { return s.AdditionalProps } -// SetError sets the value of Error. -func (s *MeRegionalUnavailable) SetError(val MeRegionalUnavailableError) { - s.Error = val -} - -// SetHomeCoreUrl sets the value of HomeCoreUrl. -func (s *MeRegionalUnavailable) SetHomeCoreUrl(val string) { - s.HomeCoreUrl = val +// SetSchema sets the value of Schema. +func (s *ListOrgInvitationsOutputBody) SetSchema(val OptURI) { + s.Schema = val } -// SetJurisdiction sets the value of Jurisdiction. -func (s *MeRegionalUnavailable) SetJurisdiction(val string) { - s.Jurisdiction = val +// SetInvitations sets the value of Invitations. +func (s *ListOrgInvitationsOutputBody) SetInvitations(val []Invitation) { + s.Invitations = val } -// SetMessage sets the value of Message. -func (s *MeRegionalUnavailable) SetMessage(val string) { - s.Message = val +// SetNextPageToken sets the value of NextPageToken. +func (s *ListOrgInvitationsOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *MeRegionalUnavailable) SetAdditionalProps(val MeRegionalUnavailableAdditional) { +func (s *ListOrgInvitationsOutputBody) SetAdditionalProps(val ListOrgInvitationsOutputBodyAdditional) { s.AdditionalProps = val } -type MeRegionalUnavailableAdditional map[string]jx.Raw +type ListOrgInvitationsOutputBodyAdditional map[string]jx.Raw -func (s *MeRegionalUnavailableAdditional) init() MeRegionalUnavailableAdditional { +func (s *ListOrgInvitationsOutputBodyAdditional) init() ListOrgInvitationsOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -7616,24 +7741,40 @@ func (s *MeRegionalUnavailableAdditional) init() MeRegionalUnavailableAdditional return m } -// Always 'foreign_jurisdiction'. Discriminator for client-side state machines. -type MeRegionalUnavailableError string +// Lifecycle state to return; all returns every state. +type ListOrgInvitationsStatus string const ( - MeRegionalUnavailableErrorForeignJurisdiction MeRegionalUnavailableError = "foreign_jurisdiction" + ListOrgInvitationsStatusOpen ListOrgInvitationsStatus = "open" + ListOrgInvitationsStatusAccepted ListOrgInvitationsStatus = "accepted" + ListOrgInvitationsStatusRevoked ListOrgInvitationsStatus = "revoked" + ListOrgInvitationsStatusExpired ListOrgInvitationsStatus = "expired" + ListOrgInvitationsStatusAll ListOrgInvitationsStatus = "all" ) -// AllValues returns all MeRegionalUnavailableError values. -func (MeRegionalUnavailableError) AllValues() []MeRegionalUnavailableError { - return []MeRegionalUnavailableError{ - MeRegionalUnavailableErrorForeignJurisdiction, +// AllValues returns all ListOrgInvitationsStatus values. +func (ListOrgInvitationsStatus) AllValues() []ListOrgInvitationsStatus { + return []ListOrgInvitationsStatus{ + ListOrgInvitationsStatusOpen, + ListOrgInvitationsStatusAccepted, + ListOrgInvitationsStatusRevoked, + ListOrgInvitationsStatusExpired, + ListOrgInvitationsStatusAll, } } // MarshalText implements encoding.TextMarshaler. -func (s MeRegionalUnavailableError) MarshalText() ([]byte, error) { +func (s ListOrgInvitationsStatus) MarshalText() ([]byte, error) { switch s { - case MeRegionalUnavailableErrorForeignJurisdiction: + case ListOrgInvitationsStatusOpen: + return []byte(s), nil + case ListOrgInvitationsStatusAccepted: + return []byte(s), nil + case ListOrgInvitationsStatusRevoked: + return []byte(s), nil + case ListOrgInvitationsStatusExpired: + return []byte(s), nil + case ListOrgInvitationsStatusAll: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) @@ -7641,208 +7782,203 @@ func (s MeRegionalUnavailableError) MarshalText() ([]byte, error) { } // UnmarshalText implements encoding.TextUnmarshaler. -func (s *MeRegionalUnavailableError) UnmarshalText(data []byte) error { - switch MeRegionalUnavailableError(data) { - case MeRegionalUnavailableErrorForeignJurisdiction: - *s = MeRegionalUnavailableErrorForeignJurisdiction +func (s *ListOrgInvitationsStatus) UnmarshalText(data []byte) error { + switch ListOrgInvitationsStatus(data) { + case ListOrgInvitationsStatusOpen: + *s = ListOrgInvitationsStatusOpen return nil - default: + case ListOrgInvitationsStatusAccepted: + *s = ListOrgInvitationsStatusAccepted + return nil + case ListOrgInvitationsStatusRevoked: + *s = ListOrgInvitationsStatusRevoked + return nil + case ListOrgInvitationsStatusExpired: + *s = ListOrgInvitationsStatusExpired + return nil + case ListOrgInvitationsStatusAll: + *s = ListOrgInvitationsStatusAll + return nil + default: return errors.Errorf("invalid value: %q", data) } } -// Ref: #/components/schemas/Membership -type Membership struct { +// Ref: #/components/schemas/ListOrgMembersOutputBody +type ListOrgMembersOutputBody struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - AccountId string `json:"accountId"` - CreatedAt time.Time `json:"createdAt"` - Handle OptString `json:"handle"` - ID string `json:"id"` - OrgId string `json:"orgId"` - Provider OptString `json:"provider"` - Role string `json:"role"` - Status string `json:"status"` - WorkosOrgMembershipId OptString `json:"workosOrgMembershipId"` - AdditionalProps MembershipAdditional + Schema OptURI `json:"$schema"` + Members []Membership `json:"members"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + AdditionalProps ListOrgMembersOutputBodyAdditional } // GetSchema returns the value of Schema. -func (s *Membership) GetSchema() OptURI { +func (s *ListOrgMembersOutputBody) GetSchema() OptURI { return s.Schema } -// GetAccountId returns the value of AccountId. -func (s *Membership) GetAccountId() string { - return s.AccountId -} - -// GetCreatedAt returns the value of CreatedAt. -func (s *Membership) GetCreatedAt() time.Time { - return s.CreatedAt -} - -// GetHandle returns the value of Handle. -func (s *Membership) GetHandle() OptString { - return s.Handle -} - -// GetID returns the value of ID. -func (s *Membership) GetID() string { - return s.ID -} - -// GetOrgId returns the value of OrgId. -func (s *Membership) GetOrgId() string { - return s.OrgId -} - -// GetProvider returns the value of Provider. -func (s *Membership) GetProvider() OptString { - return s.Provider -} - -// GetRole returns the value of Role. -func (s *Membership) GetRole() string { - return s.Role -} - -// GetStatus returns the value of Status. -func (s *Membership) GetStatus() string { - return s.Status +// GetMembers returns the value of Members. +func (s *ListOrgMembersOutputBody) GetMembers() []Membership { + return s.Members } -// GetWorkosOrgMembershipId returns the value of WorkosOrgMembershipId. -func (s *Membership) GetWorkosOrgMembershipId() OptString { - return s.WorkosOrgMembershipId +// GetNextPageToken returns the value of NextPageToken. +func (s *ListOrgMembersOutputBody) GetNextPageToken() OptString { + return s.NextPageToken } // GetAdditionalProps returns the value of AdditionalProps. -func (s *Membership) GetAdditionalProps() MembershipAdditional { +func (s *ListOrgMembersOutputBody) GetAdditionalProps() ListOrgMembersOutputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *Membership) SetSchema(val OptURI) { +func (s *ListOrgMembersOutputBody) SetSchema(val OptURI) { s.Schema = val } -// SetAccountId sets the value of AccountId. -func (s *Membership) SetAccountId(val string) { - s.AccountId = val -} - -// SetCreatedAt sets the value of CreatedAt. -func (s *Membership) SetCreatedAt(val time.Time) { - s.CreatedAt = val +// SetMembers sets the value of Members. +func (s *ListOrgMembersOutputBody) SetMembers(val []Membership) { + s.Members = val } -// SetHandle sets the value of Handle. -func (s *Membership) SetHandle(val OptString) { - s.Handle = val +// SetNextPageToken sets the value of NextPageToken. +func (s *ListOrgMembersOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val } -// SetID sets the value of ID. -func (s *Membership) SetID(val string) { - s.ID = val +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ListOrgMembersOutputBody) SetAdditionalProps(val ListOrgMembersOutputBodyAdditional) { + s.AdditionalProps = val } -// SetOrgId sets the value of OrgId. -func (s *Membership) SetOrgId(val string) { - s.OrgId = val -} +type ListOrgMembersOutputBodyAdditional map[string]jx.Raw -// SetProvider sets the value of Provider. -func (s *Membership) SetProvider(val OptString) { - s.Provider = val +func (s *ListOrgMembersOutputBodyAdditional) init() ListOrgMembersOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m } -// SetRole sets the value of Role. -func (s *Membership) SetRole(val string) { - s.Role = val -} +// Member includes non-pending memberships; invited means pending; collaborator means no direct +// membership. +type ListOrgPeopleMembership string -// SetStatus sets the value of Status. -func (s *Membership) SetStatus(val string) { - s.Status = val -} +const ( + ListOrgPeopleMembershipMember ListOrgPeopleMembership = "member" + ListOrgPeopleMembershipInvited ListOrgPeopleMembership = "invited" + ListOrgPeopleMembershipCollaborator ListOrgPeopleMembership = "collaborator" +) -// SetWorkosOrgMembershipId sets the value of WorkosOrgMembershipId. -func (s *Membership) SetWorkosOrgMembershipId(val OptString) { - s.WorkosOrgMembershipId = val +// AllValues returns all ListOrgPeopleMembership values. +func (ListOrgPeopleMembership) AllValues() []ListOrgPeopleMembership { + return []ListOrgPeopleMembership{ + ListOrgPeopleMembershipMember, + ListOrgPeopleMembershipInvited, + ListOrgPeopleMembershipCollaborator, + } } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *Membership) SetAdditionalProps(val MembershipAdditional) { - s.AdditionalProps = val +// MarshalText implements encoding.TextMarshaler. +func (s ListOrgPeopleMembership) MarshalText() ([]byte, error) { + switch s { + case ListOrgPeopleMembershipMember: + return []byte(s), nil + case ListOrgPeopleMembershipInvited: + return []byte(s), nil + case ListOrgPeopleMembershipCollaborator: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -type MembershipAdditional map[string]jx.Raw - -func (s *MembershipAdditional) init() MembershipAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ListOrgPeopleMembership) UnmarshalText(data []byte) error { + switch ListOrgPeopleMembership(data) { + case ListOrgPeopleMembershipMember: + *s = ListOrgPeopleMembershipMember + return nil + case ListOrgPeopleMembershipInvited: + *s = ListOrgPeopleMembershipInvited + return nil + case ListOrgPeopleMembershipCollaborator: + *s = ListOrgPeopleMembershipCollaborator + return nil + default: + return errors.Errorf("invalid value: %q", data) } - return m } -// Ref: #/components/schemas/MintOrgCIGitHubActionsCredentialInputBody -type MintOrgCIGitHubActionsCredentialInputBody struct { +// Ref: #/components/schemas/ListOrgPeopleOutputBody +type ListOrgPeopleOutputBody struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - // GitHub login (user or organization) whose webhooks this credential verifies. - Account string `json:"account"` - // GitHub API token for outbound workflow dispatch. Optional: omit for an inbound-only credential. On - // an existing github-actions row this stores/rotates the token instead of conflicting. - APIToken OptString `json:"api_token"` - AdditionalProps MintOrgCIGitHubActionsCredentialInputBodyAdditional + Schema OptURI `json:"$schema"` + Items []OrgPersonSummary `json:"items"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + TotalCount int64 `json:"totalCount"` + AdditionalProps ListOrgPeopleOutputBodyAdditional } // GetSchema returns the value of Schema. -func (s *MintOrgCIGitHubActionsCredentialInputBody) GetSchema() OptURI { +func (s *ListOrgPeopleOutputBody) GetSchema() OptURI { return s.Schema } -// GetAccount returns the value of Account. -func (s *MintOrgCIGitHubActionsCredentialInputBody) GetAccount() string { - return s.Account +// GetItems returns the value of Items. +func (s *ListOrgPeopleOutputBody) GetItems() []OrgPersonSummary { + return s.Items } -// GetAPIToken returns the value of APIToken. -func (s *MintOrgCIGitHubActionsCredentialInputBody) GetAPIToken() OptString { - return s.APIToken +// GetNextPageToken returns the value of NextPageToken. +func (s *ListOrgPeopleOutputBody) GetNextPageToken() OptString { + return s.NextPageToken +} + +// GetTotalCount returns the value of TotalCount. +func (s *ListOrgPeopleOutputBody) GetTotalCount() int64 { + return s.TotalCount } // GetAdditionalProps returns the value of AdditionalProps. -func (s *MintOrgCIGitHubActionsCredentialInputBody) GetAdditionalProps() MintOrgCIGitHubActionsCredentialInputBodyAdditional { +func (s *ListOrgPeopleOutputBody) GetAdditionalProps() ListOrgPeopleOutputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *MintOrgCIGitHubActionsCredentialInputBody) SetSchema(val OptURI) { +func (s *ListOrgPeopleOutputBody) SetSchema(val OptURI) { s.Schema = val } -// SetAccount sets the value of Account. -func (s *MintOrgCIGitHubActionsCredentialInputBody) SetAccount(val string) { - s.Account = val +// SetItems sets the value of Items. +func (s *ListOrgPeopleOutputBody) SetItems(val []OrgPersonSummary) { + s.Items = val } -// SetAPIToken sets the value of APIToken. -func (s *MintOrgCIGitHubActionsCredentialInputBody) SetAPIToken(val OptString) { - s.APIToken = val +// SetNextPageToken sets the value of NextPageToken. +func (s *ListOrgPeopleOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val +} + +// SetTotalCount sets the value of TotalCount. +func (s *ListOrgPeopleOutputBody) SetTotalCount(val int64) { + s.TotalCount = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *MintOrgCIGitHubActionsCredentialInputBody) SetAdditionalProps(val MintOrgCIGitHubActionsCredentialInputBodyAdditional) { +func (s *ListOrgPeopleOutputBody) SetAdditionalProps(val ListOrgPeopleOutputBodyAdditional) { s.AdditionalProps = val } -type MintOrgCIGitHubActionsCredentialInputBodyAdditional map[string]jx.Raw +type ListOrgPeopleOutputBodyAdditional map[string]jx.Raw -func (s *MintOrgCIGitHubActionsCredentialInputBodyAdditional) init() MintOrgCIGitHubActionsCredentialInputBodyAdditional { +func (s *ListOrgPeopleOutputBodyAdditional) init() ListOrgPeopleOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -7851,183 +7987,264 @@ func (s *MintOrgCIGitHubActionsCredentialInputBodyAdditional) init() MintOrgCIGi return m } -// Ref: #/components/schemas/Mirror -type Mirror struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - // Physical cell the mirror's cluster runs in, e.g. aws-us-east-2. - Cell OptString `json:"cell"` - // Public host of the cluster serving this mirror. - ClusterHost string `json:"clusterHost"` - CreatedAt time.Time `json:"createdAt"` - InstallationId OptInt64 `json:"installationId"` - IsArchived OptBool `json:"isArchived"` - IsPrivate OptBool `json:"isPrivate"` - Jurisdiction OptString `json:"jurisdiction"` - MirrorId string `json:"mirrorId"` - Owner string `json:"owner"` - Provider string `json:"provider"` - Repo string `json:"repo"` - // Clone lifecycle: processing (cloning), ready (clonable), failed (initial clone failed), or - // suspended. - Status OptMirrorStatus `json:"status"` - SuspendedAt OptDateTime `json:"suspendedAt"` - AdditionalProps MirrorAdditional +// ListOrgPeopleOutputBodyHeaders wraps ListOrgPeopleOutputBody with response headers. +type ListOrgPeopleOutputBodyHeaders struct { + CacheControl OptString + Response ListOrgPeopleOutputBody } -// GetSchema returns the value of Schema. -func (s *Mirror) GetSchema() OptURI { - return s.Schema +// GetCacheControl returns the value of CacheControl. +func (s *ListOrgPeopleOutputBodyHeaders) GetCacheControl() OptString { + return s.CacheControl } -// GetCell returns the value of Cell. -func (s *Mirror) GetCell() OptString { - return s.Cell +// GetResponse returns the value of Response. +func (s *ListOrgPeopleOutputBodyHeaders) GetResponse() ListOrgPeopleOutputBody { + return s.Response } -// GetClusterHost returns the value of ClusterHost. -func (s *Mirror) GetClusterHost() string { - return s.ClusterHost +// SetCacheControl sets the value of CacheControl. +func (s *ListOrgPeopleOutputBodyHeaders) SetCacheControl(val OptString) { + s.CacheControl = val } -// GetCreatedAt returns the value of CreatedAt. -func (s *Mirror) GetCreatedAt() time.Time { - return s.CreatedAt +// SetResponse sets the value of Response. +func (s *ListOrgPeopleOutputBodyHeaders) SetResponse(val ListOrgPeopleOutputBody) { + s.Response = val } -// GetInstallationId returns the value of InstallationId. -func (s *Mirror) GetInstallationId() OptInt64 { - return s.InstallationId -} +// Exact recorded grant role, including organization membership and weaker independent grants. +type ListOrgPeopleRole string -// GetIsArchived returns the value of IsArchived. -func (s *Mirror) GetIsArchived() OptBool { - return s.IsArchived +const ( + ListOrgPeopleRoleOwner ListOrgPeopleRole = "owner" + ListOrgPeopleRoleAdmin ListOrgPeopleRole = "admin" + ListOrgPeopleRoleMember ListOrgPeopleRole = "member" + ListOrgPeopleRoleReader ListOrgPeopleRole = "reader" + ListOrgPeopleRoleWriter ListOrgPeopleRole = "writer" + ListOrgPeopleRoleMirrorSourceAdmin ListOrgPeopleRole = "mirror_source_admin" +) + +// AllValues returns all ListOrgPeopleRole values. +func (ListOrgPeopleRole) AllValues() []ListOrgPeopleRole { + return []ListOrgPeopleRole{ + ListOrgPeopleRoleOwner, + ListOrgPeopleRoleAdmin, + ListOrgPeopleRoleMember, + ListOrgPeopleRoleReader, + ListOrgPeopleRoleWriter, + ListOrgPeopleRoleMirrorSourceAdmin, + } } -// GetIsPrivate returns the value of IsPrivate. -func (s *Mirror) GetIsPrivate() OptBool { - return s.IsPrivate +// MarshalText implements encoding.TextMarshaler. +func (s ListOrgPeopleRole) MarshalText() ([]byte, error) { + switch s { + case ListOrgPeopleRoleOwner: + return []byte(s), nil + case ListOrgPeopleRoleAdmin: + return []byte(s), nil + case ListOrgPeopleRoleMember: + return []byte(s), nil + case ListOrgPeopleRoleReader: + return []byte(s), nil + case ListOrgPeopleRoleWriter: + return []byte(s), nil + case ListOrgPeopleRoleMirrorSourceAdmin: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// GetJurisdiction returns the value of Jurisdiction. -func (s *Mirror) GetJurisdiction() OptString { - return s.Jurisdiction +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ListOrgPeopleRole) UnmarshalText(data []byte) error { + switch ListOrgPeopleRole(data) { + case ListOrgPeopleRoleOwner: + *s = ListOrgPeopleRoleOwner + return nil + case ListOrgPeopleRoleAdmin: + *s = ListOrgPeopleRoleAdmin + return nil + case ListOrgPeopleRoleMember: + *s = ListOrgPeopleRoleMember + return nil + case ListOrgPeopleRoleReader: + *s = ListOrgPeopleRoleReader + return nil + case ListOrgPeopleRoleWriter: + *s = ListOrgPeopleRoleWriter + return nil + case ListOrgPeopleRoleMirrorSourceAdmin: + *s = ListOrgPeopleRoleMirrorSourceAdmin + return nil + default: + return errors.Errorf("invalid value: %q", data) + } } -// GetMirrorId returns the value of MirrorId. -func (s *Mirror) GetMirrorId() string { - return s.MirrorId -} - -// GetOwner returns the value of Owner. -func (s *Mirror) GetOwner() string { - return s.Owner -} +// Select people with a recorded grant at this resource level. +type ListOrgPeopleScope string -// GetProvider returns the value of Provider. -func (s *Mirror) GetProvider() string { - return s.Provider -} +const ( + ListOrgPeopleScopeOrganization ListOrgPeopleScope = "organization" + ListOrgPeopleScopeProject ListOrgPeopleScope = "project" + ListOrgPeopleScopeRepository ListOrgPeopleScope = "repository" +) -// GetRepo returns the value of Repo. -func (s *Mirror) GetRepo() string { - return s.Repo +// AllValues returns all ListOrgPeopleScope values. +func (ListOrgPeopleScope) AllValues() []ListOrgPeopleScope { + return []ListOrgPeopleScope{ + ListOrgPeopleScopeOrganization, + ListOrgPeopleScopeProject, + ListOrgPeopleScopeRepository, + } } -// GetStatus returns the value of Status. -func (s *Mirror) GetStatus() OptMirrorStatus { - return s.Status +// MarshalText implements encoding.TextMarshaler. +func (s ListOrgPeopleScope) MarshalText() ([]byte, error) { + switch s { + case ListOrgPeopleScopeOrganization: + return []byte(s), nil + case ListOrgPeopleScopeProject: + return []byte(s), nil + case ListOrgPeopleScopeRepository: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// GetSuspendedAt returns the value of SuspendedAt. -func (s *Mirror) GetSuspendedAt() OptDateTime { - return s.SuspendedAt +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ListOrgPeopleScope) UnmarshalText(data []byte) error { + switch ListOrgPeopleScope(data) { + case ListOrgPeopleScopeOrganization: + *s = ListOrgPeopleScopeOrganization + return nil + case ListOrgPeopleScopeProject: + *s = ListOrgPeopleScopeProject + return nil + case ListOrgPeopleScopeRepository: + *s = ListOrgPeopleScopeRepository + return nil + default: + return errors.Errorf("invalid value: %q", data) + } } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *Mirror) GetAdditionalProps() MirrorAdditional { - return s.AdditionalProps -} +// Direct membership status; collaborators have no membership status. +type ListOrgPeopleStatus string -// SetSchema sets the value of Schema. -func (s *Mirror) SetSchema(val OptURI) { - s.Schema = val -} +const ( + ListOrgPeopleStatusActive ListOrgPeopleStatus = "active" + ListOrgPeopleStatusInactive ListOrgPeopleStatus = "inactive" + ListOrgPeopleStatusPending ListOrgPeopleStatus = "pending" +) -// SetCell sets the value of Cell. -func (s *Mirror) SetCell(val OptString) { - s.Cell = val +// AllValues returns all ListOrgPeopleStatus values. +func (ListOrgPeopleStatus) AllValues() []ListOrgPeopleStatus { + return []ListOrgPeopleStatus{ + ListOrgPeopleStatusActive, + ListOrgPeopleStatusInactive, + ListOrgPeopleStatusPending, + } } -// SetClusterHost sets the value of ClusterHost. -func (s *Mirror) SetClusterHost(val string) { - s.ClusterHost = val +// MarshalText implements encoding.TextMarshaler. +func (s ListOrgPeopleStatus) MarshalText() ([]byte, error) { + switch s { + case ListOrgPeopleStatusActive: + return []byte(s), nil + case ListOrgPeopleStatusInactive: + return []byte(s), nil + case ListOrgPeopleStatusPending: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// SetCreatedAt sets the value of CreatedAt. -func (s *Mirror) SetCreatedAt(val time.Time) { - s.CreatedAt = val +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ListOrgPeopleStatus) UnmarshalText(data []byte) error { + switch ListOrgPeopleStatus(data) { + case ListOrgPeopleStatusActive: + *s = ListOrgPeopleStatusActive + return nil + case ListOrgPeopleStatusInactive: + *s = ListOrgPeopleStatusInactive + return nil + case ListOrgPeopleStatusPending: + *s = ListOrgPeopleStatusPending + return nil + default: + return errors.Errorf("invalid value: %q", data) + } } -// SetInstallationId sets the value of InstallationId. -func (s *Mirror) SetInstallationId(val OptInt64) { - s.InstallationId = val +// Ref: #/components/schemas/ListOrgProjectsOutputBody +type ListOrgProjectsOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + Project OptProject `json:"project"` + Projects []Project `json:"projects"` + AdditionalProps ListOrgProjectsOutputBodyAdditional } -// SetIsArchived sets the value of IsArchived. -func (s *Mirror) SetIsArchived(val OptBool) { - s.IsArchived = val +// GetSchema returns the value of Schema. +func (s *ListOrgProjectsOutputBody) GetSchema() OptURI { + return s.Schema } -// SetIsPrivate sets the value of IsPrivate. -func (s *Mirror) SetIsPrivate(val OptBool) { - s.IsPrivate = val +// GetNextPageToken returns the value of NextPageToken. +func (s *ListOrgProjectsOutputBody) GetNextPageToken() OptString { + return s.NextPageToken } -// SetJurisdiction sets the value of Jurisdiction. -func (s *Mirror) SetJurisdiction(val OptString) { - s.Jurisdiction = val +// GetProject returns the value of Project. +func (s *ListOrgProjectsOutputBody) GetProject() OptProject { + return s.Project } -// SetMirrorId sets the value of MirrorId. -func (s *Mirror) SetMirrorId(val string) { - s.MirrorId = val +// GetProjects returns the value of Projects. +func (s *ListOrgProjectsOutputBody) GetProjects() []Project { + return s.Projects } -// SetOwner sets the value of Owner. -func (s *Mirror) SetOwner(val string) { - s.Owner = val +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ListOrgProjectsOutputBody) GetAdditionalProps() ListOrgProjectsOutputBodyAdditional { + return s.AdditionalProps } -// SetProvider sets the value of Provider. -func (s *Mirror) SetProvider(val string) { - s.Provider = val +// SetSchema sets the value of Schema. +func (s *ListOrgProjectsOutputBody) SetSchema(val OptURI) { + s.Schema = val } -// SetRepo sets the value of Repo. -func (s *Mirror) SetRepo(val string) { - s.Repo = val +// SetNextPageToken sets the value of NextPageToken. +func (s *ListOrgProjectsOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val } -// SetStatus sets the value of Status. -func (s *Mirror) SetStatus(val OptMirrorStatus) { - s.Status = val +// SetProject sets the value of Project. +func (s *ListOrgProjectsOutputBody) SetProject(val OptProject) { + s.Project = val } -// SetSuspendedAt sets the value of SuspendedAt. -func (s *Mirror) SetSuspendedAt(val OptDateTime) { - s.SuspendedAt = val +// SetProjects sets the value of Projects. +func (s *ListOrgProjectsOutputBody) SetProjects(val []Project) { + s.Projects = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *Mirror) SetAdditionalProps(val MirrorAdditional) { +func (s *ListOrgProjectsOutputBody) SetAdditionalProps(val ListOrgProjectsOutputBodyAdditional) { s.AdditionalProps = val } -type MirrorAdditional map[string]jx.Raw +type ListOrgProjectsOutputBodyAdditional map[string]jx.Raw -func (s *MirrorAdditional) init() MirrorAdditional { +func (s *ListOrgProjectsOutputBodyAdditional) init() ListOrgProjectsOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -8036,59 +8253,70 @@ func (s *MirrorAdditional) init() MirrorAdditional { return m } -// Ref: #/components/schemas/MirrorCollaborator -type MirrorCollaborator struct { - AccountId string `json:"accountId"` - // Primary handle (provider:label), empty if none resolves. - Handle OptString `json:"handle"` - // Reader (pull) or writer (pull+push). - Role string `json:"role"` - AdditionalProps MirrorCollaboratorAdditional +// Ref: #/components/schemas/ListOrgsOutputBody +type ListOrgsOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + Org OptOrg `json:"org"` + Orgs []Org `json:"orgs"` + AdditionalProps ListOrgsOutputBodyAdditional } -// GetAccountId returns the value of AccountId. -func (s *MirrorCollaborator) GetAccountId() string { - return s.AccountId +// GetSchema returns the value of Schema. +func (s *ListOrgsOutputBody) GetSchema() OptURI { + return s.Schema } -// GetHandle returns the value of Handle. -func (s *MirrorCollaborator) GetHandle() OptString { - return s.Handle +// GetNextPageToken returns the value of NextPageToken. +func (s *ListOrgsOutputBody) GetNextPageToken() OptString { + return s.NextPageToken } -// GetRole returns the value of Role. -func (s *MirrorCollaborator) GetRole() string { - return s.Role +// GetOrg returns the value of Org. +func (s *ListOrgsOutputBody) GetOrg() OptOrg { + return s.Org +} + +// GetOrgs returns the value of Orgs. +func (s *ListOrgsOutputBody) GetOrgs() []Org { + return s.Orgs } // GetAdditionalProps returns the value of AdditionalProps. -func (s *MirrorCollaborator) GetAdditionalProps() MirrorCollaboratorAdditional { +func (s *ListOrgsOutputBody) GetAdditionalProps() ListOrgsOutputBodyAdditional { return s.AdditionalProps } -// SetAccountId sets the value of AccountId. -func (s *MirrorCollaborator) SetAccountId(val string) { - s.AccountId = val +// SetSchema sets the value of Schema. +func (s *ListOrgsOutputBody) SetSchema(val OptURI) { + s.Schema = val } -// SetHandle sets the value of Handle. -func (s *MirrorCollaborator) SetHandle(val OptString) { - s.Handle = val +// SetNextPageToken sets the value of NextPageToken. +func (s *ListOrgsOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val } -// SetRole sets the value of Role. -func (s *MirrorCollaborator) SetRole(val string) { - s.Role = val +// SetOrg sets the value of Org. +func (s *ListOrgsOutputBody) SetOrg(val OptOrg) { + s.Org = val +} + +// SetOrgs sets the value of Orgs. +func (s *ListOrgsOutputBody) SetOrgs(val []Org) { + s.Orgs = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *MirrorCollaborator) SetAdditionalProps(val MirrorCollaboratorAdditional) { +func (s *ListOrgsOutputBody) SetAdditionalProps(val ListOrgsOutputBodyAdditional) { s.AdditionalProps = val } -type MirrorCollaboratorAdditional map[string]jx.Raw +type ListOrgsOutputBodyAdditional map[string]jx.Raw -func (s *MirrorCollaboratorAdditional) init() MirrorCollaboratorAdditional { +func (s *ListOrgsOutputBodyAdditional) init() ListOrgsOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -8097,141 +8325,107 @@ func (s *MirrorCollaboratorAdditional) init() MirrorCollaboratorAdditional { return m } -// Ref: #/components/schemas/MirrorRequest -type MirrorRequest struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Failure OptMirrorRequestFailure `json:"failure"` - RequestId uuid.UUID `json:"requestId"` - Result OptMirrorRequestResult `json:"result"` - Status MirrorRequestStatus `json:"status"` - AdditionalProps MirrorRequestAdditional +// ListOrgsOutputBodyHeaders wraps ListOrgsOutputBody with response headers. +type ListOrgsOutputBodyHeaders struct { + CacheControl OptString + ETag OptString + Vary OptString + Response ListOrgsOutputBody } -// GetSchema returns the value of Schema. -func (s *MirrorRequest) GetSchema() OptURI { - return s.Schema +// GetCacheControl returns the value of CacheControl. +func (s *ListOrgsOutputBodyHeaders) GetCacheControl() OptString { + return s.CacheControl } -// GetFailure returns the value of Failure. -func (s *MirrorRequest) GetFailure() OptMirrorRequestFailure { - return s.Failure +// GetETag returns the value of ETag. +func (s *ListOrgsOutputBodyHeaders) GetETag() OptString { + return s.ETag } -// GetRequestId returns the value of RequestId. -func (s *MirrorRequest) GetRequestId() uuid.UUID { - return s.RequestId +// GetVary returns the value of Vary. +func (s *ListOrgsOutputBodyHeaders) GetVary() OptString { + return s.Vary } -// GetResult returns the value of Result. -func (s *MirrorRequest) GetResult() OptMirrorRequestResult { - return s.Result +// GetResponse returns the value of Response. +func (s *ListOrgsOutputBodyHeaders) GetResponse() ListOrgsOutputBody { + return s.Response } -// GetStatus returns the value of Status. -func (s *MirrorRequest) GetStatus() MirrorRequestStatus { - return s.Status -} - -// GetAdditionalProps returns the value of AdditionalProps. -func (s *MirrorRequest) GetAdditionalProps() MirrorRequestAdditional { - return s.AdditionalProps -} - -// SetSchema sets the value of Schema. -func (s *MirrorRequest) SetSchema(val OptURI) { - s.Schema = val -} - -// SetFailure sets the value of Failure. -func (s *MirrorRequest) SetFailure(val OptMirrorRequestFailure) { - s.Failure = val -} - -// SetRequestId sets the value of RequestId. -func (s *MirrorRequest) SetRequestId(val uuid.UUID) { - s.RequestId = val -} - -// SetResult sets the value of Result. -func (s *MirrorRequest) SetResult(val OptMirrorRequestResult) { - s.Result = val +// SetCacheControl sets the value of CacheControl. +func (s *ListOrgsOutputBodyHeaders) SetCacheControl(val OptString) { + s.CacheControl = val } -// SetStatus sets the value of Status. -func (s *MirrorRequest) SetStatus(val MirrorRequestStatus) { - s.Status = val +// SetETag sets the value of ETag. +func (s *ListOrgsOutputBodyHeaders) SetETag(val OptString) { + s.ETag = val } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *MirrorRequest) SetAdditionalProps(val MirrorRequestAdditional) { - s.AdditionalProps = val +// SetVary sets the value of Vary. +func (s *ListOrgsOutputBodyHeaders) SetVary(val OptString) { + s.Vary = val } -type MirrorRequestAdditional map[string]jx.Raw - -func (s *MirrorRequestAdditional) init() MirrorRequestAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// SetResponse sets the value of Response. +func (s *ListOrgsOutputBodyHeaders) SetResponse(val ListOrgsOutputBody) { + s.Response = val } -// Ref: #/components/schemas/MirrorRequestFailure -type MirrorRequestFailure struct { - // Stable machine-readable failure code. - Code string `json:"code"` - Message string `json:"message"` - // Whether submitting a new request may succeed without changing its inputs. - Retryable bool `json:"retryable"` - AdditionalProps MirrorRequestFailureAdditional +// Ref: #/components/schemas/ListProjectMembersOutputBody +type ListProjectMembersOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Members []ProjectGrant `json:"members"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + AdditionalProps ListProjectMembersOutputBodyAdditional } -// GetCode returns the value of Code. -func (s *MirrorRequestFailure) GetCode() string { - return s.Code +// GetSchema returns the value of Schema. +func (s *ListProjectMembersOutputBody) GetSchema() OptURI { + return s.Schema } -// GetMessage returns the value of Message. -func (s *MirrorRequestFailure) GetMessage() string { - return s.Message +// GetMembers returns the value of Members. +func (s *ListProjectMembersOutputBody) GetMembers() []ProjectGrant { + return s.Members } -// GetRetryable returns the value of Retryable. -func (s *MirrorRequestFailure) GetRetryable() bool { - return s.Retryable +// GetNextPageToken returns the value of NextPageToken. +func (s *ListProjectMembersOutputBody) GetNextPageToken() OptString { + return s.NextPageToken } // GetAdditionalProps returns the value of AdditionalProps. -func (s *MirrorRequestFailure) GetAdditionalProps() MirrorRequestFailureAdditional { +func (s *ListProjectMembersOutputBody) GetAdditionalProps() ListProjectMembersOutputBodyAdditional { return s.AdditionalProps } -// SetCode sets the value of Code. -func (s *MirrorRequestFailure) SetCode(val string) { - s.Code = val +// SetSchema sets the value of Schema. +func (s *ListProjectMembersOutputBody) SetSchema(val OptURI) { + s.Schema = val } -// SetMessage sets the value of Message. -func (s *MirrorRequestFailure) SetMessage(val string) { - s.Message = val +// SetMembers sets the value of Members. +func (s *ListProjectMembersOutputBody) SetMembers(val []ProjectGrant) { + s.Members = val } -// SetRetryable sets the value of Retryable. -func (s *MirrorRequestFailure) SetRetryable(val bool) { - s.Retryable = val +// SetNextPageToken sets the value of NextPageToken. +func (s *ListProjectMembersOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *MirrorRequestFailure) SetAdditionalProps(val MirrorRequestFailureAdditional) { +func (s *ListProjectMembersOutputBody) SetAdditionalProps(val ListProjectMembersOutputBodyAdditional) { s.AdditionalProps = val } -type MirrorRequestFailureAdditional map[string]jx.Raw +type ListProjectMembersOutputBodyAdditional map[string]jx.Raw -func (s *MirrorRequestFailureAdditional) init() MirrorRequestFailureAdditional { +func (s *ListProjectMembersOutputBodyAdditional) init() ListProjectMembersOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -8240,83 +8434,140 @@ func (s *MirrorRequestFailureAdditional) init() MirrorRequestFailureAdditional { return m } -// MirrorRequestHeaders wraps MirrorRequest with response headers. -type MirrorRequestHeaders struct { - Location OptString - Response MirrorRequest -} +// Exact effective role on the selected resource. +type ListProjectPeopleRole string -// GetLocation returns the value of Location. -func (s *MirrorRequestHeaders) GetLocation() OptString { - return s.Location +const ( + ListProjectPeopleRoleOwner ListProjectPeopleRole = "owner" + ListProjectPeopleRoleAdmin ListProjectPeopleRole = "admin" + ListProjectPeopleRoleMember ListProjectPeopleRole = "member" + ListProjectPeopleRoleReader ListProjectPeopleRole = "reader" + ListProjectPeopleRoleWriter ListProjectPeopleRole = "writer" + ListProjectPeopleRoleMirrorSourceAdmin ListProjectPeopleRole = "mirror_source_admin" +) + +// AllValues returns all ListProjectPeopleRole values. +func (ListProjectPeopleRole) AllValues() []ListProjectPeopleRole { + return []ListProjectPeopleRole{ + ListProjectPeopleRoleOwner, + ListProjectPeopleRoleAdmin, + ListProjectPeopleRoleMember, + ListProjectPeopleRoleReader, + ListProjectPeopleRoleWriter, + ListProjectPeopleRoleMirrorSourceAdmin, + } } -// GetResponse returns the value of Response. -func (s *MirrorRequestHeaders) GetResponse() MirrorRequest { - return s.Response +// MarshalText implements encoding.TextMarshaler. +func (s ListProjectPeopleRole) MarshalText() ([]byte, error) { + switch s { + case ListProjectPeopleRoleOwner: + return []byte(s), nil + case ListProjectPeopleRoleAdmin: + return []byte(s), nil + case ListProjectPeopleRoleMember: + return []byte(s), nil + case ListProjectPeopleRoleReader: + return []byte(s), nil + case ListProjectPeopleRoleWriter: + return []byte(s), nil + case ListProjectPeopleRoleMirrorSourceAdmin: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// SetLocation sets the value of Location. -func (s *MirrorRequestHeaders) SetLocation(val OptString) { - s.Location = val +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ListProjectPeopleRole) UnmarshalText(data []byte) error { + switch ListProjectPeopleRole(data) { + case ListProjectPeopleRoleOwner: + *s = ListProjectPeopleRoleOwner + return nil + case ListProjectPeopleRoleAdmin: + *s = ListProjectPeopleRoleAdmin + return nil + case ListProjectPeopleRoleMember: + *s = ListProjectPeopleRoleMember + return nil + case ListProjectPeopleRoleReader: + *s = ListProjectPeopleRoleReader + return nil + case ListProjectPeopleRoleWriter: + *s = ListProjectPeopleRoleWriter + return nil + case ListProjectPeopleRoleMirrorSourceAdmin: + *s = ListProjectPeopleRoleMirrorSourceAdmin + return nil + default: + return errors.Errorf("invalid value: %q", data) + } } -// SetResponse sets the value of Response. -func (s *MirrorRequestHeaders) SetResponse(val MirrorRequest) { - s.Response = val +// Ref: #/components/schemas/ListProjectReposOutputBody +type ListProjectReposOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + Repo OptRepo `json:"repo"` + Repos []Repo `json:"repos"` + AdditionalProps ListProjectReposOutputBodyAdditional } -// Ref: #/components/schemas/MirrorRequestResult -type MirrorRequestResult struct { - MirrorId string `json:"mirrorId"` - MirrorUrl string `json:"mirrorUrl"` - PublicUrl string `json:"publicUrl"` - AdditionalProps MirrorRequestResultAdditional +// GetSchema returns the value of Schema. +func (s *ListProjectReposOutputBody) GetSchema() OptURI { + return s.Schema } -// GetMirrorId returns the value of MirrorId. -func (s *MirrorRequestResult) GetMirrorId() string { - return s.MirrorId +// GetNextPageToken returns the value of NextPageToken. +func (s *ListProjectReposOutputBody) GetNextPageToken() OptString { + return s.NextPageToken } -// GetMirrorUrl returns the value of MirrorUrl. -func (s *MirrorRequestResult) GetMirrorUrl() string { - return s.MirrorUrl +// GetRepo returns the value of Repo. +func (s *ListProjectReposOutputBody) GetRepo() OptRepo { + return s.Repo } -// GetPublicUrl returns the value of PublicUrl. -func (s *MirrorRequestResult) GetPublicUrl() string { - return s.PublicUrl +// GetRepos returns the value of Repos. +func (s *ListProjectReposOutputBody) GetRepos() []Repo { + return s.Repos } // GetAdditionalProps returns the value of AdditionalProps. -func (s *MirrorRequestResult) GetAdditionalProps() MirrorRequestResultAdditional { +func (s *ListProjectReposOutputBody) GetAdditionalProps() ListProjectReposOutputBodyAdditional { return s.AdditionalProps } -// SetMirrorId sets the value of MirrorId. -func (s *MirrorRequestResult) SetMirrorId(val string) { - s.MirrorId = val +// SetSchema sets the value of Schema. +func (s *ListProjectReposOutputBody) SetSchema(val OptURI) { + s.Schema = val } -// SetMirrorUrl sets the value of MirrorUrl. -func (s *MirrorRequestResult) SetMirrorUrl(val string) { - s.MirrorUrl = val +// SetNextPageToken sets the value of NextPageToken. +func (s *ListProjectReposOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val } -// SetPublicUrl sets the value of PublicUrl. -func (s *MirrorRequestResult) SetPublicUrl(val string) { - s.PublicUrl = val +// SetRepo sets the value of Repo. +func (s *ListProjectReposOutputBody) SetRepo(val OptRepo) { + s.Repo = val +} + +// SetRepos sets the value of Repos. +func (s *ListProjectReposOutputBody) SetRepos(val []Repo) { + s.Repos = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *MirrorRequestResult) SetAdditionalProps(val MirrorRequestResultAdditional) { +func (s *ListProjectReposOutputBody) SetAdditionalProps(val ListProjectReposOutputBodyAdditional) { s.AdditionalProps = val } -type MirrorRequestResultAdditional map[string]jx.Raw +type ListProjectReposOutputBodyAdditional map[string]jx.Raw -func (s *MirrorRequestResultAdditional) init() MirrorRequestResultAdditional { +func (s *ListProjectReposOutputBodyAdditional) init() ListProjectReposOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -8325,92 +8576,148 @@ func (s *MirrorRequestResultAdditional) init() MirrorRequestResultAdditional { return m } -type MirrorRequestStatus string +// Ref: #/components/schemas/ListProjectsOutputBody +type ListProjectsOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + Project OptProject `json:"project"` + Projects []Project `json:"projects"` + AdditionalProps ListProjectsOutputBodyAdditional +} -const ( - MirrorRequestStatusPending MirrorRequestStatus = "pending" - MirrorRequestStatusProcessing MirrorRequestStatus = "processing" - MirrorRequestStatusSucceeded MirrorRequestStatus = "succeeded" - MirrorRequestStatusFailed MirrorRequestStatus = "failed" -) +// GetSchema returns the value of Schema. +func (s *ListProjectsOutputBody) GetSchema() OptURI { + return s.Schema +} -// AllValues returns all MirrorRequestStatus values. -func (MirrorRequestStatus) AllValues() []MirrorRequestStatus { - return []MirrorRequestStatus{ - MirrorRequestStatusPending, - MirrorRequestStatusProcessing, - MirrorRequestStatusSucceeded, - MirrorRequestStatusFailed, - } +// GetNextPageToken returns the value of NextPageToken. +func (s *ListProjectsOutputBody) GetNextPageToken() OptString { + return s.NextPageToken } -// MarshalText implements encoding.TextMarshaler. -func (s MirrorRequestStatus) MarshalText() ([]byte, error) { - switch s { - case MirrorRequestStatusPending: - return []byte(s), nil - case MirrorRequestStatusProcessing: - return []byte(s), nil - case MirrorRequestStatusSucceeded: - return []byte(s), nil - case MirrorRequestStatusFailed: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) +// GetProject returns the value of Project. +func (s *ListProjectsOutputBody) GetProject() OptProject { + return s.Project +} + +// GetProjects returns the value of Projects. +func (s *ListProjectsOutputBody) GetProjects() []Project { + return s.Projects +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ListProjectsOutputBody) GetAdditionalProps() ListProjectsOutputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *ListProjectsOutputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetNextPageToken sets the value of NextPageToken. +func (s *ListProjectsOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val +} + +// SetProject sets the value of Project. +func (s *ListProjectsOutputBody) SetProject(val OptProject) { + s.Project = val +} + +// SetProjects sets the value of Projects. +func (s *ListProjectsOutputBody) SetProjects(val []Project) { + s.Projects = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ListProjectsOutputBody) SetAdditionalProps(val ListProjectsOutputBodyAdditional) { + s.AdditionalProps = val +} + +type ListProjectsOutputBodyAdditional map[string]jx.Raw + +func (s *ListProjectsOutputBodyAdditional) init() ListProjectsOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m } + return m } -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *MirrorRequestStatus) UnmarshalText(data []byte) error { - switch MirrorRequestStatus(data) { - case MirrorRequestStatusPending: - *s = MirrorRequestStatusPending - return nil - case MirrorRequestStatusProcessing: - *s = MirrorRequestStatusProcessing - return nil - case MirrorRequestStatusSucceeded: - *s = MirrorRequestStatusSucceeded - return nil - case MirrorRequestStatusFailed: - *s = MirrorRequestStatusFailed - return nil - default: - return errors.Errorf("invalid value: %q", data) +// Ref: #/components/schemas/ListRepoCIBuildsOutputBody +type ListRepoCIBuildsOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Builds []CIBuildView `json:"builds"` + AdditionalProps ListRepoCIBuildsOutputBodyAdditional +} + +// GetSchema returns the value of Schema. +func (s *ListRepoCIBuildsOutputBody) GetSchema() OptURI { + return s.Schema +} + +// GetBuilds returns the value of Builds. +func (s *ListRepoCIBuildsOutputBody) GetBuilds() []CIBuildView { + return s.Builds +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ListRepoCIBuildsOutputBody) GetAdditionalProps() ListRepoCIBuildsOutputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *ListRepoCIBuildsOutputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetBuilds sets the value of Builds. +func (s *ListRepoCIBuildsOutputBody) SetBuilds(val []CIBuildView) { + s.Builds = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ListRepoCIBuildsOutputBody) SetAdditionalProps(val ListRepoCIBuildsOutputBodyAdditional) { + s.AdditionalProps = val +} + +type ListRepoCIBuildsOutputBodyAdditional map[string]jx.Raw + +func (s *ListRepoCIBuildsOutputBodyAdditional) init() ListRepoCIBuildsOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m } + return m } -// Clone lifecycle: processing (cloning), ready (clonable), failed (initial clone failed), or -// suspended. -type MirrorStatus string +type ListRepoCIDeliveriesDirection string const ( - MirrorStatusProcessing MirrorStatus = "processing" - MirrorStatusReady MirrorStatus = "ready" - MirrorStatusFailed MirrorStatus = "failed" - MirrorStatusSuspended MirrorStatus = "suspended" + ListRepoCIDeliveriesDirectionOutbound ListRepoCIDeliveriesDirection = "outbound" + ListRepoCIDeliveriesDirectionInbound ListRepoCIDeliveriesDirection = "inbound" ) -// AllValues returns all MirrorStatus values. -func (MirrorStatus) AllValues() []MirrorStatus { - return []MirrorStatus{ - MirrorStatusProcessing, - MirrorStatusReady, - MirrorStatusFailed, - MirrorStatusSuspended, +// AllValues returns all ListRepoCIDeliveriesDirection values. +func (ListRepoCIDeliveriesDirection) AllValues() []ListRepoCIDeliveriesDirection { + return []ListRepoCIDeliveriesDirection{ + ListRepoCIDeliveriesDirectionOutbound, + ListRepoCIDeliveriesDirectionInbound, } } // MarshalText implements encoding.TextMarshaler. -func (s MirrorStatus) MarshalText() ([]byte, error) { +func (s ListRepoCIDeliveriesDirection) MarshalText() ([]byte, error) { switch s { - case MirrorStatusProcessing: - return []byte(s), nil - case MirrorStatusReady: + case ListRepoCIDeliveriesDirectionOutbound: return []byte(s), nil - case MirrorStatusFailed: - return []byte(s), nil - case MirrorStatusSuspended: + case ListRepoCIDeliveriesDirectionInbound: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) @@ -8418,165 +8725,207 @@ func (s MirrorStatus) MarshalText() ([]byte, error) { } // UnmarshalText implements encoding.TextUnmarshaler. -func (s *MirrorStatus) UnmarshalText(data []byte) error { - switch MirrorStatus(data) { - case MirrorStatusProcessing: - *s = MirrorStatusProcessing - return nil - case MirrorStatusReady: - *s = MirrorStatusReady - return nil - case MirrorStatusFailed: - *s = MirrorStatusFailed +func (s *ListRepoCIDeliveriesDirection) UnmarshalText(data []byte) error { + switch ListRepoCIDeliveriesDirection(data) { + case ListRepoCIDeliveriesDirectionOutbound: + *s = ListRepoCIDeliveriesDirectionOutbound return nil - case MirrorStatusSuspended: - *s = MirrorStatusSuspended + case ListRepoCIDeliveriesDirectionInbound: + *s = ListRepoCIDeliveriesDirectionInbound return nil default: return errors.Errorf("invalid value: %q", data) } } -// Ref: #/components/schemas/NativeMirrorPlacement -type NativeMirrorPlacement struct { +// Ref: #/components/schemas/ListRepoCIDeliveriesOutputBody +type ListRepoCIDeliveriesOutputBody struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Attempts int64 `json:"attempts"` - ClusterSlug string `json:"clusterSlug"` - CreatedAt time.Time `json:"createdAt"` - CreationFailedAt OptDateTime `json:"creationFailedAt"` - DesiredState NativeMirrorPlacementDesiredState `json:"desiredState"` - LastError OptString `json:"lastError"` - NextRetryAt OptDateTime `json:"nextRetryAt"` - PlacementId string `json:"placementId"` - Stage NativeMirrorPlacementStage `json:"stage"` - Status NativeMirrorPlacementStatus `json:"status"` - AdditionalProps NativeMirrorPlacementAdditional + Schema OptURI `json:"$schema"` + Deliveries []CIDeliveryView `json:"deliveries"` + AdditionalProps ListRepoCIDeliveriesOutputBodyAdditional } // GetSchema returns the value of Schema. -func (s *NativeMirrorPlacement) GetSchema() OptURI { +func (s *ListRepoCIDeliveriesOutputBody) GetSchema() OptURI { return s.Schema } -// GetAttempts returns the value of Attempts. -func (s *NativeMirrorPlacement) GetAttempts() int64 { - return s.Attempts +// GetDeliveries returns the value of Deliveries. +func (s *ListRepoCIDeliveriesOutputBody) GetDeliveries() []CIDeliveryView { + return s.Deliveries } -// GetClusterSlug returns the value of ClusterSlug. -func (s *NativeMirrorPlacement) GetClusterSlug() string { - return s.ClusterSlug +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ListRepoCIDeliveriesOutputBody) GetAdditionalProps() ListRepoCIDeliveriesOutputBodyAdditional { + return s.AdditionalProps } -// GetCreatedAt returns the value of CreatedAt. -func (s *NativeMirrorPlacement) GetCreatedAt() time.Time { - return s.CreatedAt +// SetSchema sets the value of Schema. +func (s *ListRepoCIDeliveriesOutputBody) SetSchema(val OptURI) { + s.Schema = val } -// GetCreationFailedAt returns the value of CreationFailedAt. -func (s *NativeMirrorPlacement) GetCreationFailedAt() OptDateTime { - return s.CreationFailedAt +// SetDeliveries sets the value of Deliveries. +func (s *ListRepoCIDeliveriesOutputBody) SetDeliveries(val []CIDeliveryView) { + s.Deliveries = val } -// GetDesiredState returns the value of DesiredState. -func (s *NativeMirrorPlacement) GetDesiredState() NativeMirrorPlacementDesiredState { - return s.DesiredState +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ListRepoCIDeliveriesOutputBody) SetAdditionalProps(val ListRepoCIDeliveriesOutputBodyAdditional) { + s.AdditionalProps = val } -// GetLastError returns the value of LastError. -func (s *NativeMirrorPlacement) GetLastError() OptString { - return s.LastError -} +type ListRepoCIDeliveriesOutputBodyAdditional map[string]jx.Raw -// GetNextRetryAt returns the value of NextRetryAt. -func (s *NativeMirrorPlacement) GetNextRetryAt() OptDateTime { - return s.NextRetryAt +func (s *ListRepoCIDeliveriesOutputBodyAdditional) init() ListRepoCIDeliveriesOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m } -// GetPlacementId returns the value of PlacementId. -func (s *NativeMirrorPlacement) GetPlacementId() string { - return s.PlacementId +// Ref: #/components/schemas/ListRepoCIProvidersOutputBody +type ListRepoCIProvidersOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Providers []CIProviderDescriptor `json:"providers"` + AdditionalProps ListRepoCIProvidersOutputBodyAdditional } -// GetStage returns the value of Stage. -func (s *NativeMirrorPlacement) GetStage() NativeMirrorPlacementStage { - return s.Stage +// GetSchema returns the value of Schema. +func (s *ListRepoCIProvidersOutputBody) GetSchema() OptURI { + return s.Schema } -// GetStatus returns the value of Status. -func (s *NativeMirrorPlacement) GetStatus() NativeMirrorPlacementStatus { - return s.Status +// GetProviders returns the value of Providers. +func (s *ListRepoCIProvidersOutputBody) GetProviders() []CIProviderDescriptor { + return s.Providers } // GetAdditionalProps returns the value of AdditionalProps. -func (s *NativeMirrorPlacement) GetAdditionalProps() NativeMirrorPlacementAdditional { +func (s *ListRepoCIProvidersOutputBody) GetAdditionalProps() ListRepoCIProvidersOutputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *NativeMirrorPlacement) SetSchema(val OptURI) { +func (s *ListRepoCIProvidersOutputBody) SetSchema(val OptURI) { s.Schema = val } -// SetAttempts sets the value of Attempts. -func (s *NativeMirrorPlacement) SetAttempts(val int64) { - s.Attempts = val +// SetProviders sets the value of Providers. +func (s *ListRepoCIProvidersOutputBody) SetProviders(val []CIProviderDescriptor) { + s.Providers = val } -// SetClusterSlug sets the value of ClusterSlug. -func (s *NativeMirrorPlacement) SetClusterSlug(val string) { - s.ClusterSlug = val +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ListRepoCIProvidersOutputBody) SetAdditionalProps(val ListRepoCIProvidersOutputBodyAdditional) { + s.AdditionalProps = val } -// SetCreatedAt sets the value of CreatedAt. -func (s *NativeMirrorPlacement) SetCreatedAt(val time.Time) { - s.CreatedAt = val +type ListRepoCIProvidersOutputBodyAdditional map[string]jx.Raw + +func (s *ListRepoCIProvidersOutputBodyAdditional) init() ListRepoCIProvidersOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m } -// SetCreationFailedAt sets the value of CreationFailedAt. -func (s *NativeMirrorPlacement) SetCreationFailedAt(val OptDateTime) { - s.CreationFailedAt = val +// Ref: #/components/schemas/ListRepoCIWebhookAuditOutputBody +type ListRepoCIWebhookAuditOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Events []CIWebhookAuditEventView `json:"events"` + AdditionalProps ListRepoCIWebhookAuditOutputBodyAdditional } -// SetDesiredState sets the value of DesiredState. -func (s *NativeMirrorPlacement) SetDesiredState(val NativeMirrorPlacementDesiredState) { - s.DesiredState = val +// GetSchema returns the value of Schema. +func (s *ListRepoCIWebhookAuditOutputBody) GetSchema() OptURI { + return s.Schema } -// SetLastError sets the value of LastError. -func (s *NativeMirrorPlacement) SetLastError(val OptString) { - s.LastError = val +// GetEvents returns the value of Events. +func (s *ListRepoCIWebhookAuditOutputBody) GetEvents() []CIWebhookAuditEventView { + return s.Events } -// SetNextRetryAt sets the value of NextRetryAt. -func (s *NativeMirrorPlacement) SetNextRetryAt(val OptDateTime) { - s.NextRetryAt = val +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ListRepoCIWebhookAuditOutputBody) GetAdditionalProps() ListRepoCIWebhookAuditOutputBodyAdditional { + return s.AdditionalProps } -// SetPlacementId sets the value of PlacementId. -func (s *NativeMirrorPlacement) SetPlacementId(val string) { - s.PlacementId = val +// SetSchema sets the value of Schema. +func (s *ListRepoCIWebhookAuditOutputBody) SetSchema(val OptURI) { + s.Schema = val } -// SetStage sets the value of Stage. -func (s *NativeMirrorPlacement) SetStage(val NativeMirrorPlacementStage) { - s.Stage = val +// SetEvents sets the value of Events. +func (s *ListRepoCIWebhookAuditOutputBody) SetEvents(val []CIWebhookAuditEventView) { + s.Events = val } -// SetStatus sets the value of Status. -func (s *NativeMirrorPlacement) SetStatus(val NativeMirrorPlacementStatus) { - s.Status = val +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ListRepoCIWebhookAuditOutputBody) SetAdditionalProps(val ListRepoCIWebhookAuditOutputBodyAdditional) { + s.AdditionalProps = val +} + +type ListRepoCIWebhookAuditOutputBodyAdditional map[string]jx.Raw + +func (s *ListRepoCIWebhookAuditOutputBodyAdditional) init() ListRepoCIWebhookAuditOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/ListRepoCIWebhooksOutputBody +type ListRepoCIWebhooksOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Subscriptions []CIWebhookView `json:"subscriptions"` + AdditionalProps ListRepoCIWebhooksOutputBodyAdditional +} + +// GetSchema returns the value of Schema. +func (s *ListRepoCIWebhooksOutputBody) GetSchema() OptURI { + return s.Schema +} + +// GetSubscriptions returns the value of Subscriptions. +func (s *ListRepoCIWebhooksOutputBody) GetSubscriptions() []CIWebhookView { + return s.Subscriptions +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ListRepoCIWebhooksOutputBody) GetAdditionalProps() ListRepoCIWebhooksOutputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *ListRepoCIWebhooksOutputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetSubscriptions sets the value of Subscriptions. +func (s *ListRepoCIWebhooksOutputBody) SetSubscriptions(val []CIWebhookView) { + s.Subscriptions = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *NativeMirrorPlacement) SetAdditionalProps(val NativeMirrorPlacementAdditional) { +func (s *ListRepoCIWebhooksOutputBody) SetAdditionalProps(val ListRepoCIWebhooksOutputBodyAdditional) { s.AdditionalProps = val } -type NativeMirrorPlacementAdditional map[string]jx.Raw +type ListRepoCIWebhooksOutputBodyAdditional map[string]jx.Raw -func (s *NativeMirrorPlacementAdditional) init() NativeMirrorPlacementAdditional { +func (s *ListRepoCIWebhooksOutputBodyAdditional) init() ListRepoCIWebhooksOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -8585,27 +8934,166 @@ func (s *NativeMirrorPlacementAdditional) init() NativeMirrorPlacementAdditional return m } -type NativeMirrorPlacementDesiredState string +// Ref: #/components/schemas/ListRepoCollaboratorsOutputBody +type ListRepoCollaboratorsOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Collaborators []RepoCollaborator `json:"collaborators"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + AdditionalProps ListRepoCollaboratorsOutputBodyAdditional +} + +// GetSchema returns the value of Schema. +func (s *ListRepoCollaboratorsOutputBody) GetSchema() OptURI { + return s.Schema +} + +// GetCollaborators returns the value of Collaborators. +func (s *ListRepoCollaboratorsOutputBody) GetCollaborators() []RepoCollaborator { + return s.Collaborators +} + +// GetNextPageToken returns the value of NextPageToken. +func (s *ListRepoCollaboratorsOutputBody) GetNextPageToken() OptString { + return s.NextPageToken +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ListRepoCollaboratorsOutputBody) GetAdditionalProps() ListRepoCollaboratorsOutputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *ListRepoCollaboratorsOutputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetCollaborators sets the value of Collaborators. +func (s *ListRepoCollaboratorsOutputBody) SetCollaborators(val []RepoCollaborator) { + s.Collaborators = val +} + +// SetNextPageToken sets the value of NextPageToken. +func (s *ListRepoCollaboratorsOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ListRepoCollaboratorsOutputBody) SetAdditionalProps(val ListRepoCollaboratorsOutputBodyAdditional) { + s.AdditionalProps = val +} + +type ListRepoCollaboratorsOutputBodyAdditional map[string]jx.Raw + +func (s *ListRepoCollaboratorsOutputBodyAdditional) init() ListRepoCollaboratorsOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/ListRepoGrantsOutputBody +type ListRepoGrantsOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Grants []RepoGrant `json:"grants"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + AdditionalProps ListRepoGrantsOutputBodyAdditional +} + +// GetSchema returns the value of Schema. +func (s *ListRepoGrantsOutputBody) GetSchema() OptURI { + return s.Schema +} + +// GetGrants returns the value of Grants. +func (s *ListRepoGrantsOutputBody) GetGrants() []RepoGrant { + return s.Grants +} + +// GetNextPageToken returns the value of NextPageToken. +func (s *ListRepoGrantsOutputBody) GetNextPageToken() OptString { + return s.NextPageToken +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ListRepoGrantsOutputBody) GetAdditionalProps() ListRepoGrantsOutputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *ListRepoGrantsOutputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetGrants sets the value of Grants. +func (s *ListRepoGrantsOutputBody) SetGrants(val []RepoGrant) { + s.Grants = val +} + +// SetNextPageToken sets the value of NextPageToken. +func (s *ListRepoGrantsOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ListRepoGrantsOutputBody) SetAdditionalProps(val ListRepoGrantsOutputBodyAdditional) { + s.AdditionalProps = val +} + +type ListRepoGrantsOutputBodyAdditional map[string]jx.Raw + +func (s *ListRepoGrantsOutputBodyAdditional) init() ListRepoGrantsOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Exact effective role on the selected resource. +type ListRepoPeopleRole string const ( - NativeMirrorPlacementDesiredStateActive NativeMirrorPlacementDesiredState = "active" - NativeMirrorPlacementDesiredStateDeleted NativeMirrorPlacementDesiredState = "deleted" + ListRepoPeopleRoleOwner ListRepoPeopleRole = "owner" + ListRepoPeopleRoleAdmin ListRepoPeopleRole = "admin" + ListRepoPeopleRoleMember ListRepoPeopleRole = "member" + ListRepoPeopleRoleReader ListRepoPeopleRole = "reader" + ListRepoPeopleRoleWriter ListRepoPeopleRole = "writer" + ListRepoPeopleRoleMirrorSourceAdmin ListRepoPeopleRole = "mirror_source_admin" ) -// AllValues returns all NativeMirrorPlacementDesiredState values. -func (NativeMirrorPlacementDesiredState) AllValues() []NativeMirrorPlacementDesiredState { - return []NativeMirrorPlacementDesiredState{ - NativeMirrorPlacementDesiredStateActive, - NativeMirrorPlacementDesiredStateDeleted, +// AllValues returns all ListRepoPeopleRole values. +func (ListRepoPeopleRole) AllValues() []ListRepoPeopleRole { + return []ListRepoPeopleRole{ + ListRepoPeopleRoleOwner, + ListRepoPeopleRoleAdmin, + ListRepoPeopleRoleMember, + ListRepoPeopleRoleReader, + ListRepoPeopleRoleWriter, + ListRepoPeopleRoleMirrorSourceAdmin, } } // MarshalText implements encoding.TextMarshaler. -func (s NativeMirrorPlacementDesiredState) MarshalText() ([]byte, error) { +func (s ListRepoPeopleRole) MarshalText() ([]byte, error) { switch s { - case NativeMirrorPlacementDesiredStateActive: + case ListRepoPeopleRoleOwner: return []byte(s), nil - case NativeMirrorPlacementDesiredStateDeleted: + case ListRepoPeopleRoleAdmin: + return []byte(s), nil + case ListRepoPeopleRoleMember: + return []byte(s), nil + case ListRepoPeopleRoleReader: + return []byte(s), nil + case ListRepoPeopleRoleWriter: + return []byte(s), nil + case ListRepoPeopleRoleMirrorSourceAdmin: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) @@ -8613,238 +9101,3029 @@ func (s NativeMirrorPlacementDesiredState) MarshalText() ([]byte, error) { } // UnmarshalText implements encoding.TextUnmarshaler. -func (s *NativeMirrorPlacementDesiredState) UnmarshalText(data []byte) error { - switch NativeMirrorPlacementDesiredState(data) { - case NativeMirrorPlacementDesiredStateActive: - *s = NativeMirrorPlacementDesiredStateActive +func (s *ListRepoPeopleRole) UnmarshalText(data []byte) error { + switch ListRepoPeopleRole(data) { + case ListRepoPeopleRoleOwner: + *s = ListRepoPeopleRoleOwner return nil - case NativeMirrorPlacementDesiredStateDeleted: - *s = NativeMirrorPlacementDesiredStateDeleted + case ListRepoPeopleRoleAdmin: + *s = ListRepoPeopleRoleAdmin + return nil + case ListRepoPeopleRoleMember: + *s = ListRepoPeopleRoleMember + return nil + case ListRepoPeopleRoleReader: + *s = ListRepoPeopleRoleReader + return nil + case ListRepoPeopleRoleWriter: + *s = ListRepoPeopleRoleWriter + return nil + case ListRepoPeopleRoleMirrorSourceAdmin: + *s = ListRepoPeopleRoleMirrorSourceAdmin return nil default: return errors.Errorf("invalid value: %q", data) } } -type NativeMirrorPlacementStage string +// Filter on repo_facts.archived. +type ListReposArchived string const ( - NativeMirrorPlacementStagePending NativeMirrorPlacementStage = "pending" - NativeMirrorPlacementStageProvisioned NativeMirrorPlacementStage = "provisioned" - NativeMirrorPlacementStageRegistered NativeMirrorPlacementStage = "registered" - NativeMirrorPlacementStageSeeded NativeMirrorPlacementStage = "seeded" - NativeMirrorPlacementStageAnnounced NativeMirrorPlacementStage = "announced" + ListReposArchivedTrue ListReposArchived = "true" + ListReposArchivedFalse ListReposArchived = "false" ) -// AllValues returns all NativeMirrorPlacementStage values. -func (NativeMirrorPlacementStage) AllValues() []NativeMirrorPlacementStage { - return []NativeMirrorPlacementStage{ - NativeMirrorPlacementStagePending, - NativeMirrorPlacementStageProvisioned, - NativeMirrorPlacementStageRegistered, - NativeMirrorPlacementStageSeeded, - NativeMirrorPlacementStageAnnounced, +// AllValues returns all ListReposArchived values. +func (ListReposArchived) AllValues() []ListReposArchived { + return []ListReposArchived{ + ListReposArchivedTrue, + ListReposArchivedFalse, } } // MarshalText implements encoding.TextMarshaler. -func (s NativeMirrorPlacementStage) MarshalText() ([]byte, error) { +func (s ListReposArchived) MarshalText() ([]byte, error) { switch s { - case NativeMirrorPlacementStagePending: + case ListReposArchivedTrue: return []byte(s), nil - case NativeMirrorPlacementStageProvisioned: + case ListReposArchivedFalse: return []byte(s), nil - case NativeMirrorPlacementStageRegistered: + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ListReposArchived) UnmarshalText(data []byte) error { + switch ListReposArchived(data) { + case ListReposArchivedTrue: + *s = ListReposArchivedTrue + return nil + case ListReposArchivedFalse: + *s = ListReposArchivedFalse + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// True: repo_facts.checkpoint_count > 0; false: no checkpoints (0 or unobserved). +type ListReposHasCheckpoints string + +const ( + ListReposHasCheckpointsTrue ListReposHasCheckpoints = "true" + ListReposHasCheckpointsFalse ListReposHasCheckpoints = "false" +) + +// AllValues returns all ListReposHasCheckpoints values. +func (ListReposHasCheckpoints) AllValues() []ListReposHasCheckpoints { + return []ListReposHasCheckpoints{ + ListReposHasCheckpointsTrue, + ListReposHasCheckpointsFalse, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s ListReposHasCheckpoints) MarshalText() ([]byte, error) { + switch s { + case ListReposHasCheckpointsTrue: return []byte(s), nil - case NativeMirrorPlacementStageSeeded: + case ListReposHasCheckpointsFalse: return []byte(s), nil - case NativeMirrorPlacementStageAnnounced: + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ListReposHasCheckpoints) UnmarshalText(data []byte) error { + switch ListReposHasCheckpoints(data) { + case ListReposHasCheckpointsTrue: + *s = ListReposHasCheckpointsTrue + return nil + case ListReposHasCheckpointsFalse: + *s = ListReposHasCheckpointsFalse + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// Direction for a single bare sort key; defaults to asc. Ignored when sort carries per-key +// :asc/:desc suffixes. Encoded into the cursor (authoritative on continuation). +type ListReposOrder string + +const ( + ListReposOrderAsc ListReposOrder = "asc" + ListReposOrderDesc ListReposOrder = "desc" +) + +// AllValues returns all ListReposOrder values. +func (ListReposOrder) AllValues() []ListReposOrder { + return []ListReposOrder{ + ListReposOrderAsc, + ListReposOrderDesc, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s ListReposOrder) MarshalText() ([]byte, error) { + switch s { + case ListReposOrderAsc: + return []byte(s), nil + case ListReposOrderDesc: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ListReposOrder) UnmarshalText(data []byte) error { + switch ListReposOrder(data) { + case ListReposOrderAsc: + *s = ListReposOrderAsc + return nil + case ListReposOrderDesc: + *s = ListReposOrderDesc + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// Ref: #/components/schemas/ListReposOutputBody +type ListReposOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + CandidatesIncomplete OptBool `json:"candidatesIncomplete"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + Repos []RepoIndexEntry `json:"repos"` + Truncated bool `json:"truncated"` + AdditionalProps ListReposOutputBodyAdditional +} + +// GetSchema returns the value of Schema. +func (s *ListReposOutputBody) GetSchema() OptURI { + return s.Schema +} + +// GetCandidatesIncomplete returns the value of CandidatesIncomplete. +func (s *ListReposOutputBody) GetCandidatesIncomplete() OptBool { + return s.CandidatesIncomplete +} + +// GetNextPageToken returns the value of NextPageToken. +func (s *ListReposOutputBody) GetNextPageToken() OptString { + return s.NextPageToken +} + +// GetRepos returns the value of Repos. +func (s *ListReposOutputBody) GetRepos() []RepoIndexEntry { + return s.Repos +} + +// GetTruncated returns the value of Truncated. +func (s *ListReposOutputBody) GetTruncated() bool { + return s.Truncated +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ListReposOutputBody) GetAdditionalProps() ListReposOutputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *ListReposOutputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetCandidatesIncomplete sets the value of CandidatesIncomplete. +func (s *ListReposOutputBody) SetCandidatesIncomplete(val OptBool) { + s.CandidatesIncomplete = val +} + +// SetNextPageToken sets the value of NextPageToken. +func (s *ListReposOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val +} + +// SetRepos sets the value of Repos. +func (s *ListReposOutputBody) SetRepos(val []RepoIndexEntry) { + s.Repos = val +} + +// SetTruncated sets the value of Truncated. +func (s *ListReposOutputBody) SetTruncated(val bool) { + s.Truncated = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ListReposOutputBody) SetAdditionalProps(val ListReposOutputBodyAdditional) { + s.AdditionalProps = val +} + +type ListReposOutputBodyAdditional map[string]jx.Raw + +func (s *ListReposOutputBodyAdditional) init() ListReposOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Minimum caller access tier: read (all), write (write+admin), or admin. Also accepts permission[eq]; +// +// permission[ne] is rejected. +type ListReposPermission string + +const ( + ListReposPermissionRead ListReposPermission = "read" + ListReposPermissionWrite ListReposPermission = "write" + ListReposPermissionAdmin ListReposPermission = "admin" +) + +// AllValues returns all ListReposPermission values. +func (ListReposPermission) AllValues() []ListReposPermission { + return []ListReposPermission{ + ListReposPermissionRead, + ListReposPermissionWrite, + ListReposPermissionAdmin, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s ListReposPermission) MarshalText() ([]byte, error) { + switch s { + case ListReposPermissionRead: + return []byte(s), nil + case ListReposPermissionWrite: + return []byte(s), nil + case ListReposPermissionAdmin: return []byte(s), nil default: return nil, errors.Errorf("invalid value: %q", s) } } -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *NativeMirrorPlacementStage) UnmarshalText(data []byte) error { - switch NativeMirrorPlacementStage(data) { - case NativeMirrorPlacementStagePending: - *s = NativeMirrorPlacementStagePending - return nil - case NativeMirrorPlacementStageProvisioned: - *s = NativeMirrorPlacementStageProvisioned - return nil - case NativeMirrorPlacementStageRegistered: - *s = NativeMirrorPlacementStageRegistered - return nil - case NativeMirrorPlacementStageSeeded: - *s = NativeMirrorPlacementStageSeeded - return nil - case NativeMirrorPlacementStageAnnounced: - *s = NativeMirrorPlacementStageAnnounced - return nil - default: - return errors.Errorf("invalid value: %q", data) +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ListReposPermission) UnmarshalText(data []byte) error { + switch ListReposPermission(data) { + case ListReposPermissionRead: + *s = ListReposPermissionRead + return nil + case ListReposPermissionWrite: + *s = ListReposPermissionWrite + return nil + case ListReposPermissionAdmin: + *s = ListReposPermissionAdmin + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// Onboarded (default): repos in Entire; all: also include onboardable GitHub candidates. +type ListReposScope string + +const ( + ListReposScopeOnboarded ListReposScope = "onboarded" + ListReposScopeAll ListReposScope = "all" +) + +// AllValues returns all ListReposScope values. +func (ListReposScope) AllValues() []ListReposScope { + return []ListReposScope{ + ListReposScopeOnboarded, + ListReposScopeAll, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s ListReposScope) MarshalText() ([]byte, error) { + switch s { + case ListReposScopeOnboarded: + return []byte(s), nil + case ListReposScopeAll: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ListReposScope) UnmarshalText(data []byte) error { + switch ListReposScope(data) { + case ListReposScopeOnboarded: + *s = ListReposScopeOnboarded + return nil + case ListReposScopeAll: + *s = ListReposScopeAll + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// Filter on placement/candidacy lifecycle. inactive requires scope=all. Also accepts +// status[eq]/status[ne]. +type ListReposStatus string + +const ( + ListReposStatusMirrored ListReposStatus = "mirrored" + ListReposStatusProcessing ListReposStatus = "processing" + ListReposStatusInactive ListReposStatus = "inactive" +) + +// AllValues returns all ListReposStatus values. +func (ListReposStatus) AllValues() []ListReposStatus { + return []ListReposStatus{ + ListReposStatusMirrored, + ListReposStatusProcessing, + ListReposStatusInactive, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s ListReposStatus) MarshalText() ([]byte, error) { + switch s { + case ListReposStatusMirrored: + return []byte(s), nil + case ListReposStatusProcessing: + return []byte(s), nil + case ListReposStatusInactive: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ListReposStatus) UnmarshalText(data []byte) error { + switch ListReposStatus(data) { + case ListReposStatusMirrored: + *s = ListReposStatusMirrored + return nil + case ListReposStatusProcessing: + *s = ListReposStatusProcessing + return nil + case ListReposStatusInactive: + *s = ListReposStatusInactive + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// Filter on the observed repo_facts.private fact (public: private=false; private: private=true). +// Also accepts visibility[eq]/visibility[ne]. +type ListReposVisibility string + +const ( + ListReposVisibilityPublic ListReposVisibility = "public" + ListReposVisibilityPrivate ListReposVisibility = "private" +) + +// AllValues returns all ListReposVisibility values. +func (ListReposVisibility) AllValues() []ListReposVisibility { + return []ListReposVisibility{ + ListReposVisibilityPublic, + ListReposVisibilityPrivate, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s ListReposVisibility) MarshalText() ([]byte, error) { + switch s { + case ListReposVisibilityPublic: + return []byte(s), nil + case ListReposVisibilityPrivate: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ListReposVisibility) UnmarshalText(data []byte) error { + switch ListReposVisibility(data) { + case ListReposVisibilityPublic: + *s = ListReposVisibilityPublic + return nil + case ListReposVisibilityPrivate: + *s = ListReposVisibilityPrivate + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// Ref: #/components/schemas/ListServiceAccountGrantsOutputBody +type ListServiceAccountGrantsOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Grants []ServiceAccountGrant `json:"grants"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + AdditionalProps ListServiceAccountGrantsOutputBodyAdditional +} + +// GetSchema returns the value of Schema. +func (s *ListServiceAccountGrantsOutputBody) GetSchema() OptURI { + return s.Schema +} + +// GetGrants returns the value of Grants. +func (s *ListServiceAccountGrantsOutputBody) GetGrants() []ServiceAccountGrant { + return s.Grants +} + +// GetNextPageToken returns the value of NextPageToken. +func (s *ListServiceAccountGrantsOutputBody) GetNextPageToken() OptString { + return s.NextPageToken +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ListServiceAccountGrantsOutputBody) GetAdditionalProps() ListServiceAccountGrantsOutputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *ListServiceAccountGrantsOutputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetGrants sets the value of Grants. +func (s *ListServiceAccountGrantsOutputBody) SetGrants(val []ServiceAccountGrant) { + s.Grants = val +} + +// SetNextPageToken sets the value of NextPageToken. +func (s *ListServiceAccountGrantsOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ListServiceAccountGrantsOutputBody) SetAdditionalProps(val ListServiceAccountGrantsOutputBodyAdditional) { + s.AdditionalProps = val +} + +type ListServiceAccountGrantsOutputBodyAdditional map[string]jx.Raw + +func (s *ListServiceAccountGrantsOutputBodyAdditional) init() ListServiceAccountGrantsOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/ListServiceAccountsOutputBody +type ListServiceAccountsOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + ServiceAccounts []ServiceAccountWithGrants `json:"serviceAccounts"` + AdditionalProps ListServiceAccountsOutputBodyAdditional +} + +// GetSchema returns the value of Schema. +func (s *ListServiceAccountsOutputBody) GetSchema() OptURI { + return s.Schema +} + +// GetNextPageToken returns the value of NextPageToken. +func (s *ListServiceAccountsOutputBody) GetNextPageToken() OptString { + return s.NextPageToken +} + +// GetServiceAccounts returns the value of ServiceAccounts. +func (s *ListServiceAccountsOutputBody) GetServiceAccounts() []ServiceAccountWithGrants { + return s.ServiceAccounts +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ListServiceAccountsOutputBody) GetAdditionalProps() ListServiceAccountsOutputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *ListServiceAccountsOutputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetNextPageToken sets the value of NextPageToken. +func (s *ListServiceAccountsOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val +} + +// SetServiceAccounts sets the value of ServiceAccounts. +func (s *ListServiceAccountsOutputBody) SetServiceAccounts(val []ServiceAccountWithGrants) { + s.ServiceAccounts = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ListServiceAccountsOutputBody) SetAdditionalProps(val ListServiceAccountsOutputBodyAdditional) { + s.AdditionalProps = val +} + +type ListServiceAccountsOutputBodyAdditional map[string]jx.Raw + +func (s *ListServiceAccountsOutputBodyAdditional) init() ListServiceAccountsOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/LookupBySlugOutputBody +type LookupBySlugOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Cell string `json:"cell"` + Jurisdiction string `json:"jurisdiction"` + Owner string `json:"owner"` + Repo string `json:"repo"` + RepoId string `json:"repoId"` + AdditionalProps LookupBySlugOutputBodyAdditional +} + +// GetSchema returns the value of Schema. +func (s *LookupBySlugOutputBody) GetSchema() OptURI { + return s.Schema +} + +// GetCell returns the value of Cell. +func (s *LookupBySlugOutputBody) GetCell() string { + return s.Cell +} + +// GetJurisdiction returns the value of Jurisdiction. +func (s *LookupBySlugOutputBody) GetJurisdiction() string { + return s.Jurisdiction +} + +// GetOwner returns the value of Owner. +func (s *LookupBySlugOutputBody) GetOwner() string { + return s.Owner +} + +// GetRepo returns the value of Repo. +func (s *LookupBySlugOutputBody) GetRepo() string { + return s.Repo +} + +// GetRepoId returns the value of RepoId. +func (s *LookupBySlugOutputBody) GetRepoId() string { + return s.RepoId +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *LookupBySlugOutputBody) GetAdditionalProps() LookupBySlugOutputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *LookupBySlugOutputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetCell sets the value of Cell. +func (s *LookupBySlugOutputBody) SetCell(val string) { + s.Cell = val +} + +// SetJurisdiction sets the value of Jurisdiction. +func (s *LookupBySlugOutputBody) SetJurisdiction(val string) { + s.Jurisdiction = val +} + +// SetOwner sets the value of Owner. +func (s *LookupBySlugOutputBody) SetOwner(val string) { + s.Owner = val +} + +// SetRepo sets the value of Repo. +func (s *LookupBySlugOutputBody) SetRepo(val string) { + s.Repo = val +} + +// SetRepoId sets the value of RepoId. +func (s *LookupBySlugOutputBody) SetRepoId(val string) { + s.RepoId = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *LookupBySlugOutputBody) SetAdditionalProps(val LookupBySlugOutputBodyAdditional) { + s.AdditionalProps = val +} + +type LookupBySlugOutputBodyAdditional map[string]jx.Raw + +func (s *LookupBySlugOutputBodyAdditional) init() LookupBySlugOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/MeAuth +type MeAuth struct { + Provider string `json:"provider"` + ProviderUserId string `json:"providerUserId"` + AdditionalProps MeAuthAdditional +} + +// GetProvider returns the value of Provider. +func (s *MeAuth) GetProvider() string { + return s.Provider +} + +// GetProviderUserId returns the value of ProviderUserId. +func (s *MeAuth) GetProviderUserId() string { + return s.ProviderUserId +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *MeAuth) GetAdditionalProps() MeAuthAdditional { + return s.AdditionalProps +} + +// SetProvider sets the value of Provider. +func (s *MeAuth) SetProvider(val string) { + s.Provider = val +} + +// SetProviderUserId sets the value of ProviderUserId. +func (s *MeAuth) SetProviderUserId(val string) { + s.ProviderUserId = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *MeAuth) SetAdditionalProps(val MeAuthAdditional) { + s.AdditionalProps = val +} + +type MeAuthAdditional map[string]jx.Raw + +func (s *MeAuthAdditional) init() MeAuthAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/MeDeletion +type MeDeletion struct { + // When the cooldown elapses and the account becomes eligible for irreversible hard-deletion. + CooldownEndsAt time.Time `json:"cooldownEndsAt"` + // When deletion was requested (deletion_requested_at). + RequestedAt time.Time `json:"requestedAt"` + AdditionalProps MeDeletionAdditional +} + +// GetCooldownEndsAt returns the value of CooldownEndsAt. +func (s *MeDeletion) GetCooldownEndsAt() time.Time { + return s.CooldownEndsAt +} + +// GetRequestedAt returns the value of RequestedAt. +func (s *MeDeletion) GetRequestedAt() time.Time { + return s.RequestedAt +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *MeDeletion) GetAdditionalProps() MeDeletionAdditional { + return s.AdditionalProps +} + +// SetCooldownEndsAt sets the value of CooldownEndsAt. +func (s *MeDeletion) SetCooldownEndsAt(val time.Time) { + s.CooldownEndsAt = val +} + +// SetRequestedAt sets the value of RequestedAt. +func (s *MeDeletion) SetRequestedAt(val time.Time) { + s.RequestedAt = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *MeDeletion) SetAdditionalProps(val MeDeletionAdditional) { + s.AdditionalProps = val +} + +type MeDeletionAdditional map[string]jx.Raw + +func (s *MeDeletionAdditional) init() MeDeletionAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/MeGlobal +type MeGlobal struct { + AccountId string `json:"accountId"` + AvatarUrl OptString `json:"avatarUrl"` + // When the account was created (accounts.created_at). + CreatedAt time.Time `json:"createdAt"` + Handle OptString `json:"handle"` + Handles []MeIdentityHandle `json:"handles"` + HomeJurisdiction OptString `json:"homeJurisdiction"` + AdditionalProps MeGlobalAdditional +} + +// GetAccountId returns the value of AccountId. +func (s *MeGlobal) GetAccountId() string { + return s.AccountId +} + +// GetAvatarUrl returns the value of AvatarUrl. +func (s *MeGlobal) GetAvatarUrl() OptString { + return s.AvatarUrl +} + +// GetCreatedAt returns the value of CreatedAt. +func (s *MeGlobal) GetCreatedAt() time.Time { + return s.CreatedAt +} + +// GetHandle returns the value of Handle. +func (s *MeGlobal) GetHandle() OptString { + return s.Handle +} + +// GetHandles returns the value of Handles. +func (s *MeGlobal) GetHandles() []MeIdentityHandle { + return s.Handles +} + +// GetHomeJurisdiction returns the value of HomeJurisdiction. +func (s *MeGlobal) GetHomeJurisdiction() OptString { + return s.HomeJurisdiction +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *MeGlobal) GetAdditionalProps() MeGlobalAdditional { + return s.AdditionalProps +} + +// SetAccountId sets the value of AccountId. +func (s *MeGlobal) SetAccountId(val string) { + s.AccountId = val +} + +// SetAvatarUrl sets the value of AvatarUrl. +func (s *MeGlobal) SetAvatarUrl(val OptString) { + s.AvatarUrl = val +} + +// SetCreatedAt sets the value of CreatedAt. +func (s *MeGlobal) SetCreatedAt(val time.Time) { + s.CreatedAt = val +} + +// SetHandle sets the value of Handle. +func (s *MeGlobal) SetHandle(val OptString) { + s.Handle = val +} + +// SetHandles sets the value of Handles. +func (s *MeGlobal) SetHandles(val []MeIdentityHandle) { + s.Handles = val +} + +// SetHomeJurisdiction sets the value of HomeJurisdiction. +func (s *MeGlobal) SetHomeJurisdiction(val OptString) { + s.HomeJurisdiction = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *MeGlobal) SetAdditionalProps(val MeGlobalAdditional) { + s.AdditionalProps = val +} + +type MeGlobalAdditional map[string]jx.Raw + +func (s *MeGlobalAdditional) init() MeGlobalAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/MeIdentityHandle +type MeIdentityHandle struct { + // The provider's publicly-visible profile email (from the provider at login; may be empty). NOT the + // account's contact email. + Email OptString `json:"email"` + Handle string `json:"handle"` + Provider string `json:"provider"` + ProviderUserId string `json:"providerUserId"` + AdditionalProps MeIdentityHandleAdditional +} + +// GetEmail returns the value of Email. +func (s *MeIdentityHandle) GetEmail() OptString { + return s.Email +} + +// GetHandle returns the value of Handle. +func (s *MeIdentityHandle) GetHandle() string { + return s.Handle +} + +// GetProvider returns the value of Provider. +func (s *MeIdentityHandle) GetProvider() string { + return s.Provider +} + +// GetProviderUserId returns the value of ProviderUserId. +func (s *MeIdentityHandle) GetProviderUserId() string { + return s.ProviderUserId +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *MeIdentityHandle) GetAdditionalProps() MeIdentityHandleAdditional { + return s.AdditionalProps +} + +// SetEmail sets the value of Email. +func (s *MeIdentityHandle) SetEmail(val OptString) { + s.Email = val +} + +// SetHandle sets the value of Handle. +func (s *MeIdentityHandle) SetHandle(val string) { + s.Handle = val +} + +// SetProvider sets the value of Provider. +func (s *MeIdentityHandle) SetProvider(val string) { + s.Provider = val +} + +// SetProviderUserId sets the value of ProviderUserId. +func (s *MeIdentityHandle) SetProviderUserId(val string) { + s.ProviderUserId = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *MeIdentityHandle) SetAdditionalProps(val MeIdentityHandleAdditional) { + s.AdditionalProps = val +} + +type MeIdentityHandleAdditional map[string]jx.Raw + +func (s *MeIdentityHandleAdditional) init() MeIdentityHandleAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/MeRegional +type MeRegional struct { + Bio OptString `json:"bio"` + Company OptString `json:"company"` + DisplayName OptString `json:"displayName"` + Email OptString `json:"email"` + Location OptString `json:"location"` + AdditionalProps MeRegionalAdditional +} + +// GetBio returns the value of Bio. +func (s *MeRegional) GetBio() OptString { + return s.Bio +} + +// GetCompany returns the value of Company. +func (s *MeRegional) GetCompany() OptString { + return s.Company +} + +// GetDisplayName returns the value of DisplayName. +func (s *MeRegional) GetDisplayName() OptString { + return s.DisplayName +} + +// GetEmail returns the value of Email. +func (s *MeRegional) GetEmail() OptString { + return s.Email +} + +// GetLocation returns the value of Location. +func (s *MeRegional) GetLocation() OptString { + return s.Location +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *MeRegional) GetAdditionalProps() MeRegionalAdditional { + return s.AdditionalProps +} + +// SetBio sets the value of Bio. +func (s *MeRegional) SetBio(val OptString) { + s.Bio = val +} + +// SetCompany sets the value of Company. +func (s *MeRegional) SetCompany(val OptString) { + s.Company = val +} + +// SetDisplayName sets the value of DisplayName. +func (s *MeRegional) SetDisplayName(val OptString) { + s.DisplayName = val +} + +// SetEmail sets the value of Email. +func (s *MeRegional) SetEmail(val OptString) { + s.Email = val +} + +// SetLocation sets the value of Location. +func (s *MeRegional) SetLocation(val OptString) { + s.Location = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *MeRegional) SetAdditionalProps(val MeRegionalAdditional) { + s.AdditionalProps = val +} + +type MeRegionalAdditional map[string]jx.Raw + +func (s *MeRegionalAdditional) init() MeRegionalAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/MeRegionalUnavailable +type MeRegionalUnavailable struct { + // Always 'foreign_jurisdiction'. Discriminator for client-side state machines. + Error MeRegionalUnavailableError `json:"error"` + // Origin of the account's home core — its OIDC issuer, e.g. 'https://us.auth.entire.io'. Not a + // browser link and not the console. + HomeCoreUrl string `json:"homeCoreUrl"` + // The account's home jurisdiction (e.g. 'us', 'eu'). + Jurisdiction string `json:"jurisdiction"` + // Human-readable copy ready to surface in a UI. + Message string `json:"message"` + AdditionalProps MeRegionalUnavailableAdditional +} + +// GetError returns the value of Error. +func (s *MeRegionalUnavailable) GetError() MeRegionalUnavailableError { + return s.Error +} + +// GetHomeCoreUrl returns the value of HomeCoreUrl. +func (s *MeRegionalUnavailable) GetHomeCoreUrl() string { + return s.HomeCoreUrl +} + +// GetJurisdiction returns the value of Jurisdiction. +func (s *MeRegionalUnavailable) GetJurisdiction() string { + return s.Jurisdiction +} + +// GetMessage returns the value of Message. +func (s *MeRegionalUnavailable) GetMessage() string { + return s.Message +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *MeRegionalUnavailable) GetAdditionalProps() MeRegionalUnavailableAdditional { + return s.AdditionalProps +} + +// SetError sets the value of Error. +func (s *MeRegionalUnavailable) SetError(val MeRegionalUnavailableError) { + s.Error = val +} + +// SetHomeCoreUrl sets the value of HomeCoreUrl. +func (s *MeRegionalUnavailable) SetHomeCoreUrl(val string) { + s.HomeCoreUrl = val +} + +// SetJurisdiction sets the value of Jurisdiction. +func (s *MeRegionalUnavailable) SetJurisdiction(val string) { + s.Jurisdiction = val +} + +// SetMessage sets the value of Message. +func (s *MeRegionalUnavailable) SetMessage(val string) { + s.Message = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *MeRegionalUnavailable) SetAdditionalProps(val MeRegionalUnavailableAdditional) { + s.AdditionalProps = val +} + +type MeRegionalUnavailableAdditional map[string]jx.Raw + +func (s *MeRegionalUnavailableAdditional) init() MeRegionalUnavailableAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Always 'foreign_jurisdiction'. Discriminator for client-side state machines. +type MeRegionalUnavailableError string + +const ( + MeRegionalUnavailableErrorForeignJurisdiction MeRegionalUnavailableError = "foreign_jurisdiction" +) + +// AllValues returns all MeRegionalUnavailableError values. +func (MeRegionalUnavailableError) AllValues() []MeRegionalUnavailableError { + return []MeRegionalUnavailableError{ + MeRegionalUnavailableErrorForeignJurisdiction, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s MeRegionalUnavailableError) MarshalText() ([]byte, error) { + switch s { + case MeRegionalUnavailableErrorForeignJurisdiction: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *MeRegionalUnavailableError) UnmarshalText(data []byte) error { + switch MeRegionalUnavailableError(data) { + case MeRegionalUnavailableErrorForeignJurisdiction: + *s = MeRegionalUnavailableErrorForeignJurisdiction + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// Ref: #/components/schemas/Membership +type Membership struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + AccountId string `json:"accountId"` + CreatedAt time.Time `json:"createdAt"` + Handle OptString `json:"handle"` + ID string `json:"id"` + OrgId string `json:"orgId"` + Provider OptString `json:"provider"` + Role string `json:"role"` + // Membership lifecycle status. + Status string `json:"status"` + WorkosOrgMembershipId OptString `json:"workosOrgMembershipId"` + AdditionalProps MembershipAdditional +} + +// GetSchema returns the value of Schema. +func (s *Membership) GetSchema() OptURI { + return s.Schema +} + +// GetAccountId returns the value of AccountId. +func (s *Membership) GetAccountId() string { + return s.AccountId +} + +// GetCreatedAt returns the value of CreatedAt. +func (s *Membership) GetCreatedAt() time.Time { + return s.CreatedAt +} + +// GetHandle returns the value of Handle. +func (s *Membership) GetHandle() OptString { + return s.Handle +} + +// GetID returns the value of ID. +func (s *Membership) GetID() string { + return s.ID +} + +// GetOrgId returns the value of OrgId. +func (s *Membership) GetOrgId() string { + return s.OrgId +} + +// GetProvider returns the value of Provider. +func (s *Membership) GetProvider() OptString { + return s.Provider +} + +// GetRole returns the value of Role. +func (s *Membership) GetRole() string { + return s.Role +} + +// GetStatus returns the value of Status. +func (s *Membership) GetStatus() string { + return s.Status +} + +// GetWorkosOrgMembershipId returns the value of WorkosOrgMembershipId. +func (s *Membership) GetWorkosOrgMembershipId() OptString { + return s.WorkosOrgMembershipId +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *Membership) GetAdditionalProps() MembershipAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *Membership) SetSchema(val OptURI) { + s.Schema = val +} + +// SetAccountId sets the value of AccountId. +func (s *Membership) SetAccountId(val string) { + s.AccountId = val +} + +// SetCreatedAt sets the value of CreatedAt. +func (s *Membership) SetCreatedAt(val time.Time) { + s.CreatedAt = val +} + +// SetHandle sets the value of Handle. +func (s *Membership) SetHandle(val OptString) { + s.Handle = val +} + +// SetID sets the value of ID. +func (s *Membership) SetID(val string) { + s.ID = val +} + +// SetOrgId sets the value of OrgId. +func (s *Membership) SetOrgId(val string) { + s.OrgId = val +} + +// SetProvider sets the value of Provider. +func (s *Membership) SetProvider(val OptString) { + s.Provider = val +} + +// SetRole sets the value of Role. +func (s *Membership) SetRole(val string) { + s.Role = val +} + +// SetStatus sets the value of Status. +func (s *Membership) SetStatus(val string) { + s.Status = val +} + +// SetWorkosOrgMembershipId sets the value of WorkosOrgMembershipId. +func (s *Membership) SetWorkosOrgMembershipId(val OptString) { + s.WorkosOrgMembershipId = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *Membership) SetAdditionalProps(val MembershipAdditional) { + s.AdditionalProps = val +} + +type MembershipAdditional map[string]jx.Raw + +func (s *MembershipAdditional) init() MembershipAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/MintOrgCIGitHubActionsCredentialInputBody +type MintOrgCIGitHubActionsCredentialInputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + // GitHub login (user or organization) whose webhooks this credential verifies. + Account string `json:"account"` + // GitHub API token for outbound workflow dispatch. Optional: omit for an inbound-only credential. On + // an existing github-actions row this stores/rotates the token instead of conflicting. + APIToken OptString `json:"api_token"` + AdditionalProps MintOrgCIGitHubActionsCredentialInputBodyAdditional +} + +// GetSchema returns the value of Schema. +func (s *MintOrgCIGitHubActionsCredentialInputBody) GetSchema() OptURI { + return s.Schema +} + +// GetAccount returns the value of Account. +func (s *MintOrgCIGitHubActionsCredentialInputBody) GetAccount() string { + return s.Account +} + +// GetAPIToken returns the value of APIToken. +func (s *MintOrgCIGitHubActionsCredentialInputBody) GetAPIToken() OptString { + return s.APIToken +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *MintOrgCIGitHubActionsCredentialInputBody) GetAdditionalProps() MintOrgCIGitHubActionsCredentialInputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *MintOrgCIGitHubActionsCredentialInputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetAccount sets the value of Account. +func (s *MintOrgCIGitHubActionsCredentialInputBody) SetAccount(val string) { + s.Account = val +} + +// SetAPIToken sets the value of APIToken. +func (s *MintOrgCIGitHubActionsCredentialInputBody) SetAPIToken(val OptString) { + s.APIToken = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *MintOrgCIGitHubActionsCredentialInputBody) SetAdditionalProps(val MintOrgCIGitHubActionsCredentialInputBodyAdditional) { + s.AdditionalProps = val +} + +type MintOrgCIGitHubActionsCredentialInputBodyAdditional map[string]jx.Raw + +func (s *MintOrgCIGitHubActionsCredentialInputBodyAdditional) init() MintOrgCIGitHubActionsCredentialInputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/Mirror +type Mirror struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + // Physical cell the mirror's cluster runs in, e.g. aws-us-east-2. + Cell OptString `json:"cell"` + // Public host of the cluster serving this mirror. + ClusterHost string `json:"clusterHost"` + CreatedAt time.Time `json:"createdAt"` + IsArchived OptBool `json:"isArchived"` + IsPrivate OptBool `json:"isPrivate"` + // True when this placement does its repo group's per-event work. Removing it is refused while other + // placements remain. + IsProcessingPrimary OptBool `json:"isProcessingPrimary"` + Jurisdiction OptString `json:"jurisdiction"` + MirrorId string `json:"mirrorId"` + Owner string `json:"owner"` + Provider string `json:"provider"` + Repo string `json:"repo"` + // Clone lifecycle: processing (cloning), ready (clonable), failed (initial clone failed), or + // suspended. + Status OptMirrorStatus `json:"status"` + SuspendedAt OptDateTime `json:"suspendedAt"` + AdditionalProps MirrorAdditional +} + +// GetSchema returns the value of Schema. +func (s *Mirror) GetSchema() OptURI { + return s.Schema +} + +// GetCell returns the value of Cell. +func (s *Mirror) GetCell() OptString { + return s.Cell +} + +// GetClusterHost returns the value of ClusterHost. +func (s *Mirror) GetClusterHost() string { + return s.ClusterHost +} + +// GetCreatedAt returns the value of CreatedAt. +func (s *Mirror) GetCreatedAt() time.Time { + return s.CreatedAt +} + +// GetIsArchived returns the value of IsArchived. +func (s *Mirror) GetIsArchived() OptBool { + return s.IsArchived +} + +// GetIsPrivate returns the value of IsPrivate. +func (s *Mirror) GetIsPrivate() OptBool { + return s.IsPrivate +} + +// GetIsProcessingPrimary returns the value of IsProcessingPrimary. +func (s *Mirror) GetIsProcessingPrimary() OptBool { + return s.IsProcessingPrimary +} + +// GetJurisdiction returns the value of Jurisdiction. +func (s *Mirror) GetJurisdiction() OptString { + return s.Jurisdiction +} + +// GetMirrorId returns the value of MirrorId. +func (s *Mirror) GetMirrorId() string { + return s.MirrorId +} + +// GetOwner returns the value of Owner. +func (s *Mirror) GetOwner() string { + return s.Owner +} + +// GetProvider returns the value of Provider. +func (s *Mirror) GetProvider() string { + return s.Provider +} + +// GetRepo returns the value of Repo. +func (s *Mirror) GetRepo() string { + return s.Repo +} + +// GetStatus returns the value of Status. +func (s *Mirror) GetStatus() OptMirrorStatus { + return s.Status +} + +// GetSuspendedAt returns the value of SuspendedAt. +func (s *Mirror) GetSuspendedAt() OptDateTime { + return s.SuspendedAt +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *Mirror) GetAdditionalProps() MirrorAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *Mirror) SetSchema(val OptURI) { + s.Schema = val +} + +// SetCell sets the value of Cell. +func (s *Mirror) SetCell(val OptString) { + s.Cell = val +} + +// SetClusterHost sets the value of ClusterHost. +func (s *Mirror) SetClusterHost(val string) { + s.ClusterHost = val +} + +// SetCreatedAt sets the value of CreatedAt. +func (s *Mirror) SetCreatedAt(val time.Time) { + s.CreatedAt = val +} + +// SetIsArchived sets the value of IsArchived. +func (s *Mirror) SetIsArchived(val OptBool) { + s.IsArchived = val +} + +// SetIsPrivate sets the value of IsPrivate. +func (s *Mirror) SetIsPrivate(val OptBool) { + s.IsPrivate = val +} + +// SetIsProcessingPrimary sets the value of IsProcessingPrimary. +func (s *Mirror) SetIsProcessingPrimary(val OptBool) { + s.IsProcessingPrimary = val +} + +// SetJurisdiction sets the value of Jurisdiction. +func (s *Mirror) SetJurisdiction(val OptString) { + s.Jurisdiction = val +} + +// SetMirrorId sets the value of MirrorId. +func (s *Mirror) SetMirrorId(val string) { + s.MirrorId = val +} + +// SetOwner sets the value of Owner. +func (s *Mirror) SetOwner(val string) { + s.Owner = val +} + +// SetProvider sets the value of Provider. +func (s *Mirror) SetProvider(val string) { + s.Provider = val +} + +// SetRepo sets the value of Repo. +func (s *Mirror) SetRepo(val string) { + s.Repo = val +} + +// SetStatus sets the value of Status. +func (s *Mirror) SetStatus(val OptMirrorStatus) { + s.Status = val +} + +// SetSuspendedAt sets the value of SuspendedAt. +func (s *Mirror) SetSuspendedAt(val OptDateTime) { + s.SuspendedAt = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *Mirror) SetAdditionalProps(val MirrorAdditional) { + s.AdditionalProps = val +} + +type MirrorAdditional map[string]jx.Raw + +func (s *MirrorAdditional) init() MirrorAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/MirrorCollaborator +type MirrorCollaborator struct { + AccountId string `json:"accountId"` + // Primary handle (provider:label), empty if none resolves. + Handle OptString `json:"handle"` + // Reader (pull) or writer (pull+push). + Role string `json:"role"` + AdditionalProps MirrorCollaboratorAdditional +} + +// GetAccountId returns the value of AccountId. +func (s *MirrorCollaborator) GetAccountId() string { + return s.AccountId +} + +// GetHandle returns the value of Handle. +func (s *MirrorCollaborator) GetHandle() OptString { + return s.Handle +} + +// GetRole returns the value of Role. +func (s *MirrorCollaborator) GetRole() string { + return s.Role +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *MirrorCollaborator) GetAdditionalProps() MirrorCollaboratorAdditional { + return s.AdditionalProps +} + +// SetAccountId sets the value of AccountId. +func (s *MirrorCollaborator) SetAccountId(val string) { + s.AccountId = val +} + +// SetHandle sets the value of Handle. +func (s *MirrorCollaborator) SetHandle(val OptString) { + s.Handle = val +} + +// SetRole sets the value of Role. +func (s *MirrorCollaborator) SetRole(val string) { + s.Role = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *MirrorCollaborator) SetAdditionalProps(val MirrorCollaboratorAdditional) { + s.AdditionalProps = val +} + +type MirrorCollaboratorAdditional map[string]jx.Raw + +func (s *MirrorCollaboratorAdditional) init() MirrorCollaboratorAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/MirrorRequest +type MirrorRequest struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Failure OptMirrorRequestFailure `json:"failure"` + RequestId uuid.UUID `json:"requestId"` + Result OptMirrorRequestResult `json:"result"` + Status MirrorRequestStatus `json:"status"` + AdditionalProps MirrorRequestAdditional +} + +// GetSchema returns the value of Schema. +func (s *MirrorRequest) GetSchema() OptURI { + return s.Schema +} + +// GetFailure returns the value of Failure. +func (s *MirrorRequest) GetFailure() OptMirrorRequestFailure { + return s.Failure +} + +// GetRequestId returns the value of RequestId. +func (s *MirrorRequest) GetRequestId() uuid.UUID { + return s.RequestId +} + +// GetResult returns the value of Result. +func (s *MirrorRequest) GetResult() OptMirrorRequestResult { + return s.Result +} + +// GetStatus returns the value of Status. +func (s *MirrorRequest) GetStatus() MirrorRequestStatus { + return s.Status +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *MirrorRequest) GetAdditionalProps() MirrorRequestAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *MirrorRequest) SetSchema(val OptURI) { + s.Schema = val +} + +// SetFailure sets the value of Failure. +func (s *MirrorRequest) SetFailure(val OptMirrorRequestFailure) { + s.Failure = val +} + +// SetRequestId sets the value of RequestId. +func (s *MirrorRequest) SetRequestId(val uuid.UUID) { + s.RequestId = val +} + +// SetResult sets the value of Result. +func (s *MirrorRequest) SetResult(val OptMirrorRequestResult) { + s.Result = val +} + +// SetStatus sets the value of Status. +func (s *MirrorRequest) SetStatus(val MirrorRequestStatus) { + s.Status = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *MirrorRequest) SetAdditionalProps(val MirrorRequestAdditional) { + s.AdditionalProps = val +} + +type MirrorRequestAdditional map[string]jx.Raw + +func (s *MirrorRequestAdditional) init() MirrorRequestAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/MirrorRequestFailure +type MirrorRequestFailure struct { + // Stable machine-readable failure code. + Code string `json:"code"` + Message string `json:"message"` + // Whether submitting a new request may succeed without changing its inputs. + Retryable bool `json:"retryable"` + AdditionalProps MirrorRequestFailureAdditional +} + +// GetCode returns the value of Code. +func (s *MirrorRequestFailure) GetCode() string { + return s.Code +} + +// GetMessage returns the value of Message. +func (s *MirrorRequestFailure) GetMessage() string { + return s.Message +} + +// GetRetryable returns the value of Retryable. +func (s *MirrorRequestFailure) GetRetryable() bool { + return s.Retryable +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *MirrorRequestFailure) GetAdditionalProps() MirrorRequestFailureAdditional { + return s.AdditionalProps +} + +// SetCode sets the value of Code. +func (s *MirrorRequestFailure) SetCode(val string) { + s.Code = val +} + +// SetMessage sets the value of Message. +func (s *MirrorRequestFailure) SetMessage(val string) { + s.Message = val +} + +// SetRetryable sets the value of Retryable. +func (s *MirrorRequestFailure) SetRetryable(val bool) { + s.Retryable = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *MirrorRequestFailure) SetAdditionalProps(val MirrorRequestFailureAdditional) { + s.AdditionalProps = val +} + +type MirrorRequestFailureAdditional map[string]jx.Raw + +func (s *MirrorRequestFailureAdditional) init() MirrorRequestFailureAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// MirrorRequestHeaders wraps MirrorRequest with response headers. +type MirrorRequestHeaders struct { + Location OptString + Response MirrorRequest +} + +// GetLocation returns the value of Location. +func (s *MirrorRequestHeaders) GetLocation() OptString { + return s.Location +} + +// GetResponse returns the value of Response. +func (s *MirrorRequestHeaders) GetResponse() MirrorRequest { + return s.Response +} + +// SetLocation sets the value of Location. +func (s *MirrorRequestHeaders) SetLocation(val OptString) { + s.Location = val +} + +// SetResponse sets the value of Response. +func (s *MirrorRequestHeaders) SetResponse(val MirrorRequest) { + s.Response = val +} + +// Ref: #/components/schemas/MirrorRequestResult +type MirrorRequestResult struct { + MirrorId string `json:"mirrorId"` + MirrorUrl string `json:"mirrorUrl"` + PublicUrl string `json:"publicUrl"` + AdditionalProps MirrorRequestResultAdditional +} + +// GetMirrorId returns the value of MirrorId. +func (s *MirrorRequestResult) GetMirrorId() string { + return s.MirrorId +} + +// GetMirrorUrl returns the value of MirrorUrl. +func (s *MirrorRequestResult) GetMirrorUrl() string { + return s.MirrorUrl +} + +// GetPublicUrl returns the value of PublicUrl. +func (s *MirrorRequestResult) GetPublicUrl() string { + return s.PublicUrl +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *MirrorRequestResult) GetAdditionalProps() MirrorRequestResultAdditional { + return s.AdditionalProps +} + +// SetMirrorId sets the value of MirrorId. +func (s *MirrorRequestResult) SetMirrorId(val string) { + s.MirrorId = val +} + +// SetMirrorUrl sets the value of MirrorUrl. +func (s *MirrorRequestResult) SetMirrorUrl(val string) { + s.MirrorUrl = val +} + +// SetPublicUrl sets the value of PublicUrl. +func (s *MirrorRequestResult) SetPublicUrl(val string) { + s.PublicUrl = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *MirrorRequestResult) SetAdditionalProps(val MirrorRequestResultAdditional) { + s.AdditionalProps = val +} + +type MirrorRequestResultAdditional map[string]jx.Raw + +func (s *MirrorRequestResultAdditional) init() MirrorRequestResultAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +type MirrorRequestStatus string + +const ( + MirrorRequestStatusPending MirrorRequestStatus = "pending" + MirrorRequestStatusProcessing MirrorRequestStatus = "processing" + MirrorRequestStatusSucceeded MirrorRequestStatus = "succeeded" + MirrorRequestStatusFailed MirrorRequestStatus = "failed" +) + +// AllValues returns all MirrorRequestStatus values. +func (MirrorRequestStatus) AllValues() []MirrorRequestStatus { + return []MirrorRequestStatus{ + MirrorRequestStatusPending, + MirrorRequestStatusProcessing, + MirrorRequestStatusSucceeded, + MirrorRequestStatusFailed, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s MirrorRequestStatus) MarshalText() ([]byte, error) { + switch s { + case MirrorRequestStatusPending: + return []byte(s), nil + case MirrorRequestStatusProcessing: + return []byte(s), nil + case MirrorRequestStatusSucceeded: + return []byte(s), nil + case MirrorRequestStatusFailed: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *MirrorRequestStatus) UnmarshalText(data []byte) error { + switch MirrorRequestStatus(data) { + case MirrorRequestStatusPending: + *s = MirrorRequestStatusPending + return nil + case MirrorRequestStatusProcessing: + *s = MirrorRequestStatusProcessing + return nil + case MirrorRequestStatusSucceeded: + *s = MirrorRequestStatusSucceeded + return nil + case MirrorRequestStatusFailed: + *s = MirrorRequestStatusFailed + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// Clone lifecycle: processing (cloning), ready (clonable), failed (initial clone failed), or +// suspended. +type MirrorStatus string + +const ( + MirrorStatusProcessing MirrorStatus = "processing" + MirrorStatusReady MirrorStatus = "ready" + MirrorStatusFailed MirrorStatus = "failed" + MirrorStatusSuspended MirrorStatus = "suspended" +) + +// AllValues returns all MirrorStatus values. +func (MirrorStatus) AllValues() []MirrorStatus { + return []MirrorStatus{ + MirrorStatusProcessing, + MirrorStatusReady, + MirrorStatusFailed, + MirrorStatusSuspended, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s MirrorStatus) MarshalText() ([]byte, error) { + switch s { + case MirrorStatusProcessing: + return []byte(s), nil + case MirrorStatusReady: + return []byte(s), nil + case MirrorStatusFailed: + return []byte(s), nil + case MirrorStatusSuspended: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *MirrorStatus) UnmarshalText(data []byte) error { + switch MirrorStatus(data) { + case MirrorStatusProcessing: + *s = MirrorStatusProcessing + return nil + case MirrorStatusReady: + *s = MirrorStatusReady + return nil + case MirrorStatusFailed: + *s = MirrorStatusFailed + return nil + case MirrorStatusSuspended: + *s = MirrorStatusSuspended + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// Ref: #/components/schemas/NativeMirrorPlacement +type NativeMirrorPlacement struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Attempts int64 `json:"attempts"` + ClusterSlug string `json:"clusterSlug"` + CreatedAt time.Time `json:"createdAt"` + CreationFailedAt OptDateTime `json:"creationFailedAt"` + DesiredState NativeMirrorPlacementDesiredState `json:"desiredState"` + LastError OptString `json:"lastError"` + NextRetryAt OptDateTime `json:"nextRetryAt"` + PlacementId string `json:"placementId"` + Stage NativeMirrorPlacementStage `json:"stage"` + Status NativeMirrorPlacementStatus `json:"status"` + AdditionalProps NativeMirrorPlacementAdditional +} + +// GetSchema returns the value of Schema. +func (s *NativeMirrorPlacement) GetSchema() OptURI { + return s.Schema +} + +// GetAttempts returns the value of Attempts. +func (s *NativeMirrorPlacement) GetAttempts() int64 { + return s.Attempts +} + +// GetClusterSlug returns the value of ClusterSlug. +func (s *NativeMirrorPlacement) GetClusterSlug() string { + return s.ClusterSlug +} + +// GetCreatedAt returns the value of CreatedAt. +func (s *NativeMirrorPlacement) GetCreatedAt() time.Time { + return s.CreatedAt +} + +// GetCreationFailedAt returns the value of CreationFailedAt. +func (s *NativeMirrorPlacement) GetCreationFailedAt() OptDateTime { + return s.CreationFailedAt +} + +// GetDesiredState returns the value of DesiredState. +func (s *NativeMirrorPlacement) GetDesiredState() NativeMirrorPlacementDesiredState { + return s.DesiredState +} + +// GetLastError returns the value of LastError. +func (s *NativeMirrorPlacement) GetLastError() OptString { + return s.LastError +} + +// GetNextRetryAt returns the value of NextRetryAt. +func (s *NativeMirrorPlacement) GetNextRetryAt() OptDateTime { + return s.NextRetryAt +} + +// GetPlacementId returns the value of PlacementId. +func (s *NativeMirrorPlacement) GetPlacementId() string { + return s.PlacementId +} + +// GetStage returns the value of Stage. +func (s *NativeMirrorPlacement) GetStage() NativeMirrorPlacementStage { + return s.Stage +} + +// GetStatus returns the value of Status. +func (s *NativeMirrorPlacement) GetStatus() NativeMirrorPlacementStatus { + return s.Status +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *NativeMirrorPlacement) GetAdditionalProps() NativeMirrorPlacementAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *NativeMirrorPlacement) SetSchema(val OptURI) { + s.Schema = val +} + +// SetAttempts sets the value of Attempts. +func (s *NativeMirrorPlacement) SetAttempts(val int64) { + s.Attempts = val +} + +// SetClusterSlug sets the value of ClusterSlug. +func (s *NativeMirrorPlacement) SetClusterSlug(val string) { + s.ClusterSlug = val +} + +// SetCreatedAt sets the value of CreatedAt. +func (s *NativeMirrorPlacement) SetCreatedAt(val time.Time) { + s.CreatedAt = val +} + +// SetCreationFailedAt sets the value of CreationFailedAt. +func (s *NativeMirrorPlacement) SetCreationFailedAt(val OptDateTime) { + s.CreationFailedAt = val +} + +// SetDesiredState sets the value of DesiredState. +func (s *NativeMirrorPlacement) SetDesiredState(val NativeMirrorPlacementDesiredState) { + s.DesiredState = val +} + +// SetLastError sets the value of LastError. +func (s *NativeMirrorPlacement) SetLastError(val OptString) { + s.LastError = val +} + +// SetNextRetryAt sets the value of NextRetryAt. +func (s *NativeMirrorPlacement) SetNextRetryAt(val OptDateTime) { + s.NextRetryAt = val +} + +// SetPlacementId sets the value of PlacementId. +func (s *NativeMirrorPlacement) SetPlacementId(val string) { + s.PlacementId = val +} + +// SetStage sets the value of Stage. +func (s *NativeMirrorPlacement) SetStage(val NativeMirrorPlacementStage) { + s.Stage = val +} + +// SetStatus sets the value of Status. +func (s *NativeMirrorPlacement) SetStatus(val NativeMirrorPlacementStatus) { + s.Status = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *NativeMirrorPlacement) SetAdditionalProps(val NativeMirrorPlacementAdditional) { + s.AdditionalProps = val +} + +type NativeMirrorPlacementAdditional map[string]jx.Raw + +func (s *NativeMirrorPlacementAdditional) init() NativeMirrorPlacementAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +type NativeMirrorPlacementDesiredState string + +const ( + NativeMirrorPlacementDesiredStateActive NativeMirrorPlacementDesiredState = "active" + NativeMirrorPlacementDesiredStateDeleted NativeMirrorPlacementDesiredState = "deleted" +) + +// AllValues returns all NativeMirrorPlacementDesiredState values. +func (NativeMirrorPlacementDesiredState) AllValues() []NativeMirrorPlacementDesiredState { + return []NativeMirrorPlacementDesiredState{ + NativeMirrorPlacementDesiredStateActive, + NativeMirrorPlacementDesiredStateDeleted, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s NativeMirrorPlacementDesiredState) MarshalText() ([]byte, error) { + switch s { + case NativeMirrorPlacementDesiredStateActive: + return []byte(s), nil + case NativeMirrorPlacementDesiredStateDeleted: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *NativeMirrorPlacementDesiredState) UnmarshalText(data []byte) error { + switch NativeMirrorPlacementDesiredState(data) { + case NativeMirrorPlacementDesiredStateActive: + *s = NativeMirrorPlacementDesiredStateActive + return nil + case NativeMirrorPlacementDesiredStateDeleted: + *s = NativeMirrorPlacementDesiredStateDeleted + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +type NativeMirrorPlacementStage string + +const ( + NativeMirrorPlacementStagePending NativeMirrorPlacementStage = "pending" + NativeMirrorPlacementStageProvisioned NativeMirrorPlacementStage = "provisioned" + NativeMirrorPlacementStageRegistered NativeMirrorPlacementStage = "registered" + NativeMirrorPlacementStageSeeded NativeMirrorPlacementStage = "seeded" + NativeMirrorPlacementStageAnnounced NativeMirrorPlacementStage = "announced" +) + +// AllValues returns all NativeMirrorPlacementStage values. +func (NativeMirrorPlacementStage) AllValues() []NativeMirrorPlacementStage { + return []NativeMirrorPlacementStage{ + NativeMirrorPlacementStagePending, + NativeMirrorPlacementStageProvisioned, + NativeMirrorPlacementStageRegistered, + NativeMirrorPlacementStageSeeded, + NativeMirrorPlacementStageAnnounced, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s NativeMirrorPlacementStage) MarshalText() ([]byte, error) { + switch s { + case NativeMirrorPlacementStagePending: + return []byte(s), nil + case NativeMirrorPlacementStageProvisioned: + return []byte(s), nil + case NativeMirrorPlacementStageRegistered: + return []byte(s), nil + case NativeMirrorPlacementStageSeeded: + return []byte(s), nil + case NativeMirrorPlacementStageAnnounced: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *NativeMirrorPlacementStage) UnmarshalText(data []byte) error { + switch NativeMirrorPlacementStage(data) { + case NativeMirrorPlacementStagePending: + *s = NativeMirrorPlacementStagePending + return nil + case NativeMirrorPlacementStageProvisioned: + *s = NativeMirrorPlacementStageProvisioned + return nil + case NativeMirrorPlacementStageRegistered: + *s = NativeMirrorPlacementStageRegistered + return nil + case NativeMirrorPlacementStageSeeded: + *s = NativeMirrorPlacementStageSeeded + return nil + case NativeMirrorPlacementStageAnnounced: + *s = NativeMirrorPlacementStageAnnounced + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +type NativeMirrorPlacementStatus string + +const ( + NativeMirrorPlacementStatusProcessing NativeMirrorPlacementStatus = "processing" + NativeMirrorPlacementStatusReady NativeMirrorPlacementStatus = "ready" + NativeMirrorPlacementStatusFailed NativeMirrorPlacementStatus = "failed" + NativeMirrorPlacementStatusSuspended NativeMirrorPlacementStatus = "suspended" +) + +// AllValues returns all NativeMirrorPlacementStatus values. +func (NativeMirrorPlacementStatus) AllValues() []NativeMirrorPlacementStatus { + return []NativeMirrorPlacementStatus{ + NativeMirrorPlacementStatusProcessing, + NativeMirrorPlacementStatusReady, + NativeMirrorPlacementStatusFailed, + NativeMirrorPlacementStatusSuspended, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s NativeMirrorPlacementStatus) MarshalText() ([]byte, error) { + switch s { + case NativeMirrorPlacementStatusProcessing: + return []byte(s), nil + case NativeMirrorPlacementStatusReady: + return []byte(s), nil + case NativeMirrorPlacementStatusFailed: + return []byte(s), nil + case NativeMirrorPlacementStatusSuspended: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *NativeMirrorPlacementStatus) UnmarshalText(data []byte) error { + switch NativeMirrorPlacementStatus(data) { + case NativeMirrorPlacementStatusProcessing: + *s = NativeMirrorPlacementStatusProcessing + return nil + case NativeMirrorPlacementStatusReady: + *s = NativeMirrorPlacementStatusReady + return nil + case NativeMirrorPlacementStatusFailed: + *s = NativeMirrorPlacementStatusFailed + return nil + case NativeMirrorPlacementStatusSuspended: + *s = NativeMirrorPlacementStatusSuspended + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// Ref: #/components/schemas/OIDCProvider +type OIDCProvider struct { + Description OptString `json:"description"` + DisplayName OptString `json:"displayName"` + ID string `json:"id"` + Issuer string `json:"issuer"` + AdditionalProps OIDCProviderAdditional +} + +// GetDescription returns the value of Description. +func (s *OIDCProvider) GetDescription() OptString { + return s.Description +} + +// GetDisplayName returns the value of DisplayName. +func (s *OIDCProvider) GetDisplayName() OptString { + return s.DisplayName +} + +// GetID returns the value of ID. +func (s *OIDCProvider) GetID() string { + return s.ID +} + +// GetIssuer returns the value of Issuer. +func (s *OIDCProvider) GetIssuer() string { + return s.Issuer +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *OIDCProvider) GetAdditionalProps() OIDCProviderAdditional { + return s.AdditionalProps +} + +// SetDescription sets the value of Description. +func (s *OIDCProvider) SetDescription(val OptString) { + s.Description = val +} + +// SetDisplayName sets the value of DisplayName. +func (s *OIDCProvider) SetDisplayName(val OptString) { + s.DisplayName = val +} + +// SetID sets the value of ID. +func (s *OIDCProvider) SetID(val string) { + s.ID = val +} + +// SetIssuer sets the value of Issuer. +func (s *OIDCProvider) SetIssuer(val string) { + s.Issuer = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *OIDCProvider) SetAdditionalProps(val OIDCProviderAdditional) { + s.AdditionalProps = val +} + +type OIDCProviderAdditional map[string]jx.Raw + +func (s *OIDCProviderAdditional) init() OIDCProviderAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// NewOptAddOrgMemberInputBodyRole returns new OptAddOrgMemberInputBodyRole with value set to v. +func NewOptAddOrgMemberInputBodyRole(v AddOrgMemberInputBodyRole) OptAddOrgMemberInputBodyRole { + return OptAddOrgMemberInputBodyRole{ + Value: v, + Set: true, + } +} + +// OptAddOrgMemberInputBodyRole is optional AddOrgMemberInputBodyRole. +type OptAddOrgMemberInputBodyRole struct { + Value AddOrgMemberInputBodyRole + Set bool +} + +// IsSet returns true if OptAddOrgMemberInputBodyRole was set. +func (o OptAddOrgMemberInputBodyRole) IsSet() bool { return o.Set } + +// Reset unsets value. +func (o *OptAddOrgMemberInputBodyRole) Reset() { + var v AddOrgMemberInputBodyRole + o.Value = v + o.Set = false +} + +// SetTo sets value to v. +func (o *OptAddOrgMemberInputBodyRole) SetTo(v AddOrgMemberInputBodyRole) { + o.Set = true + o.Value = v +} + +// Get returns value and boolean that denotes whether value was set. +func (o OptAddOrgMemberInputBodyRole) Get() (v AddOrgMemberInputBodyRole, ok bool) { + if !o.Set { + return v, false + } + return o.Value, true +} + +// Or returns value if set, or given parameter if does not. +func (o OptAddOrgMemberInputBodyRole) Or(d AddOrgMemberInputBodyRole) AddOrgMemberInputBodyRole { + if v, ok := o.Get(); ok { + return v + } + return d +} + +// NewOptAuditEventMetadata returns new OptAuditEventMetadata with value set to v. +func NewOptAuditEventMetadata(v AuditEventMetadata) OptAuditEventMetadata { + return OptAuditEventMetadata{ + Value: v, + Set: true, + } +} + +// OptAuditEventMetadata is optional AuditEventMetadata. +type OptAuditEventMetadata struct { + Value AuditEventMetadata + Set bool +} + +// IsSet returns true if OptAuditEventMetadata was set. +func (o OptAuditEventMetadata) IsSet() bool { return o.Set } + +// Reset unsets value. +func (o *OptAuditEventMetadata) Reset() { + var v AuditEventMetadata + o.Value = v + o.Set = false +} + +// SetTo sets value to v. +func (o *OptAuditEventMetadata) SetTo(v AuditEventMetadata) { + o.Set = true + o.Value = v +} + +// Get returns value and boolean that denotes whether value was set. +func (o OptAuditEventMetadata) Get() (v AuditEventMetadata, ok bool) { + if !o.Set { + return v, false + } + return o.Value, true +} + +// Or returns value if set, or given parameter if does not. +func (o OptAuditEventMetadata) Or(d AuditEventMetadata) AuditEventMetadata { + if v, ok := o.Get(); ok { + return v + } + return d +} + +// NewOptBool returns new OptBool with value set to v. +func NewOptBool(v bool) OptBool { + return OptBool{ + Value: v, + Set: true, + } +} + +// OptBool is optional bool. +type OptBool struct { + Value bool + Set bool +} + +// IsSet returns true if OptBool was set. +func (o OptBool) IsSet() bool { return o.Set } + +// Reset unsets value. +func (o *OptBool) Reset() { + var v bool + o.Value = v + o.Set = false +} + +// SetTo sets value to v. +func (o *OptBool) SetTo(v bool) { + o.Set = true + o.Value = v +} + +// Get returns value and boolean that denotes whether value was set. +func (o OptBool) Get() (v bool, ok bool) { + if !o.Set { + return v, false + } + return o.Value, true +} + +// Or returns value if set, or given parameter if does not. +func (o OptBool) Or(d bool) bool { + if v, ok := o.Get(); ok { + return v + } + return d +} + +// NewOptCIDeliveryPayloadView returns new OptCIDeliveryPayloadView with value set to v. +func NewOptCIDeliveryPayloadView(v CIDeliveryPayloadView) OptCIDeliveryPayloadView { + return OptCIDeliveryPayloadView{ + Value: v, + Set: true, + } +} + +// OptCIDeliveryPayloadView is optional CIDeliveryPayloadView. +type OptCIDeliveryPayloadView struct { + Value CIDeliveryPayloadView + Set bool +} + +// IsSet returns true if OptCIDeliveryPayloadView was set. +func (o OptCIDeliveryPayloadView) IsSet() bool { return o.Set } + +// Reset unsets value. +func (o *OptCIDeliveryPayloadView) Reset() { + var v CIDeliveryPayloadView + o.Value = v + o.Set = false +} + +// SetTo sets value to v. +func (o *OptCIDeliveryPayloadView) SetTo(v CIDeliveryPayloadView) { + o.Set = true + o.Value = v +} + +// Get returns value and boolean that denotes whether value was set. +func (o OptCIDeliveryPayloadView) Get() (v CIDeliveryPayloadView, ok bool) { + if !o.Set { + return v, false + } + return o.Value, true +} + +// Or returns value if set, or given parameter if does not. +func (o OptCIDeliveryPayloadView) Or(d CIDeliveryPayloadView) CIDeliveryPayloadView { + if v, ok := o.Get(); ok { + return v + } + return d +} + +// NewOptCISetupBlock returns new OptCISetupBlock with value set to v. +func NewOptCISetupBlock(v CISetupBlock) OptCISetupBlock { + return OptCISetupBlock{ + Value: v, + Set: true, + } +} + +// OptCISetupBlock is optional CISetupBlock. +type OptCISetupBlock struct { + Value CISetupBlock + Set bool +} + +// IsSet returns true if OptCISetupBlock was set. +func (o OptCISetupBlock) IsSet() bool { return o.Set } + +// Reset unsets value. +func (o *OptCISetupBlock) Reset() { + var v CISetupBlock + o.Value = v + o.Set = false +} + +// SetTo sets value to v. +func (o *OptCISetupBlock) SetTo(v CISetupBlock) { + o.Set = true + o.Value = v +} + +// Get returns value and boolean that denotes whether value was set. +func (o OptCISetupBlock) Get() (v CISetupBlock, ok bool) { + if !o.Set { + return v, false + } + return o.Value, true +} + +// Or returns value if set, or given parameter if does not. +func (o OptCISetupBlock) Or(d CISetupBlock) CISetupBlock { + if v, ok := o.Get(); ok { + return v + } + return d +} + +// NewOptCIWebhookAuditEventViewMetadata returns new OptCIWebhookAuditEventViewMetadata with value set to v. +func NewOptCIWebhookAuditEventViewMetadata(v CIWebhookAuditEventViewMetadata) OptCIWebhookAuditEventViewMetadata { + return OptCIWebhookAuditEventViewMetadata{ + Value: v, + Set: true, + } +} + +// OptCIWebhookAuditEventViewMetadata is optional CIWebhookAuditEventViewMetadata. +type OptCIWebhookAuditEventViewMetadata struct { + Value CIWebhookAuditEventViewMetadata + Set bool +} + +// IsSet returns true if OptCIWebhookAuditEventViewMetadata was set. +func (o OptCIWebhookAuditEventViewMetadata) IsSet() bool { return o.Set } + +// Reset unsets value. +func (o *OptCIWebhookAuditEventViewMetadata) Reset() { + var v CIWebhookAuditEventViewMetadata + o.Value = v + o.Set = false +} + +// SetTo sets value to v. +func (o *OptCIWebhookAuditEventViewMetadata) SetTo(v CIWebhookAuditEventViewMetadata) { + o.Set = true + o.Value = v +} + +// Get returns value and boolean that denotes whether value was set. +func (o OptCIWebhookAuditEventViewMetadata) Get() (v CIWebhookAuditEventViewMetadata, ok bool) { + if !o.Set { + return v, false + } + return o.Value, true +} + +// Or returns value if set, or given parameter if does not. +func (o OptCIWebhookAuditEventViewMetadata) Or(d CIWebhookAuditEventViewMetadata) CIWebhookAuditEventViewMetadata { + if v, ok := o.Get(); ok { + return v + } + return d +} + +// NewOptCreateRepoCIWebhookInputBodyConfig returns new OptCreateRepoCIWebhookInputBodyConfig with value set to v. +func NewOptCreateRepoCIWebhookInputBodyConfig(v CreateRepoCIWebhookInputBodyConfig) OptCreateRepoCIWebhookInputBodyConfig { + return OptCreateRepoCIWebhookInputBodyConfig{ + Value: v, + Set: true, + } +} + +// OptCreateRepoCIWebhookInputBodyConfig is optional CreateRepoCIWebhookInputBodyConfig. +type OptCreateRepoCIWebhookInputBodyConfig struct { + Value CreateRepoCIWebhookInputBodyConfig + Set bool +} + +// IsSet returns true if OptCreateRepoCIWebhookInputBodyConfig was set. +func (o OptCreateRepoCIWebhookInputBodyConfig) IsSet() bool { return o.Set } + +// Reset unsets value. +func (o *OptCreateRepoCIWebhookInputBodyConfig) Reset() { + var v CreateRepoCIWebhookInputBodyConfig + o.Value = v + o.Set = false +} + +// SetTo sets value to v. +func (o *OptCreateRepoCIWebhookInputBodyConfig) SetTo(v CreateRepoCIWebhookInputBodyConfig) { + o.Set = true + o.Value = v +} + +// Get returns value and boolean that denotes whether value was set. +func (o OptCreateRepoCIWebhookInputBodyConfig) Get() (v CreateRepoCIWebhookInputBodyConfig, ok bool) { + if !o.Set { + return v, false + } + return o.Value, true +} + +// Or returns value if set, or given parameter if does not. +func (o OptCreateRepoCIWebhookInputBodyConfig) Or(d CreateRepoCIWebhookInputBodyConfig) CreateRepoCIWebhookInputBodyConfig { + if v, ok := o.Get(); ok { + return v + } + return d +} + +// NewOptCreateRepoInputBodyObjectFormat returns new OptCreateRepoInputBodyObjectFormat with value set to v. +func NewOptCreateRepoInputBodyObjectFormat(v CreateRepoInputBodyObjectFormat) OptCreateRepoInputBodyObjectFormat { + return OptCreateRepoInputBodyObjectFormat{ + Value: v, + Set: true, + } +} + +// OptCreateRepoInputBodyObjectFormat is optional CreateRepoInputBodyObjectFormat. +type OptCreateRepoInputBodyObjectFormat struct { + Value CreateRepoInputBodyObjectFormat + Set bool +} + +// IsSet returns true if OptCreateRepoInputBodyObjectFormat was set. +func (o OptCreateRepoInputBodyObjectFormat) IsSet() bool { return o.Set } + +// Reset unsets value. +func (o *OptCreateRepoInputBodyObjectFormat) Reset() { + var v CreateRepoInputBodyObjectFormat + o.Value = v + o.Set = false +} + +// SetTo sets value to v. +func (o *OptCreateRepoInputBodyObjectFormat) SetTo(v CreateRepoInputBodyObjectFormat) { + o.Set = true + o.Value = v +} + +// Get returns value and boolean that denotes whether value was set. +func (o OptCreateRepoInputBodyObjectFormat) Get() (v CreateRepoInputBodyObjectFormat, ok bool) { + if !o.Set { + return v, false + } + return o.Value, true +} + +// Or returns value if set, or given parameter if does not. +func (o OptCreateRepoInputBodyObjectFormat) Or(d CreateRepoInputBodyObjectFormat) CreateRepoInputBodyObjectFormat { + if v, ok := o.Get(); ok { + return v + } + return d +} + +// NewOptDateTime returns new OptDateTime with value set to v. +func NewOptDateTime(v time.Time) OptDateTime { + return OptDateTime{ + Value: v, + Set: true, + } +} + +// OptDateTime is optional time.Time. +type OptDateTime struct { + Value time.Time + Set bool +} + +// IsSet returns true if OptDateTime was set. +func (o OptDateTime) IsSet() bool { return o.Set } + +// Reset unsets value. +func (o *OptDateTime) Reset() { + var v time.Time + o.Value = v + o.Set = false +} + +// SetTo sets value to v. +func (o *OptDateTime) SetTo(v time.Time) { + o.Set = true + o.Value = v +} + +// Get returns value and boolean that denotes whether value was set. +func (o OptDateTime) Get() (v time.Time, ok bool) { + if !o.Set { + return v, false + } + return o.Value, true +} + +// Or returns value if set, or given parameter if does not. +func (o OptDateTime) Or(d time.Time) time.Time { + if v, ok := o.Get(); ok { + return v + } + return d +} + +// NewOptFloat64 returns new OptFloat64 with value set to v. +func NewOptFloat64(v float64) OptFloat64 { + return OptFloat64{ + Value: v, + Set: true, + } +} + +// OptFloat64 is optional float64. +type OptFloat64 struct { + Value float64 + Set bool +} + +// IsSet returns true if OptFloat64 was set. +func (o OptFloat64) IsSet() bool { return o.Set } + +// Reset unsets value. +func (o *OptFloat64) Reset() { + var v float64 + o.Value = v + o.Set = false +} + +// SetTo sets value to v. +func (o *OptFloat64) SetTo(v float64) { + o.Set = true + o.Value = v +} + +// Get returns value and boolean that denotes whether value was set. +func (o OptFloat64) Get() (v float64, ok bool) { + if !o.Set { + return v, false + } + return o.Value, true +} + +// Or returns value if set, or given parameter if does not. +func (o OptFloat64) Or(d float64) float64 { + if v, ok := o.Get(); ok { + return v + } + return d +} + +// NewOptForgeRepoIdentity returns new OptForgeRepoIdentity with value set to v. +func NewOptForgeRepoIdentity(v ForgeRepoIdentity) OptForgeRepoIdentity { + return OptForgeRepoIdentity{ + Value: v, + Set: true, + } +} + +// OptForgeRepoIdentity is optional ForgeRepoIdentity. +type OptForgeRepoIdentity struct { + Value ForgeRepoIdentity + Set bool +} + +// IsSet returns true if OptForgeRepoIdentity was set. +func (o OptForgeRepoIdentity) IsSet() bool { return o.Set } + +// Reset unsets value. +func (o *OptForgeRepoIdentity) Reset() { + var v ForgeRepoIdentity + o.Value = v + o.Set = false +} + +// SetTo sets value to v. +func (o *OptForgeRepoIdentity) SetTo(v ForgeRepoIdentity) { + o.Set = true + o.Value = v +} + +// Get returns value and boolean that denotes whether value was set. +func (o OptForgeRepoIdentity) Get() (v ForgeRepoIdentity, ok bool) { + if !o.Set { + return v, false + } + return o.Value, true +} + +// Or returns value if set, or given parameter if does not. +func (o OptForgeRepoIdentity) Or(d ForgeRepoIdentity) ForgeRepoIdentity { + if v, ok := o.Get(); ok { + return v + } + return d +} + +// NewOptGetMeOutputBodyMode returns new OptGetMeOutputBodyMode with value set to v. +func NewOptGetMeOutputBodyMode(v GetMeOutputBodyMode) OptGetMeOutputBodyMode { + return OptGetMeOutputBodyMode{ + Value: v, + Set: true, + } +} + +// OptGetMeOutputBodyMode is optional GetMeOutputBodyMode. +type OptGetMeOutputBodyMode struct { + Value GetMeOutputBodyMode + Set bool +} + +// IsSet returns true if OptGetMeOutputBodyMode was set. +func (o OptGetMeOutputBodyMode) IsSet() bool { return o.Set } + +// Reset unsets value. +func (o *OptGetMeOutputBodyMode) Reset() { + var v GetMeOutputBodyMode + o.Value = v + o.Set = false +} + +// SetTo sets value to v. +func (o *OptGetMeOutputBodyMode) SetTo(v GetMeOutputBodyMode) { + o.Set = true + o.Value = v +} + +// Get returns value and boolean that denotes whether value was set. +func (o OptGetMeOutputBodyMode) Get() (v GetMeOutputBodyMode, ok bool) { + if !o.Set { + return v, false + } + return o.Value, true +} + +// Or returns value if set, or given parameter if does not. +func (o OptGetMeOutputBodyMode) Or(d GetMeOutputBodyMode) GetMeOutputBodyMode { + if v, ok := o.Get(); ok { + return v + } + return d +} + +// NewOptGetVersionOutputBodyMode returns new OptGetVersionOutputBodyMode with value set to v. +func NewOptGetVersionOutputBodyMode(v GetVersionOutputBodyMode) OptGetVersionOutputBodyMode { + return OptGetVersionOutputBodyMode{ + Value: v, + Set: true, + } +} + +// OptGetVersionOutputBodyMode is optional GetVersionOutputBodyMode. +type OptGetVersionOutputBodyMode struct { + Value GetVersionOutputBodyMode + Set bool +} + +// IsSet returns true if OptGetVersionOutputBodyMode was set. +func (o OptGetVersionOutputBodyMode) IsSet() bool { return o.Set } + +// Reset unsets value. +func (o *OptGetVersionOutputBodyMode) Reset() { + var v GetVersionOutputBodyMode + o.Value = v + o.Set = false +} + +// SetTo sets value to v. +func (o *OptGetVersionOutputBodyMode) SetTo(v GetVersionOutputBodyMode) { + o.Set = true + o.Value = v +} + +// Get returns value and boolean that denotes whether value was set. +func (o OptGetVersionOutputBodyMode) Get() (v GetVersionOutputBodyMode, ok bool) { + if !o.Set { + return v, false + } + return o.Value, true +} + +// Or returns value if set, or given parameter if does not. +func (o OptGetVersionOutputBodyMode) Or(d GetVersionOutputBodyMode) GetVersionOutputBodyMode { + if v, ok := o.Get(); ok { + return v } + return d } -type NativeMirrorPlacementStatus string +// NewOptGrantAccessBodyGranteeType returns new OptGrantAccessBodyGranteeType with value set to v. +func NewOptGrantAccessBodyGranteeType(v GrantAccessBodyGranteeType) OptGrantAccessBodyGranteeType { + return OptGrantAccessBodyGranteeType{ + Value: v, + Set: true, + } +} -const ( - NativeMirrorPlacementStatusProcessing NativeMirrorPlacementStatus = "processing" - NativeMirrorPlacementStatusReady NativeMirrorPlacementStatus = "ready" - NativeMirrorPlacementStatusFailed NativeMirrorPlacementStatus = "failed" - NativeMirrorPlacementStatusSuspended NativeMirrorPlacementStatus = "suspended" -) +// OptGrantAccessBodyGranteeType is optional GrantAccessBodyGranteeType. +type OptGrantAccessBodyGranteeType struct { + Value GrantAccessBodyGranteeType + Set bool +} -// AllValues returns all NativeMirrorPlacementStatus values. -func (NativeMirrorPlacementStatus) AllValues() []NativeMirrorPlacementStatus { - return []NativeMirrorPlacementStatus{ - NativeMirrorPlacementStatusProcessing, - NativeMirrorPlacementStatusReady, - NativeMirrorPlacementStatusFailed, - NativeMirrorPlacementStatusSuspended, - } +// IsSet returns true if OptGrantAccessBodyGranteeType was set. +func (o OptGrantAccessBodyGranteeType) IsSet() bool { return o.Set } + +// Reset unsets value. +func (o *OptGrantAccessBodyGranteeType) Reset() { + var v GrantAccessBodyGranteeType + o.Value = v + o.Set = false } -// MarshalText implements encoding.TextMarshaler. -func (s NativeMirrorPlacementStatus) MarshalText() ([]byte, error) { - switch s { - case NativeMirrorPlacementStatusProcessing: - return []byte(s), nil - case NativeMirrorPlacementStatusReady: - return []byte(s), nil - case NativeMirrorPlacementStatusFailed: - return []byte(s), nil - case NativeMirrorPlacementStatusSuspended: - return []byte(s), nil - default: - return nil, errors.Errorf("invalid value: %q", s) - } +// SetTo sets value to v. +func (o *OptGrantAccessBodyGranteeType) SetTo(v GrantAccessBodyGranteeType) { + o.Set = true + o.Value = v } -// UnmarshalText implements encoding.TextUnmarshaler. -func (s *NativeMirrorPlacementStatus) UnmarshalText(data []byte) error { - switch NativeMirrorPlacementStatus(data) { - case NativeMirrorPlacementStatusProcessing: - *s = NativeMirrorPlacementStatusProcessing - return nil - case NativeMirrorPlacementStatusReady: - *s = NativeMirrorPlacementStatusReady - return nil - case NativeMirrorPlacementStatusFailed: - *s = NativeMirrorPlacementStatusFailed - return nil - case NativeMirrorPlacementStatusSuspended: - *s = NativeMirrorPlacementStatusSuspended - return nil - default: - return errors.Errorf("invalid value: %q", data) +// Get returns value and boolean that denotes whether value was set. +func (o OptGrantAccessBodyGranteeType) Get() (v GrantAccessBodyGranteeType, ok bool) { + if !o.Set { + return v, false } + return o.Value, true } -// Ref: #/components/schemas/OIDCProvider -type OIDCProvider struct { - Description OptString `json:"description"` - DisplayName OptString `json:"displayName"` - ID string `json:"id"` - Issuer string `json:"issuer"` - AdditionalProps OIDCProviderAdditional +// Or returns value if set, or given parameter if does not. +func (o OptGrantAccessBodyGranteeType) Or(d GrantAccessBodyGranteeType) GrantAccessBodyGranteeType { + if v, ok := o.Get(); ok { + return v + } + return d } -// GetDescription returns the value of Description. -func (s *OIDCProvider) GetDescription() OptString { - return s.Description +// NewOptInt32 returns new OptInt32 with value set to v. +func NewOptInt32(v int32) OptInt32 { + return OptInt32{ + Value: v, + Set: true, + } } -// GetDisplayName returns the value of DisplayName. -func (s *OIDCProvider) GetDisplayName() OptString { - return s.DisplayName +// OptInt32 is optional int32. +type OptInt32 struct { + Value int32 + Set bool } -// GetID returns the value of ID. -func (s *OIDCProvider) GetID() string { - return s.ID +// IsSet returns true if OptInt32 was set. +func (o OptInt32) IsSet() bool { return o.Set } + +// Reset unsets value. +func (o *OptInt32) Reset() { + var v int32 + o.Value = v + o.Set = false } -// GetIssuer returns the value of Issuer. -func (s *OIDCProvider) GetIssuer() string { - return s.Issuer +// SetTo sets value to v. +func (o *OptInt32) SetTo(v int32) { + o.Set = true + o.Value = v } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *OIDCProvider) GetAdditionalProps() OIDCProviderAdditional { - return s.AdditionalProps +// Get returns value and boolean that denotes whether value was set. +func (o OptInt32) Get() (v int32, ok bool) { + if !o.Set { + return v, false + } + return o.Value, true } -// SetDescription sets the value of Description. -func (s *OIDCProvider) SetDescription(val OptString) { - s.Description = val +// Or returns value if set, or given parameter if does not. +func (o OptInt32) Or(d int32) int32 { + if v, ok := o.Get(); ok { + return v + } + return d } -// SetDisplayName sets the value of DisplayName. -func (s *OIDCProvider) SetDisplayName(val OptString) { - s.DisplayName = val +// NewOptInt64 returns new OptInt64 with value set to v. +func NewOptInt64(v int64) OptInt64 { + return OptInt64{ + Value: v, + Set: true, + } } -// SetID sets the value of ID. -func (s *OIDCProvider) SetID(val string) { - s.ID = val +// OptInt64 is optional int64. +type OptInt64 struct { + Value int64 + Set bool } -// SetIssuer sets the value of Issuer. -func (s *OIDCProvider) SetIssuer(val string) { - s.Issuer = val +// IsSet returns true if OptInt64 was set. +func (o OptInt64) IsSet() bool { return o.Set } + +// Reset unsets value. +func (o *OptInt64) Reset() { + var v int64 + o.Value = v + o.Set = false } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *OIDCProvider) SetAdditionalProps(val OIDCProviderAdditional) { - s.AdditionalProps = val +// SetTo sets value to v. +func (o *OptInt64) SetTo(v int64) { + o.Set = true + o.Value = v } -type OIDCProviderAdditional map[string]jx.Raw +// Get returns value and boolean that denotes whether value was set. +func (o OptInt64) Get() (v int64, ok bool) { + if !o.Set { + return v, false + } + return o.Value, true +} -func (s *OIDCProviderAdditional) init() OIDCProviderAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m +// Or returns value if set, or given parameter if does not. +func (o OptInt64) Or(d int64) int64 { + if v, ok := o.Get(); ok { + return v } - return m + return d } -// NewOptAddOrgMemberInputBodyRole returns new OptAddOrgMemberInputBodyRole with value set to v. -func NewOptAddOrgMemberInputBodyRole(v AddOrgMemberInputBodyRole) OptAddOrgMemberInputBodyRole { - return OptAddOrgMemberInputBodyRole{ +// NewOptListOrgInvitationsStatus returns new OptListOrgInvitationsStatus with value set to v. +func NewOptListOrgInvitationsStatus(v ListOrgInvitationsStatus) OptListOrgInvitationsStatus { + return OptListOrgInvitationsStatus{ Value: v, Set: true, } } -// OptAddOrgMemberInputBodyRole is optional AddOrgMemberInputBodyRole. -type OptAddOrgMemberInputBodyRole struct { - Value AddOrgMemberInputBodyRole +// OptListOrgInvitationsStatus is optional ListOrgInvitationsStatus. +type OptListOrgInvitationsStatus struct { + Value ListOrgInvitationsStatus Set bool } -// IsSet returns true if OptAddOrgMemberInputBodyRole was set. -func (o OptAddOrgMemberInputBodyRole) IsSet() bool { return o.Set } +// IsSet returns true if OptListOrgInvitationsStatus was set. +func (o OptListOrgInvitationsStatus) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptAddOrgMemberInputBodyRole) Reset() { - var v AddOrgMemberInputBodyRole +func (o *OptListOrgInvitationsStatus) Reset() { + var v ListOrgInvitationsStatus o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptAddOrgMemberInputBodyRole) SetTo(v AddOrgMemberInputBodyRole) { +func (o *OptListOrgInvitationsStatus) SetTo(v ListOrgInvitationsStatus) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptAddOrgMemberInputBodyRole) Get() (v AddOrgMemberInputBodyRole, ok bool) { +func (o OptListOrgInvitationsStatus) Get() (v ListOrgInvitationsStatus, ok bool) { if !o.Set { return v, false } @@ -8852,45 +12131,45 @@ func (o OptAddOrgMemberInputBodyRole) Get() (v AddOrgMemberInputBodyRole, ok boo } // Or returns value if set, or given parameter if does not. -func (o OptAddOrgMemberInputBodyRole) Or(d AddOrgMemberInputBodyRole) AddOrgMemberInputBodyRole { +func (o OptListOrgInvitationsStatus) Or(d ListOrgInvitationsStatus) ListOrgInvitationsStatus { if v, ok := o.Get(); ok { return v } return d } -// NewOptAuditEventMetadata returns new OptAuditEventMetadata with value set to v. -func NewOptAuditEventMetadata(v AuditEventMetadata) OptAuditEventMetadata { - return OptAuditEventMetadata{ +// NewOptListOrgPeopleMembership returns new OptListOrgPeopleMembership with value set to v. +func NewOptListOrgPeopleMembership(v ListOrgPeopleMembership) OptListOrgPeopleMembership { + return OptListOrgPeopleMembership{ Value: v, Set: true, } } -// OptAuditEventMetadata is optional AuditEventMetadata. -type OptAuditEventMetadata struct { - Value AuditEventMetadata +// OptListOrgPeopleMembership is optional ListOrgPeopleMembership. +type OptListOrgPeopleMembership struct { + Value ListOrgPeopleMembership Set bool } -// IsSet returns true if OptAuditEventMetadata was set. -func (o OptAuditEventMetadata) IsSet() bool { return o.Set } +// IsSet returns true if OptListOrgPeopleMembership was set. +func (o OptListOrgPeopleMembership) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptAuditEventMetadata) Reset() { - var v AuditEventMetadata +func (o *OptListOrgPeopleMembership) Reset() { + var v ListOrgPeopleMembership o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptAuditEventMetadata) SetTo(v AuditEventMetadata) { +func (o *OptListOrgPeopleMembership) SetTo(v ListOrgPeopleMembership) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptAuditEventMetadata) Get() (v AuditEventMetadata, ok bool) { +func (o OptListOrgPeopleMembership) Get() (v ListOrgPeopleMembership, ok bool) { if !o.Set { return v, false } @@ -8898,45 +12177,45 @@ func (o OptAuditEventMetadata) Get() (v AuditEventMetadata, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptAuditEventMetadata) Or(d AuditEventMetadata) AuditEventMetadata { +func (o OptListOrgPeopleMembership) Or(d ListOrgPeopleMembership) ListOrgPeopleMembership { if v, ok := o.Get(); ok { return v } return d } -// NewOptBool returns new OptBool with value set to v. -func NewOptBool(v bool) OptBool { - return OptBool{ +// NewOptListOrgPeopleRole returns new OptListOrgPeopleRole with value set to v. +func NewOptListOrgPeopleRole(v ListOrgPeopleRole) OptListOrgPeopleRole { + return OptListOrgPeopleRole{ Value: v, Set: true, } } -// OptBool is optional bool. -type OptBool struct { - Value bool +// OptListOrgPeopleRole is optional ListOrgPeopleRole. +type OptListOrgPeopleRole struct { + Value ListOrgPeopleRole Set bool } -// IsSet returns true if OptBool was set. -func (o OptBool) IsSet() bool { return o.Set } +// IsSet returns true if OptListOrgPeopleRole was set. +func (o OptListOrgPeopleRole) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptBool) Reset() { - var v bool +func (o *OptListOrgPeopleRole) Reset() { + var v ListOrgPeopleRole o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptBool) SetTo(v bool) { +func (o *OptListOrgPeopleRole) SetTo(v ListOrgPeopleRole) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptBool) Get() (v bool, ok bool) { +func (o OptListOrgPeopleRole) Get() (v ListOrgPeopleRole, ok bool) { if !o.Set { return v, false } @@ -8944,45 +12223,45 @@ func (o OptBool) Get() (v bool, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptBool) Or(d bool) bool { +func (o OptListOrgPeopleRole) Or(d ListOrgPeopleRole) ListOrgPeopleRole { if v, ok := o.Get(); ok { return v } return d } -// NewOptCISetupBlock returns new OptCISetupBlock with value set to v. -func NewOptCISetupBlock(v CISetupBlock) OptCISetupBlock { - return OptCISetupBlock{ +// NewOptListOrgPeopleScope returns new OptListOrgPeopleScope with value set to v. +func NewOptListOrgPeopleScope(v ListOrgPeopleScope) OptListOrgPeopleScope { + return OptListOrgPeopleScope{ Value: v, Set: true, } } -// OptCISetupBlock is optional CISetupBlock. -type OptCISetupBlock struct { - Value CISetupBlock +// OptListOrgPeopleScope is optional ListOrgPeopleScope. +type OptListOrgPeopleScope struct { + Value ListOrgPeopleScope Set bool } -// IsSet returns true if OptCISetupBlock was set. -func (o OptCISetupBlock) IsSet() bool { return o.Set } +// IsSet returns true if OptListOrgPeopleScope was set. +func (o OptListOrgPeopleScope) IsSet() bool { return o.Set } -// Reset unsets value. -func (o *OptCISetupBlock) Reset() { - var v CISetupBlock +// Reset unsets value. +func (o *OptListOrgPeopleScope) Reset() { + var v ListOrgPeopleScope o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptCISetupBlock) SetTo(v CISetupBlock) { +func (o *OptListOrgPeopleScope) SetTo(v ListOrgPeopleScope) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptCISetupBlock) Get() (v CISetupBlock, ok bool) { +func (o OptListOrgPeopleScope) Get() (v ListOrgPeopleScope, ok bool) { if !o.Set { return v, false } @@ -8990,45 +12269,45 @@ func (o OptCISetupBlock) Get() (v CISetupBlock, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptCISetupBlock) Or(d CISetupBlock) CISetupBlock { +func (o OptListOrgPeopleScope) Or(d ListOrgPeopleScope) ListOrgPeopleScope { if v, ok := o.Get(); ok { return v } return d } -// NewOptCIWebhookAuditEventViewMetadata returns new OptCIWebhookAuditEventViewMetadata with value set to v. -func NewOptCIWebhookAuditEventViewMetadata(v CIWebhookAuditEventViewMetadata) OptCIWebhookAuditEventViewMetadata { - return OptCIWebhookAuditEventViewMetadata{ +// NewOptListOrgPeopleStatus returns new OptListOrgPeopleStatus with value set to v. +func NewOptListOrgPeopleStatus(v ListOrgPeopleStatus) OptListOrgPeopleStatus { + return OptListOrgPeopleStatus{ Value: v, Set: true, } } -// OptCIWebhookAuditEventViewMetadata is optional CIWebhookAuditEventViewMetadata. -type OptCIWebhookAuditEventViewMetadata struct { - Value CIWebhookAuditEventViewMetadata +// OptListOrgPeopleStatus is optional ListOrgPeopleStatus. +type OptListOrgPeopleStatus struct { + Value ListOrgPeopleStatus Set bool } -// IsSet returns true if OptCIWebhookAuditEventViewMetadata was set. -func (o OptCIWebhookAuditEventViewMetadata) IsSet() bool { return o.Set } +// IsSet returns true if OptListOrgPeopleStatus was set. +func (o OptListOrgPeopleStatus) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptCIWebhookAuditEventViewMetadata) Reset() { - var v CIWebhookAuditEventViewMetadata +func (o *OptListOrgPeopleStatus) Reset() { + var v ListOrgPeopleStatus o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptCIWebhookAuditEventViewMetadata) SetTo(v CIWebhookAuditEventViewMetadata) { +func (o *OptListOrgPeopleStatus) SetTo(v ListOrgPeopleStatus) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptCIWebhookAuditEventViewMetadata) Get() (v CIWebhookAuditEventViewMetadata, ok bool) { +func (o OptListOrgPeopleStatus) Get() (v ListOrgPeopleStatus, ok bool) { if !o.Set { return v, false } @@ -9036,45 +12315,45 @@ func (o OptCIWebhookAuditEventViewMetadata) Get() (v CIWebhookAuditEventViewMeta } // Or returns value if set, or given parameter if does not. -func (o OptCIWebhookAuditEventViewMetadata) Or(d CIWebhookAuditEventViewMetadata) CIWebhookAuditEventViewMetadata { +func (o OptListOrgPeopleStatus) Or(d ListOrgPeopleStatus) ListOrgPeopleStatus { if v, ok := o.Get(); ok { return v } return d } -// NewOptCreateRepoCIWebhookInputBodyConfig returns new OptCreateRepoCIWebhookInputBodyConfig with value set to v. -func NewOptCreateRepoCIWebhookInputBodyConfig(v CreateRepoCIWebhookInputBodyConfig) OptCreateRepoCIWebhookInputBodyConfig { - return OptCreateRepoCIWebhookInputBodyConfig{ +// NewOptListProjectPeopleRole returns new OptListProjectPeopleRole with value set to v. +func NewOptListProjectPeopleRole(v ListProjectPeopleRole) OptListProjectPeopleRole { + return OptListProjectPeopleRole{ Value: v, Set: true, } } -// OptCreateRepoCIWebhookInputBodyConfig is optional CreateRepoCIWebhookInputBodyConfig. -type OptCreateRepoCIWebhookInputBodyConfig struct { - Value CreateRepoCIWebhookInputBodyConfig +// OptListProjectPeopleRole is optional ListProjectPeopleRole. +type OptListProjectPeopleRole struct { + Value ListProjectPeopleRole Set bool } -// IsSet returns true if OptCreateRepoCIWebhookInputBodyConfig was set. -func (o OptCreateRepoCIWebhookInputBodyConfig) IsSet() bool { return o.Set } +// IsSet returns true if OptListProjectPeopleRole was set. +func (o OptListProjectPeopleRole) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptCreateRepoCIWebhookInputBodyConfig) Reset() { - var v CreateRepoCIWebhookInputBodyConfig +func (o *OptListProjectPeopleRole) Reset() { + var v ListProjectPeopleRole o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptCreateRepoCIWebhookInputBodyConfig) SetTo(v CreateRepoCIWebhookInputBodyConfig) { +func (o *OptListProjectPeopleRole) SetTo(v ListProjectPeopleRole) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptCreateRepoCIWebhookInputBodyConfig) Get() (v CreateRepoCIWebhookInputBodyConfig, ok bool) { +func (o OptListProjectPeopleRole) Get() (v ListProjectPeopleRole, ok bool) { if !o.Set { return v, false } @@ -9082,45 +12361,45 @@ func (o OptCreateRepoCIWebhookInputBodyConfig) Get() (v CreateRepoCIWebhookInput } // Or returns value if set, or given parameter if does not. -func (o OptCreateRepoCIWebhookInputBodyConfig) Or(d CreateRepoCIWebhookInputBodyConfig) CreateRepoCIWebhookInputBodyConfig { +func (o OptListProjectPeopleRole) Or(d ListProjectPeopleRole) ListProjectPeopleRole { if v, ok := o.Get(); ok { return v } return d } -// NewOptCreateRepoInputBodyObjectFormat returns new OptCreateRepoInputBodyObjectFormat with value set to v. -func NewOptCreateRepoInputBodyObjectFormat(v CreateRepoInputBodyObjectFormat) OptCreateRepoInputBodyObjectFormat { - return OptCreateRepoInputBodyObjectFormat{ +// NewOptListRepoCIDeliveriesDirection returns new OptListRepoCIDeliveriesDirection with value set to v. +func NewOptListRepoCIDeliveriesDirection(v ListRepoCIDeliveriesDirection) OptListRepoCIDeliveriesDirection { + return OptListRepoCIDeliveriesDirection{ Value: v, Set: true, } } -// OptCreateRepoInputBodyObjectFormat is optional CreateRepoInputBodyObjectFormat. -type OptCreateRepoInputBodyObjectFormat struct { - Value CreateRepoInputBodyObjectFormat +// OptListRepoCIDeliveriesDirection is optional ListRepoCIDeliveriesDirection. +type OptListRepoCIDeliveriesDirection struct { + Value ListRepoCIDeliveriesDirection Set bool } -// IsSet returns true if OptCreateRepoInputBodyObjectFormat was set. -func (o OptCreateRepoInputBodyObjectFormat) IsSet() bool { return o.Set } +// IsSet returns true if OptListRepoCIDeliveriesDirection was set. +func (o OptListRepoCIDeliveriesDirection) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptCreateRepoInputBodyObjectFormat) Reset() { - var v CreateRepoInputBodyObjectFormat +func (o *OptListRepoCIDeliveriesDirection) Reset() { + var v ListRepoCIDeliveriesDirection o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptCreateRepoInputBodyObjectFormat) SetTo(v CreateRepoInputBodyObjectFormat) { +func (o *OptListRepoCIDeliveriesDirection) SetTo(v ListRepoCIDeliveriesDirection) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptCreateRepoInputBodyObjectFormat) Get() (v CreateRepoInputBodyObjectFormat, ok bool) { +func (o OptListRepoCIDeliveriesDirection) Get() (v ListRepoCIDeliveriesDirection, ok bool) { if !o.Set { return v, false } @@ -9128,45 +12407,45 @@ func (o OptCreateRepoInputBodyObjectFormat) Get() (v CreateRepoInputBodyObjectFo } // Or returns value if set, or given parameter if does not. -func (o OptCreateRepoInputBodyObjectFormat) Or(d CreateRepoInputBodyObjectFormat) CreateRepoInputBodyObjectFormat { +func (o OptListRepoCIDeliveriesDirection) Or(d ListRepoCIDeliveriesDirection) ListRepoCIDeliveriesDirection { if v, ok := o.Get(); ok { return v } return d } -// NewOptDateTime returns new OptDateTime with value set to v. -func NewOptDateTime(v time.Time) OptDateTime { - return OptDateTime{ +// NewOptListRepoPeopleRole returns new OptListRepoPeopleRole with value set to v. +func NewOptListRepoPeopleRole(v ListRepoPeopleRole) OptListRepoPeopleRole { + return OptListRepoPeopleRole{ Value: v, Set: true, } } -// OptDateTime is optional time.Time. -type OptDateTime struct { - Value time.Time +// OptListRepoPeopleRole is optional ListRepoPeopleRole. +type OptListRepoPeopleRole struct { + Value ListRepoPeopleRole Set bool } -// IsSet returns true if OptDateTime was set. -func (o OptDateTime) IsSet() bool { return o.Set } +// IsSet returns true if OptListRepoPeopleRole was set. +func (o OptListRepoPeopleRole) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptDateTime) Reset() { - var v time.Time +func (o *OptListRepoPeopleRole) Reset() { + var v ListRepoPeopleRole o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptDateTime) SetTo(v time.Time) { +func (o *OptListRepoPeopleRole) SetTo(v ListRepoPeopleRole) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptDateTime) Get() (v time.Time, ok bool) { +func (o OptListRepoPeopleRole) Get() (v ListRepoPeopleRole, ok bool) { if !o.Set { return v, false } @@ -9174,45 +12453,45 @@ func (o OptDateTime) Get() (v time.Time, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptDateTime) Or(d time.Time) time.Time { +func (o OptListRepoPeopleRole) Or(d ListRepoPeopleRole) ListRepoPeopleRole { if v, ok := o.Get(); ok { return v } return d } -// NewOptFloat64 returns new OptFloat64 with value set to v. -func NewOptFloat64(v float64) OptFloat64 { - return OptFloat64{ +// NewOptListReposArchived returns new OptListReposArchived with value set to v. +func NewOptListReposArchived(v ListReposArchived) OptListReposArchived { + return OptListReposArchived{ Value: v, Set: true, } } -// OptFloat64 is optional float64. -type OptFloat64 struct { - Value float64 +// OptListReposArchived is optional ListReposArchived. +type OptListReposArchived struct { + Value ListReposArchived Set bool } -// IsSet returns true if OptFloat64 was set. -func (o OptFloat64) IsSet() bool { return o.Set } +// IsSet returns true if OptListReposArchived was set. +func (o OptListReposArchived) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptFloat64) Reset() { - var v float64 +func (o *OptListReposArchived) Reset() { + var v ListReposArchived o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptFloat64) SetTo(v float64) { +func (o *OptListReposArchived) SetTo(v ListReposArchived) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptFloat64) Get() (v float64, ok bool) { +func (o OptListReposArchived) Get() (v ListReposArchived, ok bool) { if !o.Set { return v, false } @@ -9220,45 +12499,45 @@ func (o OptFloat64) Get() (v float64, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptFloat64) Or(d float64) float64 { +func (o OptListReposArchived) Or(d ListReposArchived) ListReposArchived { if v, ok := o.Get(); ok { return v } return d } -// NewOptForgeRepoIdentity returns new OptForgeRepoIdentity with value set to v. -func NewOptForgeRepoIdentity(v ForgeRepoIdentity) OptForgeRepoIdentity { - return OptForgeRepoIdentity{ +// NewOptListReposHasCheckpoints returns new OptListReposHasCheckpoints with value set to v. +func NewOptListReposHasCheckpoints(v ListReposHasCheckpoints) OptListReposHasCheckpoints { + return OptListReposHasCheckpoints{ Value: v, Set: true, } } -// OptForgeRepoIdentity is optional ForgeRepoIdentity. -type OptForgeRepoIdentity struct { - Value ForgeRepoIdentity +// OptListReposHasCheckpoints is optional ListReposHasCheckpoints. +type OptListReposHasCheckpoints struct { + Value ListReposHasCheckpoints Set bool } -// IsSet returns true if OptForgeRepoIdentity was set. -func (o OptForgeRepoIdentity) IsSet() bool { return o.Set } +// IsSet returns true if OptListReposHasCheckpoints was set. +func (o OptListReposHasCheckpoints) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptForgeRepoIdentity) Reset() { - var v ForgeRepoIdentity +func (o *OptListReposHasCheckpoints) Reset() { + var v ListReposHasCheckpoints o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptForgeRepoIdentity) SetTo(v ForgeRepoIdentity) { +func (o *OptListReposHasCheckpoints) SetTo(v ListReposHasCheckpoints) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptForgeRepoIdentity) Get() (v ForgeRepoIdentity, ok bool) { +func (o OptListReposHasCheckpoints) Get() (v ListReposHasCheckpoints, ok bool) { if !o.Set { return v, false } @@ -9266,45 +12545,45 @@ func (o OptForgeRepoIdentity) Get() (v ForgeRepoIdentity, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptForgeRepoIdentity) Or(d ForgeRepoIdentity) ForgeRepoIdentity { +func (o OptListReposHasCheckpoints) Or(d ListReposHasCheckpoints) ListReposHasCheckpoints { if v, ok := o.Get(); ok { return v } return d } -// NewOptGetMeOutputBodyMode returns new OptGetMeOutputBodyMode with value set to v. -func NewOptGetMeOutputBodyMode(v GetMeOutputBodyMode) OptGetMeOutputBodyMode { - return OptGetMeOutputBodyMode{ +// NewOptListReposOrder returns new OptListReposOrder with value set to v. +func NewOptListReposOrder(v ListReposOrder) OptListReposOrder { + return OptListReposOrder{ Value: v, Set: true, } } -// OptGetMeOutputBodyMode is optional GetMeOutputBodyMode. -type OptGetMeOutputBodyMode struct { - Value GetMeOutputBodyMode +// OptListReposOrder is optional ListReposOrder. +type OptListReposOrder struct { + Value ListReposOrder Set bool } -// IsSet returns true if OptGetMeOutputBodyMode was set. -func (o OptGetMeOutputBodyMode) IsSet() bool { return o.Set } +// IsSet returns true if OptListReposOrder was set. +func (o OptListReposOrder) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptGetMeOutputBodyMode) Reset() { - var v GetMeOutputBodyMode +func (o *OptListReposOrder) Reset() { + var v ListReposOrder o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptGetMeOutputBodyMode) SetTo(v GetMeOutputBodyMode) { +func (o *OptListReposOrder) SetTo(v ListReposOrder) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptGetMeOutputBodyMode) Get() (v GetMeOutputBodyMode, ok bool) { +func (o OptListReposOrder) Get() (v ListReposOrder, ok bool) { if !o.Set { return v, false } @@ -9312,45 +12591,45 @@ func (o OptGetMeOutputBodyMode) Get() (v GetMeOutputBodyMode, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptGetMeOutputBodyMode) Or(d GetMeOutputBodyMode) GetMeOutputBodyMode { +func (o OptListReposOrder) Or(d ListReposOrder) ListReposOrder { if v, ok := o.Get(); ok { return v } return d } -// NewOptGetPermissionsOutputBodyExplain returns new OptGetPermissionsOutputBodyExplain with value set to v. -func NewOptGetPermissionsOutputBodyExplain(v GetPermissionsOutputBodyExplain) OptGetPermissionsOutputBodyExplain { - return OptGetPermissionsOutputBodyExplain{ +// NewOptListReposPermission returns new OptListReposPermission with value set to v. +func NewOptListReposPermission(v ListReposPermission) OptListReposPermission { + return OptListReposPermission{ Value: v, Set: true, } } -// OptGetPermissionsOutputBodyExplain is optional GetPermissionsOutputBodyExplain. -type OptGetPermissionsOutputBodyExplain struct { - Value GetPermissionsOutputBodyExplain +// OptListReposPermission is optional ListReposPermission. +type OptListReposPermission struct { + Value ListReposPermission Set bool } -// IsSet returns true if OptGetPermissionsOutputBodyExplain was set. -func (o OptGetPermissionsOutputBodyExplain) IsSet() bool { return o.Set } +// IsSet returns true if OptListReposPermission was set. +func (o OptListReposPermission) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptGetPermissionsOutputBodyExplain) Reset() { - var v GetPermissionsOutputBodyExplain +func (o *OptListReposPermission) Reset() { + var v ListReposPermission o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptGetPermissionsOutputBodyExplain) SetTo(v GetPermissionsOutputBodyExplain) { +func (o *OptListReposPermission) SetTo(v ListReposPermission) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptGetPermissionsOutputBodyExplain) Get() (v GetPermissionsOutputBodyExplain, ok bool) { +func (o OptListReposPermission) Get() (v ListReposPermission, ok bool) { if !o.Set { return v, false } @@ -9358,45 +12637,45 @@ func (o OptGetPermissionsOutputBodyExplain) Get() (v GetPermissionsOutputBodyExp } // Or returns value if set, or given parameter if does not. -func (o OptGetPermissionsOutputBodyExplain) Or(d GetPermissionsOutputBodyExplain) GetPermissionsOutputBodyExplain { +func (o OptListReposPermission) Or(d ListReposPermission) ListReposPermission { if v, ok := o.Get(); ok { return v } return d } -// NewOptGetVersionOutputBodyMode returns new OptGetVersionOutputBodyMode with value set to v. -func NewOptGetVersionOutputBodyMode(v GetVersionOutputBodyMode) OptGetVersionOutputBodyMode { - return OptGetVersionOutputBodyMode{ +// NewOptListReposScope returns new OptListReposScope with value set to v. +func NewOptListReposScope(v ListReposScope) OptListReposScope { + return OptListReposScope{ Value: v, Set: true, } } -// OptGetVersionOutputBodyMode is optional GetVersionOutputBodyMode. -type OptGetVersionOutputBodyMode struct { - Value GetVersionOutputBodyMode +// OptListReposScope is optional ListReposScope. +type OptListReposScope struct { + Value ListReposScope Set bool } -// IsSet returns true if OptGetVersionOutputBodyMode was set. -func (o OptGetVersionOutputBodyMode) IsSet() bool { return o.Set } +// IsSet returns true if OptListReposScope was set. +func (o OptListReposScope) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptGetVersionOutputBodyMode) Reset() { - var v GetVersionOutputBodyMode +func (o *OptListReposScope) Reset() { + var v ListReposScope o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptGetVersionOutputBodyMode) SetTo(v GetVersionOutputBodyMode) { +func (o *OptListReposScope) SetTo(v ListReposScope) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptGetVersionOutputBodyMode) Get() (v GetVersionOutputBodyMode, ok bool) { +func (o OptListReposScope) Get() (v ListReposScope, ok bool) { if !o.Set { return v, false } @@ -9404,45 +12683,45 @@ func (o OptGetVersionOutputBodyMode) Get() (v GetVersionOutputBodyMode, ok bool) } // Or returns value if set, or given parameter if does not. -func (o OptGetVersionOutputBodyMode) Or(d GetVersionOutputBodyMode) GetVersionOutputBodyMode { +func (o OptListReposScope) Or(d ListReposScope) ListReposScope { if v, ok := o.Get(); ok { return v } return d } -// NewOptGrantProjectAccessInputBodyGranteeType returns new OptGrantProjectAccessInputBodyGranteeType with value set to v. -func NewOptGrantProjectAccessInputBodyGranteeType(v GrantProjectAccessInputBodyGranteeType) OptGrantProjectAccessInputBodyGranteeType { - return OptGrantProjectAccessInputBodyGranteeType{ +// NewOptListReposStatus returns new OptListReposStatus with value set to v. +func NewOptListReposStatus(v ListReposStatus) OptListReposStatus { + return OptListReposStatus{ Value: v, Set: true, } } -// OptGrantProjectAccessInputBodyGranteeType is optional GrantProjectAccessInputBodyGranteeType. -type OptGrantProjectAccessInputBodyGranteeType struct { - Value GrantProjectAccessInputBodyGranteeType +// OptListReposStatus is optional ListReposStatus. +type OptListReposStatus struct { + Value ListReposStatus Set bool } -// IsSet returns true if OptGrantProjectAccessInputBodyGranteeType was set. -func (o OptGrantProjectAccessInputBodyGranteeType) IsSet() bool { return o.Set } +// IsSet returns true if OptListReposStatus was set. +func (o OptListReposStatus) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptGrantProjectAccessInputBodyGranteeType) Reset() { - var v GrantProjectAccessInputBodyGranteeType +func (o *OptListReposStatus) Reset() { + var v ListReposStatus o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptGrantProjectAccessInputBodyGranteeType) SetTo(v GrantProjectAccessInputBodyGranteeType) { +func (o *OptListReposStatus) SetTo(v ListReposStatus) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptGrantProjectAccessInputBodyGranteeType) Get() (v GrantProjectAccessInputBodyGranteeType, ok bool) { +func (o OptListReposStatus) Get() (v ListReposStatus, ok bool) { if !o.Set { return v, false } @@ -9450,45 +12729,45 @@ func (o OptGrantProjectAccessInputBodyGranteeType) Get() (v GrantProjectAccessIn } // Or returns value if set, or given parameter if does not. -func (o OptGrantProjectAccessInputBodyGranteeType) Or(d GrantProjectAccessInputBodyGranteeType) GrantProjectAccessInputBodyGranteeType { +func (o OptListReposStatus) Or(d ListReposStatus) ListReposStatus { if v, ok := o.Get(); ok { return v } return d } -// NewOptGrantRepoAccessInputBodyGranteeType returns new OptGrantRepoAccessInputBodyGranteeType with value set to v. -func NewOptGrantRepoAccessInputBodyGranteeType(v GrantRepoAccessInputBodyGranteeType) OptGrantRepoAccessInputBodyGranteeType { - return OptGrantRepoAccessInputBodyGranteeType{ +// NewOptListReposVisibility returns new OptListReposVisibility with value set to v. +func NewOptListReposVisibility(v ListReposVisibility) OptListReposVisibility { + return OptListReposVisibility{ Value: v, Set: true, } } -// OptGrantRepoAccessInputBodyGranteeType is optional GrantRepoAccessInputBodyGranteeType. -type OptGrantRepoAccessInputBodyGranteeType struct { - Value GrantRepoAccessInputBodyGranteeType +// OptListReposVisibility is optional ListReposVisibility. +type OptListReposVisibility struct { + Value ListReposVisibility Set bool } -// IsSet returns true if OptGrantRepoAccessInputBodyGranteeType was set. -func (o OptGrantRepoAccessInputBodyGranteeType) IsSet() bool { return o.Set } +// IsSet returns true if OptListReposVisibility was set. +func (o OptListReposVisibility) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptGrantRepoAccessInputBodyGranteeType) Reset() { - var v GrantRepoAccessInputBodyGranteeType +func (o *OptListReposVisibility) Reset() { + var v ListReposVisibility o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptGrantRepoAccessInputBodyGranteeType) SetTo(v GrantRepoAccessInputBodyGranteeType) { +func (o *OptListReposVisibility) SetTo(v ListReposVisibility) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptGrantRepoAccessInputBodyGranteeType) Get() (v GrantRepoAccessInputBodyGranteeType, ok bool) { +func (o OptListReposVisibility) Get() (v ListReposVisibility, ok bool) { if !o.Set { return v, false } @@ -9496,45 +12775,45 @@ func (o OptGrantRepoAccessInputBodyGranteeType) Get() (v GrantRepoAccessInputBod } // Or returns value if set, or given parameter if does not. -func (o OptGrantRepoAccessInputBodyGranteeType) Or(d GrantRepoAccessInputBodyGranteeType) GrantRepoAccessInputBodyGranteeType { +func (o OptListReposVisibility) Or(d ListReposVisibility) ListReposVisibility { if v, ok := o.Get(); ok { return v } return d } -// NewOptInt32 returns new OptInt32 with value set to v. -func NewOptInt32(v int32) OptInt32 { - return OptInt32{ +// NewOptMeDeletion returns new OptMeDeletion with value set to v. +func NewOptMeDeletion(v MeDeletion) OptMeDeletion { + return OptMeDeletion{ Value: v, Set: true, } } -// OptInt32 is optional int32. -type OptInt32 struct { - Value int32 +// OptMeDeletion is optional MeDeletion. +type OptMeDeletion struct { + Value MeDeletion Set bool } -// IsSet returns true if OptInt32 was set. -func (o OptInt32) IsSet() bool { return o.Set } +// IsSet returns true if OptMeDeletion was set. +func (o OptMeDeletion) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptInt32) Reset() { - var v int32 +func (o *OptMeDeletion) Reset() { + var v MeDeletion o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptInt32) SetTo(v int32) { +func (o *OptMeDeletion) SetTo(v MeDeletion) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptInt32) Get() (v int32, ok bool) { +func (o OptMeDeletion) Get() (v MeDeletion, ok bool) { if !o.Set { return v, false } @@ -9542,45 +12821,45 @@ func (o OptInt32) Get() (v int32, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptInt32) Or(d int32) int32 { +func (o OptMeDeletion) Or(d MeDeletion) MeDeletion { if v, ok := o.Get(); ok { return v } return d } -// NewOptInt64 returns new OptInt64 with value set to v. -func NewOptInt64(v int64) OptInt64 { - return OptInt64{ +// NewOptMeRegional returns new OptMeRegional with value set to v. +func NewOptMeRegional(v MeRegional) OptMeRegional { + return OptMeRegional{ Value: v, Set: true, } } -// OptInt64 is optional int64. -type OptInt64 struct { - Value int64 +// OptMeRegional is optional MeRegional. +type OptMeRegional struct { + Value MeRegional Set bool } -// IsSet returns true if OptInt64 was set. -func (o OptInt64) IsSet() bool { return o.Set } +// IsSet returns true if OptMeRegional was set. +func (o OptMeRegional) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptInt64) Reset() { - var v int64 +func (o *OptMeRegional) Reset() { + var v MeRegional o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptInt64) SetTo(v int64) { +func (o *OptMeRegional) SetTo(v MeRegional) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptInt64) Get() (v int64, ok bool) { +func (o OptMeRegional) Get() (v MeRegional, ok bool) { if !o.Set { return v, false } @@ -9588,45 +12867,45 @@ func (o OptInt64) Get() (v int64, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptInt64) Or(d int64) int64 { +func (o OptMeRegional) Or(d MeRegional) MeRegional { if v, ok := o.Get(); ok { return v } return d -} - -// NewOptListReposArchived returns new OptListReposArchived with value set to v. -func NewOptListReposArchived(v ListReposArchived) OptListReposArchived { - return OptListReposArchived{ +} + +// NewOptMeRegionalUnavailable returns new OptMeRegionalUnavailable with value set to v. +func NewOptMeRegionalUnavailable(v MeRegionalUnavailable) OptMeRegionalUnavailable { + return OptMeRegionalUnavailable{ Value: v, Set: true, } } -// OptListReposArchived is optional ListReposArchived. -type OptListReposArchived struct { - Value ListReposArchived +// OptMeRegionalUnavailable is optional MeRegionalUnavailable. +type OptMeRegionalUnavailable struct { + Value MeRegionalUnavailable Set bool } -// IsSet returns true if OptListReposArchived was set. -func (o OptListReposArchived) IsSet() bool { return o.Set } +// IsSet returns true if OptMeRegionalUnavailable was set. +func (o OptMeRegionalUnavailable) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptListReposArchived) Reset() { - var v ListReposArchived +func (o *OptMeRegionalUnavailable) Reset() { + var v MeRegionalUnavailable o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptListReposArchived) SetTo(v ListReposArchived) { +func (o *OptMeRegionalUnavailable) SetTo(v MeRegionalUnavailable) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptListReposArchived) Get() (v ListReposArchived, ok bool) { +func (o OptMeRegionalUnavailable) Get() (v MeRegionalUnavailable, ok bool) { if !o.Set { return v, false } @@ -9634,45 +12913,45 @@ func (o OptListReposArchived) Get() (v ListReposArchived, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptListReposArchived) Or(d ListReposArchived) ListReposArchived { +func (o OptMeRegionalUnavailable) Or(d MeRegionalUnavailable) MeRegionalUnavailable { if v, ok := o.Get(); ok { return v } return d } -// NewOptListReposHasCheckpoints returns new OptListReposHasCheckpoints with value set to v. -func NewOptListReposHasCheckpoints(v ListReposHasCheckpoints) OptListReposHasCheckpoints { - return OptListReposHasCheckpoints{ +// NewOptMirrorRequestFailure returns new OptMirrorRequestFailure with value set to v. +func NewOptMirrorRequestFailure(v MirrorRequestFailure) OptMirrorRequestFailure { + return OptMirrorRequestFailure{ Value: v, Set: true, } } -// OptListReposHasCheckpoints is optional ListReposHasCheckpoints. -type OptListReposHasCheckpoints struct { - Value ListReposHasCheckpoints +// OptMirrorRequestFailure is optional MirrorRequestFailure. +type OptMirrorRequestFailure struct { + Value MirrorRequestFailure Set bool } -// IsSet returns true if OptListReposHasCheckpoints was set. -func (o OptListReposHasCheckpoints) IsSet() bool { return o.Set } +// IsSet returns true if OptMirrorRequestFailure was set. +func (o OptMirrorRequestFailure) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptListReposHasCheckpoints) Reset() { - var v ListReposHasCheckpoints +func (o *OptMirrorRequestFailure) Reset() { + var v MirrorRequestFailure o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptListReposHasCheckpoints) SetTo(v ListReposHasCheckpoints) { +func (o *OptMirrorRequestFailure) SetTo(v MirrorRequestFailure) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptListReposHasCheckpoints) Get() (v ListReposHasCheckpoints, ok bool) { +func (o OptMirrorRequestFailure) Get() (v MirrorRequestFailure, ok bool) { if !o.Set { return v, false } @@ -9680,45 +12959,45 @@ func (o OptListReposHasCheckpoints) Get() (v ListReposHasCheckpoints, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptListReposHasCheckpoints) Or(d ListReposHasCheckpoints) ListReposHasCheckpoints { +func (o OptMirrorRequestFailure) Or(d MirrorRequestFailure) MirrorRequestFailure { if v, ok := o.Get(); ok { return v } return d } -// NewOptListReposOrder returns new OptListReposOrder with value set to v. -func NewOptListReposOrder(v ListReposOrder) OptListReposOrder { - return OptListReposOrder{ +// NewOptMirrorRequestResult returns new OptMirrorRequestResult with value set to v. +func NewOptMirrorRequestResult(v MirrorRequestResult) OptMirrorRequestResult { + return OptMirrorRequestResult{ Value: v, Set: true, } } -// OptListReposOrder is optional ListReposOrder. -type OptListReposOrder struct { - Value ListReposOrder +// OptMirrorRequestResult is optional MirrorRequestResult. +type OptMirrorRequestResult struct { + Value MirrorRequestResult Set bool } -// IsSet returns true if OptListReposOrder was set. -func (o OptListReposOrder) IsSet() bool { return o.Set } +// IsSet returns true if OptMirrorRequestResult was set. +func (o OptMirrorRequestResult) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptListReposOrder) Reset() { - var v ListReposOrder +func (o *OptMirrorRequestResult) Reset() { + var v MirrorRequestResult o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptListReposOrder) SetTo(v ListReposOrder) { +func (o *OptMirrorRequestResult) SetTo(v MirrorRequestResult) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptListReposOrder) Get() (v ListReposOrder, ok bool) { +func (o OptMirrorRequestResult) Get() (v MirrorRequestResult, ok bool) { if !o.Set { return v, false } @@ -9726,45 +13005,45 @@ func (o OptListReposOrder) Get() (v ListReposOrder, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptListReposOrder) Or(d ListReposOrder) ListReposOrder { +func (o OptMirrorRequestResult) Or(d MirrorRequestResult) MirrorRequestResult { if v, ok := o.Get(); ok { return v } return d } -// NewOptListReposPermission returns new OptListReposPermission with value set to v. -func NewOptListReposPermission(v ListReposPermission) OptListReposPermission { - return OptListReposPermission{ +// NewOptMirrorStatus returns new OptMirrorStatus with value set to v. +func NewOptMirrorStatus(v MirrorStatus) OptMirrorStatus { + return OptMirrorStatus{ Value: v, Set: true, } } -// OptListReposPermission is optional ListReposPermission. -type OptListReposPermission struct { - Value ListReposPermission +// OptMirrorStatus is optional MirrorStatus. +type OptMirrorStatus struct { + Value MirrorStatus Set bool } -// IsSet returns true if OptListReposPermission was set. -func (o OptListReposPermission) IsSet() bool { return o.Set } +// IsSet returns true if OptMirrorStatus was set. +func (o OptMirrorStatus) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptListReposPermission) Reset() { - var v ListReposPermission +func (o *OptMirrorStatus) Reset() { + var v MirrorStatus o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptListReposPermission) SetTo(v ListReposPermission) { +func (o *OptMirrorStatus) SetTo(v MirrorStatus) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptListReposPermission) Get() (v ListReposPermission, ok bool) { +func (o OptMirrorStatus) Get() (v MirrorStatus, ok bool) { if !o.Set { return v, false } @@ -9772,45 +13051,45 @@ func (o OptListReposPermission) Get() (v ListReposPermission, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptListReposPermission) Or(d ListReposPermission) ListReposPermission { +func (o OptMirrorStatus) Or(d MirrorStatus) MirrorStatus { if v, ok := o.Get(); ok { return v } return d } -// NewOptListReposScope returns new OptListReposScope with value set to v. -func NewOptListReposScope(v ListReposScope) OptListReposScope { - return OptListReposScope{ +// NewOptOrg returns new OptOrg with value set to v. +func NewOptOrg(v Org) OptOrg { + return OptOrg{ Value: v, Set: true, } } -// OptListReposScope is optional ListReposScope. -type OptListReposScope struct { - Value ListReposScope +// OptOrg is optional Org. +type OptOrg struct { + Value Org Set bool } -// IsSet returns true if OptListReposScope was set. -func (o OptListReposScope) IsSet() bool { return o.Set } +// IsSet returns true if OptOrg was set. +func (o OptOrg) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptListReposScope) Reset() { - var v ListReposScope +func (o *OptOrg) Reset() { + var v Org o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptListReposScope) SetTo(v ListReposScope) { +func (o *OptOrg) SetTo(v Org) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptListReposScope) Get() (v ListReposScope, ok bool) { +func (o OptOrg) Get() (v Org, ok bool) { if !o.Set { return v, false } @@ -9818,45 +13097,45 @@ func (o OptListReposScope) Get() (v ListReposScope, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptListReposScope) Or(d ListReposScope) ListReposScope { +func (o OptOrg) Or(d Org) Org { if v, ok := o.Get(); ok { return v } return d } -// NewOptListReposStatus returns new OptListReposStatus with value set to v. -func NewOptListReposStatus(v ListReposStatus) OptListReposStatus { - return OptListReposStatus{ +// NewOptOrgCapabilities returns new OptOrgCapabilities with value set to v. +func NewOptOrgCapabilities(v OrgCapabilities) OptOrgCapabilities { + return OptOrgCapabilities{ Value: v, Set: true, } } -// OptListReposStatus is optional ListReposStatus. -type OptListReposStatus struct { - Value ListReposStatus +// OptOrgCapabilities is optional OrgCapabilities. +type OptOrgCapabilities struct { + Value OrgCapabilities Set bool } -// IsSet returns true if OptListReposStatus was set. -func (o OptListReposStatus) IsSet() bool { return o.Set } +// IsSet returns true if OptOrgCapabilities was set. +func (o OptOrgCapabilities) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptListReposStatus) Reset() { - var v ListReposStatus +func (o *OptOrgCapabilities) Reset() { + var v OrgCapabilities o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptListReposStatus) SetTo(v ListReposStatus) { +func (o *OptOrgCapabilities) SetTo(v OrgCapabilities) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptListReposStatus) Get() (v ListReposStatus, ok bool) { +func (o OptOrgCapabilities) Get() (v OrgCapabilities, ok bool) { if !o.Set { return v, false } @@ -9864,45 +13143,45 @@ func (o OptListReposStatus) Get() (v ListReposStatus, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptListReposStatus) Or(d ListReposStatus) ListReposStatus { +func (o OptOrgCapabilities) Or(d OrgCapabilities) OrgCapabilities { if v, ok := o.Get(); ok { return v } return d } -// NewOptListReposVisibility returns new OptListReposVisibility with value set to v. -func NewOptListReposVisibility(v ListReposVisibility) OptListReposVisibility { - return OptListReposVisibility{ +// NewOptProject returns new OptProject with value set to v. +func NewOptProject(v Project) OptProject { + return OptProject{ Value: v, Set: true, } } -// OptListReposVisibility is optional ListReposVisibility. -type OptListReposVisibility struct { - Value ListReposVisibility +// OptProject is optional Project. +type OptProject struct { + Value Project Set bool } -// IsSet returns true if OptListReposVisibility was set. -func (o OptListReposVisibility) IsSet() bool { return o.Set } +// IsSet returns true if OptProject was set. +func (o OptProject) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptListReposVisibility) Reset() { - var v ListReposVisibility +func (o *OptProject) Reset() { + var v Project o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptListReposVisibility) SetTo(v ListReposVisibility) { +func (o *OptProject) SetTo(v Project) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptListReposVisibility) Get() (v ListReposVisibility, ok bool) { +func (o OptProject) Get() (v Project, ok bool) { if !o.Set { return v, false } @@ -9910,45 +13189,45 @@ func (o OptListReposVisibility) Get() (v ListReposVisibility, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptListReposVisibility) Or(d ListReposVisibility) ListReposVisibility { +func (o OptProject) Or(d Project) Project { if v, ok := o.Get(); ok { return v } return d } -// NewOptMeDeletion returns new OptMeDeletion with value set to v. -func NewOptMeDeletion(v MeDeletion) OptMeDeletion { - return OptMeDeletion{ +// NewOptProjectCapabilities returns new OptProjectCapabilities with value set to v. +func NewOptProjectCapabilities(v ProjectCapabilities) OptProjectCapabilities { + return OptProjectCapabilities{ Value: v, Set: true, } } -// OptMeDeletion is optional MeDeletion. -type OptMeDeletion struct { - Value MeDeletion +// OptProjectCapabilities is optional ProjectCapabilities. +type OptProjectCapabilities struct { + Value ProjectCapabilities Set bool } -// IsSet returns true if OptMeDeletion was set. -func (o OptMeDeletion) IsSet() bool { return o.Set } +// IsSet returns true if OptProjectCapabilities was set. +func (o OptProjectCapabilities) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptMeDeletion) Reset() { - var v MeDeletion +func (o *OptProjectCapabilities) Reset() { + var v ProjectCapabilities o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptMeDeletion) SetTo(v MeDeletion) { +func (o *OptProjectCapabilities) SetTo(v ProjectCapabilities) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptMeDeletion) Get() (v MeDeletion, ok bool) { +func (o OptProjectCapabilities) Get() (v ProjectCapabilities, ok bool) { if !o.Set { return v, false } @@ -9956,45 +13235,45 @@ func (o OptMeDeletion) Get() (v MeDeletion, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptMeDeletion) Or(d MeDeletion) MeDeletion { +func (o OptProjectCapabilities) Or(d ProjectCapabilities) ProjectCapabilities { if v, ok := o.Get(); ok { return v } return d } -// NewOptMeRegional returns new OptMeRegional with value set to v. -func NewOptMeRegional(v MeRegional) OptMeRegional { - return OptMeRegional{ +// NewOptRepo returns new OptRepo with value set to v. +func NewOptRepo(v Repo) OptRepo { + return OptRepo{ Value: v, Set: true, } } -// OptMeRegional is optional MeRegional. -type OptMeRegional struct { - Value MeRegional +// OptRepo is optional Repo. +type OptRepo struct { + Value Repo Set bool } -// IsSet returns true if OptMeRegional was set. -func (o OptMeRegional) IsSet() bool { return o.Set } +// IsSet returns true if OptRepo was set. +func (o OptRepo) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptMeRegional) Reset() { - var v MeRegional +func (o *OptRepo) Reset() { + var v Repo o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptMeRegional) SetTo(v MeRegional) { +func (o *OptRepo) SetTo(v Repo) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptMeRegional) Get() (v MeRegional, ok bool) { +func (o OptRepo) Get() (v Repo, ok bool) { if !o.Set { return v, false } @@ -10002,45 +13281,45 @@ func (o OptMeRegional) Get() (v MeRegional, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptMeRegional) Or(d MeRegional) MeRegional { +func (o OptRepo) Or(d Repo) Repo { if v, ok := o.Get(); ok { return v } return d } -// NewOptMeRegionalUnavailable returns new OptMeRegionalUnavailable with value set to v. -func NewOptMeRegionalUnavailable(v MeRegionalUnavailable) OptMeRegionalUnavailable { - return OptMeRegionalUnavailable{ +// NewOptRepoCandidate returns new OptRepoCandidate with value set to v. +func NewOptRepoCandidate(v RepoCandidate) OptRepoCandidate { + return OptRepoCandidate{ Value: v, Set: true, } } -// OptMeRegionalUnavailable is optional MeRegionalUnavailable. -type OptMeRegionalUnavailable struct { - Value MeRegionalUnavailable +// OptRepoCandidate is optional RepoCandidate. +type OptRepoCandidate struct { + Value RepoCandidate Set bool } -// IsSet returns true if OptMeRegionalUnavailable was set. -func (o OptMeRegionalUnavailable) IsSet() bool { return o.Set } +// IsSet returns true if OptRepoCandidate was set. +func (o OptRepoCandidate) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptMeRegionalUnavailable) Reset() { - var v MeRegionalUnavailable +func (o *OptRepoCandidate) Reset() { + var v RepoCandidate o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptMeRegionalUnavailable) SetTo(v MeRegionalUnavailable) { +func (o *OptRepoCandidate) SetTo(v RepoCandidate) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptMeRegionalUnavailable) Get() (v MeRegionalUnavailable, ok bool) { +func (o OptRepoCandidate) Get() (v RepoCandidate, ok bool) { if !o.Set { return v, false } @@ -10048,45 +13327,45 @@ func (o OptMeRegionalUnavailable) Get() (v MeRegionalUnavailable, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptMeRegionalUnavailable) Or(d MeRegionalUnavailable) MeRegionalUnavailable { +func (o OptRepoCandidate) Or(d RepoCandidate) RepoCandidate { if v, ok := o.Get(); ok { return v } return d } -// NewOptMirrorRequestFailure returns new OptMirrorRequestFailure with value set to v. -func NewOptMirrorRequestFailure(v MirrorRequestFailure) OptMirrorRequestFailure { - return OptMirrorRequestFailure{ +// NewOptRepoCapabilities returns new OptRepoCapabilities with value set to v. +func NewOptRepoCapabilities(v RepoCapabilities) OptRepoCapabilities { + return OptRepoCapabilities{ Value: v, Set: true, } } -// OptMirrorRequestFailure is optional MirrorRequestFailure. -type OptMirrorRequestFailure struct { - Value MirrorRequestFailure +// OptRepoCapabilities is optional RepoCapabilities. +type OptRepoCapabilities struct { + Value RepoCapabilities Set bool } -// IsSet returns true if OptMirrorRequestFailure was set. -func (o OptMirrorRequestFailure) IsSet() bool { return o.Set } +// IsSet returns true if OptRepoCapabilities was set. +func (o OptRepoCapabilities) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptMirrorRequestFailure) Reset() { - var v MirrorRequestFailure +func (o *OptRepoCapabilities) Reset() { + var v RepoCapabilities o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptMirrorRequestFailure) SetTo(v MirrorRequestFailure) { +func (o *OptRepoCapabilities) SetTo(v RepoCapabilities) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptMirrorRequestFailure) Get() (v MirrorRequestFailure, ok bool) { +func (o OptRepoCapabilities) Get() (v RepoCapabilities, ok bool) { if !o.Set { return v, false } @@ -10094,45 +13373,45 @@ func (o OptMirrorRequestFailure) Get() (v MirrorRequestFailure, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptMirrorRequestFailure) Or(d MirrorRequestFailure) MirrorRequestFailure { +func (o OptRepoCapabilities) Or(d RepoCapabilities) RepoCapabilities { if v, ok := o.Get(); ok { return v } return d } -// NewOptMirrorRequestResult returns new OptMirrorRequestResult with value set to v. -func NewOptMirrorRequestResult(v MirrorRequestResult) OptMirrorRequestResult { - return OptMirrorRequestResult{ +// NewOptRepoPrimaries returns new OptRepoPrimaries with value set to v. +func NewOptRepoPrimaries(v RepoPrimaries) OptRepoPrimaries { + return OptRepoPrimaries{ Value: v, Set: true, } } -// OptMirrorRequestResult is optional MirrorRequestResult. -type OptMirrorRequestResult struct { - Value MirrorRequestResult +// OptRepoPrimaries is optional RepoPrimaries. +type OptRepoPrimaries struct { + Value RepoPrimaries Set bool } -// IsSet returns true if OptMirrorRequestResult was set. -func (o OptMirrorRequestResult) IsSet() bool { return o.Set } +// IsSet returns true if OptRepoPrimaries was set. +func (o OptRepoPrimaries) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptMirrorRequestResult) Reset() { - var v MirrorRequestResult +func (o *OptRepoPrimaries) Reset() { + var v RepoPrimaries o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptMirrorRequestResult) SetTo(v MirrorRequestResult) { +func (o *OptRepoPrimaries) SetTo(v RepoPrimaries) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptMirrorRequestResult) Get() (v MirrorRequestResult, ok bool) { +func (o OptRepoPrimaries) Get() (v RepoPrimaries, ok bool) { if !o.Set { return v, false } @@ -10140,45 +13419,45 @@ func (o OptMirrorRequestResult) Get() (v MirrorRequestResult, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptMirrorRequestResult) Or(d MirrorRequestResult) MirrorRequestResult { +func (o OptRepoPrimaries) Or(d RepoPrimaries) RepoPrimaries { if v, ok := o.Get(); ok { return v } return d } -// NewOptMirrorStatus returns new OptMirrorStatus with value set to v. -func NewOptMirrorStatus(v MirrorStatus) OptMirrorStatus { - return OptMirrorStatus{ +// NewOptString returns new OptString with value set to v. +func NewOptString(v string) OptString { + return OptString{ Value: v, Set: true, } } -// OptMirrorStatus is optional MirrorStatus. -type OptMirrorStatus struct { - Value MirrorStatus +// OptString is optional string. +type OptString struct { + Value string Set bool } -// IsSet returns true if OptMirrorStatus was set. -func (o OptMirrorStatus) IsSet() bool { return o.Set } +// IsSet returns true if OptString was set. +func (o OptString) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptMirrorStatus) Reset() { - var v MirrorStatus +func (o *OptString) Reset() { + var v string o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptMirrorStatus) SetTo(v MirrorStatus) { +func (o *OptString) SetTo(v string) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptMirrorStatus) Get() (v MirrorStatus, ok bool) { +func (o OptString) Get() (v string, ok bool) { if !o.Set { return v, false } @@ -10186,45 +13465,45 @@ func (o OptMirrorStatus) Get() (v MirrorStatus, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptMirrorStatus) Or(d MirrorStatus) MirrorStatus { +func (o OptString) Or(d string) string { if v, ok := o.Get(); ok { return v } return d } -// NewOptOrg returns new OptOrg with value set to v. -func NewOptOrg(v Org) OptOrg { - return OptOrg{ +// NewOptURI returns new OptURI with value set to v. +func NewOptURI(v url.URL) OptURI { + return OptURI{ Value: v, Set: true, } } -// OptOrg is optional Org. -type OptOrg struct { - Value Org +// OptURI is optional url.URL. +type OptURI struct { + Value url.URL Set bool } -// IsSet returns true if OptOrg was set. -func (o OptOrg) IsSet() bool { return o.Set } +// IsSet returns true if OptURI was set. +func (o OptURI) IsSet() bool { return o.Set } // Reset unsets value. -func (o *OptOrg) Reset() { - var v Org +func (o *OptURI) Reset() { + var v url.URL o.Value = v o.Set = false } // SetTo sets value to v. -func (o *OptOrg) SetTo(v Org) { +func (o *OptURI) SetTo(v url.URL) { o.Set = true o.Value = v } // Get returns value and boolean that denotes whether value was set. -func (o OptOrg) Get() (v Org, ok bool) { +func (o OptURI) Get() (v url.URL, ok bool) { if !o.Set { return v, false } @@ -10232,523 +13511,613 @@ func (o OptOrg) Get() (v Org, ok bool) { } // Or returns value if set, or given parameter if does not. -func (o OptOrg) Or(d Org) Org { +func (o OptURI) Or(d url.URL) url.URL { if v, ok := o.Get(); ok { return v } return d } -// NewOptOrgCapabilities returns new OptOrgCapabilities with value set to v. -func NewOptOrgCapabilities(v OrgCapabilities) OptOrgCapabilities { - return OptOrgCapabilities{ - Value: v, - Set: true, +// Ref: #/components/schemas/Org +type Org struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Capabilities OptOrgCapabilities `json:"capabilities"` + CreatedAt time.Time `json:"createdAt"` + ID string `json:"id"` + Name string `json:"name"` + Region string `json:"region"` + WorkosOrganizationId OptString `json:"workosOrganizationId"` + AdditionalProps OrgAdditional +} + +// GetSchema returns the value of Schema. +func (s *Org) GetSchema() OptURI { + return s.Schema +} + +// GetCapabilities returns the value of Capabilities. +func (s *Org) GetCapabilities() OptOrgCapabilities { + return s.Capabilities +} + +// GetCreatedAt returns the value of CreatedAt. +func (s *Org) GetCreatedAt() time.Time { + return s.CreatedAt +} + +// GetID returns the value of ID. +func (s *Org) GetID() string { + return s.ID +} + +// GetName returns the value of Name. +func (s *Org) GetName() string { + return s.Name +} + +// GetRegion returns the value of Region. +func (s *Org) GetRegion() string { + return s.Region +} + +// GetWorkosOrganizationId returns the value of WorkosOrganizationId. +func (s *Org) GetWorkosOrganizationId() OptString { + return s.WorkosOrganizationId +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *Org) GetAdditionalProps() OrgAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *Org) SetSchema(val OptURI) { + s.Schema = val +} + +// SetCapabilities sets the value of Capabilities. +func (s *Org) SetCapabilities(val OptOrgCapabilities) { + s.Capabilities = val +} + +// SetCreatedAt sets the value of CreatedAt. +func (s *Org) SetCreatedAt(val time.Time) { + s.CreatedAt = val +} + +// SetID sets the value of ID. +func (s *Org) SetID(val string) { + s.ID = val +} + +// SetName sets the value of Name. +func (s *Org) SetName(val string) { + s.Name = val +} + +// SetRegion sets the value of Region. +func (s *Org) SetRegion(val string) { + s.Region = val +} + +// SetWorkosOrganizationId sets the value of WorkosOrganizationId. +func (s *Org) SetWorkosOrganizationId(val OptString) { + s.WorkosOrganizationId = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *Org) SetAdditionalProps(val OrgAdditional) { + s.AdditionalProps = val +} + +type OrgAdditional map[string]jx.Raw + +func (s *OrgAdditional) init() OrgAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m } + return m } -// OptOrgCapabilities is optional OrgCapabilities. -type OptOrgCapabilities struct { - Value OrgCapabilities - Set bool +// Ref: #/components/schemas/OrgCIBuildkiteClusterView +type OrgCIBuildkiteClusterView struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + AuthPluginRef string `json:"auth_plugin_ref"` + BkClusterID string `json:"bk_cluster_id"` + BkOrganization string `json:"bk_organization"` + CreatedAt time.Time `json:"created_at"` + Label string `json:"label"` + Owner string `json:"owner"` + UpdatedAt time.Time `json:"updated_at"` + AdditionalProps OrgCIBuildkiteClusterViewAdditional +} + +// GetSchema returns the value of Schema. +func (s *OrgCIBuildkiteClusterView) GetSchema() OptURI { + return s.Schema +} + +// GetAuthPluginRef returns the value of AuthPluginRef. +func (s *OrgCIBuildkiteClusterView) GetAuthPluginRef() string { + return s.AuthPluginRef +} + +// GetBkClusterID returns the value of BkClusterID. +func (s *OrgCIBuildkiteClusterView) GetBkClusterID() string { + return s.BkClusterID +} + +// GetBkOrganization returns the value of BkOrganization. +func (s *OrgCIBuildkiteClusterView) GetBkOrganization() string { + return s.BkOrganization +} + +// GetCreatedAt returns the value of CreatedAt. +func (s *OrgCIBuildkiteClusterView) GetCreatedAt() time.Time { + return s.CreatedAt +} + +// GetLabel returns the value of Label. +func (s *OrgCIBuildkiteClusterView) GetLabel() string { + return s.Label } -// IsSet returns true if OptOrgCapabilities was set. -func (o OptOrgCapabilities) IsSet() bool { return o.Set } +// GetOwner returns the value of Owner. +func (s *OrgCIBuildkiteClusterView) GetOwner() string { + return s.Owner +} -// Reset unsets value. -func (o *OptOrgCapabilities) Reset() { - var v OrgCapabilities - o.Value = v - o.Set = false +// GetUpdatedAt returns the value of UpdatedAt. +func (s *OrgCIBuildkiteClusterView) GetUpdatedAt() time.Time { + return s.UpdatedAt } -// SetTo sets value to v. -func (o *OptOrgCapabilities) SetTo(v OrgCapabilities) { - o.Set = true - o.Value = v +// GetAdditionalProps returns the value of AdditionalProps. +func (s *OrgCIBuildkiteClusterView) GetAdditionalProps() OrgCIBuildkiteClusterViewAdditional { + return s.AdditionalProps } -// Get returns value and boolean that denotes whether value was set. -func (o OptOrgCapabilities) Get() (v OrgCapabilities, ok bool) { - if !o.Set { - return v, false - } - return o.Value, true +// SetSchema sets the value of Schema. +func (s *OrgCIBuildkiteClusterView) SetSchema(val OptURI) { + s.Schema = val } -// Or returns value if set, or given parameter if does not. -func (o OptOrgCapabilities) Or(d OrgCapabilities) OrgCapabilities { - if v, ok := o.Get(); ok { - return v - } - return d +// SetAuthPluginRef sets the value of AuthPluginRef. +func (s *OrgCIBuildkiteClusterView) SetAuthPluginRef(val string) { + s.AuthPluginRef = val } -// NewOptProject returns new OptProject with value set to v. -func NewOptProject(v Project) OptProject { - return OptProject{ - Value: v, - Set: true, - } +// SetBkClusterID sets the value of BkClusterID. +func (s *OrgCIBuildkiteClusterView) SetBkClusterID(val string) { + s.BkClusterID = val } -// OptProject is optional Project. -type OptProject struct { - Value Project - Set bool +// SetBkOrganization sets the value of BkOrganization. +func (s *OrgCIBuildkiteClusterView) SetBkOrganization(val string) { + s.BkOrganization = val } -// IsSet returns true if OptProject was set. -func (o OptProject) IsSet() bool { return o.Set } +// SetCreatedAt sets the value of CreatedAt. +func (s *OrgCIBuildkiteClusterView) SetCreatedAt(val time.Time) { + s.CreatedAt = val +} -// Reset unsets value. -func (o *OptProject) Reset() { - var v Project - o.Value = v - o.Set = false +// SetLabel sets the value of Label. +func (s *OrgCIBuildkiteClusterView) SetLabel(val string) { + s.Label = val } -// SetTo sets value to v. -func (o *OptProject) SetTo(v Project) { - o.Set = true - o.Value = v +// SetOwner sets the value of Owner. +func (s *OrgCIBuildkiteClusterView) SetOwner(val string) { + s.Owner = val } -// Get returns value and boolean that denotes whether value was set. -func (o OptProject) Get() (v Project, ok bool) { - if !o.Set { - return v, false - } - return o.Value, true +// SetUpdatedAt sets the value of UpdatedAt. +func (s *OrgCIBuildkiteClusterView) SetUpdatedAt(val time.Time) { + s.UpdatedAt = val } -// Or returns value if set, or given parameter if does not. -func (o OptProject) Or(d Project) Project { - if v, ok := o.Get(); ok { - return v - } - return d +// SetAdditionalProps sets the value of AdditionalProps. +func (s *OrgCIBuildkiteClusterView) SetAdditionalProps(val OrgCIBuildkiteClusterViewAdditional) { + s.AdditionalProps = val } -// NewOptProjectCapabilities returns new OptProjectCapabilities with value set to v. -func NewOptProjectCapabilities(v ProjectCapabilities) OptProjectCapabilities { - return OptProjectCapabilities{ - Value: v, - Set: true, +type OrgCIBuildkiteClusterViewAdditional map[string]jx.Raw + +func (s *OrgCIBuildkiteClusterViewAdditional) init() OrgCIBuildkiteClusterViewAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m } + return m } -// OptProjectCapabilities is optional ProjectCapabilities. -type OptProjectCapabilities struct { - Value ProjectCapabilities - Set bool +// Ref: #/components/schemas/OrgCIBuildkiteCredentialView +type OrgCIBuildkiteCredentialView struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + BkOrganization string `json:"bk_organization"` + CipherVersion int64 `json:"cipher_version"` + CreatedAt time.Time `json:"created_at"` + InboundEndpointID OptString `json:"inbound_endpoint_id"` + InboundEndpointPath OptString `json:"inbound_endpoint_path"` + InboundEndpointURL OptString `json:"inbound_endpoint_url"` + InboundSecret OptString `json:"inbound_secret"` + InboundSecretIssuedAt OptDateTime `json:"inbound_secret_issued_at"` + InboundSecretSet bool `json:"inbound_secret_set"` + Owner string `json:"owner"` + TokenLen int64 `json:"token_len"` + UpdatedAt time.Time `json:"updated_at"` + VerifiedAt OptDateTime `json:"verified_at"` + AdditionalProps OrgCIBuildkiteCredentialViewAdditional } -// IsSet returns true if OptProjectCapabilities was set. -func (o OptProjectCapabilities) IsSet() bool { return o.Set } - -// Reset unsets value. -func (o *OptProjectCapabilities) Reset() { - var v ProjectCapabilities - o.Value = v - o.Set = false +// GetSchema returns the value of Schema. +func (s *OrgCIBuildkiteCredentialView) GetSchema() OptURI { + return s.Schema } -// SetTo sets value to v. -func (o *OptProjectCapabilities) SetTo(v ProjectCapabilities) { - o.Set = true - o.Value = v +// GetBkOrganization returns the value of BkOrganization. +func (s *OrgCIBuildkiteCredentialView) GetBkOrganization() string { + return s.BkOrganization } -// Get returns value and boolean that denotes whether value was set. -func (o OptProjectCapabilities) Get() (v ProjectCapabilities, ok bool) { - if !o.Set { - return v, false - } - return o.Value, true +// GetCipherVersion returns the value of CipherVersion. +func (s *OrgCIBuildkiteCredentialView) GetCipherVersion() int64 { + return s.CipherVersion } -// Or returns value if set, or given parameter if does not. -func (o OptProjectCapabilities) Or(d ProjectCapabilities) ProjectCapabilities { - if v, ok := o.Get(); ok { - return v - } - return d +// GetCreatedAt returns the value of CreatedAt. +func (s *OrgCIBuildkiteCredentialView) GetCreatedAt() time.Time { + return s.CreatedAt } -// NewOptRepo returns new OptRepo with value set to v. -func NewOptRepo(v Repo) OptRepo { - return OptRepo{ - Value: v, - Set: true, - } +// GetInboundEndpointID returns the value of InboundEndpointID. +func (s *OrgCIBuildkiteCredentialView) GetInboundEndpointID() OptString { + return s.InboundEndpointID } -// OptRepo is optional Repo. -type OptRepo struct { - Value Repo - Set bool +// GetInboundEndpointPath returns the value of InboundEndpointPath. +func (s *OrgCIBuildkiteCredentialView) GetInboundEndpointPath() OptString { + return s.InboundEndpointPath } -// IsSet returns true if OptRepo was set. -func (o OptRepo) IsSet() bool { return o.Set } - -// Reset unsets value. -func (o *OptRepo) Reset() { - var v Repo - o.Value = v - o.Set = false +// GetInboundEndpointURL returns the value of InboundEndpointURL. +func (s *OrgCIBuildkiteCredentialView) GetInboundEndpointURL() OptString { + return s.InboundEndpointURL } -// SetTo sets value to v. -func (o *OptRepo) SetTo(v Repo) { - o.Set = true - o.Value = v +// GetInboundSecret returns the value of InboundSecret. +func (s *OrgCIBuildkiteCredentialView) GetInboundSecret() OptString { + return s.InboundSecret } -// Get returns value and boolean that denotes whether value was set. -func (o OptRepo) Get() (v Repo, ok bool) { - if !o.Set { - return v, false - } - return o.Value, true +// GetInboundSecretIssuedAt returns the value of InboundSecretIssuedAt. +func (s *OrgCIBuildkiteCredentialView) GetInboundSecretIssuedAt() OptDateTime { + return s.InboundSecretIssuedAt } -// Or returns value if set, or given parameter if does not. -func (o OptRepo) Or(d Repo) Repo { - if v, ok := o.Get(); ok { - return v - } - return d +// GetInboundSecretSet returns the value of InboundSecretSet. +func (s *OrgCIBuildkiteCredentialView) GetInboundSecretSet() bool { + return s.InboundSecretSet } -// NewOptRepoCandidate returns new OptRepoCandidate with value set to v. -func NewOptRepoCandidate(v RepoCandidate) OptRepoCandidate { - return OptRepoCandidate{ - Value: v, - Set: true, - } +// GetOwner returns the value of Owner. +func (s *OrgCIBuildkiteCredentialView) GetOwner() string { + return s.Owner } -// OptRepoCandidate is optional RepoCandidate. -type OptRepoCandidate struct { - Value RepoCandidate - Set bool +// GetTokenLen returns the value of TokenLen. +func (s *OrgCIBuildkiteCredentialView) GetTokenLen() int64 { + return s.TokenLen } -// IsSet returns true if OptRepoCandidate was set. -func (o OptRepoCandidate) IsSet() bool { return o.Set } +// GetUpdatedAt returns the value of UpdatedAt. +func (s *OrgCIBuildkiteCredentialView) GetUpdatedAt() time.Time { + return s.UpdatedAt +} -// Reset unsets value. -func (o *OptRepoCandidate) Reset() { - var v RepoCandidate - o.Value = v - o.Set = false +// GetVerifiedAt returns the value of VerifiedAt. +func (s *OrgCIBuildkiteCredentialView) GetVerifiedAt() OptDateTime { + return s.VerifiedAt } -// SetTo sets value to v. -func (o *OptRepoCandidate) SetTo(v RepoCandidate) { - o.Set = true - o.Value = v +// GetAdditionalProps returns the value of AdditionalProps. +func (s *OrgCIBuildkiteCredentialView) GetAdditionalProps() OrgCIBuildkiteCredentialViewAdditional { + return s.AdditionalProps } -// Get returns value and boolean that denotes whether value was set. -func (o OptRepoCandidate) Get() (v RepoCandidate, ok bool) { - if !o.Set { - return v, false - } - return o.Value, true +// SetSchema sets the value of Schema. +func (s *OrgCIBuildkiteCredentialView) SetSchema(val OptURI) { + s.Schema = val } -// Or returns value if set, or given parameter if does not. -func (o OptRepoCandidate) Or(d RepoCandidate) RepoCandidate { - if v, ok := o.Get(); ok { - return v - } - return d +// SetBkOrganization sets the value of BkOrganization. +func (s *OrgCIBuildkiteCredentialView) SetBkOrganization(val string) { + s.BkOrganization = val } -// NewOptRepoCapabilities returns new OptRepoCapabilities with value set to v. -func NewOptRepoCapabilities(v RepoCapabilities) OptRepoCapabilities { - return OptRepoCapabilities{ - Value: v, - Set: true, - } +// SetCipherVersion sets the value of CipherVersion. +func (s *OrgCIBuildkiteCredentialView) SetCipherVersion(val int64) { + s.CipherVersion = val } -// OptRepoCapabilities is optional RepoCapabilities. -type OptRepoCapabilities struct { - Value RepoCapabilities - Set bool +// SetCreatedAt sets the value of CreatedAt. +func (s *OrgCIBuildkiteCredentialView) SetCreatedAt(val time.Time) { + s.CreatedAt = val } -// IsSet returns true if OptRepoCapabilities was set. -func (o OptRepoCapabilities) IsSet() bool { return o.Set } +// SetInboundEndpointID sets the value of InboundEndpointID. +func (s *OrgCIBuildkiteCredentialView) SetInboundEndpointID(val OptString) { + s.InboundEndpointID = val +} -// Reset unsets value. -func (o *OptRepoCapabilities) Reset() { - var v RepoCapabilities - o.Value = v - o.Set = false +// SetInboundEndpointPath sets the value of InboundEndpointPath. +func (s *OrgCIBuildkiteCredentialView) SetInboundEndpointPath(val OptString) { + s.InboundEndpointPath = val } -// SetTo sets value to v. -func (o *OptRepoCapabilities) SetTo(v RepoCapabilities) { - o.Set = true - o.Value = v +// SetInboundEndpointURL sets the value of InboundEndpointURL. +func (s *OrgCIBuildkiteCredentialView) SetInboundEndpointURL(val OptString) { + s.InboundEndpointURL = val } -// Get returns value and boolean that denotes whether value was set. -func (o OptRepoCapabilities) Get() (v RepoCapabilities, ok bool) { - if !o.Set { - return v, false - } - return o.Value, true +// SetInboundSecret sets the value of InboundSecret. +func (s *OrgCIBuildkiteCredentialView) SetInboundSecret(val OptString) { + s.InboundSecret = val } -// Or returns value if set, or given parameter if does not. -func (o OptRepoCapabilities) Or(d RepoCapabilities) RepoCapabilities { - if v, ok := o.Get(); ok { - return v - } - return d +// SetInboundSecretIssuedAt sets the value of InboundSecretIssuedAt. +func (s *OrgCIBuildkiteCredentialView) SetInboundSecretIssuedAt(val OptDateTime) { + s.InboundSecretIssuedAt = val } -// NewOptRepoPrimaries returns new OptRepoPrimaries with value set to v. -func NewOptRepoPrimaries(v RepoPrimaries) OptRepoPrimaries { - return OptRepoPrimaries{ - Value: v, - Set: true, - } +// SetInboundSecretSet sets the value of InboundSecretSet. +func (s *OrgCIBuildkiteCredentialView) SetInboundSecretSet(val bool) { + s.InboundSecretSet = val } -// OptRepoPrimaries is optional RepoPrimaries. -type OptRepoPrimaries struct { - Value RepoPrimaries - Set bool +// SetOwner sets the value of Owner. +func (s *OrgCIBuildkiteCredentialView) SetOwner(val string) { + s.Owner = val } -// IsSet returns true if OptRepoPrimaries was set. -func (o OptRepoPrimaries) IsSet() bool { return o.Set } +// SetTokenLen sets the value of TokenLen. +func (s *OrgCIBuildkiteCredentialView) SetTokenLen(val int64) { + s.TokenLen = val +} -// Reset unsets value. -func (o *OptRepoPrimaries) Reset() { - var v RepoPrimaries - o.Value = v - o.Set = false +// SetUpdatedAt sets the value of UpdatedAt. +func (s *OrgCIBuildkiteCredentialView) SetUpdatedAt(val time.Time) { + s.UpdatedAt = val } -// SetTo sets value to v. -func (o *OptRepoPrimaries) SetTo(v RepoPrimaries) { - o.Set = true - o.Value = v +// SetVerifiedAt sets the value of VerifiedAt. +func (s *OrgCIBuildkiteCredentialView) SetVerifiedAt(val OptDateTime) { + s.VerifiedAt = val } -// Get returns value and boolean that denotes whether value was set. -func (o OptRepoPrimaries) Get() (v RepoPrimaries, ok bool) { - if !o.Set { - return v, false - } - return o.Value, true +// SetAdditionalProps sets the value of AdditionalProps. +func (s *OrgCIBuildkiteCredentialView) SetAdditionalProps(val OrgCIBuildkiteCredentialViewAdditional) { + s.AdditionalProps = val } -// Or returns value if set, or given parameter if does not. -func (o OptRepoPrimaries) Or(d RepoPrimaries) RepoPrimaries { - if v, ok := o.Get(); ok { - return v +type OrgCIBuildkiteCredentialViewAdditional map[string]jx.Raw + +func (s *OrgCIBuildkiteCredentialViewAdditional) init() OrgCIBuildkiteCredentialViewAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m } - return d + return m } -// NewOptString returns new OptString with value set to v. -func NewOptString(v string) OptString { - return OptString{ - Value: v, - Set: true, - } +// Ref: #/components/schemas/OrgCIDepotConnectionView +type OrgCIDepotConnectionView struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Account string `json:"account"` + ConnectedAt OptDateTime `json:"connected_at"` + Owner string `json:"owner"` + Provider string `json:"provider"` + AdditionalProps OrgCIDepotConnectionViewAdditional } -// OptString is optional string. -type OptString struct { - Value string - Set bool +// GetSchema returns the value of Schema. +func (s *OrgCIDepotConnectionView) GetSchema() OptURI { + return s.Schema } -// IsSet returns true if OptString was set. -func (o OptString) IsSet() bool { return o.Set } +// GetAccount returns the value of Account. +func (s *OrgCIDepotConnectionView) GetAccount() string { + return s.Account +} -// Reset unsets value. -func (o *OptString) Reset() { - var v string - o.Value = v - o.Set = false +// GetConnectedAt returns the value of ConnectedAt. +func (s *OrgCIDepotConnectionView) GetConnectedAt() OptDateTime { + return s.ConnectedAt } -// SetTo sets value to v. -func (o *OptString) SetTo(v string) { - o.Set = true - o.Value = v +// GetOwner returns the value of Owner. +func (s *OrgCIDepotConnectionView) GetOwner() string { + return s.Owner } -// Get returns value and boolean that denotes whether value was set. -func (o OptString) Get() (v string, ok bool) { - if !o.Set { - return v, false - } - return o.Value, true +// GetProvider returns the value of Provider. +func (s *OrgCIDepotConnectionView) GetProvider() string { + return s.Provider } -// Or returns value if set, or given parameter if does not. -func (o OptString) Or(d string) string { - if v, ok := o.Get(); ok { - return v - } - return d +// GetAdditionalProps returns the value of AdditionalProps. +func (s *OrgCIDepotConnectionView) GetAdditionalProps() OrgCIDepotConnectionViewAdditional { + return s.AdditionalProps } -// NewOptURI returns new OptURI with value set to v. -func NewOptURI(v url.URL) OptURI { - return OptURI{ - Value: v, - Set: true, - } +// SetSchema sets the value of Schema. +func (s *OrgCIDepotConnectionView) SetSchema(val OptURI) { + s.Schema = val } -// OptURI is optional url.URL. -type OptURI struct { - Value url.URL - Set bool +// SetAccount sets the value of Account. +func (s *OrgCIDepotConnectionView) SetAccount(val string) { + s.Account = val } -// IsSet returns true if OptURI was set. -func (o OptURI) IsSet() bool { return o.Set } +// SetConnectedAt sets the value of ConnectedAt. +func (s *OrgCIDepotConnectionView) SetConnectedAt(val OptDateTime) { + s.ConnectedAt = val +} -// Reset unsets value. -func (o *OptURI) Reset() { - var v url.URL - o.Value = v - o.Set = false +// SetOwner sets the value of Owner. +func (s *OrgCIDepotConnectionView) SetOwner(val string) { + s.Owner = val } -// SetTo sets value to v. -func (o *OptURI) SetTo(v url.URL) { - o.Set = true - o.Value = v +// SetProvider sets the value of Provider. +func (s *OrgCIDepotConnectionView) SetProvider(val string) { + s.Provider = val } -// Get returns value and boolean that denotes whether value was set. -func (o OptURI) Get() (v url.URL, ok bool) { - if !o.Set { - return v, false - } - return o.Value, true +// SetAdditionalProps sets the value of AdditionalProps. +func (s *OrgCIDepotConnectionView) SetAdditionalProps(val OrgCIDepotConnectionViewAdditional) { + s.AdditionalProps = val } -// Or returns value if set, or given parameter if does not. -func (o OptURI) Or(d url.URL) url.URL { - if v, ok := o.Get(); ok { - return v +type OrgCIDepotConnectionViewAdditional map[string]jx.Raw + +func (s *OrgCIDepotConnectionViewAdditional) init() OrgCIDepotConnectionViewAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m } - return d + return m } -// Ref: #/components/schemas/Org -type Org struct { +// Ref: #/components/schemas/OrgCIGitHubActionsCredentialView +type OrgCIGitHubActionsCredentialView struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Capabilities OptOrgCapabilities `json:"capabilities"` - CreatedAt time.Time `json:"createdAt"` - ID string `json:"id"` - Name string `json:"name"` - Region string `json:"region"` - WorkosOrganizationId OptString `json:"workosOrganizationId"` - AdditionalProps OrgAdditional + Schema OptURI `json:"$schema"` + Account string `json:"account"` + HasAPIToken OptBool `json:"has_api_token"` + InboundEndpointID OptString `json:"inbound_endpoint_id"` + InboundEndpointPath OptString `json:"inbound_endpoint_path"` + InboundEndpointURL OptString `json:"inbound_endpoint_url"` + InboundSecret OptString `json:"inbound_secret"` + Owner string `json:"owner"` + Provider string `json:"provider"` + AdditionalProps OrgCIGitHubActionsCredentialViewAdditional } // GetSchema returns the value of Schema. -func (s *Org) GetSchema() OptURI { +func (s *OrgCIGitHubActionsCredentialView) GetSchema() OptURI { return s.Schema } -// GetCapabilities returns the value of Capabilities. -func (s *Org) GetCapabilities() OptOrgCapabilities { - return s.Capabilities +// GetAccount returns the value of Account. +func (s *OrgCIGitHubActionsCredentialView) GetAccount() string { + return s.Account +} + +// GetHasAPIToken returns the value of HasAPIToken. +func (s *OrgCIGitHubActionsCredentialView) GetHasAPIToken() OptBool { + return s.HasAPIToken } -// GetCreatedAt returns the value of CreatedAt. -func (s *Org) GetCreatedAt() time.Time { - return s.CreatedAt +// GetInboundEndpointID returns the value of InboundEndpointID. +func (s *OrgCIGitHubActionsCredentialView) GetInboundEndpointID() OptString { + return s.InboundEndpointID } -// GetID returns the value of ID. -func (s *Org) GetID() string { - return s.ID +// GetInboundEndpointPath returns the value of InboundEndpointPath. +func (s *OrgCIGitHubActionsCredentialView) GetInboundEndpointPath() OptString { + return s.InboundEndpointPath } -// GetName returns the value of Name. -func (s *Org) GetName() string { - return s.Name +// GetInboundEndpointURL returns the value of InboundEndpointURL. +func (s *OrgCIGitHubActionsCredentialView) GetInboundEndpointURL() OptString { + return s.InboundEndpointURL } -// GetRegion returns the value of Region. -func (s *Org) GetRegion() string { - return s.Region +// GetInboundSecret returns the value of InboundSecret. +func (s *OrgCIGitHubActionsCredentialView) GetInboundSecret() OptString { + return s.InboundSecret } -// GetWorkosOrganizationId returns the value of WorkosOrganizationId. -func (s *Org) GetWorkosOrganizationId() OptString { - return s.WorkosOrganizationId +// GetOwner returns the value of Owner. +func (s *OrgCIGitHubActionsCredentialView) GetOwner() string { + return s.Owner +} + +// GetProvider returns the value of Provider. +func (s *OrgCIGitHubActionsCredentialView) GetProvider() string { + return s.Provider } // GetAdditionalProps returns the value of AdditionalProps. -func (s *Org) GetAdditionalProps() OrgAdditional { +func (s *OrgCIGitHubActionsCredentialView) GetAdditionalProps() OrgCIGitHubActionsCredentialViewAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *Org) SetSchema(val OptURI) { +func (s *OrgCIGitHubActionsCredentialView) SetSchema(val OptURI) { s.Schema = val } -// SetCapabilities sets the value of Capabilities. -func (s *Org) SetCapabilities(val OptOrgCapabilities) { - s.Capabilities = val +// SetAccount sets the value of Account. +func (s *OrgCIGitHubActionsCredentialView) SetAccount(val string) { + s.Account = val } -// SetCreatedAt sets the value of CreatedAt. -func (s *Org) SetCreatedAt(val time.Time) { - s.CreatedAt = val +// SetHasAPIToken sets the value of HasAPIToken. +func (s *OrgCIGitHubActionsCredentialView) SetHasAPIToken(val OptBool) { + s.HasAPIToken = val } -// SetID sets the value of ID. -func (s *Org) SetID(val string) { - s.ID = val +// SetInboundEndpointID sets the value of InboundEndpointID. +func (s *OrgCIGitHubActionsCredentialView) SetInboundEndpointID(val OptString) { + s.InboundEndpointID = val } -// SetName sets the value of Name. -func (s *Org) SetName(val string) { - s.Name = val +// SetInboundEndpointPath sets the value of InboundEndpointPath. +func (s *OrgCIGitHubActionsCredentialView) SetInboundEndpointPath(val OptString) { + s.InboundEndpointPath = val } -// SetRegion sets the value of Region. -func (s *Org) SetRegion(val string) { - s.Region = val +// SetInboundEndpointURL sets the value of InboundEndpointURL. +func (s *OrgCIGitHubActionsCredentialView) SetInboundEndpointURL(val OptString) { + s.InboundEndpointURL = val } -// SetWorkosOrganizationId sets the value of WorkosOrganizationId. -func (s *Org) SetWorkosOrganizationId(val OptString) { - s.WorkosOrganizationId = val +// SetInboundSecret sets the value of InboundSecret. +func (s *OrgCIGitHubActionsCredentialView) SetInboundSecret(val OptString) { + s.InboundSecret = val +} + +// SetOwner sets the value of Owner. +func (s *OrgCIGitHubActionsCredentialView) SetOwner(val string) { + s.Owner = val +} + +// SetProvider sets the value of Provider. +func (s *OrgCIGitHubActionsCredentialView) SetProvider(val string) { + s.Provider = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *Org) SetAdditionalProps(val OrgAdditional) { +func (s *OrgCIGitHubActionsCredentialView) SetAdditionalProps(val OrgCIGitHubActionsCredentialViewAdditional) { s.AdditionalProps = val } -type OrgAdditional map[string]jx.Raw +type OrgCIGitHubActionsCredentialViewAdditional map[string]jx.Raw -func (s *OrgAdditional) init() OrgAdditional { +func (s *OrgCIGitHubActionsCredentialViewAdditional) init() OrgCIGitHubActionsCredentialViewAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -10757,294 +14126,319 @@ func (s *OrgAdditional) init() OrgAdditional { return m } -// Ref: #/components/schemas/OrgCIBuildkiteClusterView -type OrgCIBuildkiteClusterView struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - AuthPluginRef string `json:"auth_plugin_ref"` - BkClusterID string `json:"bk_cluster_id"` - BkOrganization string `json:"bk_organization"` - CreatedAt time.Time `json:"created_at"` - Label string `json:"label"` - Owner string `json:"owner"` - UpdatedAt time.Time `json:"updated_at"` - AdditionalProps OrgCIBuildkiteClusterViewAdditional +// Ref: #/components/schemas/OrgCapabilities +type OrgCapabilities struct { + // Whether the caller holds the direct organization owner relation. Individual mutations still + // enforce all guards. + CanChangeOwners bool `json:"canChangeOwners"` + CanCreateProject bool `json:"canCreateProject"` + CanDelete bool `json:"canDelete"` + CanManageMembers bool `json:"canManageMembers"` + AdditionalProps OrgCapabilitiesAdditional } -// GetSchema returns the value of Schema. -func (s *OrgCIBuildkiteClusterView) GetSchema() OptURI { - return s.Schema +// GetCanChangeOwners returns the value of CanChangeOwners. +func (s *OrgCapabilities) GetCanChangeOwners() bool { + return s.CanChangeOwners } -// GetAuthPluginRef returns the value of AuthPluginRef. -func (s *OrgCIBuildkiteClusterView) GetAuthPluginRef() string { - return s.AuthPluginRef +// GetCanCreateProject returns the value of CanCreateProject. +func (s *OrgCapabilities) GetCanCreateProject() bool { + return s.CanCreateProject } -// GetBkClusterID returns the value of BkClusterID. -func (s *OrgCIBuildkiteClusterView) GetBkClusterID() string { - return s.BkClusterID +// GetCanDelete returns the value of CanDelete. +func (s *OrgCapabilities) GetCanDelete() bool { + return s.CanDelete } -// GetBkOrganization returns the value of BkOrganization. -func (s *OrgCIBuildkiteClusterView) GetBkOrganization() string { - return s.BkOrganization +// GetCanManageMembers returns the value of CanManageMembers. +func (s *OrgCapabilities) GetCanManageMembers() bool { + return s.CanManageMembers } -// GetCreatedAt returns the value of CreatedAt. -func (s *OrgCIBuildkiteClusterView) GetCreatedAt() time.Time { - return s.CreatedAt +// GetAdditionalProps returns the value of AdditionalProps. +func (s *OrgCapabilities) GetAdditionalProps() OrgCapabilitiesAdditional { + return s.AdditionalProps } -// GetLabel returns the value of Label. -func (s *OrgCIBuildkiteClusterView) GetLabel() string { - return s.Label +// SetCanChangeOwners sets the value of CanChangeOwners. +func (s *OrgCapabilities) SetCanChangeOwners(val bool) { + s.CanChangeOwners = val } -// GetOwner returns the value of Owner. -func (s *OrgCIBuildkiteClusterView) GetOwner() string { - return s.Owner +// SetCanCreateProject sets the value of CanCreateProject. +func (s *OrgCapabilities) SetCanCreateProject(val bool) { + s.CanCreateProject = val } -// GetUpdatedAt returns the value of UpdatedAt. -func (s *OrgCIBuildkiteClusterView) GetUpdatedAt() time.Time { - return s.UpdatedAt +// SetCanDelete sets the value of CanDelete. +func (s *OrgCapabilities) SetCanDelete(val bool) { + s.CanDelete = val } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *OrgCIBuildkiteClusterView) GetAdditionalProps() OrgCIBuildkiteClusterViewAdditional { - return s.AdditionalProps +// SetCanManageMembers sets the value of CanManageMembers. +func (s *OrgCapabilities) SetCanManageMembers(val bool) { + s.CanManageMembers = val } -// SetSchema sets the value of Schema. -func (s *OrgCIBuildkiteClusterView) SetSchema(val OptURI) { - s.Schema = val +// SetAdditionalProps sets the value of AdditionalProps. +func (s *OrgCapabilities) SetAdditionalProps(val OrgCapabilitiesAdditional) { + s.AdditionalProps = val } -// SetAuthPluginRef sets the value of AuthPluginRef. -func (s *OrgCIBuildkiteClusterView) SetAuthPluginRef(val string) { - s.AuthPluginRef = val +type OrgCapabilitiesAdditional map[string]jx.Raw + +func (s *OrgCapabilitiesAdditional) init() OrgCapabilitiesAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m } -// SetBkClusterID sets the value of BkClusterID. -func (s *OrgCIBuildkiteClusterView) SetBkClusterID(val string) { - s.BkClusterID = val +// Ref: #/components/schemas/OrgPerson +type OrgPerson struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + AccountId string `json:"accountId"` + AvatarUrl OptString `json:"avatarUrl"` + Grants []OrgPersonGrant `json:"grants"` + Handle OptString `json:"handle"` + Membership OrgPersonMembership `json:"membership"` + Provider OptString `json:"provider"` + AdditionalProps OrgPersonAdditional } -// SetBkOrganization sets the value of BkOrganization. -func (s *OrgCIBuildkiteClusterView) SetBkOrganization(val string) { - s.BkOrganization = val +// GetSchema returns the value of Schema. +func (s *OrgPerson) GetSchema() OptURI { + return s.Schema } -// SetCreatedAt sets the value of CreatedAt. -func (s *OrgCIBuildkiteClusterView) SetCreatedAt(val time.Time) { - s.CreatedAt = val +// GetAccountId returns the value of AccountId. +func (s *OrgPerson) GetAccountId() string { + return s.AccountId } -// SetLabel sets the value of Label. -func (s *OrgCIBuildkiteClusterView) SetLabel(val string) { - s.Label = val +// GetAvatarUrl returns the value of AvatarUrl. +func (s *OrgPerson) GetAvatarUrl() OptString { + return s.AvatarUrl } -// SetOwner sets the value of Owner. -func (s *OrgCIBuildkiteClusterView) SetOwner(val string) { - s.Owner = val +// GetGrants returns the value of Grants. +func (s *OrgPerson) GetGrants() []OrgPersonGrant { + return s.Grants } -// SetUpdatedAt sets the value of UpdatedAt. -func (s *OrgCIBuildkiteClusterView) SetUpdatedAt(val time.Time) { - s.UpdatedAt = val +// GetHandle returns the value of Handle. +func (s *OrgPerson) GetHandle() OptString { + return s.Handle } -// SetAdditionalProps sets the value of AdditionalProps. -func (s *OrgCIBuildkiteClusterView) SetAdditionalProps(val OrgCIBuildkiteClusterViewAdditional) { - s.AdditionalProps = val +// GetMembership returns the value of Membership. +func (s *OrgPerson) GetMembership() OrgPersonMembership { + return s.Membership } -type OrgCIBuildkiteClusterViewAdditional map[string]jx.Raw +// GetProvider returns the value of Provider. +func (s *OrgPerson) GetProvider() OptString { + return s.Provider +} -func (s *OrgCIBuildkiteClusterViewAdditional) init() OrgCIBuildkiteClusterViewAdditional { - m := *s - if m == nil { - m = map[string]jx.Raw{} - *s = m - } - return m +// GetAdditionalProps returns the value of AdditionalProps. +func (s *OrgPerson) GetAdditionalProps() OrgPersonAdditional { + return s.AdditionalProps } -// Ref: #/components/schemas/OrgCIBuildkiteCredentialView -type OrgCIBuildkiteCredentialView struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - BkOrganization string `json:"bk_organization"` - CipherVersion int64 `json:"cipher_version"` - CreatedAt time.Time `json:"created_at"` - InboundEndpointID OptString `json:"inbound_endpoint_id"` - InboundEndpointPath OptString `json:"inbound_endpoint_path"` - InboundEndpointURL OptString `json:"inbound_endpoint_url"` - InboundSecret OptString `json:"inbound_secret"` - InboundSecretIssuedAt OptDateTime `json:"inbound_secret_issued_at"` - InboundSecretSet bool `json:"inbound_secret_set"` - Owner string `json:"owner"` - TokenLen int64 `json:"token_len"` - UpdatedAt time.Time `json:"updated_at"` - VerifiedAt OptDateTime `json:"verified_at"` - AdditionalProps OrgCIBuildkiteCredentialViewAdditional +// SetSchema sets the value of Schema. +func (s *OrgPerson) SetSchema(val OptURI) { + s.Schema = val } -// GetSchema returns the value of Schema. -func (s *OrgCIBuildkiteCredentialView) GetSchema() OptURI { - return s.Schema +// SetAccountId sets the value of AccountId. +func (s *OrgPerson) SetAccountId(val string) { + s.AccountId = val +} + +// SetAvatarUrl sets the value of AvatarUrl. +func (s *OrgPerson) SetAvatarUrl(val OptString) { + s.AvatarUrl = val } -// GetBkOrganization returns the value of BkOrganization. -func (s *OrgCIBuildkiteCredentialView) GetBkOrganization() string { - return s.BkOrganization +// SetGrants sets the value of Grants. +func (s *OrgPerson) SetGrants(val []OrgPersonGrant) { + s.Grants = val } -// GetCipherVersion returns the value of CipherVersion. -func (s *OrgCIBuildkiteCredentialView) GetCipherVersion() int64 { - return s.CipherVersion +// SetHandle sets the value of Handle. +func (s *OrgPerson) SetHandle(val OptString) { + s.Handle = val } -// GetCreatedAt returns the value of CreatedAt. -func (s *OrgCIBuildkiteCredentialView) GetCreatedAt() time.Time { - return s.CreatedAt +// SetMembership sets the value of Membership. +func (s *OrgPerson) SetMembership(val OrgPersonMembership) { + s.Membership = val } -// GetInboundEndpointID returns the value of InboundEndpointID. -func (s *OrgCIBuildkiteCredentialView) GetInboundEndpointID() OptString { - return s.InboundEndpointID +// SetProvider sets the value of Provider. +func (s *OrgPerson) SetProvider(val OptString) { + s.Provider = val } -// GetInboundEndpointPath returns the value of InboundEndpointPath. -func (s *OrgCIBuildkiteCredentialView) GetInboundEndpointPath() OptString { - return s.InboundEndpointPath +// SetAdditionalProps sets the value of AdditionalProps. +func (s *OrgPerson) SetAdditionalProps(val OrgPersonAdditional) { + s.AdditionalProps = val } -// GetInboundEndpointURL returns the value of InboundEndpointURL. -func (s *OrgCIBuildkiteCredentialView) GetInboundEndpointURL() OptString { - return s.InboundEndpointURL +type OrgPersonAdditional map[string]jx.Raw + +func (s *OrgPersonAdditional) init() OrgPersonAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m } -// GetInboundSecret returns the value of InboundSecret. -func (s *OrgCIBuildkiteCredentialView) GetInboundSecret() OptString { - return s.InboundSecret +// Ref: #/components/schemas/OrgPersonGrant +type OrgPersonGrant struct { + Capabilities OrgPersonGrantCapabilities `json:"capabilities"` + // Organization ID, project ID, or logical repo-group ID (not a placement ID). + ResourceId string `json:"resourceId"` + ResourceName string `json:"resourceName"` + ResourceType OrgPersonGrantResourceType `json:"resourceType"` + Role OrgPersonGrantRole `json:"role"` + // Origin at this resource level; inherited access is not included. + Source OrgPersonGrantSource `json:"source"` + AdditionalProps OrgPersonGrantAdditional } -// GetInboundSecretIssuedAt returns the value of InboundSecretIssuedAt. -func (s *OrgCIBuildkiteCredentialView) GetInboundSecretIssuedAt() OptDateTime { - return s.InboundSecretIssuedAt +// GetCapabilities returns the value of Capabilities. +func (s *OrgPersonGrant) GetCapabilities() OrgPersonGrantCapabilities { + return s.Capabilities } -// GetInboundSecretSet returns the value of InboundSecretSet. -func (s *OrgCIBuildkiteCredentialView) GetInboundSecretSet() bool { - return s.InboundSecretSet +// GetResourceId returns the value of ResourceId. +func (s *OrgPersonGrant) GetResourceId() string { + return s.ResourceId } -// GetOwner returns the value of Owner. -func (s *OrgCIBuildkiteCredentialView) GetOwner() string { - return s.Owner +// GetResourceName returns the value of ResourceName. +func (s *OrgPersonGrant) GetResourceName() string { + return s.ResourceName } -// GetTokenLen returns the value of TokenLen. -func (s *OrgCIBuildkiteCredentialView) GetTokenLen() int64 { - return s.TokenLen +// GetResourceType returns the value of ResourceType. +func (s *OrgPersonGrant) GetResourceType() OrgPersonGrantResourceType { + return s.ResourceType } -// GetUpdatedAt returns the value of UpdatedAt. -func (s *OrgCIBuildkiteCredentialView) GetUpdatedAt() time.Time { - return s.UpdatedAt +// GetRole returns the value of Role. +func (s *OrgPersonGrant) GetRole() OrgPersonGrantRole { + return s.Role } -// GetVerifiedAt returns the value of VerifiedAt. -func (s *OrgCIBuildkiteCredentialView) GetVerifiedAt() OptDateTime { - return s.VerifiedAt +// GetSource returns the value of Source. +func (s *OrgPersonGrant) GetSource() OrgPersonGrantSource { + return s.Source } // GetAdditionalProps returns the value of AdditionalProps. -func (s *OrgCIBuildkiteCredentialView) GetAdditionalProps() OrgCIBuildkiteCredentialViewAdditional { +func (s *OrgPersonGrant) GetAdditionalProps() OrgPersonGrantAdditional { return s.AdditionalProps } -// SetSchema sets the value of Schema. -func (s *OrgCIBuildkiteCredentialView) SetSchema(val OptURI) { - s.Schema = val +// SetCapabilities sets the value of Capabilities. +func (s *OrgPersonGrant) SetCapabilities(val OrgPersonGrantCapabilities) { + s.Capabilities = val } -// SetBkOrganization sets the value of BkOrganization. -func (s *OrgCIBuildkiteCredentialView) SetBkOrganization(val string) { - s.BkOrganization = val +// SetResourceId sets the value of ResourceId. +func (s *OrgPersonGrant) SetResourceId(val string) { + s.ResourceId = val } -// SetCipherVersion sets the value of CipherVersion. -func (s *OrgCIBuildkiteCredentialView) SetCipherVersion(val int64) { - s.CipherVersion = val +// SetResourceName sets the value of ResourceName. +func (s *OrgPersonGrant) SetResourceName(val string) { + s.ResourceName = val } -// SetCreatedAt sets the value of CreatedAt. -func (s *OrgCIBuildkiteCredentialView) SetCreatedAt(val time.Time) { - s.CreatedAt = val +// SetResourceType sets the value of ResourceType. +func (s *OrgPersonGrant) SetResourceType(val OrgPersonGrantResourceType) { + s.ResourceType = val } -// SetInboundEndpointID sets the value of InboundEndpointID. -func (s *OrgCIBuildkiteCredentialView) SetInboundEndpointID(val OptString) { - s.InboundEndpointID = val +// SetRole sets the value of Role. +func (s *OrgPersonGrant) SetRole(val OrgPersonGrantRole) { + s.Role = val } -// SetInboundEndpointPath sets the value of InboundEndpointPath. -func (s *OrgCIBuildkiteCredentialView) SetInboundEndpointPath(val OptString) { - s.InboundEndpointPath = val +// SetSource sets the value of Source. +func (s *OrgPersonGrant) SetSource(val OrgPersonGrantSource) { + s.Source = val } -// SetInboundEndpointURL sets the value of InboundEndpointURL. -func (s *OrgCIBuildkiteCredentialView) SetInboundEndpointURL(val OptString) { - s.InboundEndpointURL = val +// SetAdditionalProps sets the value of AdditionalProps. +func (s *OrgPersonGrant) SetAdditionalProps(val OrgPersonGrantAdditional) { + s.AdditionalProps = val } -// SetInboundSecret sets the value of InboundSecret. -func (s *OrgCIBuildkiteCredentialView) SetInboundSecret(val OptString) { - s.InboundSecret = val +type OrgPersonGrantAdditional map[string]jx.Raw + +func (s *OrgPersonGrantAdditional) init() OrgPersonGrantAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m } -// SetInboundSecretIssuedAt sets the value of InboundSecretIssuedAt. -func (s *OrgCIBuildkiteCredentialView) SetInboundSecretIssuedAt(val OptDateTime) { - s.InboundSecretIssuedAt = val +// Ref: #/components/schemas/OrgPersonGrantCapabilities +type OrgPersonGrantCapabilities struct { + // Roles the caller may request. An empty array means read-only. + AllowedRoles []OrgPersonGrantCapabilitiesAllowedRolesItem `json:"allowedRoles"` + // ID for the existing role mutation: membership ID, project ID, or native primary repo placement ID. + // Present only when roles are editable. + TargetId OptString `json:"targetId"` + AdditionalProps OrgPersonGrantCapabilitiesAdditional } -// SetInboundSecretSet sets the value of InboundSecretSet. -func (s *OrgCIBuildkiteCredentialView) SetInboundSecretSet(val bool) { - s.InboundSecretSet = val +// GetAllowedRoles returns the value of AllowedRoles. +func (s *OrgPersonGrantCapabilities) GetAllowedRoles() []OrgPersonGrantCapabilitiesAllowedRolesItem { + return s.AllowedRoles } -// SetOwner sets the value of Owner. -func (s *OrgCIBuildkiteCredentialView) SetOwner(val string) { - s.Owner = val +// GetTargetId returns the value of TargetId. +func (s *OrgPersonGrantCapabilities) GetTargetId() OptString { + return s.TargetId } -// SetTokenLen sets the value of TokenLen. -func (s *OrgCIBuildkiteCredentialView) SetTokenLen(val int64) { - s.TokenLen = val +// GetAdditionalProps returns the value of AdditionalProps. +func (s *OrgPersonGrantCapabilities) GetAdditionalProps() OrgPersonGrantCapabilitiesAdditional { + return s.AdditionalProps } -// SetUpdatedAt sets the value of UpdatedAt. -func (s *OrgCIBuildkiteCredentialView) SetUpdatedAt(val time.Time) { - s.UpdatedAt = val +// SetAllowedRoles sets the value of AllowedRoles. +func (s *OrgPersonGrantCapabilities) SetAllowedRoles(val []OrgPersonGrantCapabilitiesAllowedRolesItem) { + s.AllowedRoles = val } -// SetVerifiedAt sets the value of VerifiedAt. -func (s *OrgCIBuildkiteCredentialView) SetVerifiedAt(val OptDateTime) { - s.VerifiedAt = val +// SetTargetId sets the value of TargetId. +func (s *OrgPersonGrantCapabilities) SetTargetId(val OptString) { + s.TargetId = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *OrgCIBuildkiteCredentialView) SetAdditionalProps(val OrgCIBuildkiteCredentialViewAdditional) { +func (s *OrgPersonGrantCapabilities) SetAdditionalProps(val OrgPersonGrantCapabilitiesAdditional) { s.AdditionalProps = val } -type OrgCIBuildkiteCredentialViewAdditional map[string]jx.Raw +type OrgPersonGrantCapabilitiesAdditional map[string]jx.Raw -func (s *OrgCIBuildkiteCredentialViewAdditional) init() OrgCIBuildkiteCredentialViewAdditional { +func (s *OrgPersonGrantCapabilitiesAdditional) init() OrgPersonGrantCapabilitiesAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -11053,124 +14447,329 @@ func (s *OrgCIBuildkiteCredentialViewAdditional) init() OrgCIBuildkiteCredential return m } -// Ref: #/components/schemas/OrgCIGitHubActionsCredentialView -type OrgCIGitHubActionsCredentialView struct { - // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Account string `json:"account"` - HasAPIToken OptBool `json:"has_api_token"` - InboundEndpointID OptString `json:"inbound_endpoint_id"` - InboundEndpointPath OptString `json:"inbound_endpoint_path"` - InboundEndpointURL OptString `json:"inbound_endpoint_url"` - InboundSecret OptString `json:"inbound_secret"` - Owner string `json:"owner"` - Provider string `json:"provider"` - AdditionalProps OrgCIGitHubActionsCredentialViewAdditional +type OrgPersonGrantCapabilitiesAllowedRolesItem string + +const ( + OrgPersonGrantCapabilitiesAllowedRolesItemOwner OrgPersonGrantCapabilitiesAllowedRolesItem = "owner" + OrgPersonGrantCapabilitiesAllowedRolesItemAdmin OrgPersonGrantCapabilitiesAllowedRolesItem = "admin" + OrgPersonGrantCapabilitiesAllowedRolesItemMember OrgPersonGrantCapabilitiesAllowedRolesItem = "member" + OrgPersonGrantCapabilitiesAllowedRolesItemWriter OrgPersonGrantCapabilitiesAllowedRolesItem = "writer" + OrgPersonGrantCapabilitiesAllowedRolesItemReader OrgPersonGrantCapabilitiesAllowedRolesItem = "reader" +) + +// AllValues returns all OrgPersonGrantCapabilitiesAllowedRolesItem values. +func (OrgPersonGrantCapabilitiesAllowedRolesItem) AllValues() []OrgPersonGrantCapabilitiesAllowedRolesItem { + return []OrgPersonGrantCapabilitiesAllowedRolesItem{ + OrgPersonGrantCapabilitiesAllowedRolesItemOwner, + OrgPersonGrantCapabilitiesAllowedRolesItemAdmin, + OrgPersonGrantCapabilitiesAllowedRolesItemMember, + OrgPersonGrantCapabilitiesAllowedRolesItemWriter, + OrgPersonGrantCapabilitiesAllowedRolesItemReader, + } } -// GetSchema returns the value of Schema. -func (s *OrgCIGitHubActionsCredentialView) GetSchema() OptURI { - return s.Schema +// MarshalText implements encoding.TextMarshaler. +func (s OrgPersonGrantCapabilitiesAllowedRolesItem) MarshalText() ([]byte, error) { + switch s { + case OrgPersonGrantCapabilitiesAllowedRolesItemOwner: + return []byte(s), nil + case OrgPersonGrantCapabilitiesAllowedRolesItemAdmin: + return []byte(s), nil + case OrgPersonGrantCapabilitiesAllowedRolesItemMember: + return []byte(s), nil + case OrgPersonGrantCapabilitiesAllowedRolesItemWriter: + return []byte(s), nil + case OrgPersonGrantCapabilitiesAllowedRolesItemReader: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// GetAccount returns the value of Account. -func (s *OrgCIGitHubActionsCredentialView) GetAccount() string { - return s.Account +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *OrgPersonGrantCapabilitiesAllowedRolesItem) UnmarshalText(data []byte) error { + switch OrgPersonGrantCapabilitiesAllowedRolesItem(data) { + case OrgPersonGrantCapabilitiesAllowedRolesItemOwner: + *s = OrgPersonGrantCapabilitiesAllowedRolesItemOwner + return nil + case OrgPersonGrantCapabilitiesAllowedRolesItemAdmin: + *s = OrgPersonGrantCapabilitiesAllowedRolesItemAdmin + return nil + case OrgPersonGrantCapabilitiesAllowedRolesItemMember: + *s = OrgPersonGrantCapabilitiesAllowedRolesItemMember + return nil + case OrgPersonGrantCapabilitiesAllowedRolesItemWriter: + *s = OrgPersonGrantCapabilitiesAllowedRolesItemWriter + return nil + case OrgPersonGrantCapabilitiesAllowedRolesItemReader: + *s = OrgPersonGrantCapabilitiesAllowedRolesItemReader + return nil + default: + return errors.Errorf("invalid value: %q", data) + } } -// GetHasAPIToken returns the value of HasAPIToken. -func (s *OrgCIGitHubActionsCredentialView) GetHasAPIToken() OptBool { - return s.HasAPIToken +type OrgPersonGrantResourceType string + +const ( + OrgPersonGrantResourceTypeOrganization OrgPersonGrantResourceType = "organization" + OrgPersonGrantResourceTypeProject OrgPersonGrantResourceType = "project" + OrgPersonGrantResourceTypeRepository OrgPersonGrantResourceType = "repository" +) + +// AllValues returns all OrgPersonGrantResourceType values. +func (OrgPersonGrantResourceType) AllValues() []OrgPersonGrantResourceType { + return []OrgPersonGrantResourceType{ + OrgPersonGrantResourceTypeOrganization, + OrgPersonGrantResourceTypeProject, + OrgPersonGrantResourceTypeRepository, + } } -// GetInboundEndpointID returns the value of InboundEndpointID. -func (s *OrgCIGitHubActionsCredentialView) GetInboundEndpointID() OptString { - return s.InboundEndpointID +// MarshalText implements encoding.TextMarshaler. +func (s OrgPersonGrantResourceType) MarshalText() ([]byte, error) { + switch s { + case OrgPersonGrantResourceTypeOrganization: + return []byte(s), nil + case OrgPersonGrantResourceTypeProject: + return []byte(s), nil + case OrgPersonGrantResourceTypeRepository: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *OrgPersonGrantResourceType) UnmarshalText(data []byte) error { + switch OrgPersonGrantResourceType(data) { + case OrgPersonGrantResourceTypeOrganization: + *s = OrgPersonGrantResourceTypeOrganization + return nil + case OrgPersonGrantResourceTypeProject: + *s = OrgPersonGrantResourceTypeProject + return nil + case OrgPersonGrantResourceTypeRepository: + *s = OrgPersonGrantResourceTypeRepository + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +type OrgPersonGrantRole string + +const ( + OrgPersonGrantRoleOwner OrgPersonGrantRole = "owner" + OrgPersonGrantRoleAdmin OrgPersonGrantRole = "admin" + OrgPersonGrantRoleMember OrgPersonGrantRole = "member" + OrgPersonGrantRoleReader OrgPersonGrantRole = "reader" + OrgPersonGrantRoleWriter OrgPersonGrantRole = "writer" + OrgPersonGrantRoleMirrorSourceAdmin OrgPersonGrantRole = "mirror_source_admin" +) + +// AllValues returns all OrgPersonGrantRole values. +func (OrgPersonGrantRole) AllValues() []OrgPersonGrantRole { + return []OrgPersonGrantRole{ + OrgPersonGrantRoleOwner, + OrgPersonGrantRoleAdmin, + OrgPersonGrantRoleMember, + OrgPersonGrantRoleReader, + OrgPersonGrantRoleWriter, + OrgPersonGrantRoleMirrorSourceAdmin, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s OrgPersonGrantRole) MarshalText() ([]byte, error) { + switch s { + case OrgPersonGrantRoleOwner: + return []byte(s), nil + case OrgPersonGrantRoleAdmin: + return []byte(s), nil + case OrgPersonGrantRoleMember: + return []byte(s), nil + case OrgPersonGrantRoleReader: + return []byte(s), nil + case OrgPersonGrantRoleWriter: + return []byte(s), nil + case OrgPersonGrantRoleMirrorSourceAdmin: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *OrgPersonGrantRole) UnmarshalText(data []byte) error { + switch OrgPersonGrantRole(data) { + case OrgPersonGrantRoleOwner: + *s = OrgPersonGrantRoleOwner + return nil + case OrgPersonGrantRoleAdmin: + *s = OrgPersonGrantRoleAdmin + return nil + case OrgPersonGrantRoleMember: + *s = OrgPersonGrantRoleMember + return nil + case OrgPersonGrantRoleReader: + *s = OrgPersonGrantRoleReader + return nil + case OrgPersonGrantRoleWriter: + *s = OrgPersonGrantRoleWriter + return nil + case OrgPersonGrantRoleMirrorSourceAdmin: + *s = OrgPersonGrantRoleMirrorSourceAdmin + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// Origin at this resource level; inherited access is not included. +type OrgPersonGrantSource string + +const ( + OrgPersonGrantSourceMembership OrgPersonGrantSource = "membership" + OrgPersonGrantSourceDirect OrgPersonGrantSource = "direct" + OrgPersonGrantSourceTeam OrgPersonGrantSource = "team" + OrgPersonGrantSourceGithub OrgPersonGrantSource = "github" +) + +// AllValues returns all OrgPersonGrantSource values. +func (OrgPersonGrantSource) AllValues() []OrgPersonGrantSource { + return []OrgPersonGrantSource{ + OrgPersonGrantSourceMembership, + OrgPersonGrantSourceDirect, + OrgPersonGrantSourceTeam, + OrgPersonGrantSourceGithub, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s OrgPersonGrantSource) MarshalText() ([]byte, error) { + switch s { + case OrgPersonGrantSourceMembership: + return []byte(s), nil + case OrgPersonGrantSourceDirect: + return []byte(s), nil + case OrgPersonGrantSourceTeam: + return []byte(s), nil + case OrgPersonGrantSourceGithub: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// GetInboundEndpointPath returns the value of InboundEndpointPath. -func (s *OrgCIGitHubActionsCredentialView) GetInboundEndpointPath() OptString { - return s.InboundEndpointPath +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *OrgPersonGrantSource) UnmarshalText(data []byte) error { + switch OrgPersonGrantSource(data) { + case OrgPersonGrantSourceMembership: + *s = OrgPersonGrantSourceMembership + return nil + case OrgPersonGrantSourceDirect: + *s = OrgPersonGrantSourceDirect + return nil + case OrgPersonGrantSourceTeam: + *s = OrgPersonGrantSourceTeam + return nil + case OrgPersonGrantSourceGithub: + *s = OrgPersonGrantSourceGithub + return nil + default: + return errors.Errorf("invalid value: %q", data) + } } -// GetInboundEndpointURL returns the value of InboundEndpointURL. -func (s *OrgCIGitHubActionsCredentialView) GetInboundEndpointURL() OptString { - return s.InboundEndpointURL +// OrgPersonHeaders wraps OrgPerson with response headers. +type OrgPersonHeaders struct { + CacheControl OptString + Response OrgPerson } -// GetInboundSecret returns the value of InboundSecret. -func (s *OrgCIGitHubActionsCredentialView) GetInboundSecret() OptString { - return s.InboundSecret +// GetCacheControl returns the value of CacheControl. +func (s *OrgPersonHeaders) GetCacheControl() OptString { + return s.CacheControl } -// GetOwner returns the value of Owner. -func (s *OrgCIGitHubActionsCredentialView) GetOwner() string { - return s.Owner +// GetResponse returns the value of Response. +func (s *OrgPersonHeaders) GetResponse() OrgPerson { + return s.Response } -// GetProvider returns the value of Provider. -func (s *OrgCIGitHubActionsCredentialView) GetProvider() string { - return s.Provider +// SetCacheControl sets the value of CacheControl. +func (s *OrgPersonHeaders) SetCacheControl(val OptString) { + s.CacheControl = val } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *OrgCIGitHubActionsCredentialView) GetAdditionalProps() OrgCIGitHubActionsCredentialViewAdditional { - return s.AdditionalProps +// SetResponse sets the value of Response. +func (s *OrgPersonHeaders) SetResponse(val OrgPerson) { + s.Response = val } -// SetSchema sets the value of Schema. -func (s *OrgCIGitHubActionsCredentialView) SetSchema(val OptURI) { - s.Schema = val +// Ref: #/components/schemas/OrgPersonMembership +type OrgPersonMembership struct { + CreatedAt time.Time `json:"createdAt"` + ID string `json:"id"` + Role string `json:"role"` + Status string `json:"status"` + AdditionalProps OrgPersonMembershipAdditional } -// SetAccount sets the value of Account. -func (s *OrgCIGitHubActionsCredentialView) SetAccount(val string) { - s.Account = val +// GetCreatedAt returns the value of CreatedAt. +func (s *OrgPersonMembership) GetCreatedAt() time.Time { + return s.CreatedAt } -// SetHasAPIToken sets the value of HasAPIToken. -func (s *OrgCIGitHubActionsCredentialView) SetHasAPIToken(val OptBool) { - s.HasAPIToken = val +// GetID returns the value of ID. +func (s *OrgPersonMembership) GetID() string { + return s.ID } -// SetInboundEndpointID sets the value of InboundEndpointID. -func (s *OrgCIGitHubActionsCredentialView) SetInboundEndpointID(val OptString) { - s.InboundEndpointID = val +// GetRole returns the value of Role. +func (s *OrgPersonMembership) GetRole() string { + return s.Role } -// SetInboundEndpointPath sets the value of InboundEndpointPath. -func (s *OrgCIGitHubActionsCredentialView) SetInboundEndpointPath(val OptString) { - s.InboundEndpointPath = val +// GetStatus returns the value of Status. +func (s *OrgPersonMembership) GetStatus() string { + return s.Status } -// SetInboundEndpointURL sets the value of InboundEndpointURL. -func (s *OrgCIGitHubActionsCredentialView) SetInboundEndpointURL(val OptString) { - s.InboundEndpointURL = val +// GetAdditionalProps returns the value of AdditionalProps. +func (s *OrgPersonMembership) GetAdditionalProps() OrgPersonMembershipAdditional { + return s.AdditionalProps } -// SetInboundSecret sets the value of InboundSecret. -func (s *OrgCIGitHubActionsCredentialView) SetInboundSecret(val OptString) { - s.InboundSecret = val +// SetCreatedAt sets the value of CreatedAt. +func (s *OrgPersonMembership) SetCreatedAt(val time.Time) { + s.CreatedAt = val } -// SetOwner sets the value of Owner. -func (s *OrgCIGitHubActionsCredentialView) SetOwner(val string) { - s.Owner = val +// SetID sets the value of ID. +func (s *OrgPersonMembership) SetID(val string) { + s.ID = val } -// SetProvider sets the value of Provider. -func (s *OrgCIGitHubActionsCredentialView) SetProvider(val string) { - s.Provider = val +// SetRole sets the value of Role. +func (s *OrgPersonMembership) SetRole(val string) { + s.Role = val +} + +// SetStatus sets the value of Status. +func (s *OrgPersonMembership) SetStatus(val string) { + s.Status = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *OrgCIGitHubActionsCredentialView) SetAdditionalProps(val OrgCIGitHubActionsCredentialViewAdditional) { +func (s *OrgPersonMembership) SetAdditionalProps(val OrgPersonMembershipAdditional) { s.AdditionalProps = val } -type OrgCIGitHubActionsCredentialViewAdditional map[string]jx.Raw +type OrgPersonMembershipAdditional map[string]jx.Raw -func (s *OrgCIGitHubActionsCredentialViewAdditional) init() OrgCIGitHubActionsCredentialViewAdditional { +func (s *OrgPersonMembershipAdditional) init() OrgPersonMembershipAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -11179,57 +14778,139 @@ func (s *OrgCIGitHubActionsCredentialViewAdditional) init() OrgCIGitHubActionsCr return m } -// Ref: #/components/schemas/OrgCapabilities -type OrgCapabilities struct { - CanCreateProject bool `json:"canCreateProject"` - CanDelete bool `json:"canDelete"` - CanManageMembers bool `json:"canManageMembers"` - AdditionalProps OrgCapabilitiesAdditional +// Ref: #/components/schemas/OrgPersonSummary +type OrgPersonSummary struct { + // Recorded grant levels, not effective permissions. + AccessScopes []OrgPersonSummaryAccessScopesItem `json:"accessScopes"` + AccountId string `json:"accountId"` + AvatarUrl OptString `json:"avatarUrl"` + Handle OptString `json:"handle"` + Membership OrgPersonMembership `json:"membership"` + Provider OptString `json:"provider"` + AdditionalProps OrgPersonSummaryAdditional } -// GetCanCreateProject returns the value of CanCreateProject. -func (s *OrgCapabilities) GetCanCreateProject() bool { - return s.CanCreateProject +// GetAccessScopes returns the value of AccessScopes. +func (s *OrgPersonSummary) GetAccessScopes() []OrgPersonSummaryAccessScopesItem { + return s.AccessScopes } -// GetCanDelete returns the value of CanDelete. -func (s *OrgCapabilities) GetCanDelete() bool { - return s.CanDelete +// GetAccountId returns the value of AccountId. +func (s *OrgPersonSummary) GetAccountId() string { + return s.AccountId } -// GetCanManageMembers returns the value of CanManageMembers. -func (s *OrgCapabilities) GetCanManageMembers() bool { - return s.CanManageMembers +// GetAvatarUrl returns the value of AvatarUrl. +func (s *OrgPersonSummary) GetAvatarUrl() OptString { + return s.AvatarUrl +} + +// GetHandle returns the value of Handle. +func (s *OrgPersonSummary) GetHandle() OptString { + return s.Handle +} + +// GetMembership returns the value of Membership. +func (s *OrgPersonSummary) GetMembership() OrgPersonMembership { + return s.Membership +} + +// GetProvider returns the value of Provider. +func (s *OrgPersonSummary) GetProvider() OptString { + return s.Provider } // GetAdditionalProps returns the value of AdditionalProps. -func (s *OrgCapabilities) GetAdditionalProps() OrgCapabilitiesAdditional { +func (s *OrgPersonSummary) GetAdditionalProps() OrgPersonSummaryAdditional { return s.AdditionalProps } -// SetCanCreateProject sets the value of CanCreateProject. -func (s *OrgCapabilities) SetCanCreateProject(val bool) { - s.CanCreateProject = val +// SetAccessScopes sets the value of AccessScopes. +func (s *OrgPersonSummary) SetAccessScopes(val []OrgPersonSummaryAccessScopesItem) { + s.AccessScopes = val } -// SetCanDelete sets the value of CanDelete. -func (s *OrgCapabilities) SetCanDelete(val bool) { - s.CanDelete = val +// SetAccountId sets the value of AccountId. +func (s *OrgPersonSummary) SetAccountId(val string) { + s.AccountId = val } -// SetCanManageMembers sets the value of CanManageMembers. -func (s *OrgCapabilities) SetCanManageMembers(val bool) { - s.CanManageMembers = val +// SetAvatarUrl sets the value of AvatarUrl. +func (s *OrgPersonSummary) SetAvatarUrl(val OptString) { + s.AvatarUrl = val +} + +// SetHandle sets the value of Handle. +func (s *OrgPersonSummary) SetHandle(val OptString) { + s.Handle = val +} + +// SetMembership sets the value of Membership. +func (s *OrgPersonSummary) SetMembership(val OrgPersonMembership) { + s.Membership = val +} + +// SetProvider sets the value of Provider. +func (s *OrgPersonSummary) SetProvider(val OptString) { + s.Provider = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *OrgCapabilities) SetAdditionalProps(val OrgCapabilitiesAdditional) { +func (s *OrgPersonSummary) SetAdditionalProps(val OrgPersonSummaryAdditional) { s.AdditionalProps = val } -type OrgCapabilitiesAdditional map[string]jx.Raw +type OrgPersonSummaryAccessScopesItem string -func (s *OrgCapabilitiesAdditional) init() OrgCapabilitiesAdditional { +const ( + OrgPersonSummaryAccessScopesItemOrganization OrgPersonSummaryAccessScopesItem = "organization" + OrgPersonSummaryAccessScopesItemProject OrgPersonSummaryAccessScopesItem = "project" + OrgPersonSummaryAccessScopesItemRepository OrgPersonSummaryAccessScopesItem = "repository" +) + +// AllValues returns all OrgPersonSummaryAccessScopesItem values. +func (OrgPersonSummaryAccessScopesItem) AllValues() []OrgPersonSummaryAccessScopesItem { + return []OrgPersonSummaryAccessScopesItem{ + OrgPersonSummaryAccessScopesItemOrganization, + OrgPersonSummaryAccessScopesItemProject, + OrgPersonSummaryAccessScopesItemRepository, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s OrgPersonSummaryAccessScopesItem) MarshalText() ([]byte, error) { + switch s { + case OrgPersonSummaryAccessScopesItemOrganization: + return []byte(s), nil + case OrgPersonSummaryAccessScopesItemProject: + return []byte(s), nil + case OrgPersonSummaryAccessScopesItemRepository: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *OrgPersonSummaryAccessScopesItem) UnmarshalText(data []byte) error { + switch OrgPersonSummaryAccessScopesItem(data) { + case OrgPersonSummaryAccessScopesItemOrganization: + *s = OrgPersonSummaryAccessScopesItemOrganization + return nil + case OrgPersonSummaryAccessScopesItemProject: + *s = OrgPersonSummaryAccessScopesItemProject + return nil + case OrgPersonSummaryAccessScopesItemRepository: + *s = OrgPersonSummaryAccessScopesItemRepository + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +type OrgPersonSummaryAdditional map[string]jx.Raw + +func (s *OrgPersonSummaryAdditional) init() OrgPersonSummaryAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -11247,6 +14928,7 @@ type PatchRepoCIWebhookInputBody struct { Events []string `json:"events"` PublishChecks OptBool `json:"publish_checks"` RefFilter OptString `json:"ref_filter"` + RepoWrite OptBool `json:"repo_write"` AdditionalProps PatchRepoCIWebhookInputBodyAdditional } @@ -11280,6 +14962,11 @@ func (s *PatchRepoCIWebhookInputBody) GetRefFilter() OptString { return s.RefFilter } +// GetRepoWrite returns the value of RepoWrite. +func (s *PatchRepoCIWebhookInputBody) GetRepoWrite() OptBool { + return s.RepoWrite +} + // GetAdditionalProps returns the value of AdditionalProps. func (s *PatchRepoCIWebhookInputBody) GetAdditionalProps() PatchRepoCIWebhookInputBodyAdditional { return s.AdditionalProps @@ -11295,34 +14982,146 @@ func (s *PatchRepoCIWebhookInputBody) SetDisplayName(val OptString) { s.DisplayName = val } -// SetEnabled sets the value of Enabled. -func (s *PatchRepoCIWebhookInputBody) SetEnabled(val OptBool) { - s.Enabled = val +// SetEnabled sets the value of Enabled. +func (s *PatchRepoCIWebhookInputBody) SetEnabled(val OptBool) { + s.Enabled = val +} + +// SetEvents sets the value of Events. +func (s *PatchRepoCIWebhookInputBody) SetEvents(val []string) { + s.Events = val +} + +// SetPublishChecks sets the value of PublishChecks. +func (s *PatchRepoCIWebhookInputBody) SetPublishChecks(val OptBool) { + s.PublishChecks = val +} + +// SetRefFilter sets the value of RefFilter. +func (s *PatchRepoCIWebhookInputBody) SetRefFilter(val OptString) { + s.RefFilter = val +} + +// SetRepoWrite sets the value of RepoWrite. +func (s *PatchRepoCIWebhookInputBody) SetRepoWrite(val OptBool) { + s.RepoWrite = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *PatchRepoCIWebhookInputBody) SetAdditionalProps(val PatchRepoCIWebhookInputBodyAdditional) { + s.AdditionalProps = val +} + +type PatchRepoCIWebhookInputBodyAdditional map[string]jx.Raw + +func (s *PatchRepoCIWebhookInputBodyAdditional) init() PatchRepoCIWebhookInputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/PreviewInvitationInputBody +type PreviewInvitationInputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Token string `json:"token"` + AdditionalProps PreviewInvitationInputBodyAdditional +} + +// GetSchema returns the value of Schema. +func (s *PreviewInvitationInputBody) GetSchema() OptURI { + return s.Schema +} + +// GetToken returns the value of Token. +func (s *PreviewInvitationInputBody) GetToken() string { + return s.Token +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *PreviewInvitationInputBody) GetAdditionalProps() PreviewInvitationInputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *PreviewInvitationInputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetToken sets the value of Token. +func (s *PreviewInvitationInputBody) SetToken(val string) { + s.Token = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *PreviewInvitationInputBody) SetAdditionalProps(val PreviewInvitationInputBodyAdditional) { + s.AdditionalProps = val +} + +type PreviewInvitationInputBodyAdditional map[string]jx.Raw + +func (s *PreviewInvitationInputBodyAdditional) init() PreviewInvitationInputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +type PreviewInvitationOK struct { + InviterHandle string `json:"inviterHandle"` + OrgName string `json:"orgName"` + Role PreviewInvitationOKRole `json:"role"` + AdditionalProps PreviewInvitationOKAdditional +} + +// GetInviterHandle returns the value of InviterHandle. +func (s *PreviewInvitationOK) GetInviterHandle() string { + return s.InviterHandle +} + +// GetOrgName returns the value of OrgName. +func (s *PreviewInvitationOK) GetOrgName() string { + return s.OrgName +} + +// GetRole returns the value of Role. +func (s *PreviewInvitationOK) GetRole() PreviewInvitationOKRole { + return s.Role +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *PreviewInvitationOK) GetAdditionalProps() PreviewInvitationOKAdditional { + return s.AdditionalProps } -// SetEvents sets the value of Events. -func (s *PatchRepoCIWebhookInputBody) SetEvents(val []string) { - s.Events = val +// SetInviterHandle sets the value of InviterHandle. +func (s *PreviewInvitationOK) SetInviterHandle(val string) { + s.InviterHandle = val } -// SetPublishChecks sets the value of PublishChecks. -func (s *PatchRepoCIWebhookInputBody) SetPublishChecks(val OptBool) { - s.PublishChecks = val +// SetOrgName sets the value of OrgName. +func (s *PreviewInvitationOK) SetOrgName(val string) { + s.OrgName = val } -// SetRefFilter sets the value of RefFilter. -func (s *PatchRepoCIWebhookInputBody) SetRefFilter(val OptString) { - s.RefFilter = val +// SetRole sets the value of Role. +func (s *PreviewInvitationOK) SetRole(val PreviewInvitationOKRole) { + s.Role = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *PatchRepoCIWebhookInputBody) SetAdditionalProps(val PatchRepoCIWebhookInputBodyAdditional) { +func (s *PreviewInvitationOK) SetAdditionalProps(val PreviewInvitationOKAdditional) { s.AdditionalProps = val } -type PatchRepoCIWebhookInputBodyAdditional map[string]jx.Raw +type PreviewInvitationOKAdditional map[string]jx.Raw -func (s *PatchRepoCIWebhookInputBodyAdditional) init() PatchRepoCIWebhookInputBodyAdditional { +func (s *PreviewInvitationOKAdditional) init() PreviewInvitationOKAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -11331,18 +15130,100 @@ func (s *PatchRepoCIWebhookInputBodyAdditional) init() PatchRepoCIWebhookInputBo return m } +// PreviewInvitationOKHeaders wraps PreviewInvitationOK with response headers. +type PreviewInvitationOKHeaders struct { + CacheControl OptString + Response PreviewInvitationOK +} + +// GetCacheControl returns the value of CacheControl. +func (s *PreviewInvitationOKHeaders) GetCacheControl() OptString { + return s.CacheControl +} + +// GetResponse returns the value of Response. +func (s *PreviewInvitationOKHeaders) GetResponse() PreviewInvitationOK { + return s.Response +} + +// SetCacheControl sets the value of CacheControl. +func (s *PreviewInvitationOKHeaders) SetCacheControl(val OptString) { + s.CacheControl = val +} + +// SetResponse sets the value of Response. +func (s *PreviewInvitationOKHeaders) SetResponse(val PreviewInvitationOK) { + s.Response = val +} + +type PreviewInvitationOKRole string + +const ( + PreviewInvitationOKRoleOwner PreviewInvitationOKRole = "owner" + PreviewInvitationOKRoleAdmin PreviewInvitationOKRole = "admin" + PreviewInvitationOKRoleMember PreviewInvitationOKRole = "member" +) + +// AllValues returns all PreviewInvitationOKRole values. +func (PreviewInvitationOKRole) AllValues() []PreviewInvitationOKRole { + return []PreviewInvitationOKRole{ + PreviewInvitationOKRoleOwner, + PreviewInvitationOKRoleAdmin, + PreviewInvitationOKRoleMember, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s PreviewInvitationOKRole) MarshalText() ([]byte, error) { + switch s { + case PreviewInvitationOKRoleOwner: + return []byte(s), nil + case PreviewInvitationOKRoleAdmin: + return []byte(s), nil + case PreviewInvitationOKRoleMember: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *PreviewInvitationOKRole) UnmarshalText(data []byte) error { + switch PreviewInvitationOKRole(data) { + case PreviewInvitationOKRoleOwner: + *s = PreviewInvitationOKRoleOwner + return nil + case PreviewInvitationOKRoleAdmin: + *s = PreviewInvitationOKRoleAdmin + return nil + case PreviewInvitationOKRoleMember: + *s = PreviewInvitationOKRoleMember + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + // Ref: #/components/schemas/Project type Project struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Capabilities OptProjectCapabilities `json:"capabilities"` - CreatedAt time.Time `json:"createdAt"` - ID string `json:"id"` - Name string `json:"name"` - OwnerId string `json:"ownerId"` - OwnerName OptString `json:"ownerName"` - OwnerType ProjectOwnerType `json:"ownerType"` - Region string `json:"region"` + Schema OptURI `json:"$schema"` + // Public entire-api base URL for the assigned cell. Empty when unassigned or routing is unavailable; + // do not fall back to another cell. + ApiUrl OptString `json:"apiUrl"` + Capabilities OptProjectCapabilities `json:"capabilities"` + CreatedAt time.Time `json:"createdAt"` + ID string `json:"id"` + Name string `json:"name"` + OwnerId string `json:"ownerId"` + OwnerName OptString `json:"ownerName"` + OwnerType ProjectOwnerType `json:"ownerType"` + // Stored processing cell ID, not a cluster slug. Empty when the project is unassigned. + PrimaryProcessingCell OptString `json:"primaryProcessingCell"` + Region string `json:"region"` + // Published logical repositories in paginated project listings. Omitted without project-wide view + // permission or when unavailable. + RepositoryCount OptInt64 `json:"repositoryCount"` AdditionalProps ProjectAdditional } @@ -11351,6 +15232,11 @@ func (s *Project) GetSchema() OptURI { return s.Schema } +// GetApiUrl returns the value of ApiUrl. +func (s *Project) GetApiUrl() OptString { + return s.ApiUrl +} + // GetCapabilities returns the value of Capabilities. func (s *Project) GetCapabilities() OptProjectCapabilities { return s.Capabilities @@ -11386,11 +15272,21 @@ func (s *Project) GetOwnerType() ProjectOwnerType { return s.OwnerType } +// GetPrimaryProcessingCell returns the value of PrimaryProcessingCell. +func (s *Project) GetPrimaryProcessingCell() OptString { + return s.PrimaryProcessingCell +} + // GetRegion returns the value of Region. func (s *Project) GetRegion() string { return s.Region } +// GetRepositoryCount returns the value of RepositoryCount. +func (s *Project) GetRepositoryCount() OptInt64 { + return s.RepositoryCount +} + // GetAdditionalProps returns the value of AdditionalProps. func (s *Project) GetAdditionalProps() ProjectAdditional { return s.AdditionalProps @@ -11401,6 +15297,11 @@ func (s *Project) SetSchema(val OptURI) { s.Schema = val } +// SetApiUrl sets the value of ApiUrl. +func (s *Project) SetApiUrl(val OptString) { + s.ApiUrl = val +} + // SetCapabilities sets the value of Capabilities. func (s *Project) SetCapabilities(val OptProjectCapabilities) { s.Capabilities = val @@ -11436,11 +15337,21 @@ func (s *Project) SetOwnerType(val ProjectOwnerType) { s.OwnerType = val } +// SetPrimaryProcessingCell sets the value of PrimaryProcessingCell. +func (s *Project) SetPrimaryProcessingCell(val OptString) { + s.PrimaryProcessingCell = val +} + // SetRegion sets the value of Region. func (s *Project) SetRegion(val string) { s.Region = val } +// SetRepositoryCount sets the value of RepositoryCount. +func (s *Project) SetRepositoryCount(val OptInt64) { + s.RepositoryCount = val +} + // SetAdditionalProps sets the value of AdditionalProps. func (s *Project) SetAdditionalProps(val ProjectAdditional) { s.AdditionalProps = val @@ -11649,6 +15560,95 @@ func (s *ProjectOwnerType) UnmarshalText(data []byte) error { } } +// Ref: #/components/schemas/ProjectReference +type ProjectReference struct { + Host ProjectReferenceHost `json:"host"` + Project string `json:"project"` + AdditionalProps ProjectReferenceAdditional +} + +// GetHost returns the value of Host. +func (s *ProjectReference) GetHost() ProjectReferenceHost { + return s.Host +} + +// GetProject returns the value of Project. +func (s *ProjectReference) GetProject() string { + return s.Project +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ProjectReference) GetAdditionalProps() ProjectReferenceAdditional { + return s.AdditionalProps +} + +// SetHost sets the value of Host. +func (s *ProjectReference) SetHost(val ProjectReferenceHost) { + s.Host = val +} + +// SetProject sets the value of Project. +func (s *ProjectReference) SetProject(val string) { + s.Project = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ProjectReference) SetAdditionalProps(val ProjectReferenceAdditional) { + s.AdditionalProps = val +} + +type ProjectReferenceAdditional map[string]jx.Raw + +func (s *ProjectReferenceAdditional) init() ProjectReferenceAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +type ProjectReferenceHost string + +const ( + ProjectReferenceHostEt ProjectReferenceHost = "et" + ProjectReferenceHostGh ProjectReferenceHost = "gh" +) + +// AllValues returns all ProjectReferenceHost values. +func (ProjectReferenceHost) AllValues() []ProjectReferenceHost { + return []ProjectReferenceHost{ + ProjectReferenceHostEt, + ProjectReferenceHostGh, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s ProjectReferenceHost) MarshalText() ([]byte, error) { + switch s { + case ProjectReferenceHostEt: + return []byte(s), nil + case ProjectReferenceHostGh: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ProjectReferenceHost) UnmarshalText(data []byte) error { + switch ProjectReferenceHost(data) { + case ProjectReferenceHostEt: + *s = ProjectReferenceHostEt + return nil + case ProjectReferenceHostGh: + *s = ProjectReferenceHostGh + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + // Ref: #/components/schemas/RegisterOrgCIBuildkiteClusterInputBody type RegisterOrgCIBuildkiteClusterInputBody struct { // A URL to the JSON Schema for this object. @@ -11751,6 +15751,7 @@ type Repo struct { ObjectFormat OptString `json:"objectFormat"` OwningProjectId string `json:"owningProjectId"` Path OptString `json:"path"` + Placements []RepoPlacement `json:"placements"` Primaries OptRepoPrimaries `json:"primaries"` Provider OptString `json:"provider"` ProvisionAttempts OptInt64 `json:"provisionAttempts"` @@ -11832,6 +15833,11 @@ func (s *Repo) GetPath() OptString { return s.Path } +// GetPlacements returns the value of Placements. +func (s *Repo) GetPlacements() []RepoPlacement { + return s.Placements +} + // GetPrimaries returns the value of Primaries. func (s *Repo) GetPrimaries() OptRepoPrimaries { return s.Primaries @@ -11942,6 +15948,11 @@ func (s *Repo) SetPath(val OptString) { s.Path = val } +// SetPlacements sets the value of Placements. +func (s *Repo) SetPlacements(val []RepoPlacement) { + s.Placements = val +} + // SetPrimaries sets the value of Primaries. func (s *Repo) SetPrimaries(val OptRepoPrimaries) { s.Primaries = val @@ -12150,9 +16161,11 @@ func (s *RepoCapabilitiesAdditional) init() RepoCapabilitiesAdditional { // Ref: #/components/schemas/RepoCollaborator type RepoCollaborator struct { - AccountId string `json:"accountId"` - Handle OptString `json:"handle"` - Role string `json:"role"` + AccountId string `json:"accountId"` + Handle OptString `json:"handle"` + // Display tier. Admin includes GitHub settings administrators and does not imply permission to + // manage grants. + Role RepoCollaboratorRole `json:"role"` AdditionalProps RepoCollaboratorAdditional } @@ -12167,7 +16180,7 @@ func (s *RepoCollaborator) GetHandle() OptString { } // GetRole returns the value of Role. -func (s *RepoCollaborator) GetRole() string { +func (s *RepoCollaborator) GetRole() RepoCollaboratorRole { return s.Role } @@ -12187,7 +16200,7 @@ func (s *RepoCollaborator) SetHandle(val OptString) { } // SetRole sets the value of Role. -func (s *RepoCollaborator) SetRole(val string) { +func (s *RepoCollaborator) SetRole(val RepoCollaboratorRole) { s.Role = val } @@ -12207,6 +16220,56 @@ func (s *RepoCollaboratorAdditional) init() RepoCollaboratorAdditional { return m } +// Display tier. Admin includes GitHub settings administrators and does not imply permission to +// manage grants. +type RepoCollaboratorRole string + +const ( + RepoCollaboratorRoleReader RepoCollaboratorRole = "reader" + RepoCollaboratorRoleWriter RepoCollaboratorRole = "writer" + RepoCollaboratorRoleAdmin RepoCollaboratorRole = "admin" +) + +// AllValues returns all RepoCollaboratorRole values. +func (RepoCollaboratorRole) AllValues() []RepoCollaboratorRole { + return []RepoCollaboratorRole{ + RepoCollaboratorRoleReader, + RepoCollaboratorRoleWriter, + RepoCollaboratorRoleAdmin, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s RepoCollaboratorRole) MarshalText() ([]byte, error) { + switch s { + case RepoCollaboratorRoleReader: + return []byte(s), nil + case RepoCollaboratorRoleWriter: + return []byte(s), nil + case RepoCollaboratorRoleAdmin: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *RepoCollaboratorRole) UnmarshalText(data []byte) error { + switch RepoCollaboratorRole(data) { + case RepoCollaboratorRoleReader: + *s = RepoCollaboratorRoleReader + return nil + case RepoCollaboratorRoleWriter: + *s = RepoCollaboratorRoleWriter + return nil + case RepoCollaboratorRoleAdmin: + *s = RepoCollaboratorRoleAdmin + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + // Ref: #/components/schemas/RepoFacetPage type RepoFacetPage struct { // A URL to the JSON Schema for this object. @@ -12744,6 +16807,7 @@ func (s *RepoIndexEntryAdditional) init() RepoIndexEntryAdditional { // Ref: #/components/schemas/RepoPlacement type RepoPlacement struct { + ApiBaseUrl OptString `json:"apiBaseUrl"` Cell string `json:"cell"` ClusterSlug string `json:"clusterSlug"` ID string `json:"id"` @@ -12753,6 +16817,11 @@ type RepoPlacement struct { AdditionalProps RepoPlacementAdditional } +// GetApiBaseUrl returns the value of ApiBaseUrl. +func (s *RepoPlacement) GetApiBaseUrl() OptString { + return s.ApiBaseUrl +} + // GetCell returns the value of Cell. func (s *RepoPlacement) GetCell() string { return s.Cell @@ -12788,6 +16857,11 @@ func (s *RepoPlacement) GetAdditionalProps() RepoPlacementAdditional { return s.AdditionalProps } +// SetApiBaseUrl sets the value of ApiBaseUrl. +func (s *RepoPlacement) SetApiBaseUrl(val OptString) { + s.ApiBaseUrl = val +} + // SetCell sets the value of Cell. func (s *RepoPlacement) SetCell(val string) { s.Cell = val @@ -13223,34 +17297,135 @@ func (s *ResolvePlacementsOutputBody) GetSchema() OptURI { return s.Schema } -// GetPlacements returns the value of Placements. -func (s *ResolvePlacementsOutputBody) GetPlacements() []ResolvedPlacement { - return s.Placements +// GetPlacements returns the value of Placements. +func (s *ResolvePlacementsOutputBody) GetPlacements() []ResolvedPlacement { + return s.Placements +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ResolvePlacementsOutputBody) GetAdditionalProps() ResolvePlacementsOutputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *ResolvePlacementsOutputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetPlacements sets the value of Placements. +func (s *ResolvePlacementsOutputBody) SetPlacements(val []ResolvedPlacement) { + s.Placements = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ResolvePlacementsOutputBody) SetAdditionalProps(val ResolvePlacementsOutputBodyAdditional) { + s.AdditionalProps = val +} + +type ResolvePlacementsOutputBodyAdditional map[string]jx.Raw + +func (s *ResolvePlacementsOutputBodyAdditional) init() ResolvePlacementsOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +type ResolveProjectHost string + +const ( + ResolveProjectHostEt ResolveProjectHost = "et" + ResolveProjectHostGh ResolveProjectHost = "gh" +) + +// AllValues returns all ResolveProjectHost values. +func (ResolveProjectHost) AllValues() []ResolveProjectHost { + return []ResolveProjectHost{ + ResolveProjectHostEt, + ResolveProjectHostGh, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s ResolveProjectHost) MarshalText() ([]byte, error) { + switch s { + case ResolveProjectHostEt: + return []byte(s), nil + case ResolveProjectHostGh: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ResolveProjectHost) UnmarshalText(data []byte) error { + switch ResolveProjectHost(data) { + case ResolveProjectHostEt: + *s = ResolveProjectHostEt + return nil + case ResolveProjectHostGh: + *s = ResolveProjectHostGh + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// Ref: #/components/schemas/ResolveProjectOutputBody +type ResolveProjectOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Project Project `json:"project"` + Reference ProjectReference `json:"reference"` + AdditionalProps ResolveProjectOutputBodyAdditional +} + +// GetSchema returns the value of Schema. +func (s *ResolveProjectOutputBody) GetSchema() OptURI { + return s.Schema +} + +// GetProject returns the value of Project. +func (s *ResolveProjectOutputBody) GetProject() Project { + return s.Project +} + +// GetReference returns the value of Reference. +func (s *ResolveProjectOutputBody) GetReference() ProjectReference { + return s.Reference } // GetAdditionalProps returns the value of AdditionalProps. -func (s *ResolvePlacementsOutputBody) GetAdditionalProps() ResolvePlacementsOutputBodyAdditional { +func (s *ResolveProjectOutputBody) GetAdditionalProps() ResolveProjectOutputBodyAdditional { return s.AdditionalProps } // SetSchema sets the value of Schema. -func (s *ResolvePlacementsOutputBody) SetSchema(val OptURI) { +func (s *ResolveProjectOutputBody) SetSchema(val OptURI) { s.Schema = val } -// SetPlacements sets the value of Placements. -func (s *ResolvePlacementsOutputBody) SetPlacements(val []ResolvedPlacement) { - s.Placements = val +// SetProject sets the value of Project. +func (s *ResolveProjectOutputBody) SetProject(val Project) { + s.Project = val +} + +// SetReference sets the value of Reference. +func (s *ResolveProjectOutputBody) SetReference(val ProjectReference) { + s.Reference = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ResolvePlacementsOutputBody) SetAdditionalProps(val ResolvePlacementsOutputBodyAdditional) { +func (s *ResolveProjectOutputBody) SetAdditionalProps(val ResolveProjectOutputBodyAdditional) { s.AdditionalProps = val } -type ResolvePlacementsOutputBodyAdditional map[string]jx.Raw +type ResolveProjectOutputBodyAdditional map[string]jx.Raw -func (s *ResolvePlacementsOutputBodyAdditional) init() ResolvePlacementsOutputBodyAdditional { +func (s *ResolveProjectOutputBodyAdditional) init() ResolveProjectOutputBodyAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -13360,9 +17535,13 @@ func (s *ResolveRepoIDsResponseAdditional) init() ResolveRepoIDsResponseAddition // Ref: #/components/schemas/ResolveReposInputBody type ResolveReposInputBody struct { // A URL to the JSON Schema for this object. - Schema OptURI `json:"$schema"` - Repositories []RepoReference `json:"repositories"` - AdditionalProps ResolveReposInputBodyAdditional + Schema OptURI `json:"$schema"` + CommitToken OptString `json:"commitToken"` + // Retry stale permission denials for navigation. Defaults to false for list enrichment. Failed + // retries retain denials; a commitToken authorization revision takes precedence. + RecheckDeniedPermissions OptBool `json:"recheckDeniedPermissions"` + Repositories []RepoReference `json:"repositories"` + AdditionalProps ResolveReposInputBodyAdditional } // GetSchema returns the value of Schema. @@ -13370,6 +17549,16 @@ func (s *ResolveReposInputBody) GetSchema() OptURI { return s.Schema } +// GetCommitToken returns the value of CommitToken. +func (s *ResolveReposInputBody) GetCommitToken() OptString { + return s.CommitToken +} + +// GetRecheckDeniedPermissions returns the value of RecheckDeniedPermissions. +func (s *ResolveReposInputBody) GetRecheckDeniedPermissions() OptBool { + return s.RecheckDeniedPermissions +} + // GetRepositories returns the value of Repositories. func (s *ResolveReposInputBody) GetRepositories() []RepoReference { return s.Repositories @@ -13385,6 +17574,16 @@ func (s *ResolveReposInputBody) SetSchema(val OptURI) { s.Schema = val } +// SetCommitToken sets the value of CommitToken. +func (s *ResolveReposInputBody) SetCommitToken(val OptString) { + s.CommitToken = val +} + +// SetRecheckDeniedPermissions sets the value of RecheckDeniedPermissions. +func (s *ResolveReposInputBody) SetRecheckDeniedPermissions(val OptBool) { + s.RecheckDeniedPermissions = val +} + // SetRepositories sets the value of Repositories. func (s *ResolveReposInputBody) SetRepositories(val []RepoReference) { s.Repositories = val @@ -13496,39 +17695,334 @@ func (s *ResolvedIdentity) GetAdditionalProps() ResolvedIdentityAdditional { return s.AdditionalProps } -// SetSchema sets the value of Schema. -func (s *ResolvedIdentity) SetSchema(val OptURI) { - s.Schema = val +// SetSchema sets the value of Schema. +func (s *ResolvedIdentity) SetSchema(val OptURI) { + s.Schema = val +} + +// SetAccountId sets the value of AccountId. +func (s *ResolvedIdentity) SetAccountId(val string) { + s.AccountId = val +} + +// SetHandle sets the value of Handle. +func (s *ResolvedIdentity) SetHandle(val string) { + s.Handle = val +} + +// SetProvider sets the value of Provider. +func (s *ResolvedIdentity) SetProvider(val string) { + s.Provider = val +} + +// SetProviderUserId sets the value of ProviderUserId. +func (s *ResolvedIdentity) SetProviderUserId(val string) { + s.ProviderUserId = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ResolvedIdentity) SetAdditionalProps(val ResolvedIdentityAdditional) { + s.AdditionalProps = val +} + +type ResolvedIdentityAdditional map[string]jx.Raw + +func (s *ResolvedIdentityAdditional) init() ResolvedIdentityAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/ResolvedPlacement +type ResolvedPlacement struct { + // Physical cell the mirror's cluster runs in, e.g. aws-us-east-2. + Cell OptString `json:"cell"` + // Public host of the cluster serving this mirror. + ClusterHost string `json:"clusterHost"` + Jurisdiction OptString `json:"jurisdiction"` + MirrorId string `json:"mirrorId"` + AdditionalProps ResolvedPlacementAdditional +} + +// GetCell returns the value of Cell. +func (s *ResolvedPlacement) GetCell() OptString { + return s.Cell +} + +// GetClusterHost returns the value of ClusterHost. +func (s *ResolvedPlacement) GetClusterHost() string { + return s.ClusterHost +} + +// GetJurisdiction returns the value of Jurisdiction. +func (s *ResolvedPlacement) GetJurisdiction() OptString { + return s.Jurisdiction +} + +// GetMirrorId returns the value of MirrorId. +func (s *ResolvedPlacement) GetMirrorId() string { + return s.MirrorId +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ResolvedPlacement) GetAdditionalProps() ResolvedPlacementAdditional { + return s.AdditionalProps +} + +// SetCell sets the value of Cell. +func (s *ResolvedPlacement) SetCell(val OptString) { + s.Cell = val +} + +// SetClusterHost sets the value of ClusterHost. +func (s *ResolvedPlacement) SetClusterHost(val string) { + s.ClusterHost = val +} + +// SetJurisdiction sets the value of Jurisdiction. +func (s *ResolvedPlacement) SetJurisdiction(val OptString) { + s.Jurisdiction = val +} + +// SetMirrorId sets the value of MirrorId. +func (s *ResolvedPlacement) SetMirrorId(val string) { + s.MirrorId = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ResolvedPlacement) SetAdditionalProps(val ResolvedPlacementAdditional) { + s.AdditionalProps = val +} + +type ResolvedPlacementAdditional map[string]jx.Raw + +func (s *ResolvedPlacementAdditional) init() ResolvedPlacementAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/ResourcePeopleOutputBody +type ResourcePeopleOutputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + Items []ResourcePerson `json:"items"` + // Pass back to fetch the next page; empty when no more entries. + NextPageToken OptString `json:"nextPageToken"` + TotalCount int64 `json:"totalCount"` + AdditionalProps ResourcePeopleOutputBodyAdditional +} + +// GetSchema returns the value of Schema. +func (s *ResourcePeopleOutputBody) GetSchema() OptURI { + return s.Schema +} + +// GetItems returns the value of Items. +func (s *ResourcePeopleOutputBody) GetItems() []ResourcePerson { + return s.Items +} + +// GetNextPageToken returns the value of NextPageToken. +func (s *ResourcePeopleOutputBody) GetNextPageToken() OptString { + return s.NextPageToken +} + +// GetTotalCount returns the value of TotalCount. +func (s *ResourcePeopleOutputBody) GetTotalCount() int64 { + return s.TotalCount +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ResourcePeopleOutputBody) GetAdditionalProps() ResourcePeopleOutputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *ResourcePeopleOutputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetItems sets the value of Items. +func (s *ResourcePeopleOutputBody) SetItems(val []ResourcePerson) { + s.Items = val +} + +// SetNextPageToken sets the value of NextPageToken. +func (s *ResourcePeopleOutputBody) SetNextPageToken(val OptString) { + s.NextPageToken = val +} + +// SetTotalCount sets the value of TotalCount. +func (s *ResourcePeopleOutputBody) SetTotalCount(val int64) { + s.TotalCount = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ResourcePeopleOutputBody) SetAdditionalProps(val ResourcePeopleOutputBodyAdditional) { + s.AdditionalProps = val +} + +type ResourcePeopleOutputBodyAdditional map[string]jx.Raw + +func (s *ResourcePeopleOutputBodyAdditional) init() ResourcePeopleOutputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/ResourcePerson +type ResourcePerson struct { + AccountId string `json:"accountId"` + AvatarUrl OptString `json:"avatarUrl"` + DirectGrant ResourcePersonDirectGrant `json:"directGrant"` + Handle OptString `json:"handle"` + Provider OptString `json:"provider"` + Role string `json:"role"` + Sources []ResourcePersonSource `json:"sources"` + AdditionalProps ResourcePersonAdditional +} + +// GetAccountId returns the value of AccountId. +func (s *ResourcePerson) GetAccountId() string { + return s.AccountId +} + +// GetAvatarUrl returns the value of AvatarUrl. +func (s *ResourcePerson) GetAvatarUrl() OptString { + return s.AvatarUrl +} + +// GetDirectGrant returns the value of DirectGrant. +func (s *ResourcePerson) GetDirectGrant() ResourcePersonDirectGrant { + return s.DirectGrant +} + +// GetHandle returns the value of Handle. +func (s *ResourcePerson) GetHandle() OptString { + return s.Handle +} + +// GetProvider returns the value of Provider. +func (s *ResourcePerson) GetProvider() OptString { + return s.Provider +} + +// GetRole returns the value of Role. +func (s *ResourcePerson) GetRole() string { + return s.Role +} + +// GetSources returns the value of Sources. +func (s *ResourcePerson) GetSources() []ResourcePersonSource { + return s.Sources +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ResourcePerson) GetAdditionalProps() ResourcePersonAdditional { + return s.AdditionalProps +} + +// SetAccountId sets the value of AccountId. +func (s *ResourcePerson) SetAccountId(val string) { + s.AccountId = val +} + +// SetAvatarUrl sets the value of AvatarUrl. +func (s *ResourcePerson) SetAvatarUrl(val OptString) { + s.AvatarUrl = val +} + +// SetDirectGrant sets the value of DirectGrant. +func (s *ResourcePerson) SetDirectGrant(val ResourcePersonDirectGrant) { + s.DirectGrant = val +} + +// SetHandle sets the value of Handle. +func (s *ResourcePerson) SetHandle(val OptString) { + s.Handle = val +} + +// SetProvider sets the value of Provider. +func (s *ResourcePerson) SetProvider(val OptString) { + s.Provider = val +} + +// SetRole sets the value of Role. +func (s *ResourcePerson) SetRole(val string) { + s.Role = val +} + +// SetSources sets the value of Sources. +func (s *ResourcePerson) SetSources(val []ResourcePersonSource) { + s.Sources = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *ResourcePerson) SetAdditionalProps(val ResourcePersonAdditional) { + s.AdditionalProps = val +} + +type ResourcePersonAdditional map[string]jx.Raw + +func (s *ResourcePersonAdditional) init() ResourcePersonAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Ref: #/components/schemas/ResourcePersonDirectGrant +type ResourcePersonDirectGrant struct { + Role ResourcePersonDirectGrantRole `json:"role"` + Source ResourcePersonDirectGrantSource `json:"source"` + AdditionalProps ResourcePersonDirectGrantAdditional +} + +// GetRole returns the value of Role. +func (s *ResourcePersonDirectGrant) GetRole() ResourcePersonDirectGrantRole { + return s.Role } -// SetAccountId sets the value of AccountId. -func (s *ResolvedIdentity) SetAccountId(val string) { - s.AccountId = val +// GetSource returns the value of Source. +func (s *ResourcePersonDirectGrant) GetSource() ResourcePersonDirectGrantSource { + return s.Source } -// SetHandle sets the value of Handle. -func (s *ResolvedIdentity) SetHandle(val string) { - s.Handle = val +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ResourcePersonDirectGrant) GetAdditionalProps() ResourcePersonDirectGrantAdditional { + return s.AdditionalProps } -// SetProvider sets the value of Provider. -func (s *ResolvedIdentity) SetProvider(val string) { - s.Provider = val +// SetRole sets the value of Role. +func (s *ResourcePersonDirectGrant) SetRole(val ResourcePersonDirectGrantRole) { + s.Role = val } -// SetProviderUserId sets the value of ProviderUserId. -func (s *ResolvedIdentity) SetProviderUserId(val string) { - s.ProviderUserId = val +// SetSource sets the value of Source. +func (s *ResourcePersonDirectGrant) SetSource(val ResourcePersonDirectGrantSource) { + s.Source = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ResolvedIdentity) SetAdditionalProps(val ResolvedIdentityAdditional) { +func (s *ResourcePersonDirectGrant) SetAdditionalProps(val ResourcePersonDirectGrantAdditional) { s.AdditionalProps = val } -type ResolvedIdentityAdditional map[string]jx.Raw +type ResourcePersonDirectGrantAdditional map[string]jx.Raw -func (s *ResolvedIdentityAdditional) init() ResolvedIdentityAdditional { +func (s *ResourcePersonDirectGrantAdditional) init() ResourcePersonDirectGrantAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -13537,70 +18031,156 @@ func (s *ResolvedIdentityAdditional) init() ResolvedIdentityAdditional { return m } -// Ref: #/components/schemas/ResolvedPlacement -type ResolvedPlacement struct { - // Physical cell the mirror's cluster runs in, e.g. aws-us-east-2. - Cell OptString `json:"cell"` - // Public host of the cluster serving this mirror. - ClusterHost string `json:"clusterHost"` - Jurisdiction OptString `json:"jurisdiction"` - MirrorId string `json:"mirrorId"` - AdditionalProps ResolvedPlacementAdditional +type ResourcePersonDirectGrantRole string + +const ( + ResourcePersonDirectGrantRoleOwner ResourcePersonDirectGrantRole = "owner" + ResourcePersonDirectGrantRoleAdmin ResourcePersonDirectGrantRole = "admin" + ResourcePersonDirectGrantRoleMember ResourcePersonDirectGrantRole = "member" + ResourcePersonDirectGrantRoleReader ResourcePersonDirectGrantRole = "reader" + ResourcePersonDirectGrantRoleWriter ResourcePersonDirectGrantRole = "writer" + ResourcePersonDirectGrantRoleMirrorSourceAdmin ResourcePersonDirectGrantRole = "mirror_source_admin" +) + +// AllValues returns all ResourcePersonDirectGrantRole values. +func (ResourcePersonDirectGrantRole) AllValues() []ResourcePersonDirectGrantRole { + return []ResourcePersonDirectGrantRole{ + ResourcePersonDirectGrantRoleOwner, + ResourcePersonDirectGrantRoleAdmin, + ResourcePersonDirectGrantRoleMember, + ResourcePersonDirectGrantRoleReader, + ResourcePersonDirectGrantRoleWriter, + ResourcePersonDirectGrantRoleMirrorSourceAdmin, + } } -// GetCell returns the value of Cell. -func (s *ResolvedPlacement) GetCell() OptString { - return s.Cell +// MarshalText implements encoding.TextMarshaler. +func (s ResourcePersonDirectGrantRole) MarshalText() ([]byte, error) { + switch s { + case ResourcePersonDirectGrantRoleOwner: + return []byte(s), nil + case ResourcePersonDirectGrantRoleAdmin: + return []byte(s), nil + case ResourcePersonDirectGrantRoleMember: + return []byte(s), nil + case ResourcePersonDirectGrantRoleReader: + return []byte(s), nil + case ResourcePersonDirectGrantRoleWriter: + return []byte(s), nil + case ResourcePersonDirectGrantRoleMirrorSourceAdmin: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// GetClusterHost returns the value of ClusterHost. -func (s *ResolvedPlacement) GetClusterHost() string { - return s.ClusterHost +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ResourcePersonDirectGrantRole) UnmarshalText(data []byte) error { + switch ResourcePersonDirectGrantRole(data) { + case ResourcePersonDirectGrantRoleOwner: + *s = ResourcePersonDirectGrantRoleOwner + return nil + case ResourcePersonDirectGrantRoleAdmin: + *s = ResourcePersonDirectGrantRoleAdmin + return nil + case ResourcePersonDirectGrantRoleMember: + *s = ResourcePersonDirectGrantRoleMember + return nil + case ResourcePersonDirectGrantRoleReader: + *s = ResourcePersonDirectGrantRoleReader + return nil + case ResourcePersonDirectGrantRoleWriter: + *s = ResourcePersonDirectGrantRoleWriter + return nil + case ResourcePersonDirectGrantRoleMirrorSourceAdmin: + *s = ResourcePersonDirectGrantRoleMirrorSourceAdmin + return nil + default: + return errors.Errorf("invalid value: %q", data) + } } -// GetJurisdiction returns the value of Jurisdiction. -func (s *ResolvedPlacement) GetJurisdiction() OptString { - return s.Jurisdiction +type ResourcePersonDirectGrantSource string + +const ( + ResourcePersonDirectGrantSourceMembership ResourcePersonDirectGrantSource = "membership" + ResourcePersonDirectGrantSourceDirect ResourcePersonDirectGrantSource = "direct" +) + +// AllValues returns all ResourcePersonDirectGrantSource values. +func (ResourcePersonDirectGrantSource) AllValues() []ResourcePersonDirectGrantSource { + return []ResourcePersonDirectGrantSource{ + ResourcePersonDirectGrantSourceMembership, + ResourcePersonDirectGrantSourceDirect, + } } -// GetMirrorId returns the value of MirrorId. -func (s *ResolvedPlacement) GetMirrorId() string { - return s.MirrorId +// MarshalText implements encoding.TextMarshaler. +func (s ResourcePersonDirectGrantSource) MarshalText() ([]byte, error) { + switch s { + case ResourcePersonDirectGrantSourceMembership: + return []byte(s), nil + case ResourcePersonDirectGrantSourceDirect: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } } -// GetAdditionalProps returns the value of AdditionalProps. -func (s *ResolvedPlacement) GetAdditionalProps() ResolvedPlacementAdditional { - return s.AdditionalProps +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ResourcePersonDirectGrantSource) UnmarshalText(data []byte) error { + switch ResourcePersonDirectGrantSource(data) { + case ResourcePersonDirectGrantSourceMembership: + *s = ResourcePersonDirectGrantSourceMembership + return nil + case ResourcePersonDirectGrantSourceDirect: + *s = ResourcePersonDirectGrantSourceDirect + return nil + default: + return errors.Errorf("invalid value: %q", data) + } } -// SetCell sets the value of Cell. -func (s *ResolvedPlacement) SetCell(val OptString) { - s.Cell = val +// Ref: #/components/schemas/ResourcePersonSource +type ResourcePersonSource struct { + Role ResourcePersonSourceRole `json:"role"` + Source ResourcePersonSourceSource `json:"source"` + AdditionalProps ResourcePersonSourceAdditional } -// SetClusterHost sets the value of ClusterHost. -func (s *ResolvedPlacement) SetClusterHost(val string) { - s.ClusterHost = val +// GetRole returns the value of Role. +func (s *ResourcePersonSource) GetRole() ResourcePersonSourceRole { + return s.Role } -// SetJurisdiction sets the value of Jurisdiction. -func (s *ResolvedPlacement) SetJurisdiction(val OptString) { - s.Jurisdiction = val +// GetSource returns the value of Source. +func (s *ResourcePersonSource) GetSource() ResourcePersonSourceSource { + return s.Source } -// SetMirrorId sets the value of MirrorId. -func (s *ResolvedPlacement) SetMirrorId(val string) { - s.MirrorId = val +// GetAdditionalProps returns the value of AdditionalProps. +func (s *ResourcePersonSource) GetAdditionalProps() ResourcePersonSourceAdditional { + return s.AdditionalProps +} + +// SetRole sets the value of Role. +func (s *ResourcePersonSource) SetRole(val ResourcePersonSourceRole) { + s.Role = val +} + +// SetSource sets the value of Source. +func (s *ResourcePersonSource) SetSource(val ResourcePersonSourceSource) { + s.Source = val } // SetAdditionalProps sets the value of AdditionalProps. -func (s *ResolvedPlacement) SetAdditionalProps(val ResolvedPlacementAdditional) { +func (s *ResourcePersonSource) SetAdditionalProps(val ResourcePersonSourceAdditional) { s.AdditionalProps = val } -type ResolvedPlacementAdditional map[string]jx.Raw +type ResourcePersonSourceAdditional map[string]jx.Raw -func (s *ResolvedPlacementAdditional) init() ResolvedPlacementAdditional { +func (s *ResourcePersonSourceAdditional) init() ResourcePersonSourceAdditional { m := *s if m == nil { m = map[string]jx.Raw{} @@ -13609,6 +18189,154 @@ func (s *ResolvedPlacementAdditional) init() ResolvedPlacementAdditional { return m } +type ResourcePersonSourceRole string + +const ( + ResourcePersonSourceRoleOwner ResourcePersonSourceRole = "owner" + ResourcePersonSourceRoleAdmin ResourcePersonSourceRole = "admin" + ResourcePersonSourceRoleMember ResourcePersonSourceRole = "member" + ResourcePersonSourceRoleReader ResourcePersonSourceRole = "reader" + ResourcePersonSourceRoleWriter ResourcePersonSourceRole = "writer" + ResourcePersonSourceRoleMirrorSourceAdmin ResourcePersonSourceRole = "mirror_source_admin" +) + +// AllValues returns all ResourcePersonSourceRole values. +func (ResourcePersonSourceRole) AllValues() []ResourcePersonSourceRole { + return []ResourcePersonSourceRole{ + ResourcePersonSourceRoleOwner, + ResourcePersonSourceRoleAdmin, + ResourcePersonSourceRoleMember, + ResourcePersonSourceRoleReader, + ResourcePersonSourceRoleWriter, + ResourcePersonSourceRoleMirrorSourceAdmin, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s ResourcePersonSourceRole) MarshalText() ([]byte, error) { + switch s { + case ResourcePersonSourceRoleOwner: + return []byte(s), nil + case ResourcePersonSourceRoleAdmin: + return []byte(s), nil + case ResourcePersonSourceRoleMember: + return []byte(s), nil + case ResourcePersonSourceRoleReader: + return []byte(s), nil + case ResourcePersonSourceRoleWriter: + return []byte(s), nil + case ResourcePersonSourceRoleMirrorSourceAdmin: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ResourcePersonSourceRole) UnmarshalText(data []byte) error { + switch ResourcePersonSourceRole(data) { + case ResourcePersonSourceRoleOwner: + *s = ResourcePersonSourceRoleOwner + return nil + case ResourcePersonSourceRoleAdmin: + *s = ResourcePersonSourceRoleAdmin + return nil + case ResourcePersonSourceRoleMember: + *s = ResourcePersonSourceRoleMember + return nil + case ResourcePersonSourceRoleReader: + *s = ResourcePersonSourceRoleReader + return nil + case ResourcePersonSourceRoleWriter: + *s = ResourcePersonSourceRoleWriter + return nil + case ResourcePersonSourceRoleMirrorSourceAdmin: + *s = ResourcePersonSourceRoleMirrorSourceAdmin + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +type ResourcePersonSourceSource string + +const ( + ResourcePersonSourceSourceMembership ResourcePersonSourceSource = "membership" + ResourcePersonSourceSourceDirect ResourcePersonSourceSource = "direct" + ResourcePersonSourceSourceTeam ResourcePersonSourceSource = "team" + ResourcePersonSourceSourceOrganization ResourcePersonSourceSource = "organization" + ResourcePersonSourceSourceProject ResourcePersonSourceSource = "project" + ResourcePersonSourceSourceOwner ResourcePersonSourceSource = "owner" + ResourcePersonSourceSourceGithub ResourcePersonSourceSource = "github" +) + +// AllValues returns all ResourcePersonSourceSource values. +func (ResourcePersonSourceSource) AllValues() []ResourcePersonSourceSource { + return []ResourcePersonSourceSource{ + ResourcePersonSourceSourceMembership, + ResourcePersonSourceSourceDirect, + ResourcePersonSourceSourceTeam, + ResourcePersonSourceSourceOrganization, + ResourcePersonSourceSourceProject, + ResourcePersonSourceSourceOwner, + ResourcePersonSourceSourceGithub, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s ResourcePersonSourceSource) MarshalText() ([]byte, error) { + switch s { + case ResourcePersonSourceSourceMembership: + return []byte(s), nil + case ResourcePersonSourceSourceDirect: + return []byte(s), nil + case ResourcePersonSourceSourceTeam: + return []byte(s), nil + case ResourcePersonSourceSourceOrganization: + return []byte(s), nil + case ResourcePersonSourceSourceProject: + return []byte(s), nil + case ResourcePersonSourceSourceOwner: + return []byte(s), nil + case ResourcePersonSourceSourceGithub: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *ResourcePersonSourceSource) UnmarshalText(data []byte) error { + switch ResourcePersonSourceSource(data) { + case ResourcePersonSourceSourceMembership: + *s = ResourcePersonSourceSourceMembership + return nil + case ResourcePersonSourceSourceDirect: + *s = ResourcePersonSourceSourceDirect + return nil + case ResourcePersonSourceSourceTeam: + *s = ResourcePersonSourceSourceTeam + return nil + case ResourcePersonSourceSourceOrganization: + *s = ResourcePersonSourceSourceOrganization + return nil + case ResourcePersonSourceSourceProject: + *s = ResourcePersonSourceSourceProject + return nil + case ResourcePersonSourceSourceOwner: + *s = ResourcePersonSourceSourceOwner + return nil + case ResourcePersonSourceSourceGithub: + *s = ResourcePersonSourceSourceGithub + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + +// RevokeOrgInvitationNoContent is response for RevokeOrgInvitation operation. +type RevokeOrgInvitationNoContent struct{} + // RevokeProjectAccessByProviderNoContent is response for RevokeProjectAccessByProvider operation. type RevokeProjectAccessByProviderNoContent struct{} @@ -14149,7 +18877,7 @@ func (s *SetRepoVisibilityOutputBodyVisibility) UnmarshalText(data []byte) error // Ref: #/components/schemas/TopologyCluster type TopologyCluster struct { - // DNS host of this cluster; pass verbatim as clusterHost to POST /api/v1/mirrors. + // DNS host of this cluster; pass verbatim as clusterHost to POST /api/v1/mirror-requests. Host string `json:"host"` IsDefault bool `json:"isDefault"` // Human cluster label (the cluster's display name). @@ -14354,8 +19082,9 @@ func (s *TopologyRegionAdditional) init() TopologyRegionAdditional { type UpdateBranchProtectionInputBody struct { // A URL to the JSON Schema for this object. Schema OptURI `json:"$schema"` - // Rules to add or replace by ref: an existing rule keeps its position and takes the new flag. - AddRules []BranchRule `json:"addRules"` + // Rules to add or edit by ref: an existing rule keeps its position; omit serverSideMergeOnly to keep + // its level. + AddRules []BranchRuleUpdate `json:"addRules"` // Patterns to remove; absent entries are ignored. RemoveRefs []string `json:"removeRefs"` AdditionalProps UpdateBranchProtectionInputBodyAdditional @@ -14367,7 +19096,7 @@ func (s *UpdateBranchProtectionInputBody) GetSchema() OptURI { } // GetAddRules returns the value of AddRules. -func (s *UpdateBranchProtectionInputBody) GetAddRules() []BranchRule { +func (s *UpdateBranchProtectionInputBody) GetAddRules() []BranchRuleUpdate { return s.AddRules } @@ -14387,7 +19116,7 @@ func (s *UpdateBranchProtectionInputBody) SetSchema(val OptURI) { } // SetAddRules sets the value of AddRules. -func (s *UpdateBranchProtectionInputBody) SetAddRules(val []BranchRule) { +func (s *UpdateBranchProtectionInputBody) SetAddRules(val []BranchRuleUpdate) { s.AddRules = val } @@ -14412,6 +19141,105 @@ func (s *UpdateBranchProtectionInputBodyAdditional) init() UpdateBranchProtectio return m } +// Ref: #/components/schemas/UpdateOrgMemberRoleInputBody +type UpdateOrgMemberRoleInputBody struct { + // A URL to the JSON Schema for this object. + Schema OptURI `json:"$schema"` + // Replacement organization role. + Role UpdateOrgMemberRoleInputBodyRole `json:"role"` + AdditionalProps UpdateOrgMemberRoleInputBodyAdditional +} + +// GetSchema returns the value of Schema. +func (s *UpdateOrgMemberRoleInputBody) GetSchema() OptURI { + return s.Schema +} + +// GetRole returns the value of Role. +func (s *UpdateOrgMemberRoleInputBody) GetRole() UpdateOrgMemberRoleInputBodyRole { + return s.Role +} + +// GetAdditionalProps returns the value of AdditionalProps. +func (s *UpdateOrgMemberRoleInputBody) GetAdditionalProps() UpdateOrgMemberRoleInputBodyAdditional { + return s.AdditionalProps +} + +// SetSchema sets the value of Schema. +func (s *UpdateOrgMemberRoleInputBody) SetSchema(val OptURI) { + s.Schema = val +} + +// SetRole sets the value of Role. +func (s *UpdateOrgMemberRoleInputBody) SetRole(val UpdateOrgMemberRoleInputBodyRole) { + s.Role = val +} + +// SetAdditionalProps sets the value of AdditionalProps. +func (s *UpdateOrgMemberRoleInputBody) SetAdditionalProps(val UpdateOrgMemberRoleInputBodyAdditional) { + s.AdditionalProps = val +} + +type UpdateOrgMemberRoleInputBodyAdditional map[string]jx.Raw + +func (s *UpdateOrgMemberRoleInputBodyAdditional) init() UpdateOrgMemberRoleInputBodyAdditional { + m := *s + if m == nil { + m = map[string]jx.Raw{} + *s = m + } + return m +} + +// Replacement organization role. +type UpdateOrgMemberRoleInputBodyRole string + +const ( + UpdateOrgMemberRoleInputBodyRoleOwner UpdateOrgMemberRoleInputBodyRole = "owner" + UpdateOrgMemberRoleInputBodyRoleAdmin UpdateOrgMemberRoleInputBodyRole = "admin" + UpdateOrgMemberRoleInputBodyRoleMember UpdateOrgMemberRoleInputBodyRole = "member" +) + +// AllValues returns all UpdateOrgMemberRoleInputBodyRole values. +func (UpdateOrgMemberRoleInputBodyRole) AllValues() []UpdateOrgMemberRoleInputBodyRole { + return []UpdateOrgMemberRoleInputBodyRole{ + UpdateOrgMemberRoleInputBodyRoleOwner, + UpdateOrgMemberRoleInputBodyRoleAdmin, + UpdateOrgMemberRoleInputBodyRoleMember, + } +} + +// MarshalText implements encoding.TextMarshaler. +func (s UpdateOrgMemberRoleInputBodyRole) MarshalText() ([]byte, error) { + switch s { + case UpdateOrgMemberRoleInputBodyRoleOwner: + return []byte(s), nil + case UpdateOrgMemberRoleInputBodyRoleAdmin: + return []byte(s), nil + case UpdateOrgMemberRoleInputBodyRoleMember: + return []byte(s), nil + default: + return nil, errors.Errorf("invalid value: %q", s) + } +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (s *UpdateOrgMemberRoleInputBodyRole) UnmarshalText(data []byte) error { + switch UpdateOrgMemberRoleInputBodyRole(data) { + case UpdateOrgMemberRoleInputBodyRoleOwner: + *s = UpdateOrgMemberRoleInputBodyRoleOwner + return nil + case UpdateOrgMemberRoleInputBodyRoleAdmin: + *s = UpdateOrgMemberRoleInputBodyRoleAdmin + return nil + case UpdateOrgMemberRoleInputBodyRoleMember: + *s = UpdateOrgMemberRoleInputBodyRoleMember + return nil + default: + return errors.Errorf("invalid value: %q", data) + } +} + // Ref: #/components/schemas/WillDeleteStruct type WillDeleteStruct struct { // Blanket note: profile PII is erased across all regions the account has data in (per-region diff --git a/internal/coreapi/oas_security_gen.go b/internal/coreapi/oas_security_gen.go index 4565cafd7b..75fcb0cbd1 100644 --- a/internal/coreapi/oas_security_gen.go +++ b/internal/coreapi/oas_security_gen.go @@ -21,15 +21,17 @@ type SecuritySource interface { // operationRolesBearerAuth is a private map storing roles per operation. var operationRolesBearerAuth = map[string][]string{ + AcceptInvitationOperation: {}, AddOrgMemberOperation: {}, CancelDeletionOperation: {}, CompleteOnboardingOperation: {}, ConnectOrgCIBuildkiteCredentialOperation: {}, + ConnectOrgCIDepotOrganizationOperation: {}, CreateBindingOperation: {}, - CreateMirrorOperation: {}, CreateMirrorRequestOperation: {}, CreateNativeMirrorOperation: {}, CreateOrgOperation: {}, + CreateOrgInvitationOperation: {}, CreateProjectOperation: {}, CreateRepoOperation: {}, CreateRepoCIWebhookOperation: {}, @@ -45,6 +47,8 @@ var operationRolesBearerAuth = map[string][]string{ DeleteRepoOperation: {}, DeleteRepoCIWebhookOperation: {}, DeleteServiceAccountOperation: {}, + DetachMyHandleOperation: {}, + DisconnectOrgCIDepotOrganizationOperation: {}, GetBranchProtectionOperation: {}, GetDeletionPreviewOperation: {}, GetMeOperation: {}, @@ -52,9 +56,10 @@ var operationRolesBearerAuth = map[string][]string{ GetMirrorRequestOperation: {}, GetOnboardingStatusOperation: {}, GetOrgOperation: {}, - GetPermissionsOperation: {}, + GetOrgPersonAccessOperation: {}, GetProjectOperation: {}, GetRepoOperation: {}, + GetRepoCIDeliveryOperation: {}, GetRepoVisibilityOperation: {}, GetServiceAccountOperation: {}, GetTopologyOperation: {}, @@ -71,13 +76,18 @@ var operationRolesBearerAuth = map[string][]string{ ListOIDCProvidersOperation: {}, ListOrgCIBuildkiteClustersOperation: {}, ListOrgCIBuildkiteCredentialsOperation: {}, + ListOrgCIDepotOrganizationsOperation: {}, + ListOrgInvitationsOperation: {}, ListOrgMembersOperation: {}, + ListOrgPeopleOperation: {}, ListOrgProjectsOperation: {}, ListOrgsOperation: {}, ListProjectMembersOperation: {}, + ListProjectPeopleOperation: {}, ListProjectReposOperation: {}, ListProjectsOperation: {}, ListRepoCIBuildsOperation: {}, + ListRepoCIDeliveriesOperation: {}, ListRepoCIProvidersOperation: {}, ListRepoCIWebhookAuditOperation: {}, ListRepoCIWebhooksOperation: {}, @@ -85,17 +95,21 @@ var operationRolesBearerAuth = map[string][]string{ ListRepoGrantsOperation: {}, ListRepoLanguageFacetsOperation: {}, ListRepoOrgFacetsOperation: {}, + ListRepoPeopleOperation: {}, ListReposOperation: {}, ListServiceAccountGrantsOperation: {}, ListServiceAccountsOperation: {}, MintOrgCIGitHubActionsCredentialOperation: {}, PatchRepoCIWebhookOperation: {}, + PreviewInvitationOperation: {}, RegisterOrgCIBuildkiteClusterOperation: {}, RemoveOrgMemberOperation: {}, ResolveHandleOperation: {}, ResolveMirrorPlacementsOperation: {}, + ResolveProjectOperation: {}, ResolveRepoIDsOperation: {}, ResolveReposOperation: {}, + RevokeOrgInvitationOperation: {}, RevokeProjectAccessOperation: {}, RevokeProjectAccessByProviderOperation: {}, RevokeRepoAccessOperation: {}, @@ -105,6 +119,7 @@ var operationRolesBearerAuth = map[string][]string{ SetBranchProtectionOperation: {}, SetRepoVisibilityOperation: {}, UpdateBranchProtectionOperation: {}, + UpdateOrgMemberRoleOperation: {}, } // GetRolesForBearerAuth returns the required roles for the given operation. @@ -130,15 +145,17 @@ func GetRolesForBearerAuth(operation string) []string { // operationRolesSessionAuth is a private map storing roles per operation. var operationRolesSessionAuth = map[string][]string{ + AcceptInvitationOperation: {}, AddOrgMemberOperation: {}, CancelDeletionOperation: {}, CompleteOnboardingOperation: {}, ConnectOrgCIBuildkiteCredentialOperation: {}, + ConnectOrgCIDepotOrganizationOperation: {}, CreateBindingOperation: {}, - CreateMirrorOperation: {}, CreateMirrorRequestOperation: {}, CreateNativeMirrorOperation: {}, CreateOrgOperation: {}, + CreateOrgInvitationOperation: {}, CreateProjectOperation: {}, CreateRepoOperation: {}, CreateRepoCIWebhookOperation: {}, @@ -154,6 +171,8 @@ var operationRolesSessionAuth = map[string][]string{ DeleteRepoOperation: {}, DeleteRepoCIWebhookOperation: {}, DeleteServiceAccountOperation: {}, + DetachMyHandleOperation: {}, + DisconnectOrgCIDepotOrganizationOperation: {}, GetBranchProtectionOperation: {}, GetDeletionPreviewOperation: {}, GetMeOperation: {}, @@ -161,9 +180,10 @@ var operationRolesSessionAuth = map[string][]string{ GetMirrorRequestOperation: {}, GetOnboardingStatusOperation: {}, GetOrgOperation: {}, - GetPermissionsOperation: {}, + GetOrgPersonAccessOperation: {}, GetProjectOperation: {}, GetRepoOperation: {}, + GetRepoCIDeliveryOperation: {}, GetRepoVisibilityOperation: {}, GetServiceAccountOperation: {}, GetTopologyOperation: {}, @@ -180,13 +200,18 @@ var operationRolesSessionAuth = map[string][]string{ ListOIDCProvidersOperation: {}, ListOrgCIBuildkiteClustersOperation: {}, ListOrgCIBuildkiteCredentialsOperation: {}, + ListOrgCIDepotOrganizationsOperation: {}, + ListOrgInvitationsOperation: {}, ListOrgMembersOperation: {}, + ListOrgPeopleOperation: {}, ListOrgProjectsOperation: {}, ListOrgsOperation: {}, ListProjectMembersOperation: {}, + ListProjectPeopleOperation: {}, ListProjectReposOperation: {}, ListProjectsOperation: {}, ListRepoCIBuildsOperation: {}, + ListRepoCIDeliveriesOperation: {}, ListRepoCIProvidersOperation: {}, ListRepoCIWebhookAuditOperation: {}, ListRepoCIWebhooksOperation: {}, @@ -194,17 +219,21 @@ var operationRolesSessionAuth = map[string][]string{ ListRepoGrantsOperation: {}, ListRepoLanguageFacetsOperation: {}, ListRepoOrgFacetsOperation: {}, + ListRepoPeopleOperation: {}, ListReposOperation: {}, ListServiceAccountGrantsOperation: {}, ListServiceAccountsOperation: {}, MintOrgCIGitHubActionsCredentialOperation: {}, PatchRepoCIWebhookOperation: {}, + PreviewInvitationOperation: {}, RegisterOrgCIBuildkiteClusterOperation: {}, RemoveOrgMemberOperation: {}, ResolveHandleOperation: {}, ResolveMirrorPlacementsOperation: {}, + ResolveProjectOperation: {}, ResolveRepoIDsOperation: {}, ResolveReposOperation: {}, + RevokeOrgInvitationOperation: {}, RevokeProjectAccessOperation: {}, RevokeProjectAccessByProviderOperation: {}, RevokeRepoAccessOperation: {}, @@ -214,6 +243,7 @@ var operationRolesSessionAuth = map[string][]string{ SetBranchProtectionOperation: {}, SetRepoVisibilityOperation: {}, UpdateBranchProtectionOperation: {}, + UpdateOrgMemberRoleOperation: {}, } // GetRolesForSessionAuth returns the required roles for the given operation. diff --git a/internal/coreapi/oas_validators_gen.go b/internal/coreapi/oas_validators_gen.go index f20c7b3ce3..a14f0a0694 100644 --- a/internal/coreapi/oas_validators_gen.go +++ b/internal/coreapi/oas_validators_gen.go @@ -9,6 +9,41 @@ import ( "github.com/ogen-go/ogen/validate" ) +func (s *AcceptInvitationInputBody) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if err := (validate.String{ + MinLength: 1, + MinLengthSet: true, + MaxLength: 0, + MaxLengthSet: false, + Email: false, + Hostname: false, + Regex: nil, + MinNumeric: 0, + MinNumericSet: false, + MaxNumeric: 0, + MaxNumericSet: false, + }).Validate(string(s.Token)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "token", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + func (s *AddOrgMemberInputBody) Validate() error { if s == nil { return validate.ErrNilPointer @@ -367,7 +402,7 @@ func (s *ConnectOrgCIBuildkiteCredentialInputBody) Validate() error { return nil } -func (s *CreateBindingInputBody) Validate() error { +func (s *ConnectOrgCIDepotOrganizationInputBody) Validate() error { if s == nil { return validate.ErrNilPointer } @@ -386,13 +421,13 @@ func (s *CreateBindingInputBody) Validate() error { MinNumericSet: false, MaxNumeric: 0, MaxNumericSet: false, - }).Validate(string(s.ProviderId)); err != nil { + }).Validate(string(s.Account)); err != nil { return errors.Wrap(err, "string") } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "providerId", + Name: "account", Error: err, }) } @@ -402,7 +437,7 @@ func (s *CreateBindingInputBody) Validate() error { return nil } -func (s *CreateMirrorInputBody) Validate() error { +func (s *CreateBindingInputBody) Validate() error { if s == nil { return validate.ErrNilPointer } @@ -421,70 +456,13 @@ func (s *CreateMirrorInputBody) Validate() error { MinNumericSet: false, MaxNumeric: 0, MaxNumericSet: false, - }).Validate(string(s.ClusterHost)); err != nil { - return errors.Wrap(err, "string") - } - return nil - }(); err != nil { - failures = append(failures, validate.FieldError{ - Name: "clusterHost", - Error: err, - }) - } - if err := func() error { - if err := (validate.String{ - MinLength: 1, - MinLengthSet: true, - MaxLength: 0, - MaxLengthSet: false, - Email: false, - Hostname: false, - Regex: nil, - MinNumeric: 0, - MinNumericSet: false, - MaxNumeric: 0, - MaxNumericSet: false, - }).Validate(string(s.Owner)); err != nil { - return errors.Wrap(err, "string") - } - return nil - }(); err != nil { - failures = append(failures, validate.FieldError{ - Name: "owner", - Error: err, - }) - } - if err := func() error { - if err := s.Provider.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - failures = append(failures, validate.FieldError{ - Name: "provider", - Error: err, - }) - } - if err := func() error { - if err := (validate.String{ - MinLength: 1, - MinLengthSet: true, - MaxLength: 0, - MaxLengthSet: false, - Email: false, - Hostname: false, - Regex: nil, - MinNumeric: 0, - MinNumericSet: false, - MaxNumeric: 0, - MaxNumericSet: false, - }).Validate(string(s.Repo)); err != nil { + }).Validate(string(s.ProviderId)); err != nil { return errors.Wrap(err, "string") } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "repo", + Name: "providerId", Error: err, }) } @@ -494,15 +472,6 @@ func (s *CreateMirrorInputBody) Validate() error { return nil } -func (s CreateMirrorInputBodyProvider) Validate() error { - switch s { - case "github": - return nil - default: - return errors.Errorf("invalid value: %v", s) - } -} - func (s *CreateMirrorRequestInputBody) Validate() error { if s == nil { return validate.ErrNilPointer @@ -674,6 +643,65 @@ func (s *CreateOrgInputBody) Validate() error { return nil } +func (s *CreateOrgInvitationInputBody) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if err := (validate.String{ + MinLength: 0, + MinLengthSet: false, + MaxLength: 0, + MaxLengthSet: false, + Email: true, + Hostname: false, + Regex: nil, + MinNumeric: 0, + MinNumericSet: false, + MaxNumeric: 0, + MaxNumericSet: false, + }).Validate(string(s.Email)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "email", + Error: err, + }) + } + if err := func() error { + if err := s.Role.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "role", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s CreateOrgInvitationInputBodyRole) Validate() error { + switch s { + case "owner": + return nil + case "admin": + return nil + case "member": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + func (s *CreateProjectInputBody) Validate() error { if s == nil { return validate.ErrNilPointer @@ -922,29 +950,48 @@ func (s *CreateServiceAccountInputBody) Validate() error { return nil } -func (s DeleteMirrorProvider) Validate() error { - switch s { - case "github": - return nil - default: - return errors.Errorf("invalid value: %v", s) - } -} - -func (s *DeletionBlocker) Validate() error { +func (s *CreatedProject) Validate() error { if s == nil { return validate.ErrNilPointer } var failures []validate.FieldError if err := func() error { - if err := s.Kind.Validate(); err != nil { + if err := s.OwnerType.Validate(); err != nil { return err } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "kind", + Name: "ownerType", + Error: err, + }) + } + if err := func() error { + if value, ok := s.RepositoryCount.Get(); ok { + if err := func() error { + if err := (validate.Int{ + MinSet: true, + Min: 0, + MaxSet: false, + Max: 0, + MinExclusive: false, + MaxExclusive: false, + MultipleOfSet: false, + MultipleOf: 0, + Pattern: nil, + }).Validate(int64(value)); err != nil { + return errors.Wrap(err, "int") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "repositoryCount", Error: err, }) } @@ -954,29 +1001,20 @@ func (s *DeletionBlocker) Validate() error { return nil } -func (s DeletionBlockerKind) Validate() error { - switch s { - case "owned_org": - return nil - default: - return errors.Errorf("invalid value: %v", s) - } -} - -func (s *DeletionGrant) Validate() error { +func (s *CreatedProjectHeaders) Validate() error { if s == nil { return validate.ErrNilPointer } var failures []validate.FieldError if err := func() error { - if err := s.ResourceType.Validate(); err != nil { + if err := s.Response.Validate(); err != nil { return err } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "resourceType", + Name: "Response", Error: err, }) } @@ -986,29 +1024,26 @@ func (s *DeletionGrant) Validate() error { return nil } -func (s DeletionGrantResourceType) Validate() error { +func (s CreatedProjectOwnerType) Validate() error { switch s { - case "project": + case "org": return nil - case "repo": + case "account": return nil default: return errors.Errorf("invalid value: %v", s) } } -func (s *GetDeletionPreviewOutputBody) Validate() error { +func (s *CreatedRepo) Validate() error { if s == nil { return validate.ErrNilPointer } var failures []validate.FieldError if err := func() error { - if s.Blockers == nil { - return errors.New("nil is invalid value") - } var failures []validate.FieldError - for i, elem := range s.Blockers { + for i, elem := range s.Placements { if err := func() error { if err := elem.Validate(); err != nil { return err @@ -1027,29 +1062,30 @@ func (s *GetDeletionPreviewOutputBody) Validate() error { return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "blockers", + Name: "placements", Error: err, }) } - if err := func() error { - if err := s.WillDelete.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - failures = append(failures, validate.FieldError{ - Name: "willDelete", - Error: err, - }) + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s *CreatedRepoHeaders) Validate() error { + if s == nil { + return validate.ErrNilPointer } + + var failures []validate.FieldError if err := func() error { - if err := s.WillUnlink.Validate(); err != nil { + if err := s.Response.Validate(); err != nil { return err } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "willUnlink", + Name: "Response", Error: err, }) } @@ -1059,56 +1095,61 @@ func (s *GetDeletionPreviewOutputBody) Validate() error { return nil } -func (s *GetMeOutputBody) Validate() error { +func (s DeleteMirrorProvider) Validate() error { + switch s { + case "github": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s *DeletionBlocker) Validate() error { if s == nil { return validate.ErrNilPointer } var failures []validate.FieldError if err := func() error { - if err := s.Global.Validate(); err != nil { + if err := s.Kind.Validate(); err != nil { return err } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "global", + Name: "kind", Error: err, }) } - if err := func() error { - if value, ok := s.Mode.Get(); ok { - if err := func() error { - if err := value.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - return err - } - } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s DeletionBlockerKind) Validate() error { + switch s { + case "owned_org": return nil - }(); err != nil { - failures = append(failures, validate.FieldError{ - Name: "mode", - Error: err, - }) + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s *DeletionGrant) Validate() error { + if s == nil { + return validate.ErrNilPointer } + + var failures []validate.FieldError if err := func() error { - if value, ok := s.RegionalUnavailable.Get(); ok { - if err := func() error { - if err := value.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - return err - } + if err := s.ResourceType.Validate(); err != nil { + return err } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "regionalUnavailable", + Name: "resourceType", Error: err, }) } @@ -1118,26 +1159,40 @@ func (s *GetMeOutputBody) Validate() error { return nil } -func (s GetMeOutputBodyMode) Validate() error { +func (s DeletionGrantResourceType) Validate() error { switch s { - case "global": + case "project": return nil - case "regional": + case "repo": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s DetachMyHandleProvider) Validate() error { + switch s { + case "google": + return nil + case "github": return nil default: return errors.Errorf("invalid value: %v", s) } } -func (s *GetPermissionsOutputBody) Validate() error { +func (s *GetDeletionPreviewOutputBody) Validate() error { if s == nil { return validate.ErrNilPointer } var failures []validate.FieldError if err := func() error { + if s.Blockers == nil { + return errors.New("nil is invalid value") + } var failures []validate.FieldError - for i, elem := range s.Permissions { + for i, elem := range s.Blockers { if err := func() error { if err := elem.Validate(); err != nil { return err @@ -1156,7 +1211,29 @@ func (s *GetPermissionsOutputBody) Validate() error { return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "permissions", + Name: "blockers", + Error: err, + }) + } + if err := func() error { + if err := s.WillDelete.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "willDelete", + Error: err, + }) + } + if err := func() error { + if err := s.WillUnlink.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "willUnlink", Error: err, }) } @@ -1166,25 +1243,70 @@ func (s *GetPermissionsOutputBody) Validate() error { return nil } -func (s GetPermissionsOutputBodyPermissionsItem) Validate() error { - switch s { - case "manage": - return nil - case "view": - return nil - case "read": - return nil - case "write": - return nil - case "push": +func (s *GetMeOutputBody) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if err := s.Global.Validate(); err != nil { + return err + } return nil - case "pull": + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "global", + Error: err, + }) + } + if err := func() error { + if value, ok := s.Mode.Get(); ok { + if err := func() error { + if err := value.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return err + } + } return nil - case "create_repo": + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "mode", + Error: err, + }) + } + if err := func() error { + if value, ok := s.RegionalUnavailable.Get(); ok { + if err := func() error { + if err := value.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return err + } + } return nil - case "admin": + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "regionalUnavailable", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s GetMeOutputBodyMode) Validate() error { + switch s { + case "global": return nil - case "admin_read": + case "regional": return nil default: return errors.Errorf("invalid value: %v", s) @@ -1306,84 +1428,31 @@ func (s GetVersionOutputBodyMode) Validate() error { } } -func (s *GrantProjectAccessInputBody) Validate() error { +func (s *GitHubInstallation) Validate() error { if s == nil { return validate.ErrNilPointer } var failures []validate.FieldError if err := func() error { - if value, ok := s.GranteeType.Get(); ok { - if err := func() error { - if err := value.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - return err - } - } - return nil - }(); err != nil { - failures = append(failures, validate.FieldError{ - Name: "granteeType", - Error: err, - }) - } - if err := func() error { - if err := (validate.String{ - MinLength: 1, - MinLengthSet: true, - MaxLength: 0, - MaxLengthSet: false, - Email: false, - Hostname: false, - Regex: nil, - MinNumeric: 0, - MinNumericSet: false, - MaxNumeric: 0, - MaxNumericSet: false, - }).Validate(string(s.Provider)); err != nil { - return errors.Wrap(err, "string") - } - return nil - }(); err != nil { - failures = append(failures, validate.FieldError{ - Name: "provider", - Error: err, - }) - } - if err := func() error { - if err := (validate.String{ - MinLength: 1, - MinLengthSet: true, - MaxLength: 0, - MaxLengthSet: false, - Email: false, - Hostname: false, - Regex: nil, - MinNumeric: 0, - MinNumericSet: false, - MaxNumeric: 0, - MaxNumericSet: false, - }).Validate(string(s.ProviderUserId)); err != nil { - return errors.Wrap(err, "string") + if err := s.AccountType.Validate(); err != nil { + return err } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "providerUserId", + Name: "accountType", Error: err, }) } if err := func() error { - if err := s.Role.Validate(); err != nil { + if err := s.State.Validate(); err != nil { return err } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "role", + Name: "state", Error: err, }) } @@ -1393,90 +1462,193 @@ func (s *GrantProjectAccessInputBody) Validate() error { return nil } -func (s GrantProjectAccessInputBodyGranteeType) Validate() error { +func (s GitHubInstallationAccountType) Validate() error { switch s { - case "account": + case "user": + return nil + case "organization": return nil default: return errors.Errorf("invalid value: %v", s) } } -func (s GrantProjectAccessInputBodyRole) Validate() error { +func (s GitHubInstallationState) Validate() error { switch s { - case "reader": - return nil - case "writer": + case "active": return nil - case "admin": + case "suspended": return nil default: return errors.Errorf("invalid value: %v", s) } } -func (s *GrantRepoAccessInputBody) Validate() error { +func (s *GitHubInstallations) Validate() error { if s == nil { return validate.ErrNilPointer } var failures []validate.FieldError if err := func() error { - if value, ok := s.GranteeType.Get(); ok { + var failures []validate.FieldError + for i, elem := range s.Items { if err := func() error { - if err := value.Validate(); err != nil { + if err := elem.Validate(); err != nil { return err } return nil }(); err != nil { - return err + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) } } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "granteeType", + Name: "items", Error: err, }) } if err := func() error { - if err := (validate.String{ - MinLength: 1, - MinLengthSet: true, - MaxLength: 0, - MaxLengthSet: false, - Email: false, - Hostname: false, - Regex: nil, - MinNumeric: 0, - MinNumericSet: false, - MaxNumeric: 0, - MaxNumericSet: false, - }).Validate(string(s.Provider)); err != nil { - return errors.Wrap(err, "string") + if err := s.Status.Validate(); err != nil { + return err } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "provider", + Name: "status", Error: err, }) } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s GitHubInstallationsStatus) Validate() error { + switch s { + case "ok": + return nil + case "unavailable": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s *GrantAccessBody) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError if err := func() error { - if err := (validate.String{ - MinLength: 1, - MinLengthSet: true, - MaxLength: 0, - MaxLengthSet: false, - Email: false, - Hostname: false, - Regex: nil, - MinNumeric: 0, - MinNumericSet: false, - MaxNumeric: 0, - MaxNumericSet: false, - }).Validate(string(s.ProviderUserId)); err != nil { - return errors.Wrap(err, "string") + if value, ok := s.AccountId.Get(); ok { + if err := func() error { + if err := (validate.String{ + MinLength: 0, + MinLengthSet: false, + MaxLength: 0, + MaxLengthSet: false, + Email: false, + Hostname: false, + Regex: regexMap["^[0-9A-HJKMNP-TV-Z]{26}$"], + MinNumeric: 0, + MinNumericSet: false, + MaxNumeric: 0, + MaxNumericSet: false, + }).Validate(string(value)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "accountId", + Error: err, + }) + } + if err := func() error { + if value, ok := s.GranteeType.Get(); ok { + if err := func() error { + if err := value.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "granteeType", + Error: err, + }) + } + if err := func() error { + if value, ok := s.Provider.Get(); ok { + if err := func() error { + if err := (validate.String{ + MinLength: 1, + MinLengthSet: true, + MaxLength: 0, + MaxLengthSet: false, + Email: false, + Hostname: false, + Regex: nil, + MinNumeric: 0, + MinNumericSet: false, + MaxNumeric: 0, + MaxNumericSet: false, + }).Validate(string(value)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "provider", + Error: err, + }) + } + if err := func() error { + if value, ok := s.ProviderUserId.Get(); ok { + if err := func() error { + if err := (validate.String{ + MinLength: 1, + MinLengthSet: true, + MaxLength: 0, + MaxLengthSet: false, + Email: false, + Hostname: false, + Regex: nil, + MinNumeric: 0, + MinNumericSet: false, + MaxNumeric: 0, + MaxNumericSet: false, + }).Validate(string(value)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + return err + } } return nil }(); err != nil { @@ -1502,7 +1674,7 @@ func (s *GrantRepoAccessInputBody) Validate() error { return nil } -func (s GrantRepoAccessInputBodyGranteeType) Validate() error { +func (s GrantAccessBodyGranteeType) Validate() error { switch s { case "account": return nil @@ -1511,7 +1683,7 @@ func (s GrantRepoAccessInputBodyGranteeType) Validate() error { } } -func (s GrantRepoAccessInputBodyRole) Validate() error { +func (s GrantAccessBodyRole) Validate() error { switch s { case "reader": return nil @@ -1662,6 +1834,17 @@ func (s *ListAvailableMirrorsOutputBody) Validate() error { Error: err, }) } + if err := func() error { + if err := s.GithubInstallations.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "githubInstallations", + Error: err, + }) + } if len(failures) > 0 { return &validate.Error{Fields: failures} } @@ -1895,20 +2078,20 @@ func (s *ListOrgCIBuildkiteCredentialsOutputBody) Validate() error { return nil } -func (s *ListOrgMembersOutputBody) Validate() error { +func (s *ListOrgCIDepotOrganizationsOutputBody) Validate() error { if s == nil { return validate.ErrNilPointer } var failures []validate.FieldError if err := func() error { - if s.Members == nil { + if s.Connections == nil { return errors.New("nil is invalid value") } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "members", + Name: "connections", Error: err, }) } @@ -1918,33 +2101,94 @@ func (s *ListOrgMembersOutputBody) Validate() error { return nil } -func (s *ListOrgProjectsOutputBody) Validate() error { +func (s *ListOrgInvitationsOutputBody) Validate() error { if s == nil { return validate.ErrNilPointer } var failures []validate.FieldError if err := func() error { - if value, ok := s.Project.Get(); ok { - if err := func() error { - if err := value.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - return err - } + if s.Invitations == nil { + return errors.New("nil is invalid value") } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "project", + Name: "invitations", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s ListOrgInvitationsStatus) Validate() error { + switch s { + case "open": + return nil + case "accepted": + return nil + case "revoked": + return nil + case "expired": + return nil + case "all": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s *ListOrgMembersOutputBody) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if s.Members == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "members", Error: err, }) } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s ListOrgPeopleMembership) Validate() error { + switch s { + case "member": + return nil + case "invited": + return nil + case "collaborator": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s *ListOrgPeopleOutputBody) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError if err := func() error { + if s.Items == nil { + return errors.New("nil is invalid value") + } var failures []validate.FieldError - for i, elem := range s.Projects { + for i, elem := range s.Items { if err := func() error { if err := elem.Validate(); err != nil { return err @@ -1963,7 +2207,7 @@ func (s *ListOrgProjectsOutputBody) Validate() error { return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "projects", + Name: "items", Error: err, }) } @@ -1973,20 +2217,20 @@ func (s *ListOrgProjectsOutputBody) Validate() error { return nil } -func (s *ListProjectMembersOutputBody) Validate() error { +func (s *ListOrgPeopleOutputBodyHeaders) Validate() error { if s == nil { return validate.ErrNilPointer } var failures []validate.FieldError if err := func() error { - if s.Members == nil { - return errors.New("nil is invalid value") + if err := s.Response.Validate(); err != nil { + return err } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "members", + Name: "Response", Error: err, }) } @@ -1996,7 +2240,52 @@ func (s *ListProjectMembersOutputBody) Validate() error { return nil } -func (s *ListProjectsOutputBody) Validate() error { +func (s ListOrgPeopleRole) Validate() error { + switch s { + case "owner": + return nil + case "admin": + return nil + case "member": + return nil + case "reader": + return nil + case "writer": + return nil + case "mirror_source_admin": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s ListOrgPeopleScope) Validate() error { + switch s { + case "organization": + return nil + case "project": + return nil + case "repository": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s ListOrgPeopleStatus) Validate() error { + switch s { + case "active": + return nil + case "inactive": + return nil + case "pending": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s *ListOrgProjectsOutputBody) Validate() error { if s == nil { return validate.ErrNilPointer } @@ -2051,37 +2340,20 @@ func (s *ListProjectsOutputBody) Validate() error { return nil } -func (s *ListRepoCIBuildsOutputBody) Validate() error { +func (s *ListProjectMembersOutputBody) Validate() error { if s == nil { return validate.ErrNilPointer } var failures []validate.FieldError if err := func() error { - if s.Builds == nil { + if s.Members == nil { return errors.New("nil is invalid value") } - var failures []validate.FieldError - for i, elem := range s.Builds { - if err := func() error { - if err := elem.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - failures = append(failures, validate.FieldError{ - Name: fmt.Sprintf("[%d]", i), - Error: err, - }) - } - } - if len(failures) > 0 { - return &validate.Error{Fields: failures} - } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "builds", + Name: "members", Error: err, }) } @@ -2091,17 +2363,220 @@ func (s *ListRepoCIBuildsOutputBody) Validate() error { return nil } -func (s *ListRepoCIProvidersOutputBody) Validate() error { - if s == nil { - return validate.ErrNilPointer - } - - var failures []validate.FieldError - if err := func() error { - if s.Providers == nil { - return errors.New("nil is invalid value") - } - var failures []validate.FieldError +func (s ListProjectPeopleRole) Validate() error { + switch s { + case "owner": + return nil + case "admin": + return nil + case "member": + return nil + case "reader": + return nil + case "writer": + return nil + case "mirror_source_admin": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s *ListProjectReposOutputBody) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if value, ok := s.Repo.Get(); ok { + if err := func() error { + if err := value.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "repo", + Error: err, + }) + } + if err := func() error { + var failures []validate.FieldError + for i, elem := range s.Repos { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "repos", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s *ListProjectsOutputBody) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if value, ok := s.Project.Get(); ok { + if err := func() error { + if err := value.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "project", + Error: err, + }) + } + if err := func() error { + var failures []validate.FieldError + for i, elem := range s.Projects { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "projects", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s *ListRepoCIBuildsOutputBody) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if s.Builds == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range s.Builds { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "builds", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s ListRepoCIDeliveriesDirection) Validate() error { + switch s { + case "outbound": + return nil + case "inbound": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s *ListRepoCIDeliveriesOutputBody) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if s.Deliveries == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "deliveries", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s *ListRepoCIProvidersOutputBody) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if s.Providers == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError for i, elem := range s.Providers { if err := func() error { if err := elem.Validate(); err != nil { @@ -2204,6 +2679,23 @@ func (s *ListRepoCollaboratorsOutputBody) Validate() error { if s.Collaborators == nil { return errors.New("nil is invalid value") } + var failures []validate.FieldError + for i, elem := range s.Collaborators { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } return nil }(); err != nil { failures = append(failures, validate.FieldError{ @@ -2240,6 +2732,25 @@ func (s *ListRepoGrantsOutputBody) Validate() error { return nil } +func (s ListRepoPeopleRole) Validate() error { + switch s { + case "owner": + return nil + case "admin": + return nil + case "member": + return nil + case "reader": + return nil + case "writer": + return nil + case "mirror_source_admin": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + func (s ListReposArchived) Validate() error { switch s { case "true": @@ -2460,7 +2971,508 @@ func (s *MeRegionalUnavailable) Validate() error { return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "error", + Name: "error", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s MeRegionalUnavailableError) Validate() error { + switch s { + case "foreign_jurisdiction": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s *MintOrgCIGitHubActionsCredentialInputBody) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if err := (validate.String{ + MinLength: 1, + MinLengthSet: true, + MaxLength: 0, + MaxLengthSet: false, + Email: false, + Hostname: false, + Regex: nil, + MinNumeric: 0, + MinNumericSet: false, + MaxNumeric: 0, + MaxNumericSet: false, + }).Validate(string(s.Account)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "account", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s *Mirror) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if value, ok := s.Status.Get(); ok { + if err := func() error { + if err := value.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "status", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s *MirrorRequest) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if err := s.Status.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "status", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s *MirrorRequestHeaders) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if err := s.Response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "Response", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s MirrorRequestStatus) Validate() error { + switch s { + case "pending": + return nil + case "processing": + return nil + case "succeeded": + return nil + case "failed": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s MirrorStatus) Validate() error { + switch s { + case "processing": + return nil + case "ready": + return nil + case "failed": + return nil + case "suspended": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s *NativeMirrorPlacement) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if err := s.DesiredState.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "desiredState", + Error: err, + }) + } + if err := func() error { + if err := s.Stage.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "stage", + Error: err, + }) + } + if err := func() error { + if err := s.Status.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "status", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s NativeMirrorPlacementDesiredState) Validate() error { + switch s { + case "active": + return nil + case "deleted": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s NativeMirrorPlacementStage) Validate() error { + switch s { + case "pending": + return nil + case "provisioned": + return nil + case "registered": + return nil + case "seeded": + return nil + case "announced": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s NativeMirrorPlacementStatus) Validate() error { + switch s { + case "processing": + return nil + case "ready": + return nil + case "failed": + return nil + case "suspended": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s *OrgPerson) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if s.Grants == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range s.Grants { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "grants", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s *OrgPersonGrant) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if err := s.Capabilities.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "capabilities", + Error: err, + }) + } + if err := func() error { + if err := s.ResourceType.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "resourceType", + Error: err, + }) + } + if err := func() error { + if err := s.Role.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "role", + Error: err, + }) + } + if err := func() error { + if err := s.Source.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "source", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s *OrgPersonGrantCapabilities) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if s.AllowedRoles == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range s.AllowedRoles { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "allowedRoles", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s OrgPersonGrantCapabilitiesAllowedRolesItem) Validate() error { + switch s { + case "owner": + return nil + case "admin": + return nil + case "member": + return nil + case "writer": + return nil + case "reader": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s OrgPersonGrantResourceType) Validate() error { + switch s { + case "organization": + return nil + case "project": + return nil + case "repository": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s OrgPersonGrantRole) Validate() error { + switch s { + case "owner": + return nil + case "admin": + return nil + case "member": + return nil + case "reader": + return nil + case "writer": + return nil + case "mirror_source_admin": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s OrgPersonGrantSource) Validate() error { + switch s { + case "membership": + return nil + case "direct": + return nil + case "team": + return nil + case "github": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s *OrgPersonHeaders) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if err := s.Response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "Response", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s *OrgPersonSummary) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if s.AccessScopes == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range s.AccessScopes { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "accessScopes", Error: err, }) } @@ -2470,16 +3482,20 @@ func (s *MeRegionalUnavailable) Validate() error { return nil } -func (s MeRegionalUnavailableError) Validate() error { +func (s OrgPersonSummaryAccessScopesItem) Validate() error { switch s { - case "foreign_jurisdiction": + case "organization": + return nil + case "project": + return nil + case "repository": return nil default: return errors.Errorf("invalid value: %v", s) } } -func (s *MintOrgCIGitHubActionsCredentialInputBody) Validate() error { +func (s *PreviewInvitationInputBody) Validate() error { if s == nil { return validate.ErrNilPointer } @@ -2498,43 +3514,13 @@ func (s *MintOrgCIGitHubActionsCredentialInputBody) Validate() error { MinNumericSet: false, MaxNumeric: 0, MaxNumericSet: false, - }).Validate(string(s.Account)); err != nil { + }).Validate(string(s.Token)); err != nil { return errors.Wrap(err, "string") } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "account", - Error: err, - }) - } - if len(failures) > 0 { - return &validate.Error{Fields: failures} - } - return nil -} - -func (s *Mirror) Validate() error { - if s == nil { - return validate.ErrNilPointer - } - - var failures []validate.FieldError - if err := func() error { - if value, ok := s.Status.Get(); ok { - if err := func() error { - if err := value.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - return err - } - } - return nil - }(); err != nil { - failures = append(failures, validate.FieldError{ - Name: "status", + Name: "token", Error: err, }) } @@ -2544,20 +3530,20 @@ func (s *Mirror) Validate() error { return nil } -func (s *MirrorRequest) Validate() error { +func (s *PreviewInvitationOK) Validate() error { if s == nil { return validate.ErrNilPointer } var failures []validate.FieldError if err := func() error { - if err := s.Status.Validate(); err != nil { + if err := s.Role.Validate(); err != nil { return err } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "status", + Name: "role", Error: err, }) } @@ -2567,7 +3553,7 @@ func (s *MirrorRequest) Validate() error { return nil } -func (s *MirrorRequestHeaders) Validate() error { +func (s *PreviewInvitationOKHeaders) Validate() error { if s == nil { return validate.ErrNilPointer } @@ -2590,72 +3576,61 @@ func (s *MirrorRequestHeaders) Validate() error { return nil } -func (s MirrorRequestStatus) Validate() error { - switch s { - case "pending": - return nil - case "processing": - return nil - case "succeeded": - return nil - case "failed": - return nil - default: - return errors.Errorf("invalid value: %v", s) - } -} - -func (s MirrorStatus) Validate() error { +func (s PreviewInvitationOKRole) Validate() error { switch s { - case "processing": - return nil - case "ready": + case "owner": return nil - case "failed": + case "admin": return nil - case "suspended": + case "member": return nil default: return errors.Errorf("invalid value: %v", s) } } -func (s *NativeMirrorPlacement) Validate() error { +func (s *Project) Validate() error { if s == nil { return validate.ErrNilPointer } var failures []validate.FieldError if err := func() error { - if err := s.DesiredState.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - failures = append(failures, validate.FieldError{ - Name: "desiredState", - Error: err, - }) - } - if err := func() error { - if err := s.Stage.Validate(); err != nil { + if err := s.OwnerType.Validate(); err != nil { return err } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "stage", + Name: "ownerType", Error: err, }) } if err := func() error { - if err := s.Status.Validate(); err != nil { - return err + if value, ok := s.RepositoryCount.Get(); ok { + if err := func() error { + if err := (validate.Int{ + MinSet: true, + Min: 0, + MaxSet: false, + Max: 0, + MinExclusive: false, + MaxExclusive: false, + MultipleOfSet: false, + MultipleOf: 0, + Pattern: nil, + }).Validate(int64(value)); err != nil { + return errors.Wrap(err, "int") + } + return nil + }(); err != nil { + return err + } } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "status", + Name: "repositoryCount", Error: err, }) } @@ -2665,63 +3640,31 @@ func (s *NativeMirrorPlacement) Validate() error { return nil } -func (s NativeMirrorPlacementDesiredState) Validate() error { - switch s { - case "active": - return nil - case "deleted": - return nil - default: - return errors.Errorf("invalid value: %v", s) - } -} - -func (s NativeMirrorPlacementStage) Validate() error { - switch s { - case "pending": - return nil - case "provisioned": - return nil - case "registered": - return nil - case "seeded": - return nil - case "announced": - return nil - default: - return errors.Errorf("invalid value: %v", s) - } -} - -func (s NativeMirrorPlacementStatus) Validate() error { +func (s ProjectOwnerType) Validate() error { switch s { - case "processing": - return nil - case "ready": - return nil - case "failed": + case "org": return nil - case "suspended": + case "account": return nil default: return errors.Errorf("invalid value: %v", s) } } -func (s *Project) Validate() error { +func (s *ProjectReference) Validate() error { if s == nil { return validate.ErrNilPointer } var failures []validate.FieldError if err := func() error { - if err := s.OwnerType.Validate(); err != nil { + if err := s.Host.Validate(); err != nil { return err } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "ownerType", + Name: "host", Error: err, }) } @@ -2731,11 +3674,11 @@ func (s *Project) Validate() error { return nil } -func (s ProjectOwnerType) Validate() error { +func (s ProjectReferenceHost) Validate() error { switch s { - case "org": + case "et": return nil - case "account": + case "gh": return nil default: return errors.Errorf("invalid value: %v", s) @@ -2800,6 +3743,43 @@ func (s *RegisterOrgCIBuildkiteClusterInputBody) Validate() error { return nil } +func (s *Repo) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + var failures []validate.FieldError + for i, elem := range s.Placements { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "placements", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + func (s *RepoCandidate) Validate() error { if s == nil { return validate.ErrNilPointer @@ -2836,6 +3816,42 @@ func (s RepoCandidateAccess) Validate() error { } } +func (s *RepoCollaborator) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if err := s.Role.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "role", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s RepoCollaboratorRole) Validate() error { + switch s { + case "reader": + return nil + case "writer": + return nil + case "admin": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + func (s *RepoFacetPage) Validate() error { if s == nil { return validate.ErrNilPointer @@ -3139,13 +4155,58 @@ func (s *ResolvePlacementsOutputBody) Validate() error { var failures []validate.FieldError if err := func() error { - if s.Placements == nil { - return errors.New("nil is invalid value") + if s.Placements == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "placements", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s ResolveProjectHost) Validate() error { + switch s { + case "et": + return nil + case "gh": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s *ResolveProjectOutputBody) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if err := s.Project.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "project", + Error: err, + }) + } + if err := func() error { + if err := s.Reference.Validate(); err != nil { + return err } return nil }(); err != nil { failures = append(failures, validate.FieldError{ - Name: "placements", + Name: "reference", Error: err, }) } @@ -3232,6 +4293,36 @@ func (s *ResolveReposInputBody) Validate() error { } var failures []validate.FieldError + if err := func() error { + if value, ok := s.CommitToken.Get(); ok { + if err := func() error { + if err := (validate.String{ + MinLength: 0, + MinLengthSet: false, + MaxLength: 0, + MaxLengthSet: false, + Email: false, + Hostname: false, + Regex: regexMap["^$|^[A-Za-z0-9_-]{60,512}$"], + MinNumeric: 0, + MinNumericSet: false, + MaxNumeric: 0, + MaxNumericSet: false, + }).Validate(string(value)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "commitToken", + Error: err, + }) + } if err := func() error { if s.Repositories == nil { return errors.New("nil is invalid value") @@ -3314,6 +4405,235 @@ func (s *ResolveReposResponse) Validate() error { return nil } +func (s *ResourcePeopleOutputBody) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if s.Items == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range s.Items { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "items", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s *ResourcePerson) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if err := s.DirectGrant.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "directGrant", + Error: err, + }) + } + if err := func() error { + if s.Sources == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range s.Sources { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "sources", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s *ResourcePersonDirectGrant) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if err := s.Role.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "role", + Error: err, + }) + } + if err := func() error { + if err := s.Source.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "source", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s ResourcePersonDirectGrantRole) Validate() error { + switch s { + case "owner": + return nil + case "admin": + return nil + case "member": + return nil + case "reader": + return nil + case "writer": + return nil + case "mirror_source_admin": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s ResourcePersonDirectGrantSource) Validate() error { + switch s { + case "membership": + return nil + case "direct": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s *ResourcePersonSource) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if err := s.Role.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "role", + Error: err, + }) + } + if err := func() error { + if err := s.Source.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "source", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s ResourcePersonSourceRole) Validate() error { + switch s { + case "owner": + return nil + case "admin": + return nil + case "member": + return nil + case "reader": + return nil + case "writer": + return nil + case "mirror_source_admin": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + +func (s ResourcePersonSourceSource) Validate() error { + switch s { + case "membership": + return nil + case "direct": + return nil + case "team": + return nil + case "organization": + return nil + case "project": + return nil + case "owner": + return nil + case "github": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + func (s RevokeServiceAccountAccessResourceType) Validate() error { switch s { case "repo": @@ -3529,6 +4849,42 @@ func (s *UpdateBranchProtectionInputBody) Validate() error { return nil } +func (s *UpdateOrgMemberRoleInputBody) Validate() error { + if s == nil { + return validate.ErrNilPointer + } + + var failures []validate.FieldError + if err := func() error { + if err := s.Role.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "role", + Error: err, + }) + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil +} + +func (s UpdateOrgMemberRoleInputBodyRole) Validate() error { + switch s { + case "owner": + return nil + case "admin": + return nil + case "member": + return nil + default: + return errors.Errorf("invalid value: %v", s) + } +} + func (s *WillDeleteStruct) Validate() error { if s == nil { return validate.ErrNilPointer diff --git a/internal/coreapi/repo_readiness_test.go b/internal/coreapi/repo_readiness_test.go index ac0ce8145d..1a66718253 100644 --- a/internal/coreapi/repo_readiness_test.go +++ b/internal/coreapi/repo_readiness_test.go @@ -89,8 +89,9 @@ func TestRepoAuthoritativeCrossRegion(t *testing.T) { c.cfg.Client = &http.Client{Transport: rt} ctx, cancel := context.WithCancel(t.Context()) defer cancel() - created, err := c.CreateRepo(ctx, &CreateRepoInputBody{Name: "web", ProjectId: id}) + response, err := c.CreateRepo(ctx, &CreateRepoInputBody{Name: "web", ProjectId: id}) require.NoError(t, err) + created := response.Response require.Equal(t, "provisioning", created.State.Or("")) for _, state := range []string{"provisioning", "active"} { snapshot, err := c.GetRepo(ctx, GetRepoParams{RepoId: created.ID, Authoritative: NewOptBool(true)}) diff --git a/internal/coreapi/spec/core.gen.json b/internal/coreapi/spec/core.gen.json index c0a692c71f..4d00f1d0ed 100644 --- a/internal/coreapi/spec/core.gen.json +++ b/internal/coreapi/spec/core.gen.json @@ -1,6 +1,57 @@ { "components": { "schemas": { + "AcceptInvitationInputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/AcceptInvitationInputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "token": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "token" + ], + "type": "object" + }, + "AcceptedInvitation": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/AcceptedInvitation.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "membership": { + "$ref": "#/components/schemas/Membership" + }, + "orgId": { + "type": "string" + }, + "orgName": { + "type": "string" + } + }, + "required": [ + "orgId", + "orgName", + "membership" + ], + "type": "object" + }, "AddOrgMemberInputBody": { "additionalProperties": true, "properties": { @@ -197,6 +248,23 @@ ], "type": "object" }, + "BranchRuleUpdate": { + "additionalProperties": true, + "properties": { + "ref": { + "description": "\"HEAD\" or a refs/heads/ name, fnmatch wildcards allowed.", + "type": "string" + }, + "serverSideMergeOnly": { + "description": "Sets the level: true for server-side merge only, false for protected. Omit to keep an existing rule's level.", + "type": "boolean" + } + }, + "required": [ + "ref" + ], + "type": "object" + }, "CIBuildView": { "additionalProperties": true, "properties": { @@ -283,6 +351,279 @@ ], "type": "object" }, + "CIDeliveryDetailView": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/CIDeliveryDetailView.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "account": { + "description": "Vendor account (Buildkite org, Depot org)", + "type": "string" + }, + "at": { + "description": "When the delivery started or arrived (UTC)", + "format": "date-time", + "type": "string" + }, + "attempt_count": { + "description": "Attempts made; outbound only", + "format": "int64", + "type": "integer" + }, + "completed_at": { + "description": "When an outbound delivery reached a terminal state (UTC)", + "format": "date-time", + "type": "string" + }, + "direction": { + "description": "outbound or inbound", + "type": "string" + }, + "display_name": { + "description": "Subscription display name", + "type": "string" + }, + "duration_ms": { + "description": "How long the delivery took, milliseconds", + "format": "int64", + "type": "integer" + }, + "event": { + "description": "Vendor event type, e.g. build.finished", + "type": "string" + }, + "http_status": { + "description": "HTTP status, absent when no request was made", + "format": "int64", + "type": "integer" + }, + "id": { + "description": "Opaque delivery id; pass to the delivery detail route", + "type": "string" + }, + "new_target": { + "description": "Content identity after the change", + "type": "string" + }, + "old_target": { + "description": "Content identity before the change", + "type": "string" + }, + "outcome": { + "description": "Five-valued outcome; the vocabularies differ by direction", + "type": "string" + }, + "payload": { + "$ref": "#/components/schemas/CIDeliveryPayloadView", + "description": "Absent when swept or never stored" + }, + "payload_absent": { + "description": "swept or no_request; empty when a payload is present", + "type": "string" + }, + "provider": { + "description": "CI provider registry name", + "type": "string" + }, + "ref": { + "description": "Ref that moved", + "type": "string" + }, + "ref_op": { + "description": "Ref operation. Empty means unknown — never guess it from the targets", + "type": "string" + }, + "repo_id": { + "description": "Repository ULID, empty when the delivery resolved to no enrolment", + "type": "string" + }, + "state": { + "description": "Outbound dispatch state", + "type": "string" + }, + "subscription_id": { + "description": "Subscription ULID, empty when none was resolved", + "type": "string" + }, + "target": { + "description": "Vendor target (Buildkite pipeline, Depot run label)", + "type": "string" + }, + "wire_request_id": { + "description": "The vendor's own id for this delivery", + "type": "string" + } + }, + "required": [ + "id", + "direction", + "provider", + "outcome", + "at" + ], + "type": "object" + }, + "CIDeliveryPayloadView": { + "additionalProperties": true, + "properties": { + "endpoint": { + "description": "Where the request went, or the path it arrived on", + "type": "string" + }, + "from_attempt": { + "description": "Which attempt these bytes came from; compare with attempt_count", + "format": "int64", + "type": "integer" + }, + "request_body": { + "description": "Request body as stored", + "type": "string" + }, + "request_headers": { + "additionalProperties": { + "type": "string" + }, + "description": "Stored request headers; an allowlist, signatures truncated", + "type": "object" + }, + "request_truncated": { + "description": "Request body is at the 16 KiB cap and may be cut", + "type": "boolean" + }, + "response_body": { + "description": "Response body as stored", + "type": "string" + }, + "response_present": { + "description": "False means no response arrived, not that it was empty", + "type": "boolean" + }, + "response_truncated": { + "description": "Response body is at the 16 KiB cap and may be cut", + "type": "boolean" + } + }, + "required": [ + "endpoint", + "request_headers", + "request_body", + "response_body", + "response_present", + "request_truncated", + "response_truncated", + "from_attempt" + ], + "type": "object" + }, + "CIDeliveryView": { + "additionalProperties": true, + "properties": { + "account": { + "description": "Vendor account (Buildkite org, Depot org)", + "type": "string" + }, + "at": { + "description": "When the delivery started or arrived (UTC)", + "format": "date-time", + "type": "string" + }, + "attempt_count": { + "description": "Attempts made; outbound only", + "format": "int64", + "type": "integer" + }, + "completed_at": { + "description": "When an outbound delivery reached a terminal state (UTC)", + "format": "date-time", + "type": "string" + }, + "direction": { + "description": "outbound or inbound", + "type": "string" + }, + "display_name": { + "description": "Subscription display name", + "type": "string" + }, + "duration_ms": { + "description": "How long the delivery took, milliseconds", + "format": "int64", + "type": "integer" + }, + "event": { + "description": "Vendor event type, e.g. build.finished", + "type": "string" + }, + "http_status": { + "description": "HTTP status, absent when no request was made", + "format": "int64", + "type": "integer" + }, + "id": { + "description": "Opaque delivery id; pass to the delivery detail route", + "type": "string" + }, + "new_target": { + "description": "Content identity after the change", + "type": "string" + }, + "old_target": { + "description": "Content identity before the change", + "type": "string" + }, + "outcome": { + "description": "Five-valued outcome; the vocabularies differ by direction", + "type": "string" + }, + "provider": { + "description": "CI provider registry name", + "type": "string" + }, + "ref": { + "description": "Ref that moved", + "type": "string" + }, + "ref_op": { + "description": "Ref operation. Empty means unknown — never guess it from the targets", + "type": "string" + }, + "repo_id": { + "description": "Repository ULID, empty when the delivery resolved to no enrolment", + "type": "string" + }, + "state": { + "description": "Outbound dispatch state", + "type": "string" + }, + "subscription_id": { + "description": "Subscription ULID, empty when none was resolved", + "type": "string" + }, + "target": { + "description": "Vendor target (Buildkite pipeline, Depot run label)", + "type": "string" + }, + "wire_request_id": { + "description": "The vendor's own id for this delivery", + "type": "string" + } + }, + "required": [ + "id", + "direction", + "provider", + "outcome", + "at" + ], + "type": "object" + }, "CIJobView": { "additionalProperties": true, "properties": { @@ -579,6 +920,9 @@ "provider": { "type": "string" }, + "provider_account": { + "type": "string" + }, "publish_checks": { "type": "boolean" }, @@ -588,6 +932,12 @@ "repo_id": { "type": "string" }, + "repo_write": { + "type": "boolean" + }, + "target_ref": { + "type": "string" + }, "updated_at": { "format": "date-time", "type": "string" @@ -600,10 +950,13 @@ "display_name", "bk_organization", "bk_pipeline", + "provider_account", + "target_ref", "ref_filter", "events", "enabled", "publish_checks", + "repo_write", "created_at", "updated_at" ], @@ -685,6 +1038,29 @@ ], "type": "object" }, + "ConnectOrgCIDepotOrganizationInputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/ConnectOrgCIDepotOrganizationInputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "account": { + "description": "Depot organisation id, as Depot's provisioning call returns it", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "account" + ], + "type": "object" + }, "CreateBindingInputBody": { "additionalProperties": true, "properties": { @@ -710,13 +1086,13 @@ ], "type": "object" }, - "CreateMirrorInputBody": { + "CreateMirrorRequestInputBody": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/CreateMirrorInputBody.json" + "/api/v1/schemas/CreateMirrorRequestInputBody.json" ], "format": "uri", "readOnly": true, @@ -750,93 +1126,85 @@ ], "type": "object" }, - "CreateMirrorRequestInputBody": { + "CreateNativeMirrorInputBody": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/CreateMirrorRequestInputBody.json" + "/api/v1/schemas/CreateNativeMirrorInputBody.json" ], "format": "uri", "readOnly": true, "type": "string" }, - "clusterHost": { - "description": "Destination cluster, as either a bare DNS host or the publicUrl returned by GET /api/v1/clusters.", - "minLength": 1, - "type": "string" - }, - "owner": { - "minLength": 1, - "type": "string" - }, - "provider": { - "enum": [ - "github" - ], - "type": "string" - }, - "repo": { + "clusterSlug": { "minLength": 1, "type": "string" } }, "required": [ - "provider", - "owner", - "repo", - "clusterHost" + "clusterSlug" ], "type": "object" }, - "CreateNativeMirrorInputBody": { + "CreateOrgInputBody": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/CreateNativeMirrorInputBody.json" + "/api/v1/schemas/CreateOrgInputBody.json" ], "format": "uri", "readOnly": true, "type": "string" }, - "clusterSlug": { + "name": { + "description": "Display name.", + "maxLength": 100, "minLength": 1, "type": "string" + }, + "region": { + "description": "Jurisdiction slug; defaults to the server's home jurisdiction.", + "type": "string" } }, "required": [ - "clusterSlug" + "name" ], "type": "object" }, - "CreateOrgInputBody": { + "CreateOrgInvitationInputBody": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/CreateOrgInputBody.json" + "/api/v1/schemas/CreateOrgInvitationInputBody.json" ], "format": "uri", "readOnly": true, "type": "string" }, - "name": { - "description": "Display name.", - "maxLength": 100, - "minLength": 1, + "email": { + "format": "email", "type": "string" }, - "region": { - "description": "Jurisdiction slug; defaults to the server's home jurisdiction.", + "role": { + "default": "member", + "enum": [ + "owner", + "admin", + "member" + ], "type": "string" } }, "required": [ - "name" + "email", + "role" ], "type": "object" }, @@ -931,6 +1299,9 @@ "provider": { "type": "string" }, + "provider_account": { + "type": "string" + }, "publish_checks": { "type": "boolean" }, @@ -940,10 +1311,16 @@ "repo_id": { "type": "string" }, + "repo_write": { + "type": "boolean" + }, "setup": { "$ref": "#/components/schemas/CISetupBlock", "description": "What to do next, rendered ready to use. Present on a self-managed enrolment." }, + "target_ref": { + "type": "string" + }, "updated_at": { "format": "date-time", "type": "string" @@ -959,10 +1336,13 @@ "display_name", "bk_organization", "bk_pipeline", + "provider_account", + "target_ref", "ref_filter", "events", "enabled", "publish_checks", + "repo_write", "created_at", "updated_at" ], @@ -1054,7 +1434,7 @@ "type": "string" }, "clusterHost": { - "description": "Public host of the cluster to pin the repo to (e.g. royalcanin.partial.to); empty lands on the jurisdiction default.", + "description": "Public host of the cluster to pin the repo to (e.g. royalcanin.partial.to); must be in the project's processing cell. Empty takes that cell's cluster.", "type": "string" }, "name": { @@ -1107,47 +1487,212 @@ ], "type": "object" }, - "CreatedMirror": { + "CreatedOrg": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/CreatedMirror.json" + "/api/v1/schemas/CreatedOrg.json" ], "format": "uri", "readOnly": true, "type": "string" }, - "created": { - "description": "true on fresh creation; false when an existing mirror was returned.", - "type": "boolean" + "capabilities": { + "$ref": "#/components/schemas/OrgCapabilities" + }, + "commitToken": { + "deprecated": true, + "description": "Deprecated: read the X-Entire-Commit-Token response header instead.", + "type": "string" + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "workosOrganizationId": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "region", + "createdAt" + ], + "type": "object" + }, + "CreatedProject": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/CreatedProject.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "apiUrl": { + "description": "Public entire-api base URL for the assigned cell. Empty when unassigned or routing is unavailable; do not fall back to another cell.", + "type": "string" + }, + "capabilities": { + "$ref": "#/components/schemas/ProjectCapabilities" + }, + "commitToken": { + "deprecated": true, + "description": "Deprecated: read the X-Entire-Commit-Token response header instead.", + "type": "string" + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "ownerId": { + "type": "string" + }, + "ownerName": { + "type": "string" + }, + "ownerType": { + "enum": [ + "org", + "account" + ], + "type": "string" + }, + "primaryProcessingCell": { + "description": "Stored processing cell ID, not a cluster slug. Empty when the project is unassigned.", + "type": "string" + }, + "region": { + "type": "string" + }, + "repositoryCount": { + "description": "Published logical repositories in paginated project listings. Omitted without project-wide view permission or when unavailable.", + "format": "int64", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "id", + "name", + "ownerType", + "ownerId", + "region", + "createdAt" + ], + "type": "object" + }, + "CreatedRepo": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/CreatedRepo.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "capabilities": { + "$ref": "#/components/schemas/RepoCapabilities" + }, + "clusterHost": { + "type": "string" + }, + "clusterSlug": { + "type": "string" }, - "empty": { - "description": "Deprecated: always false. Poll the mirror status instead — an empty upstream still reaches 'ready'.", + "commitToken": { + "deprecated": true, + "description": "Deprecated: read the X-Entire-Commit-Token response header instead.", + "type": "string" + }, + "foreign": { "type": "boolean" }, - "mirrorId": { + "fullName": { "type": "string" }, - "mirrorUrl": { + "id": { "type": "string" }, - "publicUrl": { + "jurisdiction": { "type": "string" }, - "suspended": { - "description": "true when an existing placement was returned that an admin suspended.", + "mirrorSuspended": { "type": "boolean" + }, + "mirrorSuspendedAt": { + "type": "string" + }, + "name": { + "type": "string" + }, + "objectFormat": { + "type": "string" + }, + "owningProjectId": { + "type": "string" + }, + "path": { + "type": "string" + }, + "placements": { + "items": { + "$ref": "#/components/schemas/RepoPlacement" + }, + "type": "array" + }, + "primaries": { + "$ref": "#/components/schemas/RepoPrimaries" + }, + "provider": { + "type": "string" + }, + "provisionAttempts": { + "format": "int64", + "type": "integer" + }, + "provisionReason": { + "type": "string" + }, + "repoGroupId": { + "type": "string" + }, + "state": { + "description": "Provisioning lifecycle. A mirror is active from creation, before its initial clone completes.", + "type": "string" + }, + "visibility": { + "type": "string" } }, "required": [ - "mirrorId", - "mirrorUrl", - "publicUrl", - "created", - "empty", - "suspended" + "id", + "owningProjectId", + "name" ], "type": "object" }, @@ -1467,69 +2012,23 @@ ], "type": "object" }, - "GetPermissionsOutputBody": { + "GetRepoVisibilityOutputBody": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/GetPermissionsOutputBody.json" + "/api/v1/schemas/GetRepoVisibilityOutputBody.json" ], "format": "uri", "readOnly": true, "type": "string" }, - "explain": { - "additionalProperties": {}, - "type": "object" - }, - "permissions": { - "items": { - "enum": [ - "manage", - "view", - "read", - "write", - "push", - "pull", - "create_repo", - "admin", - "admin_read" - ], - "type": "string" - }, - "type": "array" - }, - "resourceId": { - "type": "string" - }, - "resourceType": { - "type": "string" - } - }, - "required": [ - "resourceType", - "resourceId" - ], - "type": "object" - }, - "GetRepoVisibilityOutputBody": { - "additionalProperties": true, - "properties": { - "$schema": { - "description": "A URL to the JSON Schema for this object.", - "examples": [ - "/api/v1/schemas/GetRepoVisibilityOutputBody.json" - ], - "format": "uri", - "readOnly": true, - "type": "string" - }, - "visibility": { - "enum": [ - "public", - "private" - ], + "visibility": { + "enum": [ + "public", + "private" + ], "type": "string" } }, @@ -1592,62 +2091,52 @@ ], "type": "object" }, - "GrantProjectAccessInputBody": { + "GitHubInstallation": { "additionalProperties": true, "properties": { - "$schema": { - "description": "A URL to the JSON Schema for this object.", - "examples": [ - "/api/v1/schemas/GrantProjectAccessInputBody.json" - ], - "format": "uri", - "readOnly": true, + "accountLogin": { "type": "string" }, - "granteeType": { - "default": "account", + "accountType": { "enum": [ - "account" + "user", + "organization" ], "type": "string" }, - "provider": { - "minLength": 1, - "type": "string" - }, - "providerUserId": { - "minLength": 1, + "id": { "type": "string" }, - "role": { + "state": { "enum": [ - "reader", - "writer", - "admin" + "active", + "suspended" ], "type": "string" } }, "required": [ - "provider", - "providerUserId", - "role" + "id", + "accountLogin", + "accountType", + "state" ], "type": "object" }, - "GrantProjectAccessOutputBody": { + "GitHubInstallations": { "additionalProperties": true, "properties": { - "$schema": { - "description": "A URL to the JSON Schema for this object.", - "examples": [ - "/api/v1/schemas/GrantProjectAccessOutputBody.json" - ], - "format": "uri", - "readOnly": true, - "type": "string" + "items": { + "items": { + "$ref": "#/components/schemas/GitHubInstallation" + }, + "type": "array" }, "status": { + "enum": [ + "ok", + "unavailable" + ], "type": "string" } }, @@ -1656,18 +2145,23 @@ ], "type": "object" }, - "GrantRepoAccessInputBody": { + "GrantAccessBody": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/GrantRepoAccessInputBody.json" + "/api/v1/schemas/GrantAccessBody.json" ], "format": "uri", "readOnly": true, "type": "string" }, + "accountId": { + "description": "Entire account ULID to grant directly. Mutually exclusive with provider/providerUserId; the account must exist.", + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + }, "granteeType": { "default": "account", "enum": [ @@ -1676,10 +2170,12 @@ "type": "string" }, "provider": { + "description": "Legacy identity selector; requires providerUserId and must not be combined with accountId.", "minLength": 1, "type": "string" }, "providerUserId": { + "description": "Legacy provider user ID; requires provider and must not be combined with accountId.", "minLength": 1, "type": "string" }, @@ -1693,12 +2189,31 @@ } }, "required": [ - "provider", - "providerUserId", "role" ], "type": "object" }, + "GrantProjectAccessOutputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/GrantProjectAccessOutputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "status": { + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + }, "GrantRepoAccessOutputBody": { "additionalProperties": true, "properties": { @@ -1780,6 +2295,68 @@ ], "type": "object" }, + "Invitation": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/Invitation.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "acceptedAt": { + "format": "date-time", + "type": "string" + }, + "acceptedBy": { + "description": "Account ID that used the token. Empty until the invitation is accepted.", + "type": "string" + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "email": { + "description": "The invited address, normalized to lowercase.", + "type": "string" + }, + "expiresAt": { + "format": "date-time", + "type": "string" + }, + "id": { + "type": "string" + }, + "invitedBy": { + "description": "Account ID of the manager who created the invitation.", + "type": "string" + }, + "revokedAt": { + "format": "date-time", + "type": "string" + }, + "role": { + "type": "string" + }, + "status": { + "description": "Derived from the outcome columns at read time.", + "type": "string" + } + }, + "required": [ + "id", + "email", + "role", + "status", + "invitedBy", + "createdAt", + "expiresAt" + ], + "type": "object" + }, "ListAuditEventsOutputBody": { "additionalProperties": true, "properties": { @@ -1825,10 +2402,14 @@ "$ref": "#/components/schemas/AvailableMirror" }, "type": "array" + }, + "githubInstallations": { + "$ref": "#/components/schemas/GitHubInstallations" } }, "required": [ - "available" + "available", + "githubInstallations" ], "type": "object" }, @@ -2036,6 +2617,58 @@ ], "type": "object" }, + "ListOrgCIDepotOrganizationsOutputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/ListOrgCIDepotOrganizationsOutputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "connections": { + "items": { + "$ref": "#/components/schemas/OrgCIDepotConnectionView" + }, + "type": "array" + } + }, + "required": [ + "connections" + ], + "type": "object" + }, + "ListOrgInvitationsOutputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/ListOrgInvitationsOutputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "invitations": { + "items": { + "$ref": "#/components/schemas/Invitation" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Pass back to fetch the next page; empty when no more entries.", + "type": "string" + } + }, + "required": [ + "invitations" + ], + "type": "object" + }, "ListOrgMembersOutputBody": { "additionalProperties": true, "properties": { @@ -2064,6 +2697,39 @@ ], "type": "object" }, + "ListOrgPeopleOutputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/ListOrgPeopleOutputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "items": { + "items": { + "$ref": "#/components/schemas/OrgPersonSummary" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Pass back to fetch the next page; empty when no more entries.", + "type": "string" + }, + "totalCount": { + "format": "int64", + "type": "integer" + } + }, + "required": [ + "items", + "totalCount" + ], + "type": "object" + }, "ListOrgProjectsOutputBody": { "additionalProperties": true, "properties": { @@ -2228,6 +2894,30 @@ ], "type": "object" }, + "ListRepoCIDeliveriesOutputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/ListRepoCIDeliveriesOutputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "deliveries": { + "items": { + "$ref": "#/components/schemas/CIDeliveryView" + }, + "type": "array" + } + }, + "required": [ + "deliveries" + ], + "type": "object" + }, "ListRepoCIProvidersOutputBody": { "additionalProperties": true, "properties": { @@ -2665,6 +3355,7 @@ "type": "string" }, "status": { + "description": "Membership lifecycle status.", "type": "string" }, "workosOrgMembershipId": { @@ -2732,16 +3423,16 @@ "format": "date-time", "type": "string" }, - "installationId": { - "format": "int64", - "type": "integer" - }, "isArchived": { "type": "boolean" }, "isPrivate": { "type": "boolean" }, + "isProcessingPrimary": { + "description": "True when this placement does its repo group's per-event work. Removing it is refused while other placements remain.", + "type": "boolean" + }, "jurisdiction": { "type": "string" }, @@ -3136,13 +3827,13 @@ ], "type": "object" }, - "OrgCIGitHubActionsCredentialView": { + "OrgCIDepotConnectionView": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/OrgCIGitHubActionsCredentialView.json" + "/api/v1/schemas/OrgCIDepotConnectionView.json" ], "format": "uri", "readOnly": true, @@ -3151,19 +3842,8 @@ "account": { "type": "string" }, - "has_api_token": { - "type": "boolean" - }, - "inbound_endpoint_id": { - "type": "string" - }, - "inbound_endpoint_path": { - "type": "string" - }, - "inbound_endpoint_url": { - "type": "string" - }, - "inbound_secret": { + "connected_at": { + "format": "date-time", "type": "string" }, "owner": { @@ -3180,10 +3860,58 @@ ], "type": "object" }, - "OrgCapabilities": { + "OrgCIGitHubActionsCredentialView": { "additionalProperties": true, "properties": { - "canCreateProject": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/OrgCIGitHubActionsCredentialView.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "account": { + "type": "string" + }, + "has_api_token": { + "type": "boolean" + }, + "inbound_endpoint_id": { + "type": "string" + }, + "inbound_endpoint_path": { + "type": "string" + }, + "inbound_endpoint_url": { + "type": "string" + }, + "inbound_secret": { + "type": "string" + }, + "owner": { + "type": "string" + }, + "provider": { + "type": "string" + } + }, + "required": [ + "provider", + "account", + "owner" + ], + "type": "object" + }, + "OrgCapabilities": { + "additionalProperties": true, + "properties": { + "canChangeOwners": { + "description": "Whether the caller holds the direct organization owner relation. Individual mutations still enforce all guards.", + "type": "boolean" + }, + "canCreateProject": { "type": "boolean" }, "canDelete": { @@ -3196,7 +3924,192 @@ "required": [ "canCreateProject", "canManageMembers", - "canDelete" + "canDelete", + "canChangeOwners" + ], + "type": "object" + }, + "OrgPerson": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/OrgPerson.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "accountId": { + "type": "string" + }, + "avatarUrl": { + "type": "string" + }, + "grants": { + "items": { + "$ref": "#/components/schemas/OrgPersonGrant" + }, + "type": "array" + }, + "handle": { + "type": "string" + }, + "membership": { + "$ref": "#/components/schemas/OrgPersonMembership" + }, + "provider": { + "type": "string" + } + }, + "required": [ + "accountId", + "membership", + "grants" + ], + "type": "object" + }, + "OrgPersonGrant": { + "additionalProperties": true, + "properties": { + "capabilities": { + "$ref": "#/components/schemas/OrgPersonGrantCapabilities" + }, + "resourceId": { + "description": "Organization ID, project ID, or logical repo-group ID (not a placement ID).", + "type": "string" + }, + "resourceName": { + "type": "string" + }, + "resourceType": { + "enum": [ + "organization", + "project", + "repository" + ], + "type": "string" + }, + "role": { + "enum": [ + "owner", + "admin", + "member", + "reader", + "writer", + "mirror_source_admin" + ], + "type": "string" + }, + "source": { + "description": "Origin at this resource level; inherited access is not included.", + "enum": [ + "membership", + "direct", + "team", + "github" + ], + "type": "string" + } + }, + "required": [ + "resourceType", + "resourceId", + "resourceName", + "role", + "source", + "capabilities" + ], + "type": "object" + }, + "OrgPersonGrantCapabilities": { + "additionalProperties": true, + "properties": { + "allowedRoles": { + "description": "Roles the caller may request. An empty array means read-only.", + "items": { + "enum": [ + "owner", + "admin", + "member", + "writer", + "reader" + ], + "type": "string" + }, + "type": "array" + }, + "targetId": { + "description": "ID for the existing role mutation: membership ID, project ID, or native primary repo placement ID. Present only when roles are editable.", + "type": "string" + } + }, + "required": [ + "allowedRoles" + ], + "type": "object" + }, + "OrgPersonMembership": { + "additionalProperties": true, + "properties": { + "createdAt": { + "format": "date-time", + "type": "string" + }, + "id": { + "type": "string" + }, + "role": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "required": [ + "id", + "role", + "status", + "createdAt" + ], + "type": "object" + }, + "OrgPersonSummary": { + "additionalProperties": true, + "properties": { + "accessScopes": { + "description": "Recorded grant levels, not effective permissions.", + "items": { + "enum": [ + "organization", + "project", + "repository" + ], + "type": "string" + }, + "type": "array" + }, + "accountId": { + "type": "string" + }, + "avatarUrl": { + "type": "string" + }, + "handle": { + "type": "string" + }, + "membership": { + "$ref": "#/components/schemas/OrgPersonMembership" + }, + "provider": { + "type": "string" + } + }, + "required": [ + "accountId", + "membership", + "accessScopes" ], "type": "object" }, @@ -3229,8 +4142,33 @@ }, "ref_filter": { "type": "string" + }, + "repo_write": { + "type": "boolean" + } + }, + "type": "object" + }, + "PreviewInvitationInputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/PreviewInvitationInputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "token": { + "minLength": 1, + "type": "string" } }, + "required": [ + "token" + ], "type": "object" }, "Project": { @@ -3245,6 +4183,10 @@ "readOnly": true, "type": "string" }, + "apiUrl": { + "description": "Public entire-api base URL for the assigned cell. Empty when unassigned or routing is unavailable; do not fall back to another cell.", + "type": "string" + }, "capabilities": { "$ref": "#/components/schemas/ProjectCapabilities" }, @@ -3271,8 +4213,18 @@ ], "type": "string" }, + "primaryProcessingCell": { + "description": "Stored processing cell ID, not a cluster slug. Empty when the project is unassigned.", + "type": "string" + }, "region": { "type": "string" + }, + "repositoryCount": { + "description": "Published logical repositories in paginated project listings. Omitted without project-wide view permission or when unavailable.", + "format": "int64", + "minimum": 0, + "type": "integer" } }, "required": [ @@ -3336,6 +4288,26 @@ ], "type": "object" }, + "ProjectReference": { + "additionalProperties": true, + "properties": { + "host": { + "enum": [ + "et", + "gh" + ], + "type": "string" + }, + "project": { + "type": "string" + } + }, + "required": [ + "host", + "project" + ], + "type": "object" + }, "RegisterOrgCIBuildkiteClusterInputBody": { "additionalProperties": true, "properties": { @@ -3420,6 +4392,12 @@ "path": { "type": "string" }, + "placements": { + "items": { + "$ref": "#/components/schemas/RepoPlacement" + }, + "type": "array" + }, "primaries": { "$ref": "#/components/schemas/RepoPrimaries" }, @@ -3502,6 +4480,12 @@ "type": "string" }, "role": { + "description": "Display tier. Admin includes GitHub settings administrators and does not imply permission to manage grants.", + "enum": [ + "reader", + "writer", + "admin" + ], "type": "string" } }, @@ -3694,6 +4678,9 @@ "RepoPlacement": { "additionalProperties": true, "properties": { + "apiBaseUrl": { + "type": "string" + }, "cell": { "type": "string" }, @@ -3837,23 +4824,48 @@ ], "type": "object" }, - "ResolveRepoIDsInputBody": { + "ResolveProjectOutputBody": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/ResolveRepoIDsInputBody.json" + "/api/v1/schemas/ResolveProjectOutputBody.json" ], "format": "uri", "readOnly": true, "type": "string" }, - "repoIds": { - "items": { - "type": "string" - }, - "maxItems": 100, + "project": { + "$ref": "#/components/schemas/Project" + }, + "reference": { + "$ref": "#/components/schemas/ProjectReference" + } + }, + "required": [ + "project", + "reference" + ], + "type": "object" + }, + "ResolveRepoIDsInputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/ResolveRepoIDsInputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "repoIds": { + "items": { + "type": "string" + }, + "maxItems": 100, "type": "array" } }, @@ -3898,6 +4910,14 @@ "readOnly": true, "type": "string" }, + "commitToken": { + "pattern": "^$|^[A-Za-z0-9_-]{60,512}$", + "type": "string" + }, + "recheckDeniedPermissions": { + "description": "Retry stale permission denials for navigation. Defaults to false for list enrichment. Failed retries retain denials; a commitToken authorization revision takes precedence.", + "type": "boolean" + }, "repositories": { "items": { "$ref": "#/components/schemas/RepoReference" @@ -3992,6 +5012,136 @@ ], "type": "object" }, + "ResourcePeopleOutputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/ResourcePeopleOutputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "items": { + "items": { + "$ref": "#/components/schemas/ResourcePerson" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Pass back to fetch the next page; empty when no more entries.", + "type": "string" + }, + "totalCount": { + "format": "int64", + "type": "integer" + } + }, + "required": [ + "items", + "totalCount" + ], + "type": "object" + }, + "ResourcePerson": { + "additionalProperties": true, + "properties": { + "accountId": { + "type": "string" + }, + "avatarUrl": { + "type": "string" + }, + "directGrant": { + "$ref": "#/components/schemas/ResourcePersonDirectGrant" + }, + "handle": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "role": { + "type": "string" + }, + "sources": { + "items": { + "$ref": "#/components/schemas/ResourcePersonSource" + }, + "type": "array" + } + }, + "required": [ + "accountId", + "role", + "directGrant", + "sources" + ], + "type": "object" + }, + "ResourcePersonDirectGrant": { + "additionalProperties": true, + "properties": { + "role": { + "enum": [ + "owner", + "admin", + "member", + "reader", + "writer", + "mirror_source_admin" + ], + "type": "string" + }, + "source": { + "enum": [ + "membership", + "direct" + ], + "type": "string" + } + }, + "required": [ + "role", + "source" + ], + "type": "object" + }, + "ResourcePersonSource": { + "additionalProperties": true, + "properties": { + "role": { + "enum": [ + "owner", + "admin", + "member", + "reader", + "writer", + "mirror_source_admin" + ], + "type": "string" + }, + "source": { + "enum": [ + "membership", + "direct", + "team", + "organization", + "project", + "owner", + "github" + ], + "type": "string" + } + }, + "required": [ + "source", + "role" + ], + "type": "object" + }, "ServiceAccount": { "additionalProperties": true, "properties": { @@ -4151,7 +5301,7 @@ "additionalProperties": true, "properties": { "host": { - "description": "DNS host of this cluster; pass verbatim as clusterHost to POST /api/v1/mirrors.", + "description": "DNS host of this cluster; pass verbatim as clusterHost to POST /api/v1/mirror-requests.", "type": "string" }, "isDefault": { @@ -4238,9 +5388,9 @@ "type": "string" }, "addRules": { - "description": "Rules to add or replace by ref: an existing rule keeps its position and takes the new flag.", + "description": "Rules to add or edit by ref: an existing rule keeps its position; omit serverSideMergeOnly to keep its level.", "items": { - "$ref": "#/components/schemas/BranchRule" + "$ref": "#/components/schemas/BranchRuleUpdate" }, "maxItems": 64, "type": "array" @@ -4256,6 +5406,33 @@ }, "type": "object" }, + "UpdateOrgMemberRoleInputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/UpdateOrgMemberRoleInputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "role": { + "description": "Replacement organization role.", + "enum": [ + "owner", + "admin", + "member" + ], + "type": "string" + } + }, + "required": [ + "role" + ], + "type": "object" + }, "WillDeleteStruct": { "additionalProperties": true, "properties": { @@ -4324,75 +5501,6 @@ }, "openapi": "3.1.0", "paths": { - "/access/{resourceType}/{resourceId}": { - "get": { - "operationId": "getPermissions", - "parameters": [ - { - "in": "path", - "name": "resourceType", - "required": true, - "schema": { - "minLength": 1, - "type": "string" - } - }, - { - "in": "path", - "name": "resourceId", - "required": true, - "schema": { - "minLength": 1, - "type": "string" - } - }, - { - "description": "If set, return the SpiceDB trace for this permission instead of the permission list.", - "explode": false, - "in": "query", - "name": "explain", - "schema": { - "description": "If set, return the SpiceDB trace for this permission instead of the permission list.", - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetPermissionsOutputBody" - } - } - }, - "description": "OK" - }, - "default": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Error" - } - }, - "security": [ - { - "bearerAuth": [] - }, - { - "sessionAuth": [] - } - ], - "summary": "List the caller's permissions on a single resource", - "tags": [ - "identity" - ] - } - }, "/audit": { "get": { "operationId": "listAuditEvents", @@ -4559,12 +5667,56 @@ ] } }, - "/me": { - "delete": { - "operationId": "deleteMe", + "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/invitations/accept": { + "post": { + "operationId": "acceptInvitation", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AcceptInvitationInputBody" + } + } + }, + "required": true + }, "responses": { - "202": { - "description": "Accepted" + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "properties": { + "membership": { + "$ref": "#/components/schemas/Membership" + }, + "orgId": { + "type": "string" + }, + "orgName": { + "type": "string" + } + }, + "required": [ + "orgId", + "orgName", + "membership" + ], + "type": "object" + } + } + }, + "description": "Accepted; the caller was already an active member" + }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AcceptedInvitation" + } + } + }, + "description": "Created" }, "default": { "content": { @@ -4585,14 +5737,124 @@ "sessionAuth": [] } ], - "summary": "Request deletion of the calling account (7-day cooldown; cancel via POST /me/cancel-deletion)", + "summary": "Accept an organization invitation", "tags": [ - "identity" + "orgs" ] - }, - "get": { - "operationId": "getMe", - "responses": { + } + }, + "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/invitations/preview": { + "post": { + "operationId": "previewInvitation", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PreviewInvitationInputBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "properties": { + "inviterHandle": { + "type": "string" + }, + "orgName": { + "type": "string" + }, + "role": { + "enum": [ + "owner", + "admin", + "member" + ], + "type": "string" + } + }, + "required": [ + "orgName", + "inviterHandle", + "role" + ], + "type": "object" + } + } + }, + "description": "OK", + "headers": { + "Cache-Control": { + "schema": { + "type": "string" + } + } + } + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Preview an organization invitation", + "tags": [ + "orgs" + ] + } + }, + "/me": { + "delete": { + "operationId": "deleteMe", + "responses": { + "202": { + "description": "Accepted" + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Request deletion of the calling account (7-day cooldown; cancel via POST /me/cancel-deletion)", + "tags": [ + "identity" + ] + }, + "get": { + "operationId": "getMe", + "responses": { "200": { "content": { "application/json": { @@ -4699,6 +5961,65 @@ ] } }, + "/me/handles/{provider}/{providerUserId}": { + "delete": { + "operationId": "detachMyHandle", + "parameters": [ + { + "description": "Sign-in provider of the handle to detach.", + "in": "path", + "name": "provider", + "required": true, + "schema": { + "description": "Sign-in provider of the handle to detach.", + "enum": [ + "google", + "github" + ], + "type": "string" + } + }, + { + "description": "The provider's stable user identifier for the handle (handles[].providerUserId from GET /me).", + "in": "path", + "name": "providerUserId", + "required": true, + "schema": { + "description": "The provider's stable user identifier for the handle (handles[].providerUserId from GET /me).", + "minLength": 1, + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Detach a linked sign-in method from the calling account", + "tags": [ + "identity" + ] + } + }, "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/me/onboarding": { "get": { "operationId": "getOnboardingStatus", @@ -5053,53 +6374,6 @@ "tags": [ "mirrors" ] - }, - "post": { - "operationId": "createMirror", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateMirrorInputBody" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreatedMirror" - } - } - }, - "description": "Created" - }, - "default": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Error" - } - }, - "security": [ - { - "bearerAuth": [] - }, - { - "sessionAuth": [] - } - ], - "summary": "Create GitHub mirror", - "tags": [ - "mirrors" - ] } }, "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/mirrors/available": { @@ -5472,6 +6746,17 @@ "schema": { "type": "string" } + }, + { + "description": "Optional: opaque commit token from an org create or delete, to read at a snapshot that contains that write. Applies to both the name lookup and the page.", + "explode": false, + "in": "query", + "name": "commitToken", + "schema": { + "description": "Optional: opaque commit token from an org create or delete, to read at a snapshot that contains that write. Applies to both the name lookup and the page.", + "pattern": "^$|^[A-Za-z0-9_-]{20,512}$", + "type": "string" + } } ], "responses": { @@ -5543,11 +6828,19 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Org" + "$ref": "#/components/schemas/CreatedOrg" } } }, - "description": "Created" + "description": "Created", + "headers": { + "X-Entire-Commit-Token": { + "schema": { + "description": "Opaque token to pass as commitToken on the next org list, so this org appears immediately. Absent when none could be minted; list without it.", + "type": "string" + } + } + } }, "default": { "content": { @@ -5590,7 +6883,15 @@ ], "responses": { "204": { - "description": "No Content" + "description": "No Content", + "headers": { + "X-Entire-Commit-Token": { + "schema": { + "description": "Opaque token to pass as commitToken on the next org list, so this org is gone from it. Absent when none could be minted; list without it.", + "type": "string" + } + } + } }, "default": { "content": { @@ -6063,10 +7364,10 @@ ] } }, - "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/orgs/{orgId}/ci/github-actions/credential": { + "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/orgs/{orgId}/ci/depot/connection": { "post": { - "description": "Operator-only: requires platform#admin, unlike the Buildkite routes beside it, because GitHub Actions has no enrolment path yet and a credential minted here cannot be used. Mints the inbound webhook credential for one GitHub account: a fresh webhook secret (returned once, in this 201) and the endpoint URL to configure the GitHub webhook with, plus optionally the outbound dispatch api_token (write-only, never returned; has_api_token confirms storage). With api_token, an already-minted github-actions row gets the token stored/rotated instead (200, no secret re-issued).", - "operationId": "mintOrgCIGitHubActionsCredential", + "description": "Operator-only: requires platform#admin, unlike the Buildkite routes beside it, because nothing can verify a Depot organisation id. Depot hands Entire no credential, so there is no token to store and no API to check the id against; the operator vouches for it. Records the Depot organisation id the org's repositories enrol against. Returns 201 on a fresh connection and 200 when the same pair is already connected.", + "operationId": "connectOrgCIDepotOrganization", "parameters": [ { "in": "path", @@ -6082,7 +7383,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MintOrgCIGitHubActionsCredentialInputBody" + "$ref": "#/components/schemas/ConnectOrgCIDepotOrganizationInputBody" } } }, @@ -6093,7 +7394,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OrgCIGitHubActionsCredentialView" + "$ref": "#/components/schemas/OrgCIDepotConnectionView" } } }, @@ -6118,59 +7419,39 @@ "sessionAuth": [] } ], - "summary": "Mint an org's GitHub Actions webhook credential", + "summary": "Connect an org to a Depot organisation", "tags": [ "org-ci-webhooks" ] } }, - "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/orgs/{orgId}/members": { - "get": { - "operationId": "listOrgMembers", + "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/orgs/{orgId}/ci/depot/connection/{account}": { + "delete": { + "description": "Operator-only: requires platform#admin, mirroring the connect, because withdrawing an operator's vouch is at least as privileged as granting it. Provider-scoped on ci-webhooks, so it removes only the depot row and never a Buildkite credential of the same name. Removing a connection a subscription still names is allowed and logged; those subscriptions stop dispatching.", + "operationId": "disconnectOrgCIDepotOrganization", "parameters": [ { - "description": "Maximum entries to return; server may cap further.", - "explode": false, - "in": "query", - "name": "pageSize", - "schema": { - "description": "Maximum entries to return; server may cap further.", - "format": "int32", - "maximum": 500, - "minimum": 0, - "type": "integer" - } - }, - { - "description": "Opaque cursor from a previous response's nextPageToken.", - "explode": false, - "in": "query", - "name": "pageToken", + "in": "path", + "name": "orgId", + "required": true, "schema": { - "description": "Opaque cursor from a previous response's nextPageToken.", + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } }, { "in": "path", - "name": "orgId", + "name": "account", "required": true, "schema": { - "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "minLength": 1, "type": "string" } } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListOrgMembersOutputBody" - } - } - }, - "description": "OK" + "204": { + "description": "No Content" }, "default": { "content": { @@ -6191,44 +7472,725 @@ "sessionAuth": [] } ], - "summary": "List members of an organization", + "summary": "Disconnect an org from a Depot organisation", "tags": [ - "orgs" + "org-ci-webhooks" ] - }, - "post": { - "operationId": "addOrgMember", - "parameters": [ + } + }, + "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/orgs/{orgId}/ci/depot/connections": { + "get": { + "description": "Requires org#manage, like the Buildkite credential list. A Depot connection holds no secret: it is the Depot organisation id this org's repositories enrol against.", + "operationId": "listOrgCIDepotOrganizations", + "parameters": [ + { + "in": "path", + "name": "orgId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOrgCIDepotOrganizationsOutputBody" + } + } + }, + "description": "OK" + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "List an org's connected Depot organisations", + "tags": [ + "org-ci-webhooks" + ] + } + }, + "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/orgs/{orgId}/ci/github-actions/credential": { + "post": { + "description": "Operator-only: requires platform#admin, unlike the Buildkite routes beside it, because GitHub Actions has no enrolment path yet and a credential minted here cannot be used. Mints the inbound webhook credential for one GitHub account: a fresh webhook secret (returned once, in this 201) and the endpoint URL to configure the GitHub webhook with, plus optionally the outbound dispatch api_token (write-only, never returned; has_api_token confirms storage). With api_token, an already-minted github-actions row gets the token stored/rotated instead (200, no secret re-issued).", + "operationId": "mintOrgCIGitHubActionsCredential", + "parameters": [ + { + "in": "path", + "name": "orgId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MintOrgCIGitHubActionsCredentialInputBody" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrgCIGitHubActionsCredentialView" + } + } + }, + "description": "Created" + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Mint an org's GitHub Actions webhook credential", + "tags": [ + "org-ci-webhooks" + ] + } + }, + "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/orgs/{orgId}/invitations": { + "get": { + "operationId": "listOrgInvitations", + "parameters": [ + { + "description": "Maximum entries to return; server may cap further.", + "explode": false, + "in": "query", + "name": "pageSize", + "schema": { + "description": "Maximum entries to return; server may cap further.", + "format": "int32", + "maximum": 500, + "minimum": 0, + "type": "integer" + } + }, + { + "description": "Opaque cursor from a previous response's nextPageToken.", + "explode": false, + "in": "query", + "name": "pageToken", + "schema": { + "description": "Opaque cursor from a previous response's nextPageToken.", + "type": "string" + } + }, + { + "in": "path", + "name": "orgId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + }, + { + "description": "Lifecycle state to return; all returns every state.", + "explode": false, + "in": "query", + "name": "status", + "schema": { + "default": "open", + "description": "Lifecycle state to return; all returns every state.", + "enum": [ + "open", + "accepted", + "revoked", + "expired", + "all" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOrgInvitationsOutputBody" + } + } + }, + "description": "OK" + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "List an organization's invitations", + "tags": [ + "orgs" + ] + }, + "post": { + "operationId": "createOrgInvitation", + "parameters": [ + { + "in": "path", + "name": "orgId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrgInvitationInputBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Invitation" + } + } + }, + "description": "Resent; an open invitation for that address already existed. The role in the body is the invitation's stored role, not the request's." + }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Invitation" + } + } + }, + "description": "Created" + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Invite an address into an organization", + "tags": [ + "orgs" + ] + } + }, + "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/orgs/{orgId}/invitations/{id}": { + "delete": { + "operationId": "revokeOrgInvitation", + "parameters": [ + { + "in": "path", + "name": "orgId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + }, + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Revoke an organization invitation", + "tags": [ + "orgs" + ] + } + }, + "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/orgs/{orgId}/members": { + "get": { + "operationId": "listOrgMembers", + "parameters": [ + { + "description": "Maximum entries to return; server may cap further.", + "explode": false, + "in": "query", + "name": "pageSize", + "schema": { + "description": "Maximum entries to return; server may cap further.", + "format": "int32", + "maximum": 500, + "minimum": 0, + "type": "integer" + } + }, + { + "description": "Opaque cursor from a previous response's nextPageToken.", + "explode": false, + "in": "query", + "name": "pageToken", + "schema": { + "description": "Opaque cursor from a previous response's nextPageToken.", + "type": "string" + } + }, + { + "in": "path", + "name": "orgId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOrgMembersOutputBody" + } + } + }, + "description": "OK" + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "List members of an organization", + "tags": [ + "orgs" + ] + }, + "post": { + "operationId": "addOrgMember", + "parameters": [ + { + "in": "path", + "name": "orgId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddOrgMemberInputBody" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Membership" + } + } + }, + "description": "Created" + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Add a member to an organization", + "tags": [ + "orgs" + ] + } + }, + "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/orgs/{orgId}/members/{membershipId}": { + "patch": { + "operationId": "updateOrgMemberRole", + "parameters": [ + { + "in": "path", + "name": "orgId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + }, + { + "in": "path", + "name": "membershipId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateOrgMemberRoleInputBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Membership" + } + } + }, + "description": "OK" + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Update an organization member's role", + "tags": [ + "orgs" + ] + } + }, + "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/orgs/{orgId}/members/{provider}/{providerUserId}": { + "delete": { + "operationId": "removeOrgMember", + "parameters": [ + { + "in": "path", + "name": "orgId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + }, + { + "in": "path", + "name": "provider", + "required": true, + "schema": { + "minLength": 1, + "type": "string" + } + }, + { + "in": "path", + "name": "providerUserId", + "required": true, + "schema": { + "minLength": 1, + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Remove a member from an organization", + "tags": [ + "orgs" + ] + } + }, + "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/orgs/{orgId}/people": { + "get": { + "description": "Requires organization management permission, not repository pull permission. Returns one row per account with membership metadata and recorded accessScopes, without grant details or editing capabilities. Grants retain each distinct role and origin (membership, direct, team, or github), without inherited expansion or strongest-role collapsing. Repository IDs identify published logical repo groups, not placements. Membership grants include pending and inactive memberships; membership.status describes their lifecycle. GitHub grants use the collaborator read model and can differ from live SpiceDB permissions during reconciliation. This is a roster read model, not an authorization check or complete SpiceDB audit. Management does not imply Git read permission. Snapshot readiness uses the shared GitHub discovery eligibility and 15-minute grace policy. Detached, suspended, sync-blocked, sync-banned, and wholly suspended mirror targets do not block readiness; recorded edges still serve. Overdue eligible snapshots or missing mirror mappings return 503. Filters select people by recorded grants, not inherited roles. Load /people/{accountId}/access when opening an editor; it returns that person's grants and fresh editing capabilities. The list has no full mode. Filters and totalCount apply before cursor pagination; results are ordered by account ID.", + "operationId": "listOrgPeople", + "parameters": [ + { + "description": "Maximum entries to return; server may cap further.", + "explode": false, + "in": "query", + "name": "pageSize", + "schema": { + "description": "Maximum entries to return; server may cap further.", + "format": "int32", + "maximum": 500, + "minimum": 0, + "type": "integer" + } + }, + { + "description": "Opaque cursor from a previous response's nextPageToken.", + "explode": false, + "in": "query", + "name": "pageToken", + "schema": { + "description": "Opaque cursor from a previous response's nextPageToken.", + "type": "string" + } + }, + { + "description": "Select people with a recorded grant at this resource level.", + "explode": false, + "in": "query", + "name": "scope", + "schema": { + "description": "Select people with a recorded grant at this resource level.", + "enum": [ + "organization", + "project", + "repository" + ], + "type": "string" + } + }, + { + "in": "path", + "name": "orgId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + }, + { + "description": "Case-insensitive substring of account ID, public handle, or resource name.", + "explode": false, + "in": "query", + "name": "search", + "schema": { + "description": "Case-insensitive substring of account ID, public handle, or resource name.", + "maxLength": 200, + "type": "string" + } + }, { - "in": "path", - "name": "orgId", - "required": true, + "description": "member includes non-pending memberships; invited means pending; collaborator means no direct membership.", + "explode": false, + "in": "query", + "name": "membership", "schema": { - "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "description": "member includes non-pending memberships; invited means pending; collaborator means no direct membership.", + "enum": [ + "member", + "invited", + "collaborator" + ], "type": "string" } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddOrgMemberInputBody" - } + }, + { + "description": "Direct membership status; collaborators have no membership status.", + "explode": false, + "in": "query", + "name": "status", + "schema": { + "description": "Direct membership status; collaborators have no membership status.", + "enum": [ + "active", + "inactive", + "pending" + ], + "type": "string" } }, - "required": true - }, + { + "description": "Exact recorded grant role, including organization membership and weaker independent grants.", + "explode": false, + "in": "query", + "name": "role", + "schema": { + "description": "Exact recorded grant role, including organization membership and weaker independent grants.", + "enum": [ + "owner", + "admin", + "member", + "reader", + "writer", + "mirror_source_admin" + ], + "type": "string" + } + } + ], "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Membership" + "$ref": "#/components/schemas/ListOrgPeopleOutputBody" } } }, - "description": "Created" + "description": "OK", + "headers": { + "Cache-Control": { + "schema": { + "type": "string" + } + } + } }, "default": { "content": { @@ -6249,15 +8211,16 @@ "sessionAuth": [] } ], - "summary": "Add a member to an organization", + "summary": "List organization members, invitations, and collaborators with scope summaries", "tags": [ "orgs" ] } }, - "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/orgs/{orgId}/members/{provider}/{providerUserId}": { - "delete": { - "operationId": "removeOrgMember", + "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/orgs/{orgId}/people/{accountId}/access": { + "get": { + "description": "Requires organization management permission. Selects the exact account within this organization's roster, not a handle or substring. Returns all recorded grants and fresh caller-specific editing capabilities. Missing or excluded people return 404; incomplete organization read models return 503. Uses global public data only. Mutations independently reauthorize every write.", + "operationId": "getOrgPersonAccess", "parameters": [ { "in": "path", @@ -6270,26 +8233,31 @@ }, { "in": "path", - "name": "provider", - "required": true, - "schema": { - "minLength": 1, - "type": "string" - } - }, - { - "in": "path", - "name": "providerUserId", + "name": "accountId", "required": true, "schema": { - "minLength": 1, + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } } ], "responses": { - "204": { - "description": "No Content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrgPerson" + } + } + }, + "description": "OK", + "headers": { + "Cache-Control": { + "schema": { + "type": "string" + } + } + } }, "default": { "content": { @@ -6310,7 +8278,7 @@ "sessionAuth": [] } ], - "summary": "Remove a member from an organization", + "summary": "Get one organization person's grants and editing capabilities", "tags": [ "orgs" ] @@ -6435,6 +8403,17 @@ "description": "Optional: exact-match project name (case-insensitive).", "type": "string" } + }, + { + "description": "Optional: opaque commit token from a project create or delete, to list at a snapshot that contains that write. Ignored when name is set.", + "explode": false, + "in": "query", + "name": "commitToken", + "schema": { + "description": "Optional: opaque commit token from a project create or delete, to list at a snapshot that contains that write. Ignored when name is set.", + "pattern": "^$|^[A-Za-z0-9_-]{20,512}$", + "type": "string" + } } ], "responses": { @@ -6489,11 +8468,19 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Project" + "$ref": "#/components/schemas/CreatedProject" } } }, - "description": "Created" + "description": "Created", + "headers": { + "X-Entire-Commit-Token": { + "schema": { + "description": "Opaque token to pass as commitToken on the next project list, so this project appears immediately. Absent when none could be minted; list without it.", + "type": "string" + } + } + } }, "default": { "content": { @@ -6520,6 +8507,70 @@ ] } }, + "/projects/resolve/{host}/{project}": { + "get": { + "description": "Case-insensitive lookup by native project name (et) or GitHub owner namespace (gh). Uses project inspect permission, including platform administrators. Missing and inaccessible projects both return 404.", + "operationId": "resolveProject", + "parameters": [ + { + "in": "path", + "name": "host", + "required": true, + "schema": { + "enum": [ + "et", + "gh" + ], + "type": "string" + } + }, + { + "in": "path", + "name": "project", + "required": true, + "schema": { + "maxLength": 39, + "minLength": 1, + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveProjectOutputBody" + } + } + }, + "description": "OK" + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Resolve a canonical project reference", + "tags": [ + "projects" + ] + } + }, "/projects/{projectId}": { "delete": { "operationId": "deleteProject", @@ -6536,7 +8587,15 @@ ], "responses": { "204": { - "description": "No Content" + "description": "No Content", + "headers": { + "X-Entire-Commit-Token": { + "schema": { + "description": "Opaque token to pass as commitToken on the next project list, so this project is gone from it. Absent when none could be minted; list without it.", + "type": "string" + } + } + } }, "default": { "content": { @@ -6629,7 +8688,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GrantProjectAccessInputBody" + "$ref": "#/components/schemas/GrantAccessBody" } } }, @@ -6801,22 +8860,125 @@ "description": "Maximum entries to return; server may cap further.", "explode": false, "in": "query", - "name": "pageSize", + "name": "pageSize", + "schema": { + "description": "Maximum entries to return; server may cap further.", + "format": "int32", + "maximum": 500, + "minimum": 0, + "type": "integer" + } + }, + { + "description": "Opaque cursor from a previous response's nextPageToken.", + "explode": false, + "in": "query", + "name": "pageToken", + "schema": { + "description": "Opaque cursor from a previous response's nextPageToken.", + "type": "string" + } + }, + { + "in": "path", + "name": "projectId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListProjectMembersOutputBody" + } + } + }, + "description": "OK" + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "List project members and their roles", + "tags": [ + "projects" + ] + } + }, + "/projects/{projectId}/people": { + "get": { + "description": "Requires project roster-view permission, held by project managers and source-managed forge members but not ordinary native readers or writers. Returns one account per row with its effective role and merged access sources. Grant managers also receive the mutable direct grant. Search and role filters run before cursor pagination. Results are ordered by effective role (owner, admin, mirror_source_admin, writer, reader, member), then by handle without the provider prefix, ignoring case, then by account ID. Accounts without a handle come last within their role.", + "operationId": "listProjectPeople", + "parameters": [ + { + "description": "Maximum entries to return; server may cap further.", + "explode": false, + "in": "query", + "name": "pageSize", + "schema": { + "description": "Maximum entries to return; server may cap further.", + "format": "int32", + "maximum": 500, + "minimum": 0, + "type": "integer" + } + }, + { + "description": "Opaque cursor from a previous response's nextPageToken.", + "explode": false, + "in": "query", + "name": "pageToken", + "schema": { + "description": "Opaque cursor from a previous response's nextPageToken.", + "type": "string" + } + }, + { + "description": "Case-insensitive substring of account ID or public handle.", + "explode": false, + "in": "query", + "name": "search", "schema": { - "description": "Maximum entries to return; server may cap further.", - "format": "int32", - "maximum": 500, - "minimum": 0, - "type": "integer" + "description": "Case-insensitive substring of account ID or public handle.", + "maxLength": 200, + "type": "string" } }, { - "description": "Opaque cursor from a previous response's nextPageToken.", + "description": "Exact effective role on the selected resource.", "explode": false, "in": "query", - "name": "pageToken", + "name": "role", "schema": { - "description": "Opaque cursor from a previous response's nextPageToken.", + "description": "Exact effective role on the selected resource.", + "enum": [ + "owner", + "admin", + "member", + "reader", + "writer", + "mirror_source_admin" + ], "type": "string" } }, @@ -6835,7 +8997,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListProjectMembersOutputBody" + "$ref": "#/components/schemas/ResourcePeopleOutputBody" } } }, @@ -6860,7 +9022,7 @@ "sessionAuth": [] } ], - "summary": "List project members and their roles", + "summary": "List effective project members", "tags": [ "projects" ] @@ -6911,6 +9073,17 @@ "description": "Optional: exact-match repo name (case-insensitive).", "type": "string" } + }, + { + "description": "Optional: opaque commit token from a create, to read a snapshot that contains that write.", + "explode": false, + "in": "query", + "name": "commitToken", + "schema": { + "description": "Optional: opaque commit token from a create, to read a snapshot that contains that write.", + "pattern": "^$|^[A-Za-z0-9_-]{60,512}$", + "type": "string" + } } ], "responses": { @@ -7001,6 +9174,17 @@ "type": "string" } }, + { + "description": "Optional: opaque commit token from a create, to read a snapshot that contains that write. Requires filter.", + "explode": false, + "in": "query", + "name": "commitToken", + "schema": { + "description": "Optional: opaque commit token from a create, to read a snapshot that contains that write. Requires filter.", + "pattern": "^$|^[A-Za-z0-9_-]{60,512}$", + "type": "string" + } + }, { "description": "Multi-key sort spec, e.g. org:asc,stars:desc. Keys: name,org,language,candidacy,stars,forks,pushed_at,last_activity_at,last_pushed_at,activity_hotness,checkpoint_count,open_pr_count. A single bare key uses the order param. Encoded into the cursor (authoritative on continuation).", "explode": false, @@ -7097,6 +9281,17 @@ "type": "string" } }, + { + "description": "Exact-match owning project id (ULID). Also accepts projectId[eq]; projectId[ne] is rejected.", + "explode": false, + "in": "query", + "name": "projectId", + "schema": { + "description": "Exact-match owning project id (ULID). Also accepts projectId[eq]; projectId[ne] is rejected.", + "pattern": "^$|^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + }, { "description": "Filter on placement/candidacy lifecycle. inactive requires scope=all. Also accepts status[eq]/status[ne].", "explode": false, @@ -7180,11 +9375,19 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Repo" + "$ref": "#/components/schemas/CreatedRepo" } } }, - "description": "Created" + "description": "Created", + "headers": { + "X-Entire-Commit-Token": { + "schema": { + "description": "Opaque token to pass as commitToken on the next repo resolve, so this repo resolves immediately.", + "type": "string" + } + } + } }, "default": { "content": { @@ -7519,7 +9722,15 @@ ], "responses": { "204": { - "description": "No Content" + "description": "No Content", + "headers": { + "X-Entire-Commit-Token": { + "schema": { + "description": "Opaque token to pass as commitToken on the next repo listing, so this repo is gone from it. Absent when none could be minted; list without it.", + "type": "string" + } + } + } }, "default": { "content": { @@ -7855,6 +10066,137 @@ ] } }, + "/repos/{repoId}/ci-deliveries": { + "get": { + "description": "Recent deliveries, newest first. direction=outbound (default) is what Entire sent the repo's CI when refs changed; direction=inbound is what that CI sent back.", + "operationId": "listRepoCIDeliveries", + "parameters": [ + { + "in": "path", + "name": "repoId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + }, + { + "explode": false, + "in": "query", + "name": "direction", + "schema": { + "enum": [ + "outbound", + "inbound" + ], + "type": "string" + } + }, + { + "explode": false, + "in": "query", + "name": "limit", + "schema": { + "format": "int64", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListRepoCIDeliveriesOutputBody" + } + } + }, + "description": "OK" + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "List a repo's webhook deliveries", + "tags": [ + "ci-webhooks" + ] + } + }, + "/repos/{repoId}/ci-deliveries/{id}": { + "get": { + "description": "The id is the opaque value from a list response. A payload is absent once its day has been swept (payload_absent=swept) or when no request was ever built (payload_absent=no_request).", + "operationId": "getRepoCIDelivery", + "parameters": [ + { + "in": "path", + "name": "repoId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + }, + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CIDeliveryDetailView" + } + } + }, + "description": "OK" + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Get one delivery and its wire payloads", + "tags": [ + "ci-webhooks" + ] + } + }, "/repos/{repoId}/ci-webhooks": { "get": { "operationId": "listRepoCIWebhooks", @@ -8097,7 +10439,7 @@ }, "/repos/{repoId}/ci-webhooks/{id}": { "delete": { - "description": "Deletes the subscription AND tears down its enrollment identity: the automation row (when no sibling repo shares it), its expiring repo grant, and its Buildkite OIDC binding. The Buildkite pipeline itself is always kept. Pass keep_identity=true to delete only the subscription — for an immediate re-enroll that must preserve automation_id, since teardown retires it and a re-enroll declares a new one that only bk_force_rescaffold pushes into the pipeline. A retained identity holds read access on this repo until its grant lapses. A subscription enrolled before the automation principal has no automation to retire: the delete succeeds and removes only the subscription, reported as identity_retired=false on the ci_webhook_deleted audit event — the list an operator queries to hand-delete the leftover service accounts.", + "description": "Deletes the subscription and clears this repo's own enrolment marker. This does NOT immediately revoke the automation's access to the repo: that access normally continues, on its existing expiry, in the background. Pass keep_identity=true to leave the marker untouched too — for an immediate re-enroll, which always resumes the same automation_id either way. The Buildkite pipeline is always kept.", "operationId": "deleteRepoCIWebhook", "parameters": [ { @@ -8383,7 +10725,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GrantRepoAccessInputBody" + "$ref": "#/components/schemas/GrantAccessBody" } } }, @@ -8714,6 +11056,109 @@ ] } }, + "/repos/{repoId}/people": { + "get": { + "description": "Returns one account per row with its effective role and merged access sources. Grant managers also receive the mutable direct grant. Search and role filters run before cursor pagination. Results are ordered by effective role (owner, admin, mirror_source_admin, writer, reader, member), then by handle without the provider prefix, ignoring case, then by account ID. Accounts without a handle come last within their role.", + "operationId": "listRepoPeople", + "parameters": [ + { + "description": "Maximum entries to return; server may cap further.", + "explode": false, + "in": "query", + "name": "pageSize", + "schema": { + "description": "Maximum entries to return; server may cap further.", + "format": "int32", + "maximum": 500, + "minimum": 0, + "type": "integer" + } + }, + { + "description": "Opaque cursor from a previous response's nextPageToken.", + "explode": false, + "in": "query", + "name": "pageToken", + "schema": { + "description": "Opaque cursor from a previous response's nextPageToken.", + "type": "string" + } + }, + { + "description": "Case-insensitive substring of account ID or public handle.", + "explode": false, + "in": "query", + "name": "search", + "schema": { + "description": "Case-insensitive substring of account ID or public handle.", + "maxLength": 200, + "type": "string" + } + }, + { + "description": "Exact effective role on the selected resource.", + "explode": false, + "in": "query", + "name": "role", + "schema": { + "description": "Exact effective role on the selected resource.", + "enum": [ + "owner", + "admin", + "member", + "reader", + "writer", + "mirror_source_admin" + ], + "type": "string" + } + }, + { + "in": "path", + "name": "repoId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResourcePeopleOutputBody" + } + } + }, + "description": "OK" + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Error" + } + }, + "security": [ + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "List effective repository members", + "tags": [ + "repos" + ] + } + }, "/repos/{repoId}/visibility": { "get": { "operationId": "getRepoVisibility", diff --git a/internal/coreapi/spec/core.openapi.json b/internal/coreapi/spec/core.openapi.json index 2fcca285f3..2ea6e34ff9 100644 --- a/internal/coreapi/spec/core.openapi.json +++ b/internal/coreapi/spec/core.openapi.json @@ -1,6 +1,57 @@ { "components": { "schemas": { + "AcceptInvitationInputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/AcceptInvitationInputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "token": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "token" + ], + "type": "object" + }, + "AcceptedInvitation": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/AcceptedInvitation.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "membership": { + "$ref": "#/components/schemas/Membership" + }, + "orgId": { + "type": "string" + }, + "orgName": { + "type": "string" + } + }, + "required": [ + "orgId", + "orgName", + "membership" + ], + "type": "object" + }, "AddOrgMemberInputBody": { "additionalProperties": true, "properties": { @@ -197,6 +248,23 @@ ], "type": "object" }, + "BranchRuleUpdate": { + "additionalProperties": true, + "properties": { + "ref": { + "description": "\"HEAD\" or a refs/heads/ name, fnmatch wildcards allowed.", + "type": "string" + }, + "serverSideMergeOnly": { + "description": "Sets the level: true for server-side merge only, false for protected. Omit to keep an existing rule's level.", + "type": "boolean" + } + }, + "required": [ + "ref" + ], + "type": "object" + }, "CIBuildView": { "additionalProperties": true, "properties": { @@ -283,6 +351,279 @@ ], "type": "object" }, + "CIDeliveryDetailView": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/CIDeliveryDetailView.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "account": { + "description": "Vendor account (Buildkite org, Depot org)", + "type": "string" + }, + "at": { + "description": "When the delivery started or arrived (UTC)", + "format": "date-time", + "type": "string" + }, + "attempt_count": { + "description": "Attempts made; outbound only", + "format": "int64", + "type": "integer" + }, + "completed_at": { + "description": "When an outbound delivery reached a terminal state (UTC)", + "format": "date-time", + "type": "string" + }, + "direction": { + "description": "outbound or inbound", + "type": "string" + }, + "display_name": { + "description": "Subscription display name", + "type": "string" + }, + "duration_ms": { + "description": "How long the delivery took, milliseconds", + "format": "int64", + "type": "integer" + }, + "event": { + "description": "Vendor event type, e.g. build.finished", + "type": "string" + }, + "http_status": { + "description": "HTTP status, absent when no request was made", + "format": "int64", + "type": "integer" + }, + "id": { + "description": "Opaque delivery id; pass to the delivery detail route", + "type": "string" + }, + "new_target": { + "description": "Content identity after the change", + "type": "string" + }, + "old_target": { + "description": "Content identity before the change", + "type": "string" + }, + "outcome": { + "description": "Five-valued outcome; the vocabularies differ by direction", + "type": "string" + }, + "payload": { + "$ref": "#/components/schemas/CIDeliveryPayloadView", + "description": "Absent when swept or never stored" + }, + "payload_absent": { + "description": "swept or no_request; empty when a payload is present", + "type": "string" + }, + "provider": { + "description": "CI provider registry name", + "type": "string" + }, + "ref": { + "description": "Ref that moved", + "type": "string" + }, + "ref_op": { + "description": "Ref operation. Empty means unknown — never guess it from the targets", + "type": "string" + }, + "repo_id": { + "description": "Repository ULID, empty when the delivery resolved to no enrolment", + "type": "string" + }, + "state": { + "description": "Outbound dispatch state", + "type": "string" + }, + "subscription_id": { + "description": "Subscription ULID, empty when none was resolved", + "type": "string" + }, + "target": { + "description": "Vendor target (Buildkite pipeline, Depot run label)", + "type": "string" + }, + "wire_request_id": { + "description": "The vendor's own id for this delivery", + "type": "string" + } + }, + "required": [ + "id", + "direction", + "provider", + "outcome", + "at" + ], + "type": "object" + }, + "CIDeliveryPayloadView": { + "additionalProperties": true, + "properties": { + "endpoint": { + "description": "Where the request went, or the path it arrived on", + "type": "string" + }, + "from_attempt": { + "description": "Which attempt these bytes came from; compare with attempt_count", + "format": "int64", + "type": "integer" + }, + "request_body": { + "description": "Request body as stored", + "type": "string" + }, + "request_headers": { + "additionalProperties": { + "type": "string" + }, + "description": "Stored request headers; an allowlist, signatures truncated", + "type": "object" + }, + "request_truncated": { + "description": "Request body is at the 16 KiB cap and may be cut", + "type": "boolean" + }, + "response_body": { + "description": "Response body as stored", + "type": "string" + }, + "response_present": { + "description": "False means no response arrived, not that it was empty", + "type": "boolean" + }, + "response_truncated": { + "description": "Response body is at the 16 KiB cap and may be cut", + "type": "boolean" + } + }, + "required": [ + "endpoint", + "request_headers", + "request_body", + "response_body", + "response_present", + "request_truncated", + "response_truncated", + "from_attempt" + ], + "type": "object" + }, + "CIDeliveryView": { + "additionalProperties": true, + "properties": { + "account": { + "description": "Vendor account (Buildkite org, Depot org)", + "type": "string" + }, + "at": { + "description": "When the delivery started or arrived (UTC)", + "format": "date-time", + "type": "string" + }, + "attempt_count": { + "description": "Attempts made; outbound only", + "format": "int64", + "type": "integer" + }, + "completed_at": { + "description": "When an outbound delivery reached a terminal state (UTC)", + "format": "date-time", + "type": "string" + }, + "direction": { + "description": "outbound or inbound", + "type": "string" + }, + "display_name": { + "description": "Subscription display name", + "type": "string" + }, + "duration_ms": { + "description": "How long the delivery took, milliseconds", + "format": "int64", + "type": "integer" + }, + "event": { + "description": "Vendor event type, e.g. build.finished", + "type": "string" + }, + "http_status": { + "description": "HTTP status, absent when no request was made", + "format": "int64", + "type": "integer" + }, + "id": { + "description": "Opaque delivery id; pass to the delivery detail route", + "type": "string" + }, + "new_target": { + "description": "Content identity after the change", + "type": "string" + }, + "old_target": { + "description": "Content identity before the change", + "type": "string" + }, + "outcome": { + "description": "Five-valued outcome; the vocabularies differ by direction", + "type": "string" + }, + "provider": { + "description": "CI provider registry name", + "type": "string" + }, + "ref": { + "description": "Ref that moved", + "type": "string" + }, + "ref_op": { + "description": "Ref operation. Empty means unknown — never guess it from the targets", + "type": "string" + }, + "repo_id": { + "description": "Repository ULID, empty when the delivery resolved to no enrolment", + "type": "string" + }, + "state": { + "description": "Outbound dispatch state", + "type": "string" + }, + "subscription_id": { + "description": "Subscription ULID, empty when none was resolved", + "type": "string" + }, + "target": { + "description": "Vendor target (Buildkite pipeline, Depot run label)", + "type": "string" + }, + "wire_request_id": { + "description": "The vendor's own id for this delivery", + "type": "string" + } + }, + "required": [ + "id", + "direction", + "provider", + "outcome", + "at" + ], + "type": "object" + }, "CIJobView": { "additionalProperties": true, "properties": { @@ -579,6 +920,9 @@ "provider": { "type": "string" }, + "provider_account": { + "type": "string" + }, "publish_checks": { "type": "boolean" }, @@ -588,6 +932,12 @@ "repo_id": { "type": "string" }, + "repo_write": { + "type": "boolean" + }, + "target_ref": { + "type": "string" + }, "updated_at": { "format": "date-time", "type": "string" @@ -600,10 +950,13 @@ "display_name", "bk_organization", "bk_pipeline", + "provider_account", + "target_ref", "ref_filter", "events", "enabled", "publish_checks", + "repo_write", "created_at", "updated_at" ], @@ -685,6 +1038,29 @@ ], "type": "object" }, + "ConnectOrgCIDepotOrganizationInputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/ConnectOrgCIDepotOrganizationInputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "account": { + "description": "Depot organisation id, as Depot's provisioning call returns it", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "account" + ], + "type": "object" + }, "CreateBindingInputBody": { "additionalProperties": true, "properties": { @@ -710,13 +1086,13 @@ ], "type": "object" }, - "CreateMirrorInputBody": { + "CreateMirrorRequestInputBody": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/CreateMirrorInputBody.json" + "/api/v1/schemas/CreateMirrorRequestInputBody.json" ], "format": "uri", "readOnly": true, @@ -750,93 +1126,85 @@ ], "type": "object" }, - "CreateMirrorRequestInputBody": { + "CreateNativeMirrorInputBody": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/CreateMirrorRequestInputBody.json" + "/api/v1/schemas/CreateNativeMirrorInputBody.json" ], "format": "uri", "readOnly": true, "type": "string" }, - "clusterHost": { - "description": "Destination cluster, as either a bare DNS host or the publicUrl returned by GET /api/v1/clusters.", - "minLength": 1, - "type": "string" - }, - "owner": { - "minLength": 1, - "type": "string" - }, - "provider": { - "enum": [ - "github" - ], - "type": "string" - }, - "repo": { + "clusterSlug": { "minLength": 1, "type": "string" } }, "required": [ - "provider", - "owner", - "repo", - "clusterHost" + "clusterSlug" ], "type": "object" }, - "CreateNativeMirrorInputBody": { + "CreateOrgInputBody": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/CreateNativeMirrorInputBody.json" + "/api/v1/schemas/CreateOrgInputBody.json" ], "format": "uri", "readOnly": true, "type": "string" }, - "clusterSlug": { + "name": { + "description": "Display name.", + "maxLength": 100, "minLength": 1, "type": "string" + }, + "region": { + "description": "Jurisdiction slug; defaults to the server's home jurisdiction.", + "type": "string" } }, "required": [ - "clusterSlug" + "name" ], "type": "object" }, - "CreateOrgInputBody": { + "CreateOrgInvitationInputBody": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/CreateOrgInputBody.json" + "/api/v1/schemas/CreateOrgInvitationInputBody.json" ], "format": "uri", "readOnly": true, "type": "string" }, - "name": { - "description": "Display name.", - "maxLength": 100, - "minLength": 1, + "email": { + "format": "email", "type": "string" }, - "region": { - "description": "Jurisdiction slug; defaults to the server's home jurisdiction.", + "role": { + "default": "member", + "enum": [ + "owner", + "admin", + "member" + ], "type": "string" } }, "required": [ - "name" + "email", + "role" ], "type": "object" }, @@ -931,6 +1299,9 @@ "provider": { "type": "string" }, + "provider_account": { + "type": "string" + }, "publish_checks": { "type": "boolean" }, @@ -940,10 +1311,16 @@ "repo_id": { "type": "string" }, + "repo_write": { + "type": "boolean" + }, "setup": { "$ref": "#/components/schemas/CISetupBlock", "description": "What to do next, rendered ready to use. Present on a self-managed enrolment." }, + "target_ref": { + "type": "string" + }, "updated_at": { "format": "date-time", "type": "string" @@ -959,10 +1336,13 @@ "display_name", "bk_organization", "bk_pipeline", + "provider_account", + "target_ref", "ref_filter", "events", "enabled", "publish_checks", + "repo_write", "created_at", "updated_at" ], @@ -1054,7 +1434,7 @@ "type": "string" }, "clusterHost": { - "description": "Public host of the cluster to pin the repo to (e.g. royalcanin.partial.to); empty lands on the jurisdiction default.", + "description": "Public host of the cluster to pin the repo to (e.g. royalcanin.partial.to); must be in the project's processing cell. Empty takes that cell's cluster.", "type": "string" }, "name": { @@ -1107,47 +1487,233 @@ ], "type": "object" }, - "CreatedMirror": { + "CreatedOrg": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/CreatedMirror.json" + "/api/v1/schemas/CreatedOrg.json" ], "format": "uri", "readOnly": true, "type": "string" }, - "created": { - "description": "true on fresh creation; false when an existing mirror was returned.", - "type": "boolean" + "capabilities": { + "$ref": "#/components/schemas/OrgCapabilities" + }, + "commitToken": { + "deprecated": true, + "description": "Deprecated: read the X-Entire-Commit-Token response header instead.", + "type": "string" + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "workosOrganizationId": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "region", + "createdAt", + "capabilities" + ], + "type": "object" + }, + "CreatedProject": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/CreatedProject.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "apiUrl": { + "description": "Public entire-api base URL for the assigned cell. Empty when unassigned or routing is unavailable; do not fall back to another cell.", + "type": "string" + }, + "capabilities": { + "$ref": "#/components/schemas/ProjectCapabilities" + }, + "commitToken": { + "deprecated": true, + "description": "Deprecated: read the X-Entire-Commit-Token response header instead.", + "type": "string" + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "ownerId": { + "type": "string" + }, + "ownerName": { + "type": "string" }, - "empty": { - "description": "Deprecated: always false. Poll the mirror status instead — an empty upstream still reaches 'ready'.", + "ownerType": { + "enum": [ + "org", + "account" + ], + "type": "string" + }, + "primaryProcessingCell": { + "description": "Stored processing cell ID, not a cluster slug. Empty when the project is unassigned.", + "type": "string" + }, + "region": { + "type": "string" + }, + "repositoryCount": { + "description": "Published logical repositories in paginated project listings. Omitted without project-wide view permission or when unavailable.", + "format": "int64", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "id", + "name", + "ownerType", + "ownerId", + "region", + "createdAt", + "capabilities" + ], + "type": "object" + }, + "CreatedRepo": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/CreatedRepo.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "capabilities": { + "$ref": "#/components/schemas/RepoCapabilities" + }, + "clusterHost": { + "type": "string" + }, + "clusterSlug": { + "type": "string" + }, + "commitToken": { + "deprecated": true, + "description": "Deprecated: read the X-Entire-Commit-Token response header instead.", + "type": "string" + }, + "foreign": { "type": "boolean" }, - "mirrorId": { + "fullName": { "type": "string" }, - "mirrorUrl": { + "id": { "type": "string" }, - "publicUrl": { + "jurisdiction": { "type": "string" }, - "suspended": { - "description": "true when an existing placement was returned that an admin suspended.", + "mirrorSuspended": { "type": "boolean" + }, + "mirrorSuspendedAt": { + "type": "string" + }, + "name": { + "type": "string" + }, + "objectFormat": { + "enum": [ + "sha1", + "sha256" + ], + "type": "string" + }, + "owningProjectId": { + "type": "string" + }, + "path": { + "type": "string" + }, + "placements": { + "items": { + "$ref": "#/components/schemas/RepoPlacement" + }, + "type": "array" + }, + "primaries": { + "$ref": "#/components/schemas/RepoPrimaries" + }, + "provider": { + "enum": [ + "github", + "entire" + ], + "type": "string" + }, + "provisionAttempts": { + "format": "int64", + "type": "integer" + }, + "provisionReason": { + "type": "string" + }, + "repoGroupId": { + "type": "string" + }, + "state": { + "description": "Provisioning lifecycle. A mirror is active from creation, before its initial clone completes.", + "enum": [ + "provisioning", + "active", + "failed" + ], + "type": "string" + }, + "visibility": { + "enum": [ + "public", + "private" + ], + "type": "string" } }, "required": [ - "mirrorId", - "mirrorUrl", - "publicUrl", - "created", - "empty", - "suspended" + "id", + "owningProjectId", + "name", + "provider", + "capabilities" ], "type": "object" }, @@ -1467,59 +2033,13 @@ ], "type": "object" }, - "GetPermissionsOutputBody": { + "GetRepoVisibilityOutputBody": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/GetPermissionsOutputBody.json" - ], - "format": "uri", - "readOnly": true, - "type": "string" - }, - "explain": { - "additionalProperties": {}, - "type": "object" - }, - "permissions": { - "items": { - "enum": [ - "manage", - "view", - "read", - "write", - "push", - "pull", - "create_repo", - "admin", - "admin_read" - ], - "type": "string" - }, - "type": "array" - }, - "resourceId": { - "type": "string" - }, - "resourceType": { - "type": "string" - } - }, - "required": [ - "resourceType", - "resourceId" - ], - "type": "object" - }, - "GetRepoVisibilityOutputBody": { - "additionalProperties": true, - "properties": { - "$schema": { - "description": "A URL to the JSON Schema for this object.", - "examples": [ - "/api/v1/schemas/GetRepoVisibilityOutputBody.json" + "/api/v1/schemas/GetRepoVisibilityOutputBody.json" ], "format": "uri", "readOnly": true, @@ -1592,62 +2112,52 @@ ], "type": "object" }, - "GrantProjectAccessInputBody": { + "GitHubInstallation": { "additionalProperties": true, "properties": { - "$schema": { - "description": "A URL to the JSON Schema for this object.", - "examples": [ - "/api/v1/schemas/GrantProjectAccessInputBody.json" - ], - "format": "uri", - "readOnly": true, + "accountLogin": { "type": "string" }, - "granteeType": { - "default": "account", + "accountType": { "enum": [ - "account" + "user", + "organization" ], "type": "string" }, - "provider": { - "minLength": 1, - "type": "string" - }, - "providerUserId": { - "minLength": 1, + "id": { "type": "string" }, - "role": { + "state": { "enum": [ - "reader", - "writer", - "admin" + "active", + "suspended" ], "type": "string" } }, "required": [ - "provider", - "providerUserId", - "role" + "id", + "accountLogin", + "accountType", + "state" ], "type": "object" }, - "GrantProjectAccessOutputBody": { + "GitHubInstallations": { "additionalProperties": true, "properties": { - "$schema": { - "description": "A URL to the JSON Schema for this object.", - "examples": [ - "/api/v1/schemas/GrantProjectAccessOutputBody.json" - ], - "format": "uri", - "readOnly": true, - "type": "string" + "items": { + "items": { + "$ref": "#/components/schemas/GitHubInstallation" + }, + "type": "array" }, "status": { + "enum": [ + "ok", + "unavailable" + ], "type": "string" } }, @@ -1656,18 +2166,23 @@ ], "type": "object" }, - "GrantRepoAccessInputBody": { + "GrantAccessBody": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/GrantRepoAccessInputBody.json" + "/api/v1/schemas/GrantAccessBody.json" ], "format": "uri", "readOnly": true, "type": "string" }, + "accountId": { + "description": "Entire account ULID to grant directly. Mutually exclusive with provider/providerUserId; the account must exist.", + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + }, "granteeType": { "default": "account", "enum": [ @@ -1676,10 +2191,12 @@ "type": "string" }, "provider": { + "description": "Legacy identity selector; requires providerUserId and must not be combined with accountId.", "minLength": 1, "type": "string" }, "providerUserId": { + "description": "Legacy provider user ID; requires provider and must not be combined with accountId.", "minLength": 1, "type": "string" }, @@ -1693,12 +2210,31 @@ } }, "required": [ - "provider", - "providerUserId", "role" ], "type": "object" }, + "GrantProjectAccessOutputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/GrantProjectAccessOutputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "status": { + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + }, "GrantRepoAccessOutputBody": { "additionalProperties": true, "properties": { @@ -1780,6 +2316,79 @@ ], "type": "object" }, + "Invitation": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/Invitation.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "acceptedAt": { + "format": "date-time", + "type": "string" + }, + "acceptedBy": { + "description": "Account ID that used the token. Empty until the invitation is accepted.", + "type": "string" + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "email": { + "description": "The invited address, normalized to lowercase.", + "type": "string" + }, + "expiresAt": { + "format": "date-time", + "type": "string" + }, + "id": { + "type": "string" + }, + "invitedBy": { + "description": "Account ID of the manager who created the invitation.", + "type": "string" + }, + "revokedAt": { + "format": "date-time", + "type": "string" + }, + "role": { + "enum": [ + "owner", + "admin", + "member" + ], + "type": "string" + }, + "status": { + "description": "Derived from the outcome columns at read time.", + "enum": [ + "open", + "accepted", + "revoked", + "expired" + ], + "type": "string" + } + }, + "required": [ + "id", + "email", + "role", + "status", + "invitedBy", + "createdAt", + "expiresAt" + ], + "type": "object" + }, "ListAuditEventsOutputBody": { "additionalProperties": true, "properties": { @@ -1825,10 +2434,14 @@ "$ref": "#/components/schemas/AvailableMirror" }, "type": "array" + }, + "githubInstallations": { + "$ref": "#/components/schemas/GitHubInstallations" } }, "required": [ - "available" + "available", + "githubInstallations" ], "type": "object" }, @@ -2036,6 +2649,58 @@ ], "type": "object" }, + "ListOrgCIDepotOrganizationsOutputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/ListOrgCIDepotOrganizationsOutputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "connections": { + "items": { + "$ref": "#/components/schemas/OrgCIDepotConnectionView" + }, + "type": "array" + } + }, + "required": [ + "connections" + ], + "type": "object" + }, + "ListOrgInvitationsOutputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/ListOrgInvitationsOutputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "invitations": { + "items": { + "$ref": "#/components/schemas/Invitation" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Pass back to fetch the next page; empty when no more entries.", + "type": "string" + } + }, + "required": [ + "invitations" + ], + "type": "object" + }, "ListOrgMembersOutputBody": { "additionalProperties": true, "properties": { @@ -2064,6 +2729,39 @@ ], "type": "object" }, + "ListOrgPeopleOutputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/ListOrgPeopleOutputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "items": { + "items": { + "$ref": "#/components/schemas/OrgPersonSummary" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Pass back to fetch the next page; empty when no more entries.", + "type": "string" + }, + "totalCount": { + "format": "int64", + "type": "integer" + } + }, + "required": [ + "items", + "totalCount" + ], + "type": "object" + }, "ListOrgProjectsOutputBody": { "additionalProperties": true, "properties": { @@ -2228,6 +2926,30 @@ ], "type": "object" }, + "ListRepoCIDeliveriesOutputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/ListRepoCIDeliveriesOutputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "deliveries": { + "items": { + "$ref": "#/components/schemas/CIDeliveryView" + }, + "type": "array" + } + }, + "required": [ + "deliveries" + ], + "type": "object" + }, "ListRepoCIProvidersOutputBody": { "additionalProperties": true, "properties": { @@ -2663,10 +3385,21 @@ "type": "string" }, "role": { + "enum": [ + "owner", + "admin", + "member" + ], "type": "string" }, "status": { - "type": "string" + "description": "Membership lifecycle status.", + "enum": [ + "active", + "inactive", + "pending" + ], + "type": "string" }, "workosOrgMembershipId": { "type": "string" @@ -2733,16 +3466,16 @@ "format": "date-time", "type": "string" }, - "installationId": { - "format": "int64", - "type": "integer" - }, "isArchived": { "type": "boolean" }, "isPrivate": { "type": "boolean" }, + "isProcessingPrimary": { + "description": "True when this placement does its repo group's per-event work. Removing it is refused while other placements remain.", + "type": "boolean" + }, "jurisdiction": { "type": "string" }, @@ -3138,6 +3871,39 @@ ], "type": "object" }, + "OrgCIDepotConnectionView": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/OrgCIDepotConnectionView.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "account": { + "type": "string" + }, + "connected_at": { + "format": "date-time", + "type": "string" + }, + "owner": { + "type": "string" + }, + "provider": { + "type": "string" + } + }, + "required": [ + "provider", + "account", + "owner" + ], + "type": "object" + }, "OrgCIGitHubActionsCredentialView": { "additionalProperties": true, "properties": { @@ -3185,6 +3951,10 @@ "OrgCapabilities": { "additionalProperties": true, "properties": { + "canChangeOwners": { + "description": "Whether the caller holds the direct organization owner relation. Individual mutations still enforce all guards.", + "type": "boolean" + }, "canCreateProject": { "type": "boolean" }, @@ -3198,7 +3968,192 @@ "required": [ "canCreateProject", "canManageMembers", - "canDelete" + "canDelete", + "canChangeOwners" + ], + "type": "object" + }, + "OrgPerson": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/OrgPerson.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "accountId": { + "type": "string" + }, + "avatarUrl": { + "type": "string" + }, + "grants": { + "items": { + "$ref": "#/components/schemas/OrgPersonGrant" + }, + "type": "array" + }, + "handle": { + "type": "string" + }, + "membership": { + "$ref": "#/components/schemas/OrgPersonMembership" + }, + "provider": { + "type": "string" + } + }, + "required": [ + "accountId", + "membership", + "grants" + ], + "type": "object" + }, + "OrgPersonGrant": { + "additionalProperties": true, + "properties": { + "capabilities": { + "$ref": "#/components/schemas/OrgPersonGrantCapabilities" + }, + "resourceId": { + "description": "Organization ID, project ID, or logical repo-group ID (not a placement ID).", + "type": "string" + }, + "resourceName": { + "type": "string" + }, + "resourceType": { + "enum": [ + "organization", + "project", + "repository" + ], + "type": "string" + }, + "role": { + "enum": [ + "owner", + "admin", + "member", + "reader", + "writer", + "mirror_source_admin" + ], + "type": "string" + }, + "source": { + "description": "Origin at this resource level; inherited access is not included.", + "enum": [ + "membership", + "direct", + "team", + "github" + ], + "type": "string" + } + }, + "required": [ + "resourceType", + "resourceId", + "resourceName", + "role", + "source", + "capabilities" + ], + "type": "object" + }, + "OrgPersonGrantCapabilities": { + "additionalProperties": true, + "properties": { + "allowedRoles": { + "description": "Roles the caller may request. An empty array means read-only.", + "items": { + "enum": [ + "owner", + "admin", + "member", + "writer", + "reader" + ], + "type": "string" + }, + "type": "array" + }, + "targetId": { + "description": "ID for the existing role mutation: membership ID, project ID, or native primary repo placement ID. Present only when roles are editable.", + "type": "string" + } + }, + "required": [ + "allowedRoles" + ], + "type": "object" + }, + "OrgPersonMembership": { + "additionalProperties": true, + "properties": { + "createdAt": { + "format": "date-time", + "type": "string" + }, + "id": { + "type": "string" + }, + "role": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "required": [ + "id", + "role", + "status", + "createdAt" + ], + "type": "object" + }, + "OrgPersonSummary": { + "additionalProperties": true, + "properties": { + "accessScopes": { + "description": "Recorded grant levels, not effective permissions.", + "items": { + "enum": [ + "organization", + "project", + "repository" + ], + "type": "string" + }, + "type": "array" + }, + "accountId": { + "type": "string" + }, + "avatarUrl": { + "type": "string" + }, + "handle": { + "type": "string" + }, + "membership": { + "$ref": "#/components/schemas/OrgPersonMembership" + }, + "provider": { + "type": "string" + } + }, + "required": [ + "accountId", + "membership", + "accessScopes" ], "type": "object" }, @@ -3231,8 +4186,33 @@ }, "ref_filter": { "type": "string" + }, + "repo_write": { + "type": "boolean" + } + }, + "type": "object" + }, + "PreviewInvitationInputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/PreviewInvitationInputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "token": { + "minLength": 1, + "type": "string" } }, + "required": [ + "token" + ], "type": "object" }, "Project": { @@ -3247,6 +4227,10 @@ "readOnly": true, "type": "string" }, + "apiUrl": { + "description": "Public entire-api base URL for the assigned cell. Empty when unassigned or routing is unavailable; do not fall back to another cell.", + "type": "string" + }, "capabilities": { "$ref": "#/components/schemas/ProjectCapabilities" }, @@ -3273,8 +4257,18 @@ ], "type": "string" }, + "primaryProcessingCell": { + "description": "Stored processing cell ID, not a cluster slug. Empty when the project is unassigned.", + "type": "string" + }, "region": { "type": "string" + }, + "repositoryCount": { + "description": "Published logical repositories in paginated project listings. Omitted without project-wide view permission or when unavailable.", + "format": "int64", + "minimum": 0, + "type": "integer" } }, "required": [ @@ -3339,6 +4333,26 @@ ], "type": "object" }, + "ProjectReference": { + "additionalProperties": true, + "properties": { + "host": { + "enum": [ + "et", + "gh" + ], + "type": "string" + }, + "project": { + "type": "string" + } + }, + "required": [ + "host", + "project" + ], + "type": "object" + }, "RegisterOrgCIBuildkiteClusterInputBody": { "additionalProperties": true, "properties": { @@ -3427,6 +4441,12 @@ "path": { "type": "string" }, + "placements": { + "items": { + "$ref": "#/components/schemas/RepoPlacement" + }, + "type": "array" + }, "primaries": { "$ref": "#/components/schemas/RepoPrimaries" }, @@ -3524,6 +4544,12 @@ "type": "string" }, "role": { + "description": "Display tier. Admin includes GitHub settings administrators and does not imply permission to manage grants.", + "enum": [ + "reader", + "writer", + "admin" + ], "type": "string" } }, @@ -3731,6 +4757,9 @@ "RepoPlacement": { "additionalProperties": true, "properties": { + "apiBaseUrl": { + "type": "string" + }, "cell": { "type": "string" }, @@ -3882,28 +4911,53 @@ ], "type": "object" }, - "ResolveRepoIDsInputBody": { + "ResolveProjectOutputBody": { "additionalProperties": true, "properties": { "$schema": { "description": "A URL to the JSON Schema for this object.", "examples": [ - "/api/v1/schemas/ResolveRepoIDsInputBody.json" + "/api/v1/schemas/ResolveProjectOutputBody.json" ], "format": "uri", "readOnly": true, "type": "string" }, - "repoIds": { - "items": { - "type": "string" - }, - "maxItems": 100, - "type": "array" + "project": { + "$ref": "#/components/schemas/Project" + }, + "reference": { + "$ref": "#/components/schemas/ProjectReference" } }, "required": [ - "repoIds" + "project", + "reference" + ], + "type": "object" + }, + "ResolveRepoIDsInputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/ResolveRepoIDsInputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "repoIds": { + "items": { + "type": "string" + }, + "maxItems": 100, + "type": "array" + } + }, + "required": [ + "repoIds" ], "type": "object" }, @@ -3943,6 +4997,14 @@ "readOnly": true, "type": "string" }, + "commitToken": { + "pattern": "^$|^[A-Za-z0-9_-]{60,512}$", + "type": "string" + }, + "recheckDeniedPermissions": { + "description": "Retry stale permission denials for navigation. Defaults to false for list enrichment. Failed retries retain denials; a commitToken authorization revision takes precedence.", + "type": "boolean" + }, "repositories": { "items": { "$ref": "#/components/schemas/RepoReference" @@ -4037,6 +5099,136 @@ ], "type": "object" }, + "ResourcePeopleOutputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/ResourcePeopleOutputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "items": { + "items": { + "$ref": "#/components/schemas/ResourcePerson" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Pass back to fetch the next page; empty when no more entries.", + "type": "string" + }, + "totalCount": { + "format": "int64", + "type": "integer" + } + }, + "required": [ + "items", + "totalCount" + ], + "type": "object" + }, + "ResourcePerson": { + "additionalProperties": true, + "properties": { + "accountId": { + "type": "string" + }, + "avatarUrl": { + "type": "string" + }, + "directGrant": { + "$ref": "#/components/schemas/ResourcePersonDirectGrant" + }, + "handle": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "role": { + "type": "string" + }, + "sources": { + "items": { + "$ref": "#/components/schemas/ResourcePersonSource" + }, + "type": "array" + } + }, + "required": [ + "accountId", + "role", + "directGrant", + "sources" + ], + "type": "object" + }, + "ResourcePersonDirectGrant": { + "additionalProperties": true, + "properties": { + "role": { + "enum": [ + "owner", + "admin", + "member", + "reader", + "writer", + "mirror_source_admin" + ], + "type": "string" + }, + "source": { + "enum": [ + "membership", + "direct" + ], + "type": "string" + } + }, + "required": [ + "role", + "source" + ], + "type": "object" + }, + "ResourcePersonSource": { + "additionalProperties": true, + "properties": { + "role": { + "enum": [ + "owner", + "admin", + "member", + "reader", + "writer", + "mirror_source_admin" + ], + "type": "string" + }, + "source": { + "enum": [ + "membership", + "direct", + "team", + "organization", + "project", + "owner", + "github" + ], + "type": "string" + } + }, + "required": [ + "source", + "role" + ], + "type": "object" + }, "ServiceAccount": { "additionalProperties": true, "properties": { @@ -4196,7 +5388,7 @@ "additionalProperties": true, "properties": { "host": { - "description": "DNS host of this cluster; pass verbatim as clusterHost to POST /api/v1/mirrors.", + "description": "DNS host of this cluster; pass verbatim as clusterHost to POST /api/v1/mirror-requests.", "type": "string" }, "isDefault": { @@ -4283,9 +5475,9 @@ "type": "string" }, "addRules": { - "description": "Rules to add or replace by ref: an existing rule keeps its position and takes the new flag.", + "description": "Rules to add or edit by ref: an existing rule keeps its position; omit serverSideMergeOnly to keep its level.", "items": { - "$ref": "#/components/schemas/BranchRule" + "$ref": "#/components/schemas/BranchRuleUpdate" }, "maxItems": 64, "type": "array" @@ -4301,6 +5493,33 @@ }, "type": "object" }, + "UpdateOrgMemberRoleInputBody": { + "additionalProperties": true, + "properties": { + "$schema": { + "description": "A URL to the JSON Schema for this object.", + "examples": [ + "/api/v1/schemas/UpdateOrgMemberRoleInputBody.json" + ], + "format": "uri", + "readOnly": true, + "type": "string" + }, + "role": { + "description": "Replacement organization role.", + "enum": [ + "owner", + "admin", + "member" + ], + "type": "string" + } + }, + "required": [ + "role" + ], + "type": "object" + }, "WillDeleteStruct": { "additionalProperties": true, "properties": { @@ -4388,35 +5607,30 @@ }, "openapi": "3.1.0", "paths": { - "/access/{resourceType}/{resourceId}": { + "/audit": { "get": { - "operationId": "getPermissions", + "operationId": "listAuditEvents", "parameters": [ { - "in": "path", - "name": "resourceType", - "required": true, - "schema": { - "minLength": 1, - "type": "string" - } - }, - { - "in": "path", - "name": "resourceId", - "required": true, + "description": "Maximum entries to return; server may cap further.", + "explode": false, + "in": "query", + "name": "pageSize", "schema": { - "minLength": 1, - "type": "string" + "description": "Maximum entries to return; server may cap further.", + "format": "int32", + "maximum": 500, + "minimum": 0, + "type": "integer" } }, { - "description": "If set, return the SpiceDB trace for this permission instead of the permission list.", + "description": "Opaque cursor from a previous response's nextPageToken.", "explode": false, "in": "query", - "name": "explain", + "name": "pageToken", "schema": { - "description": "If set, return the SpiceDB trace for this permission instead of the permission list.", + "description": "Opaque cursor from a previous response's nextPageToken.", "type": "string" } } @@ -4426,7 +5640,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetPermissionsOutputBody" + "$ref": "#/components/schemas/ListAuditEventsOutputBody" } } }, @@ -4497,46 +5711,21 @@ "sessionAuth": [] } ], - "summary": "List the caller's permissions on a single resource", + "summary": "List the calling account's recent audit events", "tags": [ "identity" ] } }, - "/audit": { + "/clusters": { "get": { - "operationId": "listAuditEvents", - "parameters": [ - { - "description": "Maximum entries to return; server may cap further.", - "explode": false, - "in": "query", - "name": "pageSize", - "schema": { - "description": "Maximum entries to return; server may cap further.", - "format": "int32", - "maximum": 500, - "minimum": 0, - "type": "integer" - } - }, - { - "description": "Opaque cursor from a previous response's nextPageToken.", - "explode": false, - "in": "query", - "name": "pageToken", - "schema": { - "description": "Opaque cursor from a previous response's nextPageToken.", - "type": "string" - } - } - ], + "operationId": "listClusters", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListAuditEventsOutputBody" + "$ref": "#/components/schemas/ListClustersOutputBody" } } }, @@ -4572,16 +5761,6 @@ }, "description": "Forbidden" }, - "422": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Unprocessable Entity" - }, "500": { "content": { "application/problem+json": { @@ -4607,88 +5786,13 @@ "sessionAuth": [] } ], - "summary": "List the calling account's recent audit events", + "summary": "List data-plane clusters attached to this control plane", "tags": [ - "identity" + "clusters" ] } }, - "/clusters": { - "get": { - "operationId": "listClusters", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListClustersOutputBody" - } - } - }, - "description": "OK" - }, - "400": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Bad Request" - }, - "401": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Unauthorized" - }, - "403": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Forbidden" - }, - "500": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Internal Server Error" - } - }, - "security": [ - { - "oauth2": [] - }, - { - "oidc": [] - }, - { - "bearerAuth": [] - }, - { - "sessionAuth": [] - } - ], - "summary": "List data-plane clusters attached to this control plane", - "tags": [ - "clusters" - ] - } - }, - "/identity/handles/{provider}/{handle}": { + "/identity/handles/{provider}/{handle}": { "get": { "operationId": "resolveHandle", "parameters": [ @@ -4807,12 +5911,56 @@ ] } }, - "/me": { - "delete": { - "operationId": "deleteMe", + "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/invitations/accept": { + "post": { + "operationId": "acceptInvitation", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AcceptInvitationInputBody" + } + } + }, + "required": true + }, "responses": { - "202": { - "description": "Accepted" + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "properties": { + "membership": { + "$ref": "#/components/schemas/Membership" + }, + "orgId": { + "type": "string" + }, + "orgName": { + "type": "string" + } + }, + "required": [ + "orgId", + "orgName", + "membership" + ], + "type": "object" + } + } + }, + "description": "Accepted; the caller was already an active member" + }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AcceptedInvitation" + } + } + }, + "description": "Created" }, "400": { "content": { @@ -4844,6 +5992,16 @@ }, "description": "Forbidden" }, + "404": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Not Found" + }, "409": { "content": { "application/problem+json": { @@ -4854,6 +6012,36 @@ }, "description": "Conflict" }, + "410": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Gone" + }, + "421": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Misdirected Request" + }, + "422": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unprocessable Entity" + }, "500": { "content": { "application/problem+json": { @@ -4889,23 +6077,64 @@ "sessionAuth": [] } ], - "summary": "Request deletion of the calling account (7-day cooldown; cancel via POST /me/cancel-deletion)", + "summary": "Accept an organization invitation", "tags": [ - "identity" + "orgs" ] - }, - "get": { - "operationId": "getMe", + } + }, + "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/invitations/preview": { + "post": { + "operationId": "previewInvitation", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PreviewInvitationInputBody" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetMeOutputBody" + "additionalProperties": true, + "properties": { + "inviterHandle": { + "type": "string" + }, + "orgName": { + "type": "string" + }, + "role": { + "enum": [ + "owner", + "admin", + "member" + ], + "type": "string" + } + }, + "required": [ + "orgName", + "inviterHandle", + "role" + ], + "type": "object" } } }, - "description": "OK" + "description": "OK", + "headers": { + "Cache-Control": { + "schema": { + "type": "string" + } + } + } }, "400": { "content": { @@ -4937,7 +6166,7 @@ }, "description": "Forbidden" }, - "500": { + "404": { "content": { "application/problem+json": { "schema": { @@ -4945,37 +6174,9 @@ } } }, - "description": "Internal Server Error" - } - }, - "security": [ - { - "oauth2": [] - }, - { - "oidc": [] - }, - { - "bearerAuth": [] - }, - { - "sessionAuth": [] - } - ], - "summary": "Get the calling account's identity and profile", - "tags": [ - "identity" - ] - } - }, - "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/me/cancel-deletion": { - "post": { - "operationId": "cancelDeletion", - "responses": { - "200": { - "description": "OK" + "description": "Not Found" }, - "400": { + "409": { "content": { "application/problem+json": { "schema": { @@ -4983,9 +6184,37 @@ } } }, - "description": "Bad Request" + "description": "Conflict" }, - "401": { + "410": { + "content": { + "application/problem+json": { + "schema": { + "additionalProperties": true, + "properties": { + "error": { + "type": "string" + }, + "reason": { + "enum": [ + "revoked", + "used", + "expired" + ], + "type": "string" + } + }, + "required": [ + "error", + "reason" + ], + "type": "object" + } + } + }, + "description": "Invitation is no longer valid" + }, + "421": { "content": { "application/problem+json": { "schema": { @@ -4993,9 +6222,9 @@ } } }, - "description": "Unauthorized" + "description": "Misdirected Request" }, - "403": { + "422": { "content": { "application/problem+json": { "schema": { @@ -5003,7 +6232,7 @@ } } }, - "description": "Forbidden" + "description": "Unprocessable Entity" }, "500": { "content": { @@ -5040,25 +6269,18 @@ "sessionAuth": [] } ], - "summary": "Cancel a pending deletion request for the calling account", + "summary": "Preview an organization invitation", "tags": [ - "identity" + "orgs" ] } }, - "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/me/deletion-preview": { - "get": { - "operationId": "getDeletionPreview", + "/me": { + "delete": { + "operationId": "deleteMe", "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetDeletionPreviewOutputBody" - } - } - }, - "description": "OK" + "202": { + "description": "Accepted" }, "400": { "content": { @@ -5090,6 +6312,16 @@ }, "description": "Forbidden" }, + "409": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Conflict" + }, "500": { "content": { "application/problem+json": { @@ -5125,21 +6357,19 @@ "sessionAuth": [] } ], - "summary": "Preview what deleting the calling account will erase, unlink, and block on", + "summary": "Request deletion of the calling account (7-day cooldown; cancel via POST /me/cancel-deletion)", "tags": [ "identity" ] - } - }, - "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/me/onboarding": { + }, "get": { - "operationId": "getOnboardingStatus", + "operationId": "getMe", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetOnboardingStatusOutputBody" + "$ref": "#/components/schemas/GetMeOutputBody" } } }, @@ -5200,24 +6430,17 @@ "sessionAuth": [] } ], - "summary": "Report whether the calling account still needs to complete onboarding", + "summary": "Get the calling account's identity and profile", "tags": [ "identity" ] } }, - "/me/onboarding/complete": { + "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/me/cancel-deletion": { "post": { - "operationId": "completeOnboarding", + "operationId": "cancelDeletion", "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CompleteOnboardingOutputBody" - } - } - }, "description": "OK" }, "400": { @@ -5250,7 +6473,7 @@ }, "description": "Forbidden" }, - "409": { + "500": { "content": { "application/problem+json": { "schema": { @@ -5258,17 +6481,7 @@ } } }, - "description": "Conflict" - }, - "500": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Internal Server Error" + "description": "Internal Server Error" }, "503": { "content": { @@ -5295,43 +6508,25 @@ "sessionAuth": [] } ], - "summary": "Record that the calling account completed web onboarding", + "summary": "Cancel a pending deletion request for the calling account", "tags": [ "identity" ] } }, - "/mirror-requests": { - "post": { - "description": "a validation failure may be reported synchronously at submission or as a terminal state on the request; clients must handle both.", - "operationId": "createMirrorRequest", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateMirrorRequestInputBody" - } - } - }, - "required": true - }, + "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/me/deletion-preview": { + "get": { + "operationId": "getDeletionPreview", "responses": { - "202": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MirrorRequest" + "$ref": "#/components/schemas/GetDeletionPreviewOutputBody" } } }, - "description": "Accepted", - "headers": { - "Location": { - "schema": { - "type": "string" - } - } - } + "description": "OK" }, "400": { "content": { @@ -5363,46 +6558,6 @@ }, "description": "Forbidden" }, - "404": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Not Found" - }, - "409": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Conflict" - }, - "421": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Misdirected Request" - }, - "422": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Unprocessable Entity" - }, "500": { "content": { "application/problem+json": { @@ -5413,16 +6568,6 @@ }, "description": "Internal Server Error" }, - "502": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Bad Gateway" - }, "503": { "content": { "application/problem+json": { @@ -5448,37 +6593,45 @@ "sessionAuth": [] } ], - "summary": "Submit a mirror creation request", + "summary": "Preview what deleting the calling account will erase, unlink, and block on", "tags": [ - "mirrors" + "identity" ] } }, - "/mirror-requests/{requestId}": { - "get": { - "description": "unknown failure codes must be treated as a generic terminal failure.", - "operationId": "getMirrorRequest", + "/me/handles/{provider}/{providerUserId}": { + "delete": { + "operationId": "detachMyHandle", "parameters": [ { + "description": "Sign-in provider of the handle to detach.", "in": "path", - "name": "requestId", + "name": "provider", "required": true, "schema": { - "format": "uuid", + "description": "Sign-in provider of the handle to detach.", + "enum": [ + "google", + "github" + ], + "type": "string" + } + }, + { + "description": "The provider's stable user identifier for the handle (handles[].providerUserId from GET /me).", + "in": "path", + "name": "providerUserId", + "required": true, + "schema": { + "description": "The provider's stable user identifier for the handle (handles[].providerUserId from GET /me).", + "minLength": 1, "type": "string" } } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MirrorRequest" - } - } - }, - "description": "OK" + "204": { + "description": "No Content" }, "400": { "content": { @@ -5520,6 +6673,16 @@ }, "description": "Not Found" }, + "409": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Conflict" + }, "422": { "content": { "application/problem+json": { @@ -5565,64 +6728,25 @@ "sessionAuth": [] } ], - "summary": "Get a mirror creation request", + "summary": "Detach a linked sign-in method from the calling account", "tags": [ - "mirrors" + "identity" ] } }, - "/mirrors": { - "delete": { - "operationId": "deleteMirror", - "parameters": [ - { - "explode": false, - "in": "query", - "name": "provider", - "required": true, - "schema": { - "enum": [ - "github" - ], - "type": "string" - } - }, - { - "explode": false, - "in": "query", - "name": "owner", - "required": true, - "schema": { - "minLength": 1, - "type": "string" - } - }, - { - "explode": false, - "in": "query", - "name": "repo", - "required": true, - "schema": { - "minLength": 1, - "type": "string" - } - }, - { - "description": "Public host of the cluster serving the mirror.", - "explode": false, - "in": "query", - "name": "clusterHost", - "required": true, - "schema": { - "description": "Public host of the cluster serving the mirror.", - "minLength": 1, - "type": "string" - } - } - ], + "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/me/onboarding": { + "get": { + "operationId": "getOnboardingStatus", "responses": { - "204": { - "description": "No Content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetOnboardingStatusOutputBody" + } + } + }, + "description": "OK" }, "400": { "content": { @@ -5654,7 +6778,7 @@ }, "description": "Forbidden" }, - "404": { + "500": { "content": { "application/problem+json": { "schema": { @@ -5662,9 +6786,44 @@ } } }, - "description": "Not Found" + "description": "Internal Server Error" + } + }, + "security": [ + { + "oauth2": [] }, - "421": { + { + "oidc": [] + }, + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Report whether the calling account still needs to complete onboarding", + "tags": [ + "identity" + ] + } + }, + "/me/onboarding/complete": { + "post": { + "operationId": "completeOnboarding", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CompleteOnboardingOutputBody" + } + } + }, + "description": "OK" + }, + "400": { "content": { "application/problem+json": { "schema": { @@ -5672,9 +6831,9 @@ } } }, - "description": "Misdirected Request" + "description": "Bad Request" }, - "422": { + "401": { "content": { "application/problem+json": { "schema": { @@ -5682,9 +6841,9 @@ } } }, - "description": "Unprocessable Entity" + "description": "Unauthorized" }, - "500": { + "403": { "content": { "application/problem+json": { "schema": { @@ -5692,9 +6851,9 @@ } } }, - "description": "Internal Server Error" + "description": "Forbidden" }, - "502": { + "409": { "content": { "application/problem+json": { "schema": { @@ -5702,9 +6861,1188 @@ } } }, - "description": "Bad Gateway" + "description": "Conflict" }, - "503": { + "500": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Internal Server Error" + }, + "503": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Service Unavailable" + } + }, + "security": [ + { + "oauth2": [] + }, + { + "oidc": [] + }, + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Record that the calling account completed web onboarding", + "tags": [ + "identity" + ] + } + }, + "/mirror-requests": { + "post": { + "description": "a validation failure may be reported synchronously at submission or as a terminal state on the request; clients must handle both.", + "operationId": "createMirrorRequest", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMirrorRequestInputBody" + } + } + }, + "required": true + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MirrorRequest" + } + } + }, + "description": "Accepted", + "headers": { + "Location": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Conflict" + }, + "421": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Misdirected Request" + }, + "422": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unprocessable Entity" + }, + "500": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Internal Server Error" + }, + "503": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Service Unavailable" + } + }, + "security": [ + { + "oauth2": [] + }, + { + "oidc": [] + }, + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Submit a mirror creation request", + "tags": [ + "mirrors" + ] + } + }, + "/mirror-requests/{requestId}": { + "get": { + "description": "unknown failure codes must be treated as a generic terminal failure.", + "operationId": "getMirrorRequest", + "parameters": [ + { + "in": "path", + "name": "requestId", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MirrorRequest" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Not Found" + }, + "422": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unprocessable Entity" + }, + "500": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Internal Server Error" + }, + "503": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Service Unavailable" + } + }, + "security": [ + { + "oauth2": [] + }, + { + "oidc": [] + }, + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Get a mirror creation request", + "tags": [ + "mirrors" + ] + } + }, + "/mirrors": { + "delete": { + "operationId": "deleteMirror", + "parameters": [ + { + "explode": false, + "in": "query", + "name": "provider", + "required": true, + "schema": { + "enum": [ + "github" + ], + "type": "string" + } + }, + { + "explode": false, + "in": "query", + "name": "owner", + "required": true, + "schema": { + "minLength": 1, + "type": "string" + } + }, + { + "explode": false, + "in": "query", + "name": "repo", + "required": true, + "schema": { + "minLength": 1, + "type": "string" + } + }, + { + "description": "Public host of the cluster serving the mirror.", + "explode": false, + "in": "query", + "name": "clusterHost", + "required": true, + "schema": { + "description": "Public host of the cluster serving the mirror.", + "minLength": 1, + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Not Found" + }, + "421": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Misdirected Request" + }, + "422": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unprocessable Entity" + }, + "500": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Internal Server Error" + }, + "503": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Service Unavailable" + } + }, + "security": [ + { + "oauth2": [] + }, + { + "oidc": [] + }, + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Delete a mirror by upstream coords + cluster host", + "tags": [ + "mirrors" + ] + }, + "get": { + "operationId": "listMirrors", + "parameters": [ + { + "description": "Maximum entries to return; server may cap further.", + "explode": false, + "in": "query", + "name": "pageSize", + "schema": { + "description": "Maximum entries to return; server may cap further.", + "format": "int32", + "maximum": 500, + "minimum": 0, + "type": "integer" + } + }, + { + "description": "Opaque cursor from a previous response's nextPageToken.", + "explode": false, + "in": "query", + "name": "pageToken", + "schema": { + "description": "Opaque cursor from a previous response's nextPageToken.", + "type": "string" + } + }, + { + "description": "Optional: restrict to mirrors on this cluster (public host, e.g. royalcanin.partial.to). Case-sensitive exact match.", + "explode": false, + "in": "query", + "name": "cluster", + "schema": { + "description": "Optional: restrict to mirrors on this cluster (public host, e.g. royalcanin.partial.to). Case-sensitive exact match.", + "type": "string" + } + }, + { + "description": "Optional: restrict to mirrors of this upstream provider, case-insensitive (e.g. \"github\").", + "explode": false, + "in": "query", + "name": "provider", + "schema": { + "description": "Optional: restrict to mirrors of this upstream provider, case-insensitive (e.g. \"github\").", + "type": "string" + } + }, + { + "description": "Optional: restrict to mirrors with this upstream owner login (case-insensitive).", + "explode": false, + "in": "query", + "name": "owner", + "schema": { + "description": "Optional: restrict to mirrors with this upstream owner login (case-insensitive).", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListMirrorsOutputBody" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Forbidden" + }, + "422": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unprocessable Entity" + }, + "500": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Internal Server Error" + } + }, + "security": [ + { + "oauth2": [] + }, + { + "oidc": [] + }, + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "List mirrors visible to the caller", + "tags": [ + "mirrors" + ] + } + }, + "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/mirrors/available": { + "get": { + "operationId": "listAvailableMirrors", + "parameters": [ + { + "description": "Optional: restrict to repos with this owner login (case-insensitive).", + "explode": false, + "in": "query", + "name": "owner", + "schema": { + "description": "Optional: restrict to repos with this owner login (case-insensitive).", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListAvailableMirrorsOutputBody" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Forbidden" + }, + "422": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unprocessable Entity" + }, + "500": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Internal Server Error" + }, + "503": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Service Unavailable" + } + }, + "security": [ + { + "oauth2": [] + }, + { + "oidc": [] + }, + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "List GitHub repos the caller could onboard as mirrors", + "tags": [ + "mirrors" + ] + } + }, + "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/mirrors/collaborators": { + "get": { + "operationId": "listMirrorCollaborators", + "parameters": [ + { + "explode": false, + "in": "query", + "name": "provider", + "required": true, + "schema": { + "enum": [ + "github" + ], + "type": "string" + } + }, + { + "explode": false, + "in": "query", + "name": "owner", + "required": true, + "schema": { + "minLength": 1, + "type": "string" + } + }, + { + "explode": false, + "in": "query", + "name": "repo", + "required": true, + "schema": { + "minLength": 1, + "type": "string" + } + }, + { + "description": "Public host of the cluster serving the mirror.", + "explode": false, + "in": "query", + "name": "clusterHost", + "required": true, + "schema": { + "description": "Public host of the cluster serving the mirror.", + "minLength": 1, + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListMirrorCollaboratorsOutputBody" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Not Found" + }, + "421": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Misdirected Request" + }, + "422": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unprocessable Entity" + }, + "500": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Internal Server Error" + }, + "503": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Service Unavailable" + } + }, + "security": [ + { + "oauth2": [] + }, + { + "oidc": [] + }, + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "List the principals with access to a mirror (live GitHub-admin gated)", + "tags": [ + "mirrors" + ] + } + }, + "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/mirrors/placements": { + "get": { + "operationId": "resolveMirrorPlacements", + "parameters": [ + { + "explode": false, + "in": "query", + "name": "provider", + "required": true, + "schema": { + "enum": [ + "github" + ], + "type": "string" + } + }, + { + "description": "Upstream owner login (case-insensitive).", + "explode": false, + "in": "query", + "name": "owner", + "required": true, + "schema": { + "description": "Upstream owner login (case-insensitive).", + "minLength": 1, + "type": "string" + } + }, + { + "description": "Upstream repo name (case-insensitive).", + "explode": false, + "in": "query", + "name": "repo", + "required": true, + "schema": { + "description": "Upstream repo name (case-insensitive).", + "minLength": 1, + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolvePlacementsOutputBody" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Forbidden" + }, + "422": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unprocessable Entity" + }, + "500": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Internal Server Error" + } + }, + "security": [ + { + "oauth2": [] + }, + { + "oidc": [] + }, + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Resolve the pullable cluster placements of a mirrored upstream (clone discovery)", + "tags": [ + "mirrors" + ] + } + }, + "/mirrors/{mirrorId}": { + "get": { + "operationId": "getMirror", + "parameters": [ + { + "in": "path", + "name": "mirrorId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Mirror" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Not Found" + }, + "422": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unprocessable Entity" + }, + "500": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Internal Server Error" + } + }, + "security": [ + { + "oauth2": [] + }, + { + "oidc": [] + }, + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Get mirror by id", + "tags": [ + "mirrors" + ] + } + }, + "/oidc-providers": { + "get": { + "operationId": "listOIDCProviders", + "parameters": [ + { + "description": "Maximum entries to return; server may cap further.", + "explode": false, + "in": "query", + "name": "pageSize", + "schema": { + "description": "Maximum entries to return; server may cap further.", + "format": "int32", + "maximum": 500, + "minimum": 0, + "type": "integer" + } + }, + { + "description": "Opaque cursor from a previous response's nextPageToken.", + "explode": false, + "in": "query", + "name": "pageToken", + "schema": { + "description": "Opaque cursor from a previous response's nextPageToken.", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOIDCProvidersOutputBody" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Forbidden" + }, + "422": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unprocessable Entity" + }, + "500": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Internal Server Error" + }, + "503": { "content": { "application/problem+json": { "schema": { @@ -5729,13 +8067,15 @@ "sessionAuth": [] } ], - "summary": "Delete a mirror by upstream coords + cluster host", + "summary": "List federated OIDC identity providers", "tags": [ - "mirrors" + "identity" ] - }, + } + }, + "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/orgs": { "get": { - "operationId": "listMirrors", + "operationId": "listOrgs", "parameters": [ { "description": "Maximum entries to return; server may cap further.", @@ -5761,46 +8101,279 @@ } }, { - "description": "Optional: restrict to mirrors on this cluster (public host, e.g. royalcanin.partial.to). Case-sensitive exact match.", + "description": "Optional: exact-match org name (case-insensitive).", "explode": false, "in": "query", - "name": "cluster", + "name": "name", "schema": { - "description": "Optional: restrict to mirrors on this cluster (public host, e.g. royalcanin.partial.to). Case-sensitive exact match.", + "description": "Optional: exact-match org name (case-insensitive).", "type": "string" } }, { - "description": "Optional: restrict to mirrors of this upstream provider, case-insensitive (e.g. \"github\").", + "in": "header", + "name": "If-None-Match", + "schema": { + "type": "string" + } + }, + { + "description": "Optional: opaque commit token from an org create or delete, to read at a snapshot that contains that write. Applies to both the name lookup and the page.", "explode": false, "in": "query", - "name": "provider", + "name": "commitToken", "schema": { - "description": "Optional: restrict to mirrors of this upstream provider, case-insensitive (e.g. \"github\").", + "description": "Optional: opaque commit token from an org create or delete, to read at a snapshot that contains that write. Applies to both the name lookup and the page.", + "pattern": "^$|^[A-Za-z0-9_-]{20,512}$", "type": "string" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOrgsOutputBody" + } + } + }, + "description": "OK", + "headers": { + "Cache-Control": { + "schema": { + "type": "string" + } + }, + "ETag": { + "schema": { + "type": "string" + } + }, + "Vary": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Not Found" + }, + "422": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unprocessable Entity" + }, + "500": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Internal Server Error" + } + }, + "security": [ + { + "oauth2": [] + }, + { + "oidc": [] + }, + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "List organizations the caller can see (or one by name)", + "tags": [ + "orgs" + ] + }, + "post": { + "operationId": "createOrg", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrgInputBody" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatedOrg" + } + } + }, + "description": "Created", + "headers": { + "X-Entire-Commit-Token": { + "schema": { + "description": "Opaque token to pass as commitToken on the next org list, so this org appears immediately. Absent when none could be minted; list without it.", + "type": "string" + } + } + } + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Forbidden" + }, + "409": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unprocessable Entity" + }, + "500": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Internal Server Error" + } + }, + "security": [ + { + "oauth2": [] + }, + { + "oidc": [] + }, + { + "bearerAuth": [] }, { - "description": "Optional: restrict to mirrors with this upstream owner login (case-insensitive).", - "explode": false, - "in": "query", - "name": "owner", + "sessionAuth": [] + } + ], + "summary": "Create organization", + "tags": [ + "orgs" + ] + } + }, + "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/orgs/{orgId}": { + "delete": { + "operationId": "deleteOrg", + "parameters": [ + { + "in": "path", + "name": "orgId", + "required": true, "schema": { - "description": "Optional: restrict to mirrors with this upstream owner login (case-insensitive).", + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } } ], "responses": { - "200": { - "content": { - "application/json": { + "204": { + "description": "No Content", + "headers": { + "X-Entire-Commit-Token": { "schema": { - "$ref": "#/components/schemas/ListMirrorsOutputBody" + "description": "Opaque token to pass as commitToken on the next org list, so this org is gone from it. Absent when none could be minted; list without it.", + "type": "string" } } - }, - "description": "OK" + } }, "400": { "content": { @@ -5832,6 +8405,36 @@ }, "description": "Forbidden" }, + "404": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Conflict" + }, + "421": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Misdirected Request" + }, "422": { "content": { "application/problem+json": { @@ -5867,33 +8470,34 @@ "sessionAuth": [] } ], - "summary": "List mirrors visible to the caller", + "summary": "Delete an organization", "tags": [ - "mirrors" + "orgs" ] }, - "post": { - "operationId": "createMirror", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateMirrorInputBody" - } + "get": { + "operationId": "getOrg", + "parameters": [ + { + "in": "path", + "name": "orgId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" } - }, - "required": true - }, + } + ], "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreatedMirror" + "$ref": "#/components/schemas/Org" } } }, - "description": "Created" + "description": "OK" }, "400": { "content": { @@ -5935,36 +8539,6 @@ }, "description": "Not Found" }, - "409": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Conflict" - }, - "412": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Precondition Failed" - }, - "421": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Misdirected Request" - }, "422": { "content": { "application/problem+json": { @@ -5984,26 +8558,6 @@ } }, "description": "Internal Server Error" - }, - "502": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Bad Gateway" - }, - "503": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Service Unavailable" } }, "security": [ @@ -6020,23 +8574,30 @@ "sessionAuth": [] } ], - "summary": "Create GitHub mirror", + "summary": "Get an organization", "tags": [ - "mirrors" + "orgs" ] } }, - "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/mirrors/available": { + "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/orgs/{orgId}/ci/buildkite/clusters": { "get": { - "operationId": "listAvailableMirrors", + "operationId": "listOrgCIBuildkiteClusters", "parameters": [ { - "description": "Optional: restrict to repos with this owner login (case-insensitive).", + "in": "path", + "name": "orgId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + }, + { "explode": false, "in": "query", - "name": "owner", + "name": "bk_organization", "schema": { - "description": "Optional: restrict to repos with this owner login (case-insensitive).", "type": "string" } } @@ -6046,7 +8607,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListAvailableMirrorsOutputBody" + "$ref": "#/components/schemas/ListOrgCIBuildkiteClustersOutputBody" } } }, @@ -6082,7 +8643,7 @@ }, "description": "Forbidden" }, - "422": { + "404": { "content": { "application/problem+json": { "schema": { @@ -6090,9 +8651,9 @@ } } }, - "description": "Unprocessable Entity" + "description": "Not Found" }, - "500": { + "422": { "content": { "application/problem+json": { "schema": { @@ -6100,9 +8661,9 @@ } } }, - "description": "Internal Server Error" + "description": "Unprocessable Entity" }, - "502": { + "500": { "content": { "application/problem+json": { "schema": { @@ -6110,7 +8671,7 @@ } } }, - "description": "Bad Gateway" + "description": "Internal Server Error" }, "503": { "content": { @@ -6137,71 +8698,44 @@ "sessionAuth": [] } ], - "summary": "List GitHub repos the caller could onboard as mirrors", + "summary": "List an org's registered Buildkite clusters", "tags": [ - "mirrors" + "org-ci-webhooks" ] - } - }, - "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/mirrors/collaborators": { - "get": { - "operationId": "listMirrorCollaborators", + }, + "post": { + "operationId": "registerOrgCIBuildkiteCluster", "parameters": [ { - "explode": false, - "in": "query", - "name": "provider", - "required": true, - "schema": { - "enum": [ - "github" - ], - "type": "string" - } - }, - { - "explode": false, - "in": "query", - "name": "owner", - "required": true, - "schema": { - "minLength": 1, - "type": "string" - } - }, - { - "explode": false, - "in": "query", - "name": "repo", - "required": true, - "schema": { - "minLength": 1, - "type": "string" - } - }, - { - "description": "Public host of the cluster serving the mirror.", - "explode": false, - "in": "query", - "name": "clusterHost", + "in": "path", + "name": "orgId", "required": true, "schema": { - "description": "Public host of the cluster serving the mirror.", - "minLength": 1, + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterOrgCIBuildkiteClusterInputBody" + } + } + }, + "required": true + }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListMirrorCollaboratorsOutputBody" + "$ref": "#/components/schemas/OrgCIBuildkiteClusterView" } } }, - "description": "OK" + "description": "Created" }, "400": { "content": { @@ -6243,7 +8777,7 @@ }, "description": "Not Found" }, - "421": { + "409": { "content": { "application/problem+json": { "schema": { @@ -6251,7 +8785,7 @@ } } }, - "description": "Misdirected Request" + "description": "Conflict" }, "422": { "content": { @@ -6273,16 +8807,6 @@ }, "description": "Internal Server Error" }, - "502": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Bad Gateway" - }, "503": { "content": { "application/problem+json": { @@ -6308,63 +8832,47 @@ "sessionAuth": [] } ], - "summary": "List the principals with access to a mirror (live GitHub-admin gated)", + "summary": "Register or update a Buildkite hosted cluster for an org", "tags": [ - "mirrors" + "org-ci-webhooks" ] } }, - "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/mirrors/placements": { - "get": { - "operationId": "resolveMirrorPlacements", + "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/orgs/{orgId}/ci/buildkite/clusters/{bkOrg}/{bkClusterId}": { + "delete": { + "operationId": "deleteOrgCIBuildkiteCluster", "parameters": [ { - "explode": false, - "in": "query", - "name": "provider", + "in": "path", + "name": "orgId", "required": true, "schema": { - "enum": [ - "github" - ], + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } }, { - "description": "Upstream owner login (case-insensitive).", - "explode": false, - "in": "query", - "name": "owner", + "in": "path", + "name": "bkOrg", "required": true, "schema": { - "description": "Upstream owner login (case-insensitive).", - "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9-]*$", "type": "string" } }, { - "description": "Upstream repo name (case-insensitive).", - "explode": false, - "in": "query", - "name": "repo", + "in": "path", + "name": "bkClusterId", "required": true, "schema": { - "description": "Upstream repo name (case-insensitive).", "minLength": 1, "type": "string" } } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ResolvePlacementsOutputBody" - } - } - }, - "description": "OK" + "204": { + "description": "No Content" }, "400": { "content": { @@ -6396,6 +8904,16 @@ }, "description": "Forbidden" }, + "404": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Not Found" + }, "422": { "content": { "application/problem+json": { @@ -6415,6 +8933,16 @@ } }, "description": "Internal Server Error" + }, + "503": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Service Unavailable" } }, "security": [ @@ -6431,19 +8959,19 @@ "sessionAuth": [] } ], - "summary": "Resolve the pullable cluster placements of a mirrored upstream (clone discovery)", + "summary": "Remove a registered Buildkite cluster from an org", "tags": [ - "mirrors" + "org-ci-webhooks" ] } }, - "/mirrors/{mirrorId}": { - "get": { - "operationId": "getMirror", + "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/orgs/{orgId}/ci/buildkite/credential": { + "post": { + "operationId": "connectOrgCIBuildkiteCredential", "parameters": [ { "in": "path", - "name": "mirrorId", + "name": "orgId", "required": true, "schema": { "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", @@ -6451,16 +8979,26 @@ } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConnectOrgCIBuildkiteCredentialInputBody" + } + } + }, + "required": true + }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Mirror" + "$ref": "#/components/schemas/OrgCIBuildkiteCredentialView" } } }, - "description": "OK" + "description": "Created" }, "400": { "content": { @@ -6502,6 +9040,16 @@ }, "description": "Not Found" }, + "409": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Conflict" + }, "422": { "content": { "application/problem+json": { @@ -6521,6 +9069,16 @@ } }, "description": "Internal Server Error" + }, + "503": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Service Unavailable" } }, "security": [ @@ -6537,50 +9095,38 @@ "sessionAuth": [] } ], - "summary": "Get mirror by id", + "summary": "Connect or rotate an org's Buildkite API credential", "tags": [ - "mirrors" + "org-ci-webhooks" ] } }, - "/oidc-providers": { - "get": { - "operationId": "listOIDCProviders", + "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/orgs/{orgId}/ci/buildkite/credential/{bkOrg}": { + "delete": { + "operationId": "deleteOrgCIBuildkiteCredential", "parameters": [ { - "description": "Maximum entries to return; server may cap further.", - "explode": false, - "in": "query", - "name": "pageSize", + "in": "path", + "name": "orgId", + "required": true, "schema": { - "description": "Maximum entries to return; server may cap further.", - "format": "int32", - "maximum": 500, - "minimum": 0, - "type": "integer" + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" } }, { - "description": "Opaque cursor from a previous response's nextPageToken.", - "explode": false, - "in": "query", - "name": "pageToken", + "in": "path", + "name": "bkOrg", + "required": true, "schema": { - "description": "Opaque cursor from a previous response's nextPageToken.", + "pattern": "^[a-z0-9][a-z0-9-]*$", "type": "string" } } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListOIDCProvidersOutputBody" - } - } - }, - "description": "OK" + "204": { + "description": "No Content" }, "400": { "content": { @@ -6612,6 +9158,16 @@ }, "description": "Forbidden" }, + "404": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Not Found" + }, "422": { "content": { "application/problem+json": { @@ -6657,53 +9213,31 @@ "sessionAuth": [] } ], - "summary": "List federated OIDC identity providers", + "summary": "Delete an org's connected Buildkite credential", "tags": [ - "identity" + "org-ci-webhooks" ] } }, - "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/orgs": { - "get": { - "operationId": "listOrgs", + "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/orgs/{orgId}/ci/buildkite/credential/{bkOrg}/inbound-secret": { + "put": { + "operationId": "rotateOrgCIBuildkiteInboundSecret", "parameters": [ { - "description": "Maximum entries to return; server may cap further.", - "explode": false, - "in": "query", - "name": "pageSize", - "schema": { - "description": "Maximum entries to return; server may cap further.", - "format": "int32", - "maximum": 500, - "minimum": 0, - "type": "integer" - } - }, - { - "description": "Opaque cursor from a previous response's nextPageToken.", - "explode": false, - "in": "query", - "name": "pageToken", - "schema": { - "description": "Opaque cursor from a previous response's nextPageToken.", - "type": "string" - } - }, - { - "description": "Optional: exact-match org name (case-insensitive).", - "explode": false, - "in": "query", - "name": "name", + "in": "path", + "name": "orgId", + "required": true, "schema": { - "description": "Optional: exact-match org name (case-insensitive).", + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } }, { - "in": "header", - "name": "If-None-Match", + "in": "path", + "name": "bkOrg", + "required": true, "schema": { + "pattern": "^[a-z0-9][a-z0-9-]*$", "type": "string" } } @@ -6713,28 +9247,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListOrgsOutputBody" + "$ref": "#/components/schemas/OrgCIBuildkiteCredentialView" } } }, - "description": "OK", - "headers": { - "Cache-Control": { - "schema": { - "type": "string" - } - }, - "ETag": { - "schema": { - "type": "string" - } - }, - "Vary": { - "schema": { - "type": "string" - } - } - } + "description": "OK" }, "400": { "content": { @@ -6795,6 +9312,16 @@ } }, "description": "Internal Server Error" + }, + "503": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Service Unavailable" } }, "security": [ @@ -6811,33 +9338,36 @@ "sessionAuth": [] } ], - "summary": "List organizations the caller can see (or one by name)", - "tags": [ - "orgs" - ] - }, - "post": { - "operationId": "createOrg", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateOrgInputBody" - } - } - }, - "required": true - }, + "summary": "Rotate an org's inbound Buildkite webhook secret", + "tags": [ + "org-ci-webhooks" + ] + } + }, + "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/orgs/{orgId}/ci/buildkite/credentials": { + "get": { + "operationId": "listOrgCIBuildkiteCredentials", + "parameters": [ + { + "in": "path", + "name": "orgId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + } + ], "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Org" + "$ref": "#/components/schemas/ListOrgCIBuildkiteCredentialsOutputBody" } } }, - "description": "Created" + "description": "OK" }, "400": { "content": { @@ -6869,7 +9399,7 @@ }, "description": "Forbidden" }, - "409": { + "404": { "content": { "application/problem+json": { "schema": { @@ -6877,7 +9407,7 @@ } } }, - "description": "Conflict" + "description": "Not Found" }, "422": { "content": { @@ -6898,6 +9428,16 @@ } }, "description": "Internal Server Error" + }, + "503": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Service Unavailable" } }, "security": [ @@ -6914,15 +9454,16 @@ "sessionAuth": [] } ], - "summary": "Create organization", + "summary": "List an org's connected Buildkite credentials", "tags": [ - "orgs" + "org-ci-webhooks" ] } }, - "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/orgs/{orgId}": { - "delete": { - "operationId": "deleteOrg", + "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/orgs/{orgId}/ci/depot/connection": { + "post": { + "description": "Operator-only: requires platform#admin, unlike the Buildkite routes beside it, because nothing can verify a Depot organisation id. Depot hands Entire no credential, so there is no token to store and no API to check the id against; the operator vouches for it. Records the Depot organisation id the org's repositories enrol against. Returns 201 on a fresh connection and 200 when the same pair is already connected.", + "operationId": "connectOrgCIDepotOrganization", "parameters": [ { "in": "path", @@ -6934,9 +9475,26 @@ } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConnectOrgCIDepotOrganizationInputBody" + } + } + }, + "required": true + }, "responses": { - "204": { - "description": "No Content" + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrgCIDepotConnectionView" + } + } + }, + "description": "Created" }, "400": { "content": { @@ -6988,7 +9546,7 @@ }, "description": "Conflict" }, - "421": { + "422": { "content": { "application/problem+json": { "schema": { @@ -6996,9 +9554,9 @@ } } }, - "description": "Misdirected Request" + "description": "Unprocessable Entity" }, - "422": { + "500": { "content": { "application/problem+json": { "schema": { @@ -7006,9 +9564,9 @@ } } }, - "description": "Unprocessable Entity" + "description": "Internal Server Error" }, - "500": { + "503": { "content": { "application/problem+json": { "schema": { @@ -7016,7 +9574,7 @@ } } }, - "description": "Internal Server Error" + "description": "Service Unavailable" } }, "security": [ @@ -7033,13 +9591,16 @@ "sessionAuth": [] } ], - "summary": "Delete an organization", + "summary": "Connect an org to a Depot organisation", "tags": [ - "orgs" + "org-ci-webhooks" ] - }, - "get": { - "operationId": "getOrg", + } + }, + "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/orgs/{orgId}/ci/depot/connection/{account}": { + "delete": { + "description": "Operator-only: requires platform#admin, mirroring the connect, because withdrawing an operator's vouch is at least as privileged as granting it. Provider-scoped on ci-webhooks, so it removes only the depot row and never a Buildkite credential of the same name. Removing a connection a subscription still names is allowed and logged; those subscriptions stop dispatching.", + "operationId": "disconnectOrgCIDepotOrganization", "parameters": [ { "in": "path", @@ -7049,18 +9610,20 @@ "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } + }, + { + "in": "path", + "name": "account", + "required": true, + "schema": { + "minLength": 1, + "type": "string" + } } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Org" - } - } - }, - "description": "OK" + "204": { + "description": "No Content" }, "400": { "content": { @@ -7121,6 +9684,16 @@ } }, "description": "Internal Server Error" + }, + "503": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Service Unavailable" } }, "security": [ @@ -7137,15 +9710,16 @@ "sessionAuth": [] } ], - "summary": "Get an organization", + "summary": "Disconnect an org from a Depot organisation", "tags": [ - "orgs" + "org-ci-webhooks" ] } }, - "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/orgs/{orgId}/ci/buildkite/clusters": { + "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/orgs/{orgId}/ci/depot/connections": { "get": { - "operationId": "listOrgCIBuildkiteClusters", + "description": "Requires org#manage, like the Buildkite credential list. A Depot connection holds no secret: it is the Depot organisation id this org's repositories enrol against.", + "operationId": "listOrgCIDepotOrganizations", "parameters": [ { "in": "path", @@ -7155,14 +9729,6 @@ "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } - }, - { - "explode": false, - "in": "query", - "name": "bk_organization", - "schema": { - "type": "string" - } } ], "responses": { @@ -7170,7 +9736,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListOrgCIBuildkiteClustersOutputBody" + "$ref": "#/components/schemas/ListOrgCIDepotOrganizationsOutputBody" } } }, @@ -7236,16 +9802,6 @@ }, "description": "Internal Server Error" }, - "502": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Bad Gateway" - }, "503": { "content": { "application/problem+json": { @@ -7271,13 +9827,16 @@ "sessionAuth": [] } ], - "summary": "List an org's registered Buildkite clusters", + "summary": "List an org's connected Depot organisations", "tags": [ "org-ci-webhooks" ] - }, + } + }, + "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/orgs/{orgId}/ci/github-actions/credential": { "post": { - "operationId": "registerOrgCIBuildkiteCluster", + "description": "Operator-only: requires platform#admin, unlike the Buildkite routes beside it, because GitHub Actions has no enrolment path yet and a credential minted here cannot be used. Mints the inbound webhook credential for one GitHub account: a fresh webhook secret (returned once, in this 201) and the endpoint URL to configure the GitHub webhook with, plus optionally the outbound dispatch api_token (write-only, never returned; has_api_token confirms storage). With api_token, an already-minted github-actions row gets the token stored/rotated instead (200, no secret re-issued).", + "operationId": "mintOrgCIGitHubActionsCredential", "parameters": [ { "in": "path", @@ -7293,7 +9852,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RegisterOrgCIBuildkiteClusterInputBody" + "$ref": "#/components/schemas/MintOrgCIGitHubActionsCredentialInputBody" } } }, @@ -7304,7 +9863,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OrgCIBuildkiteClusterView" + "$ref": "#/components/schemas/OrgCIGitHubActionsCredentialView" } } }, @@ -7380,16 +9939,6 @@ }, "description": "Internal Server Error" }, - "502": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Bad Gateway" - }, "503": { "content": { "application/problem+json": { @@ -7415,47 +9964,77 @@ "sessionAuth": [] } ], - "summary": "Register or update a Buildkite hosted cluster for an org", + "summary": "Mint an org's GitHub Actions webhook credential", "tags": [ "org-ci-webhooks" ] } }, - "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/orgs/{orgId}/ci/buildkite/clusters/{bkOrg}/{bkClusterId}": { - "delete": { - "operationId": "deleteOrgCIBuildkiteCluster", + "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/orgs/{orgId}/invitations": { + "get": { + "operationId": "listOrgInvitations", "parameters": [ { - "in": "path", - "name": "orgId", - "required": true, + "description": "Maximum entries to return; server may cap further.", + "explode": false, + "in": "query", + "name": "pageSize", "schema": { - "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "description": "Maximum entries to return; server may cap further.", + "format": "int32", + "maximum": 500, + "minimum": 0, + "type": "integer" + } + }, + { + "description": "Opaque cursor from a previous response's nextPageToken.", + "explode": false, + "in": "query", + "name": "pageToken", + "schema": { + "description": "Opaque cursor from a previous response's nextPageToken.", "type": "string" } }, { "in": "path", - "name": "bkOrg", + "name": "orgId", "required": true, "schema": { - "pattern": "^[a-z0-9][a-z0-9-]*$", + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } }, { - "in": "path", - "name": "bkClusterId", - "required": true, + "description": "Lifecycle state to return; all returns every state.", + "explode": false, + "in": "query", + "name": "status", "schema": { - "minLength": 1, + "default": "open", + "description": "Lifecycle state to return; all returns every state.", + "enum": [ + "open", + "accepted", + "revoked", + "expired", + "all" + ], "type": "string" } } ], "responses": { - "204": { - "description": "No Content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOrgInvitationsOutputBody" + } + } + }, + "description": "OK" }, "400": { "content": { @@ -7497,7 +10076,7 @@ }, "description": "Not Found" }, - "422": { + "409": { "content": { "application/problem+json": { "schema": { @@ -7505,9 +10084,9 @@ } } }, - "description": "Unprocessable Entity" + "description": "Conflict" }, - "500": { + "421": { "content": { "application/problem+json": { "schema": { @@ -7515,9 +10094,9 @@ } } }, - "description": "Internal Server Error" + "description": "Misdirected Request" }, - "502": { + "422": { "content": { "application/problem+json": { "schema": { @@ -7525,9 +10104,9 @@ } } }, - "description": "Bad Gateway" + "description": "Unprocessable Entity" }, - "503": { + "500": { "content": { "application/problem+json": { "schema": { @@ -7535,7 +10114,7 @@ } } }, - "description": "Service Unavailable" + "description": "Internal Server Error" } }, "security": [ @@ -7552,15 +10131,13 @@ "sessionAuth": [] } ], - "summary": "Remove a registered Buildkite cluster from an org", + "summary": "List an organization's invitations", "tags": [ - "org-ci-webhooks" + "orgs" ] - } - }, - "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/orgs/{orgId}/ci/buildkite/credential": { + }, "post": { - "operationId": "connectOrgCIBuildkiteCredential", + "operationId": "createOrgInvitation", "parameters": [ { "in": "path", @@ -7576,18 +10153,28 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConnectOrgCIBuildkiteCredentialInputBody" + "$ref": "#/components/schemas/CreateOrgInvitationInputBody" } } }, "required": true }, "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Invitation" + } + } + }, + "description": "Resent; an open invitation for that address already existed. The role in the body is the invitation's stored role, not the request's." + }, "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OrgCIBuildkiteCredentialView" + "$ref": "#/components/schemas/Invitation" } } }, @@ -7643,6 +10230,16 @@ }, "description": "Conflict" }, + "421": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Misdirected Request" + }, "422": { "content": { "application/problem+json": { @@ -7653,7 +10250,7 @@ }, "description": "Unprocessable Entity" }, - "500": { + "429": { "content": { "application/problem+json": { "schema": { @@ -7661,9 +10258,9 @@ } } }, - "description": "Internal Server Error" + "description": "Too Many Requests" }, - "502": { + "500": { "content": { "application/problem+json": { "schema": { @@ -7671,7 +10268,7 @@ } } }, - "description": "Bad Gateway" + "description": "Internal Server Error" }, "503": { "content": { @@ -7698,15 +10295,15 @@ "sessionAuth": [] } ], - "summary": "Connect or rotate an org's Buildkite API credential", + "summary": "Invite an address into an organization", "tags": [ - "org-ci-webhooks" + "orgs" ] } }, - "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/orgs/{orgId}/ci/buildkite/credential/{bkOrg}": { + "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/orgs/{orgId}/invitations/{id}": { "delete": { - "operationId": "deleteOrgCIBuildkiteCredential", + "operationId": "revokeOrgInvitation", "parameters": [ { "in": "path", @@ -7719,10 +10316,10 @@ }, { "in": "path", - "name": "bkOrg", + "name": "id", "required": true, "schema": { - "pattern": "^[a-z0-9][a-z0-9-]*$", + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } } @@ -7771,7 +10368,7 @@ }, "description": "Not Found" }, - "422": { + "409": { "content": { "application/problem+json": { "schema": { @@ -7779,9 +10376,9 @@ } } }, - "description": "Unprocessable Entity" + "description": "Conflict" }, - "500": { + "421": { "content": { "application/problem+json": { "schema": { @@ -7789,9 +10386,9 @@ } } }, - "description": "Internal Server Error" + "description": "Misdirected Request" }, - "502": { + "422": { "content": { "application/problem+json": { "schema": { @@ -7799,9 +10396,9 @@ } } }, - "description": "Bad Gateway" + "description": "Unprocessable Entity" }, - "503": { + "500": { "content": { "application/problem+json": { "schema": { @@ -7809,7 +10406,7 @@ } } }, - "description": "Service Unavailable" + "description": "Internal Server Error" } }, "security": [ @@ -7826,31 +10423,45 @@ "sessionAuth": [] } ], - "summary": "Delete an org's connected Buildkite credential", + "summary": "Revoke an organization invitation", "tags": [ - "org-ci-webhooks" + "orgs" ] } }, - "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/orgs/{orgId}/ci/buildkite/credential/{bkOrg}/inbound-secret": { - "put": { - "operationId": "rotateOrgCIBuildkiteInboundSecret", + "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/orgs/{orgId}/members": { + "get": { + "operationId": "listOrgMembers", "parameters": [ { - "in": "path", - "name": "orgId", - "required": true, + "description": "Maximum entries to return; server may cap further.", + "explode": false, + "in": "query", + "name": "pageSize", "schema": { - "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "description": "Maximum entries to return; server may cap further.", + "format": "int32", + "maximum": 500, + "minimum": 0, + "type": "integer" + } + }, + { + "description": "Opaque cursor from a previous response's nextPageToken.", + "explode": false, + "in": "query", + "name": "pageToken", + "schema": { + "description": "Opaque cursor from a previous response's nextPageToken.", "type": "string" } }, { "in": "path", - "name": "bkOrg", + "name": "orgId", "required": true, "schema": { - "pattern": "^[a-z0-9][a-z0-9-]*$", + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } } @@ -7860,7 +10471,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OrgCIBuildkiteCredentialView" + "$ref": "#/components/schemas/ListOrgMembersOutputBody" } } }, @@ -7925,26 +10536,6 @@ } }, "description": "Internal Server Error" - }, - "502": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Bad Gateway" - }, - "503": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Service Unavailable" } }, "security": [ @@ -7961,15 +10552,13 @@ "sessionAuth": [] } ], - "summary": "Rotate an org's inbound Buildkite webhook secret", + "summary": "List members of an organization", "tags": [ - "org-ci-webhooks" + "orgs" ] - } - }, - "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/orgs/{orgId}/ci/buildkite/credentials": { - "get": { - "operationId": "listOrgCIBuildkiteCredentials", + }, + "post": { + "operationId": "addOrgMember", "parameters": [ { "in": "path", @@ -7981,16 +10570,26 @@ } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddOrgMemberInputBody" + } + } + }, + "required": true + }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListOrgCIBuildkiteCredentialsOutputBody" + "$ref": "#/components/schemas/Membership" } } }, - "description": "OK" + "description": "Created" }, "400": { "content": { @@ -8032,17 +10631,7 @@ }, "description": "Not Found" }, - "422": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Unprocessable Entity" - }, - "500": { + "409": { "content": { "application/problem+json": { "schema": { @@ -8050,9 +10639,9 @@ } } }, - "description": "Internal Server Error" + "description": "Conflict" }, - "502": { + "422": { "content": { "application/problem+json": { "schema": { @@ -8060,9 +10649,9 @@ } } }, - "description": "Bad Gateway" + "description": "Unprocessable Entity" }, - "503": { + "500": { "content": { "application/problem+json": { "schema": { @@ -8070,7 +10659,7 @@ } } }, - "description": "Service Unavailable" + "description": "Internal Server Error" } }, "security": [ @@ -8087,16 +10676,15 @@ "sessionAuth": [] } ], - "summary": "List an org's connected Buildkite credentials", + "summary": "Add a member to an organization", "tags": [ - "org-ci-webhooks" + "orgs" ] } }, - "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/orgs/{orgId}/ci/github-actions/credential": { - "post": { - "description": "Operator-only: requires platform#admin, unlike the Buildkite routes beside it, because GitHub Actions has no enrolment path yet and a credential minted here cannot be used. Mints the inbound webhook credential for one GitHub account: a fresh webhook secret (returned once, in this 201) and the endpoint URL to configure the GitHub webhook with, plus optionally the outbound dispatch api_token (write-only, never returned; has_api_token confirms storage). With api_token, an already-minted github-actions row gets the token stored/rotated instead (200, no secret re-issued).", - "operationId": "mintOrgCIGitHubActionsCredential", + "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/orgs/{orgId}/members/{membershipId}": { + "patch": { + "operationId": "updateOrgMemberRole", "parameters": [ { "in": "path", @@ -8106,28 +10694,37 @@ "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } + }, + { + "in": "path", + "name": "membershipId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } } ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MintOrgCIGitHubActionsCredentialInputBody" + "$ref": "#/components/schemas/UpdateOrgMemberRoleInputBody" } } }, "required": true }, "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OrgCIGitHubActionsCredentialView" + "$ref": "#/components/schemas/Membership" } } }, - "description": "Created" + "description": "OK" }, "400": { "content": { @@ -8197,9 +10794,116 @@ } } }, - "description": "Internal Server Error" + "description": "Internal Server Error" + } + }, + "security": [ + { + "oauth2": [] + }, + { + "oidc": [] + }, + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Update an organization member's role", + "tags": [ + "orgs" + ] + } + }, + "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/orgs/{orgId}/members/{provider}/{providerUserId}": { + "delete": { + "operationId": "removeOrgMember", + "parameters": [ + { + "in": "path", + "name": "orgId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + }, + { + "in": "path", + "name": "provider", + "required": true, + "schema": { + "minLength": 1, + "type": "string" + } + }, + { + "in": "path", + "name": "providerUserId", + "required": true, + "schema": { + "minLength": 1, + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Conflict" }, - "502": { + "422": { "content": { "application/problem+json": { "schema": { @@ -8207,9 +10911,9 @@ } } }, - "description": "Bad Gateway" + "description": "Unprocessable Entity" }, - "503": { + "500": { "content": { "application/problem+json": { "schema": { @@ -8217,7 +10921,7 @@ } } }, - "description": "Service Unavailable" + "description": "Internal Server Error" } }, "security": [ @@ -8234,15 +10938,16 @@ "sessionAuth": [] } ], - "summary": "Mint an org's GitHub Actions webhook credential", + "summary": "Remove a member from an organization", "tags": [ - "org-ci-webhooks" + "orgs" ] } }, - "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/orgs/{orgId}/members": { + "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/orgs/{orgId}/people": { "get": { - "operationId": "listOrgMembers", + "description": "Requires organization management permission, not repository pull permission. Returns one row per account with membership metadata and recorded accessScopes, without grant details or editing capabilities. Grants retain each distinct role and origin (membership, direct, team, or github), without inherited expansion or strongest-role collapsing. Repository IDs identify published logical repo groups, not placements. Membership grants include pending and inactive memberships; membership.status describes their lifecycle. GitHub grants use the collaborator read model and can differ from live SpiceDB permissions during reconciliation. This is a roster read model, not an authorization check or complete SpiceDB audit. Management does not imply Git read permission. Snapshot readiness uses the shared GitHub discovery eligibility and 15-minute grace policy. Detached, suspended, sync-blocked, sync-banned, and wholly suspended mirror targets do not block readiness; recorded edges still serve. Overdue eligible snapshots or missing mirror mappings return 503. Filters select people by recorded grants, not inherited roles. Load /people/{accountId}/access when opening an editor; it returns that person's grants and fresh editing capabilities. The list has no full mode. Filters and totalCount apply before cursor pagination; results are ordered by account ID.", + "operationId": "listOrgPeople", "parameters": [ { "description": "Maximum entries to return; server may cap further.", @@ -8267,6 +10972,21 @@ "type": "string" } }, + { + "description": "Select people with a recorded grant at this resource level.", + "explode": false, + "in": "query", + "name": "scope", + "schema": { + "description": "Select people with a recorded grant at this resource level.", + "enum": [ + "organization", + "project", + "repository" + ], + "type": "string" + } + }, { "in": "path", "name": "orgId", @@ -8275,6 +10995,65 @@ "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } + }, + { + "description": "Case-insensitive substring of account ID, public handle, or resource name.", + "explode": false, + "in": "query", + "name": "search", + "schema": { + "description": "Case-insensitive substring of account ID, public handle, or resource name.", + "maxLength": 200, + "type": "string" + } + }, + { + "description": "member includes non-pending memberships; invited means pending; collaborator means no direct membership.", + "explode": false, + "in": "query", + "name": "membership", + "schema": { + "description": "member includes non-pending memberships; invited means pending; collaborator means no direct membership.", + "enum": [ + "member", + "invited", + "collaborator" + ], + "type": "string" + } + }, + { + "description": "Direct membership status; collaborators have no membership status.", + "explode": false, + "in": "query", + "name": "status", + "schema": { + "description": "Direct membership status; collaborators have no membership status.", + "enum": [ + "active", + "inactive", + "pending" + ], + "type": "string" + } + }, + { + "description": "Exact recorded grant role, including organization membership and weaker independent grants.", + "explode": false, + "in": "query", + "name": "role", + "schema": { + "description": "Exact recorded grant role, including organization membership and weaker independent grants.", + "enum": [ + "owner", + "admin", + "member", + "reader", + "writer", + "mirror_source_admin" + ], + "type": "string" + } } ], "responses": { @@ -8282,11 +11061,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListOrgMembersOutputBody" + "$ref": "#/components/schemas/ListOrgPeopleOutputBody" } } }, - "description": "OK" + "description": "OK", + "headers": { + "Cache-Control": { + "schema": { + "type": "string" + } + } + } }, "400": { "content": { @@ -8347,6 +11133,16 @@ } }, "description": "Internal Server Error" + }, + "503": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Service Unavailable" } }, "security": [ @@ -8363,13 +11159,16 @@ "sessionAuth": [] } ], - "summary": "List members of an organization", + "summary": "List organization members, invitations, and collaborators with scope summaries", "tags": [ "orgs" ] - }, - "post": { - "operationId": "addOrgMember", + } + }, + "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/orgs/{orgId}/people/{accountId}/access": { + "get": { + "description": "Requires organization management permission. Selects the exact account within this organization's roster, not a handle or substring. Returns all recorded grants and fresh caller-specific editing capabilities. Missing or excluded people return 404; incomplete organization read models return 503. Uses global public data only. Mutations independently reauthorize every write.", + "operationId": "getOrgPersonAccess", "parameters": [ { "in": "path", @@ -8379,28 +11178,34 @@ "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } + }, + { + "in": "path", + "name": "accountId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddOrgMemberInputBody" - } - } - }, - "required": true - }, "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Membership" + "$ref": "#/components/schemas/OrgPerson" } } }, - "description": "Created" + "description": "OK", + "headers": { + "Cache-Control": { + "schema": { + "type": "string" + } + } + } }, "400": { "content": { @@ -8442,7 +11247,7 @@ }, "description": "Not Found" }, - "409": { + "422": { "content": { "application/problem+json": { "schema": { @@ -8450,9 +11255,9 @@ } } }, - "description": "Conflict" + "description": "Unprocessable Entity" }, - "422": { + "500": { "content": { "application/problem+json": { "schema": { @@ -8460,9 +11265,9 @@ } } }, - "description": "Unprocessable Entity" + "description": "Internal Server Error" }, - "500": { + "503": { "content": { "application/problem+json": { "schema": { @@ -8470,7 +11275,7 @@ } } }, - "description": "Internal Server Error" + "description": "Service Unavailable" } }, "security": [ @@ -8487,47 +11292,69 @@ "sessionAuth": [] } ], - "summary": "Add a member to an organization", + "summary": "Get one organization person's grants and editing capabilities", "tags": [ "orgs" ] } }, - "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/orgs/{orgId}/members/{provider}/{providerUserId}": { - "delete": { - "operationId": "removeOrgMember", + "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/orgs/{orgId}/projects": { + "get": { + "operationId": "listOrgProjects", "parameters": [ { - "in": "path", - "name": "orgId", - "required": true, + "description": "Maximum entries to return; server may cap further.", + "explode": false, + "in": "query", + "name": "pageSize", "schema": { - "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "description": "Maximum entries to return; server may cap further.", + "format": "int32", + "maximum": 500, + "minimum": 0, + "type": "integer" + } + }, + { + "description": "Opaque cursor from a previous response's nextPageToken.", + "explode": false, + "in": "query", + "name": "pageToken", + "schema": { + "description": "Opaque cursor from a previous response's nextPageToken.", "type": "string" } }, { "in": "path", - "name": "provider", + "name": "orgId", "required": true, "schema": { - "minLength": 1, + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } }, { - "in": "path", - "name": "providerUserId", - "required": true, + "description": "Optional: exact-match project name (case-insensitive).", + "explode": false, + "in": "query", + "name": "name", "schema": { - "minLength": 1, + "description": "Optional: exact-match project name (case-insensitive).", "type": "string" } } ], "responses": { - "204": { - "description": "No Content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOrgProjectsOutputBody" + } + } + }, + "description": "OK" }, "400": { "content": { @@ -8569,16 +11396,6 @@ }, "description": "Not Found" }, - "409": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Conflict" - }, "422": { "content": { "application/problem+json": { @@ -8614,15 +11431,15 @@ "sessionAuth": [] } ], - "summary": "Remove a member from an organization", + "summary": "List projects owned by an organization", "tags": [ - "orgs" + "projects" ] } }, - "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/orgs/{orgId}/projects": { + "/projects": { "get": { - "operationId": "listOrgProjects", + "operationId": "listProjects", "parameters": [ { "description": "Maximum entries to return; server may cap further.", @@ -8648,21 +11465,23 @@ } }, { - "in": "path", - "name": "orgId", - "required": true, + "description": "Optional: exact-match project name (case-insensitive).", + "explode": false, + "in": "query", + "name": "name", "schema": { - "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "description": "Optional: exact-match project name (case-insensitive).", "type": "string" } }, { - "description": "Optional: exact-match project name (case-insensitive).", + "description": "Optional: opaque commit token from a project create or delete, to list at a snapshot that contains that write. Ignored when name is set.", "explode": false, "in": "query", - "name": "name", + "name": "commitToken", "schema": { - "description": "Optional: exact-match project name (case-insensitive).", + "description": "Optional: opaque commit token from a project create or delete, to list at a snapshot that contains that write. Ignored when name is set.", + "pattern": "^$|^[A-Za-z0-9_-]{20,512}$", "type": "string" } } @@ -8672,7 +11491,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListOrgProjectsOutputBody" + "$ref": "#/components/schemas/ListProjectsOutputBody" } } }, @@ -8747,66 +11566,47 @@ "oidc": [] }, { - "bearerAuth": [] - }, - { - "sessionAuth": [] - } - ], - "summary": "List projects owned by an organization", - "tags": [ - "projects" - ] - } - }, - "/projects": { - "get": { - "operationId": "listProjects", - "parameters": [ - { - "description": "Maximum entries to return; server may cap further.", - "explode": false, - "in": "query", - "name": "pageSize", - "schema": { - "description": "Maximum entries to return; server may cap further.", - "format": "int32", - "maximum": 500, - "minimum": 0, - "type": "integer" - } - }, - { - "description": "Opaque cursor from a previous response's nextPageToken.", - "explode": false, - "in": "query", - "name": "pageToken", - "schema": { - "description": "Opaque cursor from a previous response's nextPageToken.", - "type": "string" - } - }, - { - "description": "Optional: exact-match project name (case-insensitive).", - "explode": false, - "in": "query", - "name": "name", - "schema": { - "description": "Optional: exact-match project name (case-insensitive).", - "type": "string" - } + "bearerAuth": [] + }, + { + "sessionAuth": [] } ], + "summary": "List projects accessible to the caller (or one by name)", + "tags": [ + "projects" + ] + }, + "post": { + "operationId": "createProject", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateProjectInputBody" + } + } + }, + "required": true + }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListProjectsOutputBody" + "$ref": "#/components/schemas/CreatedProject" } } }, - "description": "OK" + "description": "Created", + "headers": { + "X-Entire-Commit-Token": { + "schema": { + "description": "Opaque token to pass as commitToken on the next project list, so this project appears immediately. Absent when none could be minted; list without it.", + "type": "string" + } + } + } }, "400": { "content": { @@ -8848,6 +11648,16 @@ }, "description": "Not Found" }, + "409": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Conflict" + }, "422": { "content": { "application/problem+json": { @@ -8883,33 +11693,50 @@ "sessionAuth": [] } ], - "summary": "List projects accessible to the caller (or one by name)", + "summary": "Create project", "tags": [ "projects" ] - }, - "post": { - "operationId": "createProject", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateProjectInputBody" - } + } + }, + "/projects/resolve/{host}/{project}": { + "get": { + "description": "Case-insensitive lookup by native project name (et) or GitHub owner namespace (gh). Uses project inspect permission, including platform administrators. Missing and inaccessible projects both return 404.", + "operationId": "resolveProject", + "parameters": [ + { + "in": "path", + "name": "host", + "required": true, + "schema": { + "enum": [ + "et", + "gh" + ], + "type": "string" } }, - "required": true - }, + { + "in": "path", + "name": "project", + "required": true, + "schema": { + "maxLength": 39, + "minLength": 1, + "type": "string" + } + } + ], "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Project" + "$ref": "#/components/schemas/ResolveProjectOutputBody" } } }, - "description": "Created" + "description": "OK" }, "400": { "content": { @@ -8951,16 +11778,6 @@ }, "description": "Not Found" }, - "409": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Conflict" - }, "422": { "content": { "application/problem+json": { @@ -8996,7 +11813,7 @@ "sessionAuth": [] } ], - "summary": "Create project", + "summary": "Resolve a canonical project reference", "tags": [ "projects" ] @@ -9018,7 +11835,15 @@ ], "responses": { "204": { - "description": "No Content" + "description": "No Content", + "headers": { + "X-Entire-Commit-Token": { + "schema": { + "description": "Opaque token to pass as commitToken on the next project list, so this project is gone from it. Absent when none could be minted; list without it.", + "type": "string" + } + } + } }, "400": { "content": { @@ -9243,7 +12068,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GrantProjectAccessInputBody" + "$ref": "#/components/schemas/GrantAccessBody" } } }, @@ -9734,6 +12559,165 @@ ] } }, + "/projects/{projectId}/people": { + "get": { + "description": "Requires project roster-view permission, held by project managers and source-managed forge members but not ordinary native readers or writers. Returns one account per row with its effective role and merged access sources. Grant managers also receive the mutable direct grant. Search and role filters run before cursor pagination. Results are ordered by effective role (owner, admin, mirror_source_admin, writer, reader, member), then by handle without the provider prefix, ignoring case, then by account ID. Accounts without a handle come last within their role.", + "operationId": "listProjectPeople", + "parameters": [ + { + "description": "Maximum entries to return; server may cap further.", + "explode": false, + "in": "query", + "name": "pageSize", + "schema": { + "description": "Maximum entries to return; server may cap further.", + "format": "int32", + "maximum": 500, + "minimum": 0, + "type": "integer" + } + }, + { + "description": "Opaque cursor from a previous response's nextPageToken.", + "explode": false, + "in": "query", + "name": "pageToken", + "schema": { + "description": "Opaque cursor from a previous response's nextPageToken.", + "type": "string" + } + }, + { + "description": "Case-insensitive substring of account ID or public handle.", + "explode": false, + "in": "query", + "name": "search", + "schema": { + "description": "Case-insensitive substring of account ID or public handle.", + "maxLength": 200, + "type": "string" + } + }, + { + "description": "Exact effective role on the selected resource.", + "explode": false, + "in": "query", + "name": "role", + "schema": { + "description": "Exact effective role on the selected resource.", + "enum": [ + "owner", + "admin", + "member", + "reader", + "writer", + "mirror_source_admin" + ], + "type": "string" + } + }, + { + "in": "path", + "name": "projectId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResourcePeopleOutputBody" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Not Found" + }, + "422": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unprocessable Entity" + }, + "500": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Internal Server Error" + } + }, + "security": [ + { + "oauth2": [] + }, + { + "oidc": [] + }, + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "List effective project members", + "tags": [ + "projects" + ] + } + }, "/projects/{projectId}/repos": { "get": { "operationId": "listProjectRepos", @@ -9766,17 +12750,28 @@ "name": "projectId", "required": true, "schema": { - "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + }, + { + "description": "Optional: exact-match repo name (case-insensitive).", + "explode": false, + "in": "query", + "name": "name", + "schema": { + "description": "Optional: exact-match repo name (case-insensitive).", "type": "string" } }, { - "description": "Optional: exact-match repo name (case-insensitive).", + "description": "Optional: opaque commit token from a create, to read a snapshot that contains that write.", "explode": false, "in": "query", - "name": "name", + "name": "commitToken", "schema": { - "description": "Optional: exact-match repo name (case-insensitive).", + "description": "Optional: opaque commit token from a create, to read a snapshot that contains that write.", + "pattern": "^$|^[A-Za-z0-9_-]{60,512}$", "type": "string" } } @@ -9925,6 +12920,17 @@ "type": "string" } }, + { + "description": "Optional: opaque commit token from a create, to read a snapshot that contains that write. Requires filter.", + "explode": false, + "in": "query", + "name": "commitToken", + "schema": { + "description": "Optional: opaque commit token from a create, to read a snapshot that contains that write. Requires filter.", + "pattern": "^$|^[A-Za-z0-9_-]{60,512}$", + "type": "string" + } + }, { "description": "Multi-key sort spec, e.g. org:asc,stars:desc. Keys: name,org,language,candidacy,stars,forks,pushed_at,last_activity_at,last_pushed_at,activity_hotness,checkpoint_count,open_pr_count. A single bare key uses the order param. Encoded into the cursor (authoritative on continuation).", "explode": false, @@ -10021,6 +13027,17 @@ "type": "string" } }, + { + "description": "Exact-match owning project id (ULID). Also accepts projectId[eq]; projectId[ne] is rejected.", + "explode": false, + "in": "query", + "name": "projectId", + "schema": { + "description": "Exact-match owning project id (ULID). Also accepts projectId[eq]; projectId[ne] is rejected.", + "pattern": "^$|^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + }, { "description": "Filter on placement/candidacy lifecycle. inactive requires scope=all. Also accepts status[eq]/status[ne].", "explode": false, @@ -10150,11 +13167,19 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Repo" + "$ref": "#/components/schemas/CreatedRepo" } } }, - "description": "Created" + "description": "Created", + "headers": { + "X-Entire-Commit-Token": { + "schema": { + "description": "Opaque token to pass as commitToken on the next repo resolve, so this repo resolves immediately.", + "type": "string" + } + } + } }, "400": { "content": { @@ -10757,15 +13782,276 @@ "sessionAuth": [] } ], - "summary": "Resolve repository ids to full name and provider", + "summary": "Resolve repository ids to full name and provider", + "tags": [ + "repos" + ] + } + }, + "/repos/{repoId}": { + "delete": { + "operationId": "deleteRepo", + "parameters": [ + { + "in": "path", + "name": "repoId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content", + "headers": { + "X-Entire-Commit-Token": { + "schema": { + "description": "Opaque token to pass as commitToken on the next repo listing, so this repo is gone from it. Absent when none could be minted; list without it.", + "type": "string" + } + } + } + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Not Found" + }, + "421": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Misdirected Request" + }, + "422": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unprocessable Entity" + }, + "500": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Internal Server Error" + }, + "503": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Service Unavailable" + } + }, + "security": [ + { + "oauth2": [] + }, + { + "oidc": [] + }, + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Delete repository", + "tags": [ + "repos" + ] + }, + "get": { + "operationId": "getRepo", + "parameters": [ + { + "in": "path", + "name": "repoId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + }, + { + "description": "Require the repo's regional lifecycle state. A local repo is unaffected. A repo homed in another jurisdiction redirects with 421. This core reports 503 when it cannot route the read. Provisioning and failed states still return 200.", + "explode": false, + "in": "query", + "name": "authoritative", + "schema": { + "description": "Require the repo's regional lifecycle state. A local repo is unaffected. A repo homed in another jurisdiction redirects with 421. This core reports 503 when it cannot route the read. Provisioning and failed states still return 200.", + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Repo" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Not Found" + }, + "421": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Misdirected Request" + }, + "422": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unprocessable Entity" + }, + "500": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Internal Server Error" + }, + "503": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Service Unavailable" + } + }, + "security": [ + { + "oauth2": [] + }, + { + "oidc": [] + }, + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "Get repository", "tags": [ "repos" ] } }, - "/repos/{repoId}": { - "delete": { - "operationId": "deleteRepo", + "/repos/{repoId}/branch-protection": { + "get": { + "operationId": "getBranchProtection", "parameters": [ { "in": "path", @@ -10778,8 +14064,15 @@ } ], "responses": { - "204": { - "description": "No Content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BranchProtection" + } + } + }, + "description": "OK" }, "400": { "content": { @@ -10850,26 +14143,6 @@ } }, "description": "Internal Server Error" - }, - "502": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Bad Gateway" - }, - "503": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Service Unavailable" } }, "security": [ @@ -10886,13 +14159,13 @@ "sessionAuth": [] } ], - "summary": "Delete repository", + "summary": "Get repository branch protection", "tags": [ "repos" ] }, - "get": { - "operationId": "getRepo", + "patch": { + "operationId": "updateBranchProtection", "parameters": [ { "in": "path", @@ -10902,24 +14175,24 @@ "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } - }, - { - "description": "Require the repo's regional lifecycle state. A local repo is unaffected. A repo homed in another jurisdiction redirects with 421. This core reports 503 when it cannot route the read. Provisioning and failed states still return 200.", - "explode": false, - "in": "query", - "name": "authoritative", - "schema": { - "description": "Require the repo's regional lifecycle state. A local repo is unaffected. A repo homed in another jurisdiction redirects with 421. This core reports 503 when it cannot route the read. Provisioning and failed states still return 200.", - "type": "boolean" - } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateBranchProtectionInputBody" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Repo" + "$ref": "#/components/schemas/BranchProtection" } } }, @@ -10965,7 +14238,7 @@ }, "description": "Not Found" }, - "421": { + "409": { "content": { "application/problem+json": { "schema": { @@ -10973,9 +14246,9 @@ } } }, - "description": "Misdirected Request" + "description": "Conflict" }, - "422": { + "421": { "content": { "application/problem+json": { "schema": { @@ -10983,9 +14256,9 @@ } } }, - "description": "Unprocessable Entity" + "description": "Misdirected Request" }, - "500": { + "422": { "content": { "application/problem+json": { "schema": { @@ -10993,9 +14266,9 @@ } } }, - "description": "Internal Server Error" + "description": "Unprocessable Entity" }, - "503": { + "500": { "content": { "application/problem+json": { "schema": { @@ -11003,7 +14276,7 @@ } } }, - "description": "Service Unavailable" + "description": "Internal Server Error" } }, "security": [ @@ -11020,15 +14293,13 @@ "sessionAuth": [] } ], - "summary": "Get repository", + "summary": "Add or remove protected branches", "tags": [ "repos" ] - } - }, - "/repos/{repoId}/branch-protection": { - "get": { - "operationId": "getBranchProtection", + }, + "put": { + "operationId": "setBranchProtection", "parameters": [ { "in": "path", @@ -11040,6 +14311,16 @@ } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BranchProtection" + } + } + }, + "required": true + }, "responses": { "200": { "content": { @@ -11091,6 +14372,16 @@ }, "description": "Not Found" }, + "409": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Conflict" + }, "421": { "content": { "application/problem+json": { @@ -11136,13 +14427,15 @@ "sessionAuth": [] } ], - "summary": "Get repository branch protection", + "summary": "Set repository branch protection", "tags": [ "repos" ] - }, - "patch": { - "operationId": "updateBranchProtection", + } + }, + "/repos/{repoId}/ci-builds": { + "get": { + "operationId": "listRepoCIBuilds", "parameters": [ { "in": "path", @@ -11152,24 +14445,49 @@ "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateBranchProtectionInputBody" - } + }, + { + "explode": false, + "in": "query", + "name": "commit", + "schema": { + "type": "string" } }, - "required": true - }, + { + "explode": false, + "in": "query", + "name": "pipeline", + "schema": { + "type": "string" + } + }, + { + "explode": false, + "in": "query", + "name": "build_number", + "schema": { + "format": "int64", + "minimum": 1, + "type": "integer" + } + }, + { + "explode": false, + "in": "query", + "name": "limit", + "schema": { + "format": "int64", + "type": "integer" + } + } + ], "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BranchProtection" + "$ref": "#/components/schemas/ListRepoCIBuildsOutputBody" } } }, @@ -11215,17 +14533,7 @@ }, "description": "Not Found" }, - "409": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Conflict" - }, - "421": { + "422": { "content": { "application/problem+json": { "schema": { @@ -11233,9 +14541,9 @@ } } }, - "description": "Misdirected Request" + "description": "Unprocessable Entity" }, - "422": { + "500": { "content": { "application/problem+json": { "schema": { @@ -11243,9 +14551,9 @@ } } }, - "description": "Unprocessable Entity" + "description": "Internal Server Error" }, - "500": { + "503": { "content": { "application/problem+json": { "schema": { @@ -11253,7 +14561,7 @@ } } }, - "description": "Internal Server Error" + "description": "Service Unavailable" } }, "security": [ @@ -11270,13 +14578,16 @@ "sessionAuth": [] } ], - "summary": "Add or remove protected branches", + "summary": "List a repo's CI build statuses", "tags": [ - "repos" + "ci-webhooks" ] - }, - "put": { - "operationId": "setBranchProtection", + } + }, + "/repos/{repoId}/ci-deliveries": { + "get": { + "description": "Recent deliveries, newest first. direction=outbound (default) is what Entire sent the repo's CI when refs changed; direction=inbound is what that CI sent back.", + "operationId": "listRepoCIDeliveries", "parameters": [ { "in": "path", @@ -11286,24 +14597,35 @@ "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", "type": "string" } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BranchProtection" - } + }, + { + "explode": false, + "in": "query", + "name": "direction", + "schema": { + "enum": [ + "outbound", + "inbound" + ], + "type": "string" } }, - "required": true - }, + { + "explode": false, + "in": "query", + "name": "limit", + "schema": { + "format": "int64", + "type": "integer" + } + } + ], "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BranchProtection" + "$ref": "#/components/schemas/ListRepoCIDeliveriesOutputBody" } } }, @@ -11349,17 +14671,7 @@ }, "description": "Not Found" }, - "409": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Conflict" - }, - "421": { + "422": { "content": { "application/problem+json": { "schema": { @@ -11367,9 +14679,9 @@ } } }, - "description": "Misdirected Request" + "description": "Unprocessable Entity" }, - "422": { + "500": { "content": { "application/problem+json": { "schema": { @@ -11377,9 +14689,9 @@ } } }, - "description": "Unprocessable Entity" + "description": "Internal Server Error" }, - "500": { + "503": { "content": { "application/problem+json": { "schema": { @@ -11387,7 +14699,7 @@ } } }, - "description": "Internal Server Error" + "description": "Service Unavailable" } }, "security": [ @@ -11404,15 +14716,16 @@ "sessionAuth": [] } ], - "summary": "Set repository branch protection", + "summary": "List a repo's webhook deliveries", "tags": [ - "repos" + "ci-webhooks" ] } }, - "/repos/{repoId}/ci-builds": { + "/repos/{repoId}/ci-deliveries/{id}": { "get": { - "operationId": "listRepoCIBuilds", + "description": "The id is the opaque value from a list response. A payload is absent once its day has been swept (payload_absent=swept) or when no request was ever built (payload_absent=no_request).", + "operationId": "getRepoCIDelivery", "parameters": [ { "in": "path", @@ -11424,39 +14737,12 @@ } }, { - "explode": false, - "in": "query", - "name": "commit", - "schema": { - "type": "string" - } - }, - { - "explode": false, - "in": "query", - "name": "pipeline", + "in": "path", + "name": "id", + "required": true, "schema": { "type": "string" } - }, - { - "explode": false, - "in": "query", - "name": "build_number", - "schema": { - "format": "int64", - "minimum": 1, - "type": "integer" - } - }, - { - "explode": false, - "in": "query", - "name": "limit", - "schema": { - "format": "int64", - "type": "integer" - } } ], "responses": { @@ -11464,7 +14750,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListRepoCIBuildsOutputBody" + "$ref": "#/components/schemas/CIDeliveryDetailView" } } }, @@ -11530,16 +14816,6 @@ }, "description": "Internal Server Error" }, - "502": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Bad Gateway" - }, "503": { "content": { "application/problem+json": { @@ -11565,7 +14841,7 @@ "sessionAuth": [] } ], - "summary": "List a repo's CI build statuses", + "summary": "Get one delivery and its wire payloads", "tags": [ "ci-webhooks" ] @@ -11656,16 +14932,6 @@ }, "description": "Internal Server Error" }, - "502": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Bad Gateway" - }, "503": { "content": { "application/problem+json": { @@ -11790,16 +15056,6 @@ }, "description": "Internal Server Error" }, - "502": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Bad Gateway" - }, "503": { "content": { "application/problem+json": { @@ -12064,16 +15320,6 @@ }, "description": "Internal Server Error" }, - "502": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Bad Gateway" - }, "503": { "content": { "application/problem+json": { @@ -12107,7 +15353,7 @@ }, "/repos/{repoId}/ci-webhooks/{id}": { "delete": { - "description": "Deletes the subscription AND tears down its enrollment identity: the automation row (when no sibling repo shares it), its expiring repo grant, and its Buildkite OIDC binding. The Buildkite pipeline itself is always kept. Pass keep_identity=true to delete only the subscription — for an immediate re-enroll that must preserve automation_id, since teardown retires it and a re-enroll declares a new one that only bk_force_rescaffold pushes into the pipeline. A retained identity holds read access on this repo until its grant lapses. A subscription enrolled before the automation principal has no automation to retire: the delete succeeds and removes only the subscription, reported as identity_retired=false on the ci_webhook_deleted audit event — the list an operator queries to hand-delete the leftover service accounts.", + "description": "Deletes the subscription and clears this repo's own enrolment marker. This does NOT immediately revoke the automation's access to the repo: that access normally continues, on its existing expiry, in the background. Pass keep_identity=true to leave the marker untouched too — for an immediate re-enroll, which always resumes the same automation_id either way. The Buildkite pipeline is always kept.", "operationId": "deleteRepoCIWebhook", "parameters": [ { @@ -12200,16 +15446,6 @@ }, "description": "Internal Server Error" }, - "502": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Bad Gateway" - }, "503": { "content": { "application/problem+json": { @@ -12342,16 +15578,6 @@ }, "description": "Internal Server Error" }, - "502": { - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ErrorModel" - } - } - }, - "description": "Bad Gateway" - }, "503": { "content": { "application/problem+json": { @@ -12657,7 +15883,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GrantRepoAccessInputBody" + "$ref": "#/components/schemas/GrantAccessBody" } } }, @@ -13444,6 +16670,165 @@ ] } }, + "/repos/{repoId}/people": { + "get": { + "description": "Returns one account per row with its effective role and merged access sources. Grant managers also receive the mutable direct grant. Search and role filters run before cursor pagination. Results are ordered by effective role (owner, admin, mirror_source_admin, writer, reader, member), then by handle without the provider prefix, ignoring case, then by account ID. Accounts without a handle come last within their role.", + "operationId": "listRepoPeople", + "parameters": [ + { + "description": "Maximum entries to return; server may cap further.", + "explode": false, + "in": "query", + "name": "pageSize", + "schema": { + "description": "Maximum entries to return; server may cap further.", + "format": "int32", + "maximum": 500, + "minimum": 0, + "type": "integer" + } + }, + { + "description": "Opaque cursor from a previous response's nextPageToken.", + "explode": false, + "in": "query", + "name": "pageToken", + "schema": { + "description": "Opaque cursor from a previous response's nextPageToken.", + "type": "string" + } + }, + { + "description": "Case-insensitive substring of account ID or public handle.", + "explode": false, + "in": "query", + "name": "search", + "schema": { + "description": "Case-insensitive substring of account ID or public handle.", + "maxLength": 200, + "type": "string" + } + }, + { + "description": "Exact effective role on the selected resource.", + "explode": false, + "in": "query", + "name": "role", + "schema": { + "description": "Exact effective role on the selected resource.", + "enum": [ + "owner", + "admin", + "member", + "reader", + "writer", + "mirror_source_admin" + ], + "type": "string" + } + }, + { + "in": "path", + "name": "repoId", + "required": true, + "schema": { + "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResourcePeopleOutputBody" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Not Found" + }, + "422": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Unprocessable Entity" + }, + "500": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ErrorModel" + } + } + }, + "description": "Internal Server Error" + } + }, + "security": [ + { + "oauth2": [] + }, + { + "oidc": [] + }, + { + "bearerAuth": [] + }, + { + "sessionAuth": [] + } + ], + "summary": "List effective repository members", + "tags": [ + "repos" + ] + } + }, "/repos/{repoId}/visibility": { "get": { "operationId": "getRepoVisibility", diff --git a/internal/coreapi/spec/normalize.go b/internal/coreapi/spec/normalize.go index 14a6c68ec6..8816dd3a67 100644 --- a/internal/coreapi/spec/normalize.go +++ b/internal/coreapi/spec/normalize.go @@ -237,6 +237,9 @@ func filterSecurityRequirements(reqs []any) ([]any, error) { // SetRepoVisibilityInputBody) keep their enums so we still reject a bad // value before sending it. var readModelEnumFields = map[string][]string{ + "CreatedRepo": {"objectFormat", "provider", "state", "visibility"}, + "Invitation": {"role", "status"}, + "Membership": {"role", "status"}, "Repo": {"objectFormat", "provider", "state", "visibility"}, "RepoIDResolution": {"provider"}, "RepoIndexEntry": {"permission", "provider"}, @@ -256,6 +259,9 @@ var readModelEnumFields = map[string][]string{ // message when the server omits it. A field must leave this list when the // CLI needs it to be *present* to be correct. var readModelOptionalFields = map[string][]string{ + "CreatedOrg": {"capabilities"}, + "CreatedProject": {"capabilities"}, + "CreatedRepo": {"capabilities", "provider"}, "ListReposOutputBody": {"candidatesIncomplete"}, "Org": {"capabilities"}, "Project": {"capabilities"}, From d574c5a6efe922b7f92a605a3be3ef9ac85ff4e7 Mon Sep 17 00:00:00 2001 From: Alex Ong Date: Thu, 24 Sep 2026 12:55:13 +1000 Subject: [PATCH 2/2] docs: describe invitation read-model behavior accurately Entire-Checkpoint: 01M38NDB76KW0RBGCKX7CX1742 --- internal/coreapi/UPSTREAM.md | 7 ++++--- internal/coreapi/client_test.go | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/internal/coreapi/UPSTREAM.md b/internal/coreapi/UPSTREAM.md index 834299ea1b..28e249f2bb 100644 --- a/internal/coreapi/UPSTREAM.md +++ b/internal/coreapi/UPSTREAM.md @@ -44,15 +44,16 @@ the *client sends* (request bodies like `SetRepoVisibilityInputBody`) should stay strict. `Membership.role`/`status` and `Invitation.role`/`status` are the same shape: -`entire org grant list` and `entire grant org invites` only print them, so a -role or lifecycle state added later must display rather than fail the listing. +`entire org grant list` displays memberships; the generated +`ListOrgInvitations` client decodes invitations. A new role or lifecycle state +must not fail either listing. **Workaround:** `spec/normalize.go` (`loosenReadModelEnums`, allowlist `readModelEnumFields`) deletes the `enum` constraint from those response read-model fields, so ogen emits plain strings with no `Validate()` and unknown values pass through for display. Only response read models are loosened; request-body enums stay strict — `CreateOrgInvitationInputBody.role` -keeps its enum, so a bad `--role` is still refused before it is sent. Locked in +keeps its enum for outgoing requests. Locked in by `TestListProjectRepos_UnknownEnumValuesPassThrough`, `TestListOrgInvitations_UnknownEnumValuesPassThrough` and `TestListOrgMembers_UnknownEnumValuesPassThrough` in `client_test.go`. diff --git a/internal/coreapi/client_test.go b/internal/coreapi/client_test.go index 44477c097b..fdead0f2a6 100644 --- a/internal/coreapi/client_test.go +++ b/internal/coreapi/client_test.go @@ -424,9 +424,9 @@ func TestListOrgsAndProjects_UnsentCapabilitiesDecode(t *testing.T) { // TestListOrgInvitations_UnknownEnumValuesPassThrough locks in the // forward-compat contract for spec/normalize.go's loosenReadModelEnums on -// Invitation: the CLI only prints `role` and `status`, so a lifecycle state or -// role the server adds later must decode and display rather than fail the whole -// listing in ogen's Validate(). +// Invitation: future consumers must be able to display `role` and `status`, +// so a lifecycle state or role the server adds later must decode rather than +// fail the whole listing in ogen's Validate(). func TestListOrgInvitations_UnknownEnumValuesPassThrough(t *testing.T) { t.Parallel()